Run time error 4: "Array index out of bounds"
#1

Код:
[20:39:58] [debug] Run time error 4: "Array index out of bounds"
[20:39:58] [debug]  Accessing element at negative index -1
[20:39:58] [debug] AMX backtrace:
[20:39:58] [debug] #0 0007a130 in ?? () from phg.amx
[20:39:58] [debug] #1 0007a068 in ?? () from phg.amx
[20:39:58] [debug] #2 00079d40 in ?? () from phg.amx
[20:39:58] [debug] #3 00020de0 in public Itter_OnPlayerDisconnect () from phg.amx
[20:39:58] [debug] #4 native CallLocalFunction () [00472ad0] from samp-server.exe
[20:39:58] [debug] #5 0000afb0 in ?? () from phg.amx
[20:39:58] [debug] #6 00000374 in public OnPlayerDisconnect () from phg.amx
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    Delete3DTextLabel(label[playerid]);

/*------------------------------------------------------
-> Squad system
-----------------------------------------------------*/

    LeaveSquad(playerid, 3);

/*------------------------------------------------------
-> Reseting vars
------------------------------------------------------*/

    player[playerid][isspawned]=0;
    team_selection[playerid]=1;
    spawn_timer[playerid]=0;
    spree[playerid]=0;
    PlayerRank[playerid]=1;
    class[playerid]=0;
    medicine[playerid]=0;
    disguise[playerid]=0;
    string_4[playerid] = "-";
    string_3[playerid] = "-";
    string_2[playerid] = "-";
    string_1[playerid] = "-";
    for(new k; k < 10; k++)
    {
        _cp[playerid][k][created] = 0;
        _cp[playerid][k][cid] = -1;
    }
    player_veh[playerid]=0;
    donor_supply[playerid]=0;
    donor_armor[playerid]=0;
    anti_headshot[playerid]=0;
    anti_spy[playerid]=0;
    anti_teargas[playerid]=0;
    logged[playerid]=0;
    player_animing[playerid]=0;
    dm[playerid]=0;
    player_shop[playerid]=-1;

/*------------------------------------------------------
-> Player leaving message
------------------------------------------------------*/

    new string[125];
    if(reason==0)
    {   format(string, sizeof(string), "~r~%s(%d) has left the server the server (Reason: Timeout/Crashed).", GetName(playerid),playerid); }
    if(reason==1)
    {   format(string, sizeof(string), "~r~%s(%d) has left the server the server (Reason: Leaving).", GetName(playerid),playerid); }
    if(reason==2)
    {   format(string, sizeof(string), "~r~%s(%d) has left the server the server (Reason: Kicked/Banned).", GetName(playerid),playerid); }
    SendServerTDMessage(string);
/*------------------------------------------------------*/
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)