SA-MP Forums Archive
Help bug onplayerdeath skin shot - 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: Help bug onplayerdeath skin shot (/showthread.php?tid=480885)



Help bug onplayerdeath skin shot - luccagomes15 - 13.12.2013

People need that much! Help me fix my skin shot (/ anti inv, god mode) ... A long time passed me the script it works fine shot on skin, qm ta hack dies. But he has put buga.

When you arrow the life of a player to 0 in the computation shot to the skin, OnPlayerDeath runs without any killerid, so OnPlayerDeath is not working (sometimes it works sometimes not) as Chat Kill Contract Dying to police and being arrested, anything involving someone who killed a player and a player who died ta running direct!, may be the shot in the lag that seems to also be present on the server ... Someone help me I'm newbie to fix this and my server needs it tidy!

sorry my english

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
            new
                Float: vida,
                Float: armadura,
                Float: dmg;

            GetPlayerArmour(damagedid, armadura);
            GetPlayerHealth(damagedid, vida);

            if (armadura > 0)
            {
                if (amount > armadura)
                {
                    dmg = amount - armadura;
                    vida = vida - dmg;
                    SetPlayerArmour(damagedid, 0.0);
                    SetPlayerHealth(damagedid, vida);
                    return 1;
                }
                armadura = armadura - amount;
                SetPlayerArmour(damagedid, armadura);
            }
            if (armadura < 1)
            {
                vida = vida - amount;
                SetPlayerHealth(damagedid, vida);
            }

    return 1;
}
Se precisar meu onplayerdeath, mas creio q ta tudo certo...
http://pastebin.com/hUSszVrd


Re: Help bug onplayerdeath skin shot - AssBlaster - 13.12.2013

pawn Код:
// on top
new pKillID[MAX_PLAYERS], pKillReason[MAX_PLAYERS];

// OnPlayerGiveDamage
pKillID[damagedid] = playerid;
pKillReason[damagedid] = weaponid;

// OnPlayerDeath
if(pKillID[playerid] != INVALID_PLAYER_ID)
{
    killerid = pKillID[playerid];
    reason = pKillReason[playerid];

    pKillID[playerid] = INVALID_PLAYER_ID;
    pKillReason[playerid] = 54;
}



Re: Help bug onplayerdeath skin shot - maikons - 18.12.2013

very thank, +rep