19.03.2012, 05:36
Here it is : I need to save players positions. So when they spawn , if they already registered they simply load their old position. But if they did not , they need to spawn to where i want them to go, which means, the default spawn point. For now on , the position save works but they cannot spawn normaly to where i want them to spawn as they spawn on Default spawn coordinates (0,0)
Heres my code : public OnPlayerSpawn(playerid)
{
PlayerInfo[playerid][gHP] = 100;
if(PlayerInfo[playerid][Logged] == 1)
PlayerInfo[playerid][Spawned] = 1;
{
SetPlayerPos(playerid, PlayerInfo[playerid][X], PlayerInfo[playerid][Y], PlayerInfo[playerid][Z]);
SetPlayerInterior(playerid, dini_Int(NameToFile(playerid), "LastInt"));
}
else
{
SetPlayerPos(playerid, 1641.5160, -2239.5818, 13.4972);
}
return 1;
}
Thanks a lot ! :B
Mike
Heres my code : public OnPlayerSpawn(playerid)
{
PlayerInfo[playerid][gHP] = 100;
if(PlayerInfo[playerid][Logged] == 1)
PlayerInfo[playerid][Spawned] = 1;
{
SetPlayerPos(playerid, PlayerInfo[playerid][X], PlayerInfo[playerid][Y], PlayerInfo[playerid][Z]);
SetPlayerInterior(playerid, dini_Int(NameToFile(playerid), "LastInt"));
}
else
{
SetPlayerPos(playerid, 1641.5160, -2239.5818, 13.4972);
}
return 1;
}
Thanks a lot ! :B
Mike