23.12.2012, 18:07
pawn Код:
if(UserStats[playerid][Hunger] == 0) {
for(new i = 1; i <= 1; i++) {
new Float:GetHealth,Float:HealthAnswer,Float:pHealth;
GetHealth = GetPlayerHealth(playerid,pHealth);
HealthAnswer = GetHealth -= 10;
SetPlayerHealth(playerid,HealthAnswer);
SendClientMessage(playerid,COLOR_RED,"You are loosing health, you need to eat something!");
}
}
First off I'm giving GetHealth variable an value GetPlayerHealth so i can get player health and subtract it by 10.
Later on I'm setting player health what's equal to HealthAnswer, so it should be from player health subtract 10 and subtract that from current player health. Still it sets player health to 0 once this Timer is called.