another backtrace
#1

Hello! I found this recently:

PHP Code:
[18:09:34] [debugRun time error 4"Array index out of bounds"
[18:09:34] [debug]  Attempted to read/write array element at negative index -1
[18:09:34] [debugAMX backtrace:
[
18:09:34] [debug#0 00042230 in public Iter_OnPlayerDisconnect (playerid=1, reason=0) at C:\Users\ert\OneDrive\Desktop\game\gamemodes\game.pwn:890
[18:09:34] [debug#1 native CallLocalFunction () in server
[18:09:34] [debug#2 00038a38 in public SSCANF_OnPlayerDisconnect (playerid=1, reason=0) at C:\Users\ert\OneDrive\Desktop\game\pawno\include\foreach.inc:833
[18:09:34] [debug#3 00031860 in public WC_OnPlayerDisconnect (playerid=1, reason=0) at C:\Users\ert\OneDrive\Desktop\game\pawno\include\sscanf2.inc:266
[18:09:34] [debug#4 00014b98 in public FIXES_OnPlayerDisconnect (1, 0)  at C:\Users\ert\OneDrive\Desktop\game\pawno\include\weapon-config.inc:2243
[18:09:34] [debug#5 00004960 in public OnPlayerDisconnect (playerid=1, reason=0) at C:\Users\ert\OneDrive\Desktop\game\pawno\include\fixes.inc:6522 
This happens if a player disconnects in the middle of a duel. Line:

PHP Code:
format(strsizeof(str), "%s abandoned the server in the mid of a duel vs %s. %s is the winner. [%.0f health and %.0f armour]"GetName(playerid), GetName(id), GetName(id), healtharmour); 
OnPlayerDisconnect:

PHP Code:
public OnPlayerDisconnect(playeridreason)
{
   
//another checks...
    
if(PlayerInfo[playerid][inDuel] == 1)
    {
        new 
id PlayerInfo[playerid][Duelingto], Float:healthFloat:armourstr[124];
        
GetPlayerHealth(idhealth);
        
GetPlayerArmour(idarmour);
        
ResetPlayerWeapons(id);
        
SetPlayerVirtualWorld(id0);
        
SetPlayerInterior(id0);
        
SetPlayerHealth(id100);
        
SpawnPlayer(id);
        
format(strsizeof(str), "%s abandoned the server in the mid of a duel vs %s. %s is the winner. [%.0f health and %.0f armour]"GetName(playerid), GetName(id), GetName(id), healtharmour);
        
SendClientMessageToAll(CDUELstr);
        
PlayerInfo[id][Duelingto] = -1;
        
PlayerInfo[id][Maker] = -1;
        
PlayerInfo[id][Opponent] = -1;
        
PlayerInfo[playerid][LoseDuels] ++;
        
PlayerInfo[id][WinDuels] ++;
    }
   
// another checks etc
   
return 1;

The message is sent correctly to the other player and runs well the code but i founded this in the log
Reply


Messages In This Thread
another backtrace - by Ertouq - 02.06.2020, 08:51
Re: another backtrace - by Adamoneoone - 02.06.2020, 09:00
Re: another backtrace - by Ertouq - 02.06.2020, 09:14
Re: another backtrace - by Ertouq - 02.06.2020, 23:56
Re: another backtrace - by Variable™ - 03.06.2020, 00:04
Re: another backtrace - by v1k1nG - 03.06.2020, 00:20
Re: another backtrace - by ItsRobinson - 03.06.2020, 01:23
Re: another backtrace - by Ertouq - 03.06.2020, 07:31
Re: another backtrace - by Variable™ - 03.06.2020, 07:37
Re: another backtrace - by Ertouq - 03.06.2020, 07:42

Forum Jump:


Users browsing this thread: 1 Guest(s)