Help Please
#1

How would i go about loading Player Position i got it to save but having the most hardest time getting it load it..


pawn Код:
if(PlayerInfo[playerid][pLocX] == 0.0 && PlayerInfo[playerid][pLocY] == 0.0)
    {
        SetPlayerPos(playerid, PlayerInfo[playerid][pLocX], PlayerInfo[playerid][pLocY], PlayerInfo[playerid][pLocZ]); // Loads Spawning but NOT working
        SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pLocW]);
        SetPlayerInterior(playerid, PlayerInfo[playerid][pLocI]);
        TogglePlayerSpectating(playerid, false);
    }
    else
    {

        SetPlayerPos(playerid, -299.8857, 1015.5681, 19.5938); // For if Player Cords are 0 Spawns them on Ground
        TogglePlayerSpectating(playerid, false);
    }
Dont work ...
Reply
#2

Where you put that code?
Reply
#3

Dude put ur conditional code the other way around.
Reply
#4

pawn Код:
if(PlayerInfo[playerid][pLocX] != 0.0 && PlayerInfo[playerid][pLocY] != 0.0)
    {
        SetPlayerPos(playerid, PlayerInfo[playerid][pLocX], PlayerInfo[playerid][pLocY], PlayerInfo[playerid][pLocZ]); // Loads Spawning but NOT working
        SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pLocW]);
        SetPlayerInterior(playerid, PlayerInfo[playerid][pLocI]);
        TogglePlayerSpectating(playerid, false);
    }
    else
    {

        SetPlayerPos(playerid, -299.8857, 1015.5681, 19.5938); // For if Player Cords are 0 Spawns them on Ground
        TogglePlayerSpectating(playerid, false);
    }
Reply
#5

Okay Ive put the code on player Request Class and even on player spawn and I switched them around it still never called on there last position it spawned them at the SetPlayerPos(playerid, -299.8857, 1015.5681, 19.593;

I even tried making a new Function and used SetTimerEx and Still.. nothing
Reply
#6

Have you tried SuperViper code?
To make sure, debug PlayerInfo[playerid][pLocX] and PlayerInfo[playerid][pLocY].
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)