getplayerhealth problem?
#7

You could use a function like this:
pawn Код:
// This function can be used to check if a float matches the other one
CheckFloat(Float:Value1, Float:Value2)
{
    // Check if Value1 is nearly the same as Value2
    if (((Value2 - 0.1) < Value1) && (Value1 < (Value2 + 0.1)))
        return 1;
    else
        return 0;
}


// Compare if 2 floats are the same
GetPlayerHealth(playerid, health);
if (CheckFloat(health, 100.0) == 1) return SendClientMessage(playerid,lightyellow,"I think you are bit too full for eating");
Reply


Messages In This Thread
getplayerhealth problem? - by Tanush123 - 03.01.2012, 21:18
Re: getplayerhealth problem? - by Vince - 03.01.2012, 21:26
Re: getplayerhealth problem? - by geerdinho8 - 03.01.2012, 21:30
Re: getplayerhealth problem? - by FireCat - 03.01.2012, 21:37
Re: getplayerhealth problem? - by PowerPC603 - 03.01.2012, 21:46
Re: getplayerhealth problem? - by cessil - 03.01.2012, 22:14
Re: getplayerhealth problem? - by PowerPC603 - 03.01.2012, 22:39
Re: getplayerhealth problem? - by Basssiiie - 03.01.2012, 23:13
Re: getplayerhealth problem? - by Tanush123 - 04.01.2012, 02:31

Forum Jump:


Users browsing this thread: 1 Guest(s)