Problem with health bug
#4

Maybe my OnPlayerTakeDamage and GiveDamage helps. Can't find the timers, what sets the health to 100.

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
        new Float:armourloss, Float:healthloss, Float:pArmour;
        GetPlayerArmour(playerid, pArmour);
        if(pArmour != 0)
        {
                if(amount > pArmour)
                {
                        armourloss = pArmour;
                        healthloss = amount-pArmour;
                }
                else
                {
                        armourloss = amount;
                }
        }
        else healthloss = amount;

     
        CallLocalFunction("OnPlayerTakeDamageEx", "iiffi", playerid, issuerid, healthloss, armourloss, weaponid);

    #if defined OPGTD_OnPlayerTakeDamage
        return OPGTD_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid);
    #else
        return 1;
    #endif
}
#if defined OPGTD_OnPlayerTakeDamage
    forward OPGTD_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid);
#endif
#if defined _ALS_OnPlayerTakeDamage
    #undef OnPlayerTakeDamage
#else
    #define _ALS_OnPlayerTakeDamage
#endif
#define OnPlayerTakeDamage OPGTD_OnPlayerTakeDamage

public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
        new Float:armourloss, Float:healthloss, Float:pArmour;
        GetPlayerArmour(damagedid, pArmour);
        if(pArmour != 0)
        {
                if(amount > pArmour)
                {
                        armourloss = pArmour;
                        healthloss = amount-pArmour;
                }
                else
                {
                        armourloss = amount;
                }
        }
        else healthloss = amount;

        CallLocalFunction("OnPlayerGiveDamageEx", "iiffi", playerid, damagedid, healthloss, armourloss, weaponid);

    #if defined OPGTD_OnPlayerGiveDamage
        return OPGTD_OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid);
    #else
        return 1;
    #endif
}
#if defined OPGTD_OnPlayerGiveDamage
    forward OPGTD_OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid);
#endif
#if defined _ALS_OnPlayerGiveDamage
    #undef OnPlayerGiveDamage
#else
    #define _ALS_OnPlayerGiveDamage
#endif
#define OnPlayerGiveDamage OPGTD_OnPlayerGiveDamage
Reply


Messages In This Thread
Problem with health bug - by Lops - 26.10.2013, 14:33
Re: Problem with health bug - by Lops - 28.10.2013, 05:47
Re: Problem with health bug - by ]Rafaellos[ - 28.10.2013, 05:53
Re: Problem with health bug - by Lops - 28.10.2013, 10:25
Re: Problem with health bug - by -=Dar[K]Lord=- - 28.10.2013, 11:34

Forum Jump:


Users browsing this thread: 1 Guest(s)