OnPlayerStateChange Problem
#2

Quote:

Accessing element at index 999 past array upper bound 500

What does it mean? And why so many people are getting it? Long story short: your array has 500 slots, and you want to access nonexistent index at 999.

I don't know if you've written this code, but look at
pawn Код:
if(GettingSpectated[playerid] != 999)
Code inside this if statement won't execute when GettingSpectated for this specific player is not set (i.e if equal 999 don't do that block). But, later in code (outside of this block) you have
pawn Код:
new spectator = GettingSpectated[playerid];
if(PlayerInfo[spectator][pAdmin] >= 2) {
What if GettingSpectated[playerid] is equal 999? Bam, your error. The fix:
pawn Код:
//This line
if(PlayerInfo[spectator][pAdmin] >= 2) {
//Changes into
if(spectator != 999 && PlayerInfo[spectator][pAdmin] >= 2) {
I just swifted through your code, so there might be some other cause, but it's identical example, all you have to do is look for such pitfalls.
Reply


Messages In This Thread
OnPlayerStateChange Problem - by Fachrul48 - 10.08.2014, 02:58
Re: OnPlayerStateChange Problem - by Misiur - 10.08.2014, 08:27

Forum Jump:


Users browsing this thread: 1 Guest(s)