else if(clickedid == Heal) //Hospital
{
GivePlayerMoney(playerid,-100);
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, COLOR_WHITE, "you have Healed Your Self");
}
new Float:health;
GetPlayerHealth(playerid,health);
if (health == 100.0)
{
SendClientMessage(playerid, COLOR_WHITE, "Your health is already full.");
}
else if(clickedid == Heal) //Hospital
{
new Float:health;
GetPlayerHealth(playerid,health);
if (health == 0.1 99.9)
{
GivePlayerMoney(playerid,-100);
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, COLOR_WHITE, "you have Healed Your Self");
}
else SendClientMessage(playerid, COLOR_RED, "Your Health Is Already Full");
}
pawn Код:
|
dude if his health is 100 i want it only to tell him "Your health is already full." without giving him health and losing money etc....
how to make if (health == 0.1 tell 99.9)? |
new Float: playersHealth;
GetPlayerHealth(playerid, playersHealth);
if(playersHealth >= 100)
{
return SendClientMessage(playerid, -1, "Your health is already full.");
}
else if(clickedid == Heal) //Hospital
{
new Float:hp;
GetPlayerHealth(playerid,hp);
if(hp < 100)
{
GivePlayerMoney(playerid,-100);
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, COLOR_WHITE, "you have Healed Your Self");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Your Health Is Already Full");
}
}
else if(clickedid == Heal) //Hospital
{
new Float:health;
GetPlayerHealth(playerid,health);
if (health >= 100.0) return SendClientMessage(playerid, COLOR_WHITE, "Your health is already full.");
else {
if(GetPlayerMoney(playerid) >= 100) {
GivePlayerMoney(playerid,-100);
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, COLOR_WHITE, "You have healed yourself."); }
else return SendClientMessage(playerid, COLOR_WHITE, "Youson't have the cash to heal yourself.");
}
}