Code Executed 2 Times
#1

pawn Код:
if(pInfo[playerid][prSTEP] >= 3)
    {
        if(FirstTimerSpawn[playerid] == 1)
        {
            SetPlayerInterior(playerid, 0);
            SetPlayerPos(playerid, 1612.3240, -2330.1670, 13.5469);
            FirstTimerSpawn[playerid] = 0;
            setPlayerStats(playerid);
        }
        else if(FirstTimerSpawn[playerid] == 0)
        {
            SetPlayerPos(playerid, pInfo[playerid][pX], pInfo[playerid][pY], pInfo[playerid][pZ]);
            setPlayerStats(playerid);  
            SendClientMessage(playerid, COL_RED, "Message");
        }
        return 0;
    }
    return 1;
The Code Abouve is my onplayerspawn code



Please Tell My Why
Reply
#2

The code, i suppose is in another function, that function is triggered twice.
Reply
#3

Are you calling TogglePlayerSpectating before spawning the player? It calls OnPlayerSpawn automatically, use a variable to check for it.
Reply
#4

i calling TogglePlayerSpectating right before player spawn yea

my god you are right !!!! i was calling TogglePlayerSpectating and spawn player +REP for you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)