Szerző Téma: Innen folytatod a játkot.  (Megtekintve 2605 alkalommal)

Nem elérhető sza23

  • 346
    • Profil megtekintése
Innen folytatod a játkot.
« Dátum: 2012. December 03. - 19:59:41 »
0 Show voters
Udv,azt higy kell megcsinani ha valaki kilépk akkor onnan folytassa ahol abba ahgyta?

Nem elérhető ►ѕтa

  • 2016
  • Newbie
    • Profil megtekintése
Innen folytatod a játkot.
« Válasz #1 Dátum: 2012. December 03. - 20:00:44 »
0 Show voters
Attól függ mibe mented (fájlba vagy mysql).

Nem elérhető sza23

  • 346
    • Profil megtekintése
Innen folytatod a játkot.
« Válasz #2 Dátum: 2012. December 03. - 20:21:04 »
0 Show voters
fájlban,de mit mentek?

Nem elérhető Iceaac

  • 2187
    • Profil megtekintése
Innen folytatod a játkot.
« Válasz #3 Dátum: 2012. December 03. - 20:33:09 »
0 Show voters
Lecsatlakozásnál lekéred a játékos X, Y, Z pozícióját (akár facing anglet is), elmented fájlba, majd mikor a játékos csatlakozik, az elsõ spawnolásnál betöltöd a fájlból és átállítod a játékos pozícióját a fájlban levõre.
Egyébként ezt megtalálod rengeteg szkriptben, nézz szét, tényleg rengeteg van.
Tessék utánanézni kérdezés elõtt!

Nem elérhető sza23

  • 346
    • Profil megtekintése
Innen folytatod a játkot.
« Válasz #4 Dátum: 2012. December 04. - 06:25:04 »
0 Show voters
nemkapok ilyent ,lecci megcsinalnad nekem?  :thumbsup:

Nem elérhető Iceaac

  • 2187
    • Profil megtekintése
Innen folytatod a játkot.
« Válasz #5 Dátum: 2012. December 04. - 14:58:03 »
0 Show voters
Keresõ! Nem értem miért olyan nehéz!
http://sampforum.hu/index.php?page=google
Annyit írtam be, hogy \"pozíció mentés\" és egybõl elsõ találat:
http://sampforum.hu/index.php?topic=32087.0

Nem elérhető sza23

  • 346
    • Profil megtekintése
Innen folytatod a játkot.
« Válasz #6 Dátum: 2012. December 04. - 15:25:28 »
0 Show voters
megoldottam kössz,csak azt kellene hogy hogyan lehet megcsinálni,hogy egy parancsot csak egyszer lehesenn használni,ugy hogy használja és ha kilép és vissza akkor még egyszer tudja?

