GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: sza23 - 2012. december 03. - 19:59:41

Cím: Innen folytatod a játkot.
Írta: sza23 - 2012. december 03. - 19:59:41
Udv,azt higy kell megcsinani ha valaki kilépk akkor onnan folytassa ahol abba ahgyta?
Cím: Innen folytatod a játkot.
Írta: ►ѕтa - 2012. december 03. - 20:00:44
Attól függ mibe mented (fájlba vagy mysql).
Cím: Innen folytatod a játkot.
Írta: sza23 - 2012. december 03. - 20:21:04
fájlban,de mit mentek?
Cím: Innen folytatod a játkot.
Írta: Iceaac - 2012. december 03. - 20:33:09
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!
Cím: Innen folytatod a játkot.
Írta: sza23 - 2012. december 04. - 06:25:04
nemkapok ilyent ,lecci megcsinalnad nekem?  :thumbsup:
Cím: Innen folytatod a játkot.
Írta: Iceaac - 2012. december 04. - 14:58:03
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
Cím: Innen folytatod a játkot.
Írta: sza23 - 2012. december 04. - 15:25:28
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?
Cím: Innen folytatod a játkot.
Írta: N@rbirock - 2012. december 04. - 15:33:09
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;
}
Cím: Innen folytatod a játkot.
Írta: sza23 - 2012. december 04. - 17:46:07
kösz,amit leirtam megbirod csinálni?  :D
Cím: Innen folytatod a játkot.
Írta: Petrik - 2012. december 05. - 21:49:18
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ó.
Cím: Innen folytatod a játkot.
Írta: Flash - 2012. december 05. - 21:52:42
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.
Cím: Innen folytatod a játkot.
Írta: bendor - 2012. december 05. - 22:01:19
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
Cím: Innen folytatod a játkot.
Írta: Petrik - 2012. december 05. - 22:21:52
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?\"
Cím: Innen folytatod a játkot.
Írta: sza23 - 2012. december 06. - 06:07:16
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.
Cím: Innen folytatod a játkot.
Írta: bendor - 2012. december 06. - 07:06:27
[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;
Cím: Innen folytatod a játkot.
Írta: sza23 - 2012. december 06. - 13:45:06
//ide func -- ide mitkell?
Cím: Innen folytatod a játkot.
Írta: N@rbirock - 2012. december 06. - 14:07:00
Amit akarod hogy csináljon a parancs.
Cím: Innen folytatod a játkot.
Írta: sza23 - 2012. december 06. - 15:11:04
nemjó akárhányszor tudom hasznalni