Idiot question, Detecting if the player have a saved position? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Idiot question, Detecting if the player have a saved position? (
/showthread.php?tid=223877)
Idiot question, Detecting if the player have a saved position? -
-Rebel Son- - 10.02.2011
ok, so, with my account system. it skips skin selection if the player logs in, And loads their saved position from when they logged out, but, new players, If a new player doesnt have saved cords, i want to spawn them somewhere, but i cant get them to :S
Код:
public OnPlayerRequestClass(playerid, classid)
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, "You must sign in!");
if(gPlayerLogged[playerid] == 1)
{
SetTimerEx("SkipSpawn",1,0,"i",playerid);
}
return 1;
}
public SkipSpawn(playerid)
{
SetSpawnInfo(playerid,NO_TEAM, 100, PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY],PlayerInfo[playerid][pPosZ],PlayerInfo[playerid][pRotation],22,55,34,55,32,5555);
SpawnPlayer(playerid);
return 1;
}
Re: Idiot question, Detecting if the player have a saved position? -
_Tommy - 10.02.2011
pawn Код:
if(PlayerInfo[playerid][pPosX] == 0 && PlayerInfo[playerid][pPosY] == 0 && PlayerInfo[playerid][pPosZ] == 0)
?
Re: Idiot question, Detecting if the player have a saved position? -
-Rebel Son- - 10.02.2011
It fixed it sorta, Now, the Position, and Skin doesnt save when you log off.
Код:
public SkipSpawn(playerid)
{
if(PlayerInfo[playerid][pPosX] == 0 && PlayerInfo[playerid][pPosY] == 0 && PlayerInfo[playerid][pPosZ] == 0)
{
SetSpawnInfo(playerid, NO_TEAM, 0, -240.4968, 2599.8032, 62.7031, 15.5884, 0,0,7 0,0, 0,0);
SpawnPlayer(playerid);
}
else
{
SetSpawnInfo(playerid,NO_TEAM, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY],PlayerInfo[playerid][pPosZ],PlayerInfo[playerid][pRotation],22,55,34,55,32,5555);
SpawnPlayer(playerid);
}
return 1;
}