Saving pos failure - 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)
+--- Thread: Saving pos failure (
/showthread.php?tid=388599)
Saving pos failure -
Devix - 29.10.2012
Hey guys,
Please help me with the following:
Sometimes I get tp'd to the right cords when I spawn, but most of the times I get tp'd to 0.00.
My pX, pY and pZ are not at 0.00 in my file though.
This is the onlplayerspawn:
Код:
SetTimerEx("LoginTimer",2000,false,"d",playerid);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
SetTimerEx("SaveData",10000,true,"d",playerid);
And this is the logintimer:
Код:
forward LoginTimer(playerid);
public LoginTimer(playerid)
{
ResetPlayerMoney(playerid);
TogglePlayerControllable(playerid, 1);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
SetPlayerPos(playerid, PlayerInfo[playerid][pX],PlayerInfo[playerid][pY],PlayerInfo[playerid][pZ]);
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
return 1;
}
Please help me!
Re: Saving pos failure -
Abhishek. - 29.10.2012
HAHAHA!!!!!!! i had also failed 3 months in this but now its too easy
well i would say that make onplayerspawn
if(autospawn =1)
{
SetPlayerPos(playerid, PlayerInfo[playerid][pX],PlayerInfo[playerid][pY],PlayerInfo[playerid][pZ]);
}
and the progblem will be surely in you LoadUSER_Data would you mind posting it
Re: Saving pos failure -
[HK]Ryder[AN] - 29.10.2012
If you didn't load a plugin and went ingame to play you get spawned at 0,0,0
Re: Saving pos failure -
Abhishek. - 29.10.2012
nah it happens because mostly guys never loads a float value's while the player logins
Re: Saving pos failure -
Devix - 29.10.2012
In userdata load:
INI_Float("Xpos",PlayerInfo[playerid][pX]);
INI_Float("Ypos",PlayerInfo[playerid][pY]);
INI_Float("Zpos",PlayerInfo[playerid][pZ]);
Re: Saving pos failure -
Devix - 29.10.2012
Anyone?