SA-MP Forums Archive
hit cancelled bug - 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: hit cancelled bug (/showthread.php?tid=420039)



hit cancelled bug - GoldZoroGrab - 03.03.2013

=================
----------------------
| FIXED |
----------------------
=================


Re: hit cancelled bug - Babul - 03.03.2013

ah, there we go again, iam specialist for that id-0 bug, HAHA (irony hurts. ouch! ><)
try this one:
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(reason <=46)
    {
        if(hitted[playerid]==1 && hiter[playerid]==killerid)
        {
            new string[250];
            hiter[playerid]=INVALID_PLAYER_ID;
            hit[playerid] = 0;
            hitted[playerid] = 0;
            new name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "The hit on %s[%i] has been cancelled (hitter died)",name,playerid);
            SendClientMessageToAll(COLOR_RED, string);
        }
    }
}
return 1;
i removed some irrelevant lines, since a non-connected player cannot die. for NPCs this is true also (atm).
the loop is not required at all.


Re: hit cancelled bug - GoldZoroGrab - 03.03.2013

and thanks
fixed