Help bug onplayerdeath skin shot
#1

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
Reply
#2

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;
}
Reply
#3

very thank, +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)