03.08.2009, 11:45
hello im trying to make it so people spanw on there last pos
the codes are:
but they crash when they spawn
why?
the codes are:
Код:
public OnPlayerSpawn(playerid)
{
new string[256];
SetPlayerInterior(playerid,PlayerAccount[playerid][pPlayerINT]);
SetPlayerPos(playerid,PlayerAccount[playerid][pPlayerX],PlayerAccount[playerid][pPlayerY],PlayerAccount[playerid][pPlayerZ]);
SetPlayerFacingAngle(playerid,PlayerAccount[playerid][pPlayerA]);
format(string, sizeof(string), "~w~Position~n~Loaded");
GameTextForPlayer(playerid, string, 5000, 3);
}
public OnPlayerDisconnect(playerid, reason)
{
new Float:x,Float:y,Float:z;
new Float:a;
new Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
PlayerAccount[playerid][pPlayerX] = x;
PlayerAccount[playerid][pPlayerY] = y;
PlayerAccount[playerid][pPlayerZ] = z;
PlayerAccount[playerid][pPlayerA] = a;
PlayerAccount[playerid][pPlayerINT] = Int;
return 1;
}
why?

