Spawn Help
#1

How do I make it so when the player logs in, they spawn back to where they logged off from?
Reply
#2

Save player x,y,z positions then load when player logged in

like
pawn Код:
SStats(playerid)
{
  new Float:cx,Float:cy,Float:cz,weap,ammo;
  new Float:x,Float:y,Float:z,Float:armour;
  GetPlayerPos(playerid, x, y, z);
  dini_IntSet(Pos(playerid),"X1",floatround(x));
  dini_IntSet(Pos(playerid),"Y1",floatround(y));
  dini_IntSet(Pos(playerid),"Z1",floatround(z));
  return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
  SStats(playerid);
  return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
  SetSpawnInfo(playerid,0,dini_Int(Pos(playerid), "X1"),dini_Int(Pos(playerid), "Y1"),    dini_Int(Pos(playerid), "Z1"),0, 0, 0, 0, 0, 0, 0 );
  SpawnPlayer(playerid);
  return 1;
}
Reply
#3

That didn't work probably because I'm using this gamemode script - https://sampforum.blast.hk/showthread.php?tid=279927

Thanks though
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)