SA-MP Forums Archive
OnPlayerDeath debug error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerDeath debug error (/showthread.php?tid=397150)



OnPlayerDeath debug error - Threshold - 03.12.2012

Guys,
Another problem. The crashdetect plugin is reading a Debug on OnPlayerDeath. I dont see whats wrong here. The onplayedeath callback consists the Register and a piece from the Spectate system.

pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{
    PlayerInfo[killerid][pKills]++;
    PlayerInfo[playerid][pDeaths]++;
    if(IsBeingSpeced[playerid] == 1)//If the player being spectated, dies, then turn off the spec mode for the spectator.
    {
        foreach(Player,i)
        {
            if(spectatorid[i] == playerid)
            {
                TogglePlayerSpectating(i,false);// This justifies what's above, if it's not off then you'll be either spectating your connect screen, or somewhere in blueberry (I don't know why)
            }
        }
    }
    return 1;
    }



Re: OnPlayerDeath debug error - Konstantinos - 03.12.2012

Can you show us what the crashdetect shows?


Re: OnPlayerDeath debug error - Threshold - 03.12.2012

pawn Код:
[18:03:53] [debug] #0 0000ae80 in public OnPlayerDeath () from systema.amx



Re: OnPlayerDeath debug error - Konstantinos - 03.12.2012

I'm not really sure, but check if the killer is valid player.
pawn Код:
if( killerid != INVALID_PLAYER_ID ) PlayerInfo[ killerid ][ pKills ]++;
And tell me if it shows that message again.