Issue with making player loosing health over time by 10
#1

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!");
            }
        }
Seems kinda logic to me but for some reason it sets player health to 0.
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.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)