Server log errors !
#1

Код:
[debug] Run time error 4: "Array index out of bounds"
[15:33:26] [debug]  Accessing element at index 999 past array upper bound 500
[15:33:26] [debug] AMX backtrace:
[15:33:26] [debug] #0 000661d0 in public OnPlayerStateChange () from EG-RP_nomysql.amx
These codes appear randomly at any random CMD
Reply
#2

Bump
Anyways sorry for the bump
Reply
#3

Can you show your OnPlayerStateChange callback?
Reply
#4

They are many callbacks and i do not know which one gives the error ?
Reply
#5

OnPlayerStateChange causes it, post it.
Reply
#6

pawn Код:
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);
        }
    }
    if(newstate == PLAYER_STATE_ONFOOT)
    {
        if(Audio_IsClientConnected(playerid))
        {
            Audio_Stop(playerid, stationidp[playerid]);
            stationidp[playerid] = 0;
        }
       
       
        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 ) );
        }

        if(oldstate == PLAYER_STATE_DRIVER)
        {
            SetPlayerWeaponsEx(playerid);
        }
        else if(oldstate == PLAYER_STATE_PASSENGER) SetPlayerWeaponsEx(playerid);

        if(ConnectedToPC[playerid] == 1337)//mdc
        {
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You are now logged off the MDC.");
            ConnectedToPC[playerid] = 0;
        }
        if(TransportDuty[playerid] > 0)
        {
            if(TransportDuty[playerid] == 1)
            {
                TaxiDrivers -= 1;
            }
            else if(TransportDuty[playerid] == 2)
            {
                BusDrivers -= 1;
            }
            TransportDuty[playerid] = 0;
            new string[42];
            format(string, sizeof(string), "* You are now off duty and earned $%d.", TransportMoney[playerid]);
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
            GivePlayerCash(playerid, TransportMoney[playerid]);
            ConsumingMoney[playerid] = 1; TransportValue[playerid] = 0; TransportMoney[playerid] = 0;
            SetPlayerColor(playerid, TEAM_HIT_COLOR);
            TransportTime[playerid] = 0;
            TransportCost[playerid] = 0;
        }
This is a big part of it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)