30.05.2012, 12:44
Код:
[09:39:16] [debug] Run time error 4: "Array index out of bounds" [09:39:16] [debug] Accessing element at index 999 past array upper bound 500 [09:39:16] [debug] Backtrace (most recent call first): [09:39:16] [debug] #0 000603e0 in OnPlayerStateChange () from OGHRP.amx
Код:
public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate != 2) NOPTrigger[playerid] = 0; if(IsPlayerNPC(playerid)) { if(newstate == PLAYER_STATE_SPECTATING) { TogglePlayerSpectating(playerid, false); } return 1; } if(GettingSpectated[playerid] != 999) { new spectator = GettingSpectated[playerid]; if(!IsPlayerConnected(spectator)) { GettingSpectated[playerid] = 999; Spectate[spectator] = 999; } if(newstate == PLAYER_STATE_DRIVER && PlayerInfo[spectator][pAdmin] >= 2 || newstate == PLAYER_STATE_PASSENGER && PlayerInfo[spectator][pAdmin] >= 2) { TogglePlayerSpectating(spectator, true); new carid = GetPlayerVehicleID( playerid ); PlayerSpectateVehicle( spectator, carid ); SetPVarInt(spectator, "SpecState", newstate); } else if(newstate == PLAYER_STATE_ONFOOT && PlayerInfo[spectator][pAdmin] >= 2) { TogglePlayerSpectating(spectator, true); PlayerSpectatePlayer( spectator, playerid ); SetPlayerInterior( spectator, GetPlayerInterior( playerid ) ); SetPVarInt(spectator, "SpecState", newstate); } }