OnPlayerStateChange run time error
#5

It's fairly obvious that it's related to this part;
pawn Код:
if(GettingSpectated[playerid] != INVALID_PLAYER_ID) // suppose this contains 999. Obviously not equal to INVALID_PLAYER_ID so this is true
    {
        new spectator = GettingSpectated[playerid]; // spectator now contains 999
        if(!IsPlayerConnected(spectator)) // player 999 does not exist and is therefore not connected so this is also true
        {
            GettingSpectated[playerid] = 999;
            Spectate[spectator] = 999; // 'spectator' is still 999, which is an invalid array index, hence causing the OOB error
        }
        // bunch of code
    }
Why do you use INVALID_PLAYER_ID in one place and 999 in another?
Reply


Messages In This Thread
OnPlayerStateChange run time error - by ahmedkoki - 15.01.2015, 12:20
Re: OnPlayerStateChange run time error - by MBilal - 15.01.2015, 12:31
Re: OnPlayerStateChange run time error - by ahmedkoki - 15.01.2015, 12:35
Re: OnPlayerStateChange run time error - by ahmedkoki - 05.02.2015, 21:43
Re: OnPlayerStateChange run time error - by Vince - 05.02.2015, 21:56
Re: OnPlayerStateChange run time error - by ahmedkoki - 05.02.2015, 22:40
Re: OnPlayerStateChange run time error - by Schneider - 05.02.2015, 22:50

Forum Jump:


Users browsing this thread: 1 Guest(s)