02.10.2016, 01:49
how to provide health -5 player, when he was hungry at 5%?
pls.. help me
THIS CODE DONT WORK! WHY?
pls.. help me
THIS CODE DONT WORK! WHY?
PHP код:
for(new playerid; playerid < MAX_PLAYERS; playerid++)
{
new Float:health;
GetPlayerHealth(playerid, health);
new HungryTime = SetPlayerHealth(playerid, health-5);
if(GetProgressBarValue(hungry[playerid]) <= 0)
{
SetTimer("HungryTime", 30000, 1);
SendClientMessage(playerid, COLOR_BLUE, "You Are Hungry Now, Go To The Restaurant To Eat Some Food");
SendClientMessage(playerid, COLOR_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.000000, 147.000000, "ENERGY");
TextDrawBackgroundColor(Hungry, -1);
TextDrawFont(Hungry, 1);
TextDrawLetterSize(Hungry, 0.918888, 2.398888);
TextDrawColor(Hungry, -16776961);
TextDrawSetOutline(Hungry, 1);
TextDrawSetProportional(Hungry, 1);
TextDrawTextSize(Hungry, 130.000000, 750.000000);