14.08.2010, 12:09
Hello,
My login script is acting very weird since i added this. If you login, it will load everything correctly, but if you restart the server the player's position and health won't load. When that happens, the player get teleported to the 0-point of San Andreas, and he will die cause his health and armor is set to 0. My conclusion is that maybe dini_Float returns 0 instead of the right value's. Here you have my code:
Note: All things without float load correctly. Please tell me what's wrong.
Greetz,
Danny
My login script is acting very weird since i added this. If you login, it will load everything correctly, but if you restart the server the player's position and health won't load. When that happens, the player get teleported to the 0-point of San Andreas, and he will die cause his health and armor is set to 0. My conclusion is that maybe dini_Float returns 0 instead of the right value's. Here you have my code:
Код:
public Loadmorestats(playerid) { new Float:POS[3]; GetPlayerName(playerid, pname, sizeof (pname)); skin[playerid] = dini_Int((pname), "skin"); POS[0] = dini_Float((pname), "spawnX"); POS[1] = dini_Float((pname), "spawnY"); POS[2] = dini_Float((pname), "spawnZ"); new Float:hp2 = dini_Float((pname),"health"); new Float:am2 = dini_Float((pname),"armour"); SetPlayerInterior(playerid, 0); SetPlayerPos(playerid, POS[0], POS[1], POS[2]); SetPlayerHealth(playerid, floatround(hp2)); SetPlayerArmour(playerid, floatround(am2)); SetPlayerSkin(playerid, skin[playerid]); TogglePlayerControllable(playerid,1); return 1; }
Greetz,
Danny