Server crashes
#1

Код:
[22:56:13] [debug] Server crashed while executing TGP.amx
[22:56:13] [debug] AMX backtrace:
[22:56:13] [debug] #0 00000075 in ?? () from TGP.amx
[22:56:13] [debug] #1 000bfd5c in ?? () from TGP.amx
[22:56:13] [debug] #2 00000075 in public cmd_ant () from TGP.amx
[22:56:13] [debug] #3 native CallLocalFunction () [080d2870] from samp03svr
[22:56:13] [debug] #4 0000131c in public OnPlayerCommandText () from TGP.amx
[22:56:13] [debug] System backtrace:
pawn Код:
CMD:ant(playerid, params[])
{
    if(playerDB[playerid][darbas]!=1) return 0;
    new
        vardas[MAX_PLAYER_NAME],
        msg[64],
        policeman[MAX_PLAYER_NAME],
        name[MAX_PLAYER_NAME]
    ;
    if( sscanf( params,"z",vardas ) ) return SendClientMessage(playerid,Zalia, "{00CC00}Surakinti ћaidėją: {FF0000}/ant [Vardas_Pavadė]");
    new id = GetPlayeridMid(vardas);
    if(id == INVALID_PLAYER_ID) return InfoBoxForPlayer(playerid, "~r~Tokio zaidejo nera");
    if(id == playerid) return InfoBoxForPlayer(playerid, "~r~Saves surankiti negalite");
    new Float:poz[3];
    GetPlayerPos(id, poz[0], poz[1], poz[2]);
    if(!PlayerToPoint(3, playerid, poz[0],poz[1],poz[2])) return InfoBoxForPlayer(playerid, "~r~Zaidejas per toli");
    GetPlayerName(playerid,policeman,sizeof(policeman));
    GetPlayerName(id,name,sizeof(name));
    if(playerDB[id][surakintas])
    {
        playerDB[id][surakintas]=false;
        TogglePlayerControllable(id,true);
        RemovePlayerAttachedObject(id,0);
        SetPlayerSpecialAction(id,SPECIAL_ACTION_NONE);
        format(msg,sizeof(msg),"{FFD400}Paleidote {DC00FF}%s.",name);
        SendClientMessage(playerid,Raudona,msg);
        format(msg,sizeof(msg),"{FFD400}Jus paleido {DC00FF}%s.",policeman);
        SendClientMessage(id,Raudona,msg);
    }
    else
    {
        playerDB[id][surakintas]=true;
        TogglePlayerControllable(id,false);
        SetPlayerSpecialAction(id, SPECIAL_ACTION_CUFFED );
        SetPlayerAttachedObject(id,0,19418,5,0.016000,0.032000,0.025000,17.500005,-10.099991,-48.099990,1.0,1.0,1.0 );
        format(msg,sizeof(msg),"{FFD400}Surakinote {DC00FF}%s.",name);
        SendClientMessage(playerid,Raudona,msg);
        format(msg,sizeof(msg),"{FFD400}Jus surakino {DC00FF}%s.",policeman);
        SendClientMessage(id,Raudona,msg);
    }
    return 1;
}
Reply
#2

I can't really find the issue but the way I normally fix these issues is to start commenting out small parts of the script and then tests if the script crashes, you will then be able to find out what line it is that does the crash and do appropriate action according to that.
Reply
#3

Now i gave this error in debug:

pawn Код:
[15:15:16] [debug] Run time error 4: "Array index out of bounds"
[15:15:16] [debug]  Accessing element at index 65535 past array upper bound 1999
[15:15:16] [debug] AMX backtrace:
[15:15:16] [debug] #0 00163534 in ?? () from TGP.amx
[15:15:16] [debug] #1 000b8504 in public OnPlayerSpawn () from TGP.amx
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)