SA-MP Forums Archive
Players HP Bar refilling - 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: Players HP Bar refilling (/showthread.php?tid=387794)



Players HP Bar refilling - _Khaled_ - 26.10.2012

For some unknown reason, the players HP bars keep on refilling on damage..
PHP код:
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponid)
{
    if(
issuerid != INVALID_PLAYER_ID)
    {
        new 
Float:health;
        
GetPlayerHealth(playeridhealth);
        if(
weaponid == 7)
                        
SetPlayerHealth(playerid,health-12);
        if(
weaponid == 8)
                        
SetPlayerHealth(playerid,health-90);
        if(
weaponid == 4)
                        
SetPlayerHealth(playerid,health-78);
        if(
weaponid == 3)
                        
SetPlayerHealth(playerid,health-11);
        if(
weaponid == 5)
                        
SetPlayerHealth(playerid,health-11);
        if(
weaponid == 23)
                        
SetPlayerHealth(playerid,health-53);
        if(
weaponid == 24)
                        
SetPlayerHealth(playerid,health-90);
        if(
weaponid == 22)
                        
SetPlayerHealth(playerid,health-39);
        if(
weaponid == 25)
                        
SetPlayerHealth(playerid,health-65);
        if(
weaponid == 26)
                        
SetPlayerHealth(playerid,health-48);
        if(
weaponid == 27)
                        
SetPlayerHealth(playerid,health-32);
        if(
weaponid == 28)
                        
SetPlayerHealth(playerid,health-28);
        if(
weaponid == 29)
                        
SetPlayerHealth(playerid,health-31);
        if(
weaponid == 30)
                        
SetPlayerHealth(playerid,health-41);
        if(
weaponid == 31)
                        
SetPlayerHealth(playerid,health-41);
        if(
weaponid == 32)
                        
SetPlayerHealth(playerid,health-27);
        if(
weaponid == 33)
                        
SetPlayerHealth(playerid,health-97);
        if(
weaponid == 34)
                        
SetPlayerHealth(playerid,health-213);
        if(
weaponid == 33)
                        
SetPlayerHealth(playerid,health-97);
        if(
weaponid == 33)
                       
SetPlayerHealth(playerid,health-97);
    }
    return 
1;

I tried removing it, still..
anyone knows?


Re: Players HP Bar refilling - _Khaled_ - 26.10.2012

Bump


Re: Players HP Bar refilling - iPLEOMAX - 26.10.2012

Quote:
Originally Posted by _Khaled_
Посмотреть сообщение
For some unknown reason, the players HP bars keep on refilling on damage..
PHP код:
codecode 
I tried removing it, still..
It occurs even without this entire code?


Re: Players HP Bar refilling - _Khaled_ - 26.10.2012

Sir Yes Sir


Re: Players HP Bar refilling - _Khaled_ - 27.10.2012

Someone?


Re: Players HP Bar refilling - Black Axe - 27.10.2012

Sorry but I Don't understand... When that CODE is NOT EVEN THERE - Like.. You didn't create it or Add it.. The HP Bar keep on Re-filling on damage ?


Re: Players HP Bar refilling - WizBoy - 27.10.2012

HHHHAAHA xD Cool


Re: Players HP Bar refilling - Vasu99 - 27.10.2012

May I steal the first part of your script? But I'll edit it a bit, for ex.


pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID)
    {
        new Float:health;
        GetPlayerHealth(playerid, health);
        if(weaponid == 0)
                        SetPlayerHealth(playerid,health-100);
Edit: If I can, where do I put this?


Re: Players HP Bar refilling - _Khaled_ - 27.10.2012

Anywhere, it's a public.

And YES it happens even when I REMOVE the WHOLE code.
Someone know why's that? :/ pissing me off alot.


Re: Players HP Bar refilling - gtakillerIV - 27.10.2012

Might wanna show us your OnPlayerUpdate?

Since you say his health gets refilled without this code.