another backtrace
#8

Quote:
Originally Posted by Variable™
View Post
Are you resetting the PlayerInfo array when the player disconnects? If so, make sure to do the duel check before you reset it, otherwise I assume you set the value to -1 before you actually do your check, so "id" will always be -1 which isn't a valid player ID.

You also have a typo in your parameters, while it's unrelated to your problem, you gotta figure it out.
I checked and I don't see anything wrong, could you tell me a clue? I will post the code.

Quote:
Originally Posted by v1k1nG
View Post
Since arrays start from 0, -1 looks like an arbitrary value you give to it.

Post OnPlayerDisconnect entirely, maybe we can help.
Quote:
Originally Posted by ItsRobinson
View Post
PHP Code:
        PlayerInfo[id][Duelingto] = -1;
        
PlayerInfo[id][Maker] = -1;
        
PlayerInfo[id][Opponent] = -1;
        
PlayerInfo[playerid][LoseDuels] ++;
        
PlayerInfo[id][WinDuels] ++; 
We can't see your whole code, but I'd presuming these would need to be in the above bit no?

PHP Code:
        PlayerInfo[playerid][inDuel] = 0;
        
PlayerInfo[id][inDuel] = 0


PHP Code:
public OnPlayerDisconnect(playeridreason)
{
    if(
gTeam[playerid][TEAMATT] == 1)
    {
        
CountAtt --;
    }
    if(
gTeam[playerid][TEAMDEF] == 1)
    {
        
CountDef --;
    }
    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] ++;
    }
    if(
PlayerInfo[playerid][Inviter] == 1)
    {
        new 
id PlayerInfo[playerid][Inviter], str[124];
        
PlayerInfo[id][Invited] = 0;
        
KillTimer(InviteTimer[id]);
        
format(strsizeof(str), "%s disconnected in the mid of the invite. The invite is cancelled."GetName(playerid));
        
SendClientMessage(idCDUELstr);
    }
    if(
PlayerInfo[playerid][Invited] == 1)
    {
        new 
id PlayerInfo[playerid][Invited], str[124];
        
PlayerInfo[id][Inviter] = 0;
        
KillTimer(InviteTimer[id]);
        
format(strsizeof(str), "%s disconnected in the mid of the invite. The invite is cancelled."GetName(playerid));
        
SendClientMessage(idCDUELstr);
    }
    if(
SniperGame[playerid] == 1)
    {
        new 
str[124];
        
countsniper --;
        
format(strsizeof(str), "%s disconnected in the mid of sniper game. (%d players)."GetName(playerid), countsniper);
        
SendClientMessageToAll(-1str);
    }
    
    
Saving(playerid);
    
PlayerInfo[playerid][Logged] = 0;
    
PlayerInfo[playerid][pDeaths] = 0;
    
PlayerInfo[playerid][pKills] = 0;
    
PlayerInfo[playerid][Invisible] = 0;
    
PlayerInfo[playerid][God] = 0;
    
PlayerInfo[playerid][PMs] = 0;
    
PlayerInfo[playerid][Muted] = 0;
    
PlayerInfo[playerid][Admin] = 0;
    
PlayerInfo[playerid][Skin] = 0;
    
PlayerInfo[playerid][ATT] = 0;
    
PlayerInfo[playerid][DEF] = 0;
    
PlayerInfo[playerid][DMG] = 0;
    
PlayerInfo[playerid][TotalDMG] = 0;
    
PlayerInfo[playerid][FPSCheck] = 0;
    
PlayerInfo[playerid][FPSKick] = 0;
    
PlayerInfo[playerid][MsKick] = 0;
    
PlayerInfo[playerid][MsCheck] = 0;
    
PlayerInfo[playerid][NetCheck] = 0;
    
PlayerInfo[playerid][RestartSpawn] = 0;
    
PlayerInfo[playerid][WinRounds] = 0;
    
PlayerInfo[playerid][LoseRounds] = 0;
    
PlayerInfo[playerid][Hora] = 0;
    
PlayerInfo[playerid][Clima] = 0;
    
PlayerInfo[playerid][Warns] = 0;
    
PlayerInfo[playerid][Kicks] = 0;
    
PlayerInfo[playerid][Maker] = -1;
    
PlayerInfo[playerid][Opponent] = -1;
    
PlayerInfo[playerid][inDuel] = 0;
    
PlayerInfo[playerid][DuelMap] = 0;
    
PlayerInfo[playerid][DuelPack] = 0;
    
PlayerInfo[playerid][DuelArmour] = 0;
    
PlayerInfo[playerid][WeapDuel] = 0;
    
PlayerInfo[playerid][OnWeap] = 0;
    
PlayerInfo[playerid][Inviter] = 0;
    
PlayerInfo[playerid][Invited] = 0;
    
PlayerInfo[playerid][Duelingto] = -1;
    
PlayerInfo[playerid][WinDuels] = 0;
    
PlayerInfo[playerid][LoseDuels] = 0;
    
PlayerInfo[playerid][Duelos] = 1;
    
PlayerInfo[playerid][Duty] = 1;
    
gTeam[playerid][TEAMATT] = 0;
    
gTeam[playerid][TEAMDEF] = 0;
    
Streaks[playerid] = 0;
    
Voted[playerid] = 0;
    
LastPm[playerid] = -1;
    
onspec[playerid] = -1;
    
SendDeathMessage(INVALID_PLAYER_IDplayerid201);
    
TextDrawHideForPlayer(playeridTextdrawLogo1);
    
TextDrawHideForPlayer(playeridTextdraw2);
    
TextDrawHideForPlayer(playeridTextdrawDMG[playerid]);
    return 
1;

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)