Innen folytatod a játkot.
« Válasz #7 Dátum: 2012. December 04. - 15:33:09 »
0 Show voters
public OnPlayerSpawn(playerid)
{
        new name[MAX_PLAYER_NAME];
              new
                 Float:fPos[ 3 ],
                 Interior;
                 new file[128];
        GetPlayerName( playerid, name, MAX_PLAYER_NAME );
        format( file, sizeof( file ), \"pos/%s.ini\", name );
        if( dini_Exists( file ) )
        {
           fPos[ 0 ] = dini_Float( file, \"KooX\" );
           fPos[ 1 ] = dini_Float( file, \"KooY\" );
           fPos[ 2 ] = dini_Float( file, \"KooZ\" );
                   Interior = dini_Int(file, \"KooI\");
           SetPlayerPos( playerid, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ] );
                        SetPlayerInterior(playerid, Interior);
        }
        else
        {
           SetPlayerPos( playerid, //ahol kezd);
           SetPlayerInterior(playerid, 0);
        }
        return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
        new name[MAX_PLAYER_NAME];
             new
                 Float:fPos[ 3 ],
                 Interior;
                Interior = GetPlayerInterior(playerid);
        GetPlayerPos( playerid, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ] );
        GetPlayerName( playerid, name, MAX_PLAYER_NAME );
        format( file, sizeof( file ), \"pos/%s.ini\", name );
        if( !dini_Exists( file ) )
        {
          dini_Create( file );
          dini_FloatSet(file, \"KooX\", fPos[ 0 ] );
          dini_FloatSet(file, \"KooY\", fPos[ 1 ] );
          dini_FloatSet(file, \"KooZ\", fPos[ 2 ] );
          dini_IntSet(file, \"KooI\", Interior);
        }
        else
        {
          dini_FloatSet(file, \"KooX\", fPos[ 0 ] );
          dini_FloatSet(file, \"KooY\", fPos[ 1 ] );
          dini_FloatSet(file, \"KooZ\", fPos[ 2 ] );
          dini_IntSet(file, \"KooI\", Interior);
        }
        return 1;
}

Nem elérhető sza23

  • 346
    • Profil megtekintése
Innen folytatod a játkot.
« Válasz #8 Dátum: 2012. December 04. - 17:46:07 »
0 Show voters
kösz,amit leirtam megbirod csinálni?  :D

Nem elérhető Petrik

  • 318
    • Profil megtekintése
Innen folytatod a játkot.
« Válasz #9 Dátum: 2012. December 05. - 21:49:18 »
0 Show voters
Idézetet írta: sza23 date=1354639567\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"30589\" data-ipsquote-contentclass=\"forums_Topic
kösz,amit leirtam megbirod csinálni?  :D
 
Itt van a cuccosod. (1x használható parancs belépéskor/kilépéskor)
 
new bool:Parancs;
public OnPlayerConnect(playerid)
{
        Parancs = true;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
       if (strcmp(\"/parancs\", cmdtext, true, 10) == 0)
       {
       if(Parancs == true)
       {
       SendClientMessage(playerid,COLOR_YELLOW, \"Mostantól nem tudod használni ezt a parancsot, csak relog után.\");
       Parancs = false;
       }
       else
       {
       SendClientMessage(playerid,-1,\"Te már használtad ezt a parancsot! Relogolj!\");
       }
       return 1;
}

 
Szerintem jó.

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Innen folytatod a játkot.
« Válasz #10 Dátum: 2012. December 05. - 21:52:42 »
0 Show voters
public OnPlayerCommandText(playerid, cmdtext[])
{
       if (strcmp(\"/parancs\", cmdtext, true, 10) == 0)
       {
       if(Parancs == true)
       {
       SendClientMessage(playerid,COLOR_YELLOW, \"Mostantól nem tudod használni ezt a parancsot, csak relog után.\");
       Parancs = false;
       }
       else
       {
       SendClientMessage(playerid,-1,\"Te már használtad ezt a parancsot! Relogolj!\");
       }
       return 1;
}
[/quote]
Rövidítve:
 
if (strcmp(\"/parancs\", cmdtext, true, 10) == 0)
{
       if(Parancs == false) return SendClientMessage(playerid,-1,\"Te már használtad ezt a parancsot! Relogolj!\");
       SendClientMessage(playerid,COLOR_YELLOW, \"Mostantól nem tudod használni ezt a parancsot, csak relog után.\");
       Parancs = false;
       return 1;
}

 
Nem kell összezavarni az \'{, }, else\' meg ezekkel.

Nem elérhető bendor

  • 2949
    • Profil megtekintése
Innen folytatod a játkot.
« Válasz #11 Dátum: 2012. December 05. - 22:01:19 »
0 Show voters
Hülye megoldás,mert restart után újra használhatja..
 

#define File \"parancshaszn.ini\"
CMD:parancs(playerid,params[])
{
if(!dini_Exists(File))
{
dini_Create(File);
dini_IntSet(File,\"Parancs1\",1);
}
else if(dini_Int(File,\"Parancs1) <= 0)
{
dini_IntSet(File,\"Parancs1\",1);
}
else if(dini_Int(File,\"Parancs1\") >= 1) return SendClienMessage(playerid,0xffffaa,\"Már használták ezt a parancsot!\");
return 1;
}

 


valahogy így xd
« Utoljára szerkesztve: 2012. December 05. - 22:03:48 írta Bendor »

Nem elérhető Petrik

  • 318
    • Profil megtekintése
Innen folytatod a játkot.
« Válasz #12 Dátum: 2012. December 05. - 22:21:52 »
0 Show voters
Idézetet írta: Bendor date=1354741279\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"30589\" data-ipsquote-contentclass=\"forums_Topic
Hülye megoldás,mert restart után újra használhatja..
 

#define File \"parancshaszn.ini\"
CMD:parancs(playerid,params[])
{
if(!dini_Exists(File))
{
dini_Create(File);
dini_IntSet(File,\"Parancs1\",1);
}
else if(dini_Int(File,\"Parancs1) <= 0)
{
dini_IntSet(File,\"Parancs1\",1);
}
else if(dini_Int(File,\"Parancs1\") >= 1) return SendClienMessage(playerid,0xffffaa,\"Már használták ezt a parancsot!\");
return 1;
}

 


valahogy így xd
 
\"egy parancsot csak egyszer lehesenn használni,ugy hogy használja és ha kilép és vissza akkor még egyszer tudja?\"

Nem elérhető sza23

  • 346
    • Profil megtekintése
Innen folytatod a játkot.
« Válasz #13 Dátum: 2012. December 06. - 06:07:16 »
0 Show voters
igen!  :D

Dupla hozzászólás automatikusan összefûzve. ( 2012. December 06. - 06:12:03 )

if (strcmp(\"/parancs\", cmdtext, true, 10) == 0)
{
       if(Parancs == false) return SendClientMessage(playerid,-1,\"Te már használtad ezt a parancsot! Relogolj!\");
       SendClientMessage(playerid,COLOR_YELLOW, \"Mostantól nem tudod használni ezt a parancsot, csak relog után.\");
       Parancs = false;
       return 1;
}
[/quote]
erroros:
 
C:\\DOCUME~1\\szabi\\Asztal\\server\\FILTER~1\\asd.pwn(52) : error 017: undefined symbol \"Parancs\"
C:\\DOCUME~1\\szabi\\Asztal\\server\\FILTER~1\\asd.pwn(54) : error 017: undefined symbol \"Parancs\"
C:\\DOCUME~1\\szabi\\Asztal\\server\\FILTER~1\\asd.pwn(54) : warning 215: expression has no effect
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase
 
2 Errors.
« Utoljára szerkesztve: 2012. December 06. - 06:12:03 írta sza23 »

Nem elérhető bendor

  • 2949
    • Profil megtekintése
Innen folytatod a játkot.
« Válasz #14 Dátum: 2012. December 06. - 07:06:27 »
0 Show voters
[Pawn]
new parancsh[MAX_PLAYERS];
CMD:parancs(playerid, params[])
{
if(parancsh[playerid] == 1) return SendClientMessage(playerid,0xffffaa,\"Már használtad \");
//ide func
parancsh[playerid] = 1;
return 1;
}
[/pawn]
onplayerdisconnectnel :
parancsh[playerid] = 0;

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal