SA-MP Forums Archive
Run time error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Run time error (/showthread.php?tid=559061)



Run time error - DavidSparks - 20.01.2015

pawn Код:
new spectator = GettingSpectated[playerid];
        if(PlayerInfo[spectator][pAdmin] >= 2) {
            // Preventing possible buffer overflows with the arrays
            TogglePlayerSpectating(spectator, true);
            PlayerSpectatePlayer( spectator, playerid );
            SetPlayerInterior( spectator, GetPlayerInterior( playerid ) );
            SetPVarInt(spectator, "SpecState", newstate);
            SetPlayerInterior( spectator, GetPlayerInterior( playerid ) );
            SetPlayerVirtualWorld( spectator, GetPlayerVirtualWorld( playerid ) );
        }



Re: Run time error - Misiur - 20.01.2015

IIRC INVALID_PLAYER_ID is 0xFFFF, so I guess:
1. new spectator = GettingSpectated[playerid];

Now you have INVALID_PLAYER_ID, and you are using it anyway. Do something like
pawn Код:
if(spectator != INVALID_PLAYER_ID && PlayerInfo[spectator][pAdmin] >= 2) {



Re: Run time error - DavidSparks - 20.01.2015

Quote:
Originally Posted by Misiur
Посмотреть сообщение
IIRC INVALID_PLAYER_ID is 0xFFFF, so I guess:
1. new spectator = GettingSpectated[playerid];

Now you have INVALID_PLAYER_ID, and you are using it anyway. Do something like
pawn Код:
if(spectator != INVALID_PLAYER_ID && PlayerInfo[spectator][pAdmin] >= 2) {
I'll try it. Thanks.