SA-MP Forums Archive
Hungry SYstem Help - 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: Hungry SYstem Help (/showthread.php?tid=618159)



Hungry SYstem Help - DandyCorleone - 02.10.2016

how to provide health -5 player, when he was hungry at 5%?
pls.. help me


THIS CODE DONT WORK! WHY?

PHP код:
for(new playeridplayerid MAX_PLAYERSplayerid++)
    {
        new 
Float:health;
        
GetPlayerHealth(playeridhealth);
        new 
HungryTime SetPlayerHealth(playeridhealth-5);
        if(
GetProgressBarValue(hungry[playerid]) <= 0)
        {
            
SetTimer("HungryTime"300001);
            
SendClientMessage(playeridCOLOR_BLUE"You Are Hungry Now, Go To The Restaurant To Eat Some Food");
            
SendClientMessage(playeridCOLOR_BLUE"If You're Not Going To Eat, You Will Lose Your Health Every 30 Seconds");
        }
        if(
GetProgressBarValue(hungry[playerid]) <= 0)
        {
            
SetProgressBarValue(hungry[playerid], 0);
        }
        if(
GetProgressBarValue(hungry[playerid]) > 0)
        {
            
KillTimer(HungryTime);
        }
    }
    
Hungry TextDrawCreate(43.000000147.000000"ENERGY");
    
TextDrawBackgroundColor(Hungry, -1);
    
TextDrawFont(Hungry1);
    
TextDrawLetterSize(Hungry0.9188882.398888);
    
TextDrawColor(Hungry, -16776961);
    
TextDrawSetOutline(Hungry1);
    
TextDrawSetProportional(Hungry1);
    
TextDrawTextSize(Hungry130.000000750.000000);