12.06.2013, 06:21
Save player x,y,z positions then load when player logged in
like
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;
}