Spawn on last pos
#1

hello im trying to make it so people spanw on there last pos
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;
}
but they crash when they spawn

why?
Reply


Messages In This Thread
Spawn on last pos - by Kanji_Suzuki - 03.08.2009, 11:45
Re: Spawn on last pos - by dice7 - 03.08.2009, 12:57
Re: Spawn on last pos - by Hecky - 03.08.2009, 13:11
Re: Spawn on last pos - by Kanji_Suzuki - 03.08.2009, 15:05
Re: Spawn on last pos - by Kanji_Suzuki - 03.08.2009, 21:07
Re: Spawn on last pos - by SkyWinder - 12.08.2009, 04:17
Re: Spawn on last pos - by [LF]Mr.Lucci - 25.08.2009, 20:55
Re: Spawn on last pos - by Mauka4 - 26.08.2009, 12:06

Forum Jump:


Users browsing this thread: 1 Guest(s)