Saving pos failure
#1

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!
Reply
#2

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
Reply
#3

If you didn't load a plugin and went ingame to play you get spawned at 0,0,0
Reply
#4

nah it happens because mostly guys never loads a float value's while the player logins
Reply
#5

In userdata load:

INI_Float("Xpos",PlayerInfo[playerid][pX]);
INI_Float("Ypos",PlayerInfo[playerid][pY]);
INI_Float("Zpos",PlayerInfo[playerid][pZ]);
Reply
#6

Anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)