Stupid Mistake i can't fix ! :B
#1

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
Reply
#2

Try this:
pawn Код:
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;
}
Reply
#3

Oh god ! Thanks a lot buddy ! That was quick and exactly what i needed !

Mike
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)