Problem with health bug
#1

I have problem with health losing.
So, if someone shoot me or i jump down from the building roof, it takes away amount of health, but then health recovers immidiently. There's no way to die.
Problem is in the roleplay server and i can't figure it out by myself.
Maybe someone know the issue/problem?
Reply
#2

Someone know the solution?
Reply
#3

Is there any timer that restore health back to 100? Or on OnPlayerUpdate or on OnPlayerTakeDamage? Check you'r Gamemode and you'r Filterscripts.
Reply
#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
#5

i think you should post the codes of OnPlayerTakeDamageEx And OnPlayerGiveDamageEx too... so that it might have the codes which gives the player health again.. cuz its calling a LocalFunctionAgain in there which isnt a timer but a function can have anything such as giving player a weapon setting textdraws , logging player , registring player , Anything...
Untill you post that code we cannot help you..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)