13.01.2012, 20:09
pawn Code:
if(positionx[playerid] != 0 && positiony[playerid] !=0 && positionz[playerid] != 0); {
SetPlayerPos(playerid, 1676.8462, 1447.7908, 10.7833);
}
else {
SetPlayerPos(playerid,positionx,positiony,position z);
}
you check if its not 0 then you spawn him at your default spawn.
AND you have to add
pawn Code:
positionx = dini_Int(Pos(playerid), "PositionX");
positiony = dini_Int(Pos(playerid), "PositionY");
positionz = dini_Int(Pos(playerid), "PositionZ");
so result :
pawn Code:
public OnPlayerSpawn(playerid)
{
positionx = dini_Int(Pos(playerid), "PositionX");
positiony = dini_Int(Pos(playerid), "PositionY");
positionz = dini_Int(Pos(playerid), "PositionZ");
if(positionx[playerid] != 0 && positiony[playerid] !=0 && positionz[playerid] != 0);
{
SetPlayerPos(playerid,positionx,positiony,position z);
}
else
{
SetPlayerPos(playerid, 1676.8462, 1447.7908, 10.7833);
}
return 1;
}