12.06.2013, 06:17
How do I make it so when the player logs in, they spawn back to where they logged off from?
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;
}
public OnPlayerDisconnect(playerid, reason)
{
SStats(playerid);
return 1;
}
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;
}