Armour / Health problem
#2

pawn Код:
CMD:armour(playerid, params[])
{
new string[128], name[MAX_PLAYER_NAME];
new Float:armour;
GetPlayerArmour(playerid, armour);
if(isDead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Dead.");
if(armour >= 100) return SendClientMessage(playerid, COLOR_RED, "Your Armour Is Already Full.");
GetPlayerName(playerid, name, sizeof name);
format(string, sizeof string, "%s (%d) Has Used /armour To Refill His Armour.", name, playerid);
SendClientMessageToAll(COLOR_LIME, string);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You Have Refilled Your Armour.");
SetPlayerArmour(playerid, 100.0);
return 1;
}
pawn Код:
CMD:heal(playerid, params[])
{
new string[128], name[MAX_PLAYER_NAME];
new Float:health;GetPlayerHealth(playerid,health);
if(isDead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Dead.");
if(health >= 100) return SendClientMessage(playerid, COLOR_RED, "Your Health Is Already Full.");
GetPlayerName(playerid, name, sizeof name);
format(string, sizeof string, "%s (%d) Has Used /heal To Heal Himself.", name, playerid);
SendClientMessageToAll(COLOR_LIME, string);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You Have Healed Yourself.");
SetPlayerHealth(playerid, 100.0);
return 1;
}
First: you didn't assign the variables of the players Health/Armor
Second: you mixed up the checking

what i mean is you were checking if the player health is more then 100 OR anything less then 100
which makes no sense.

And for the health you made it check if the player health is anything below 100, also meaning if it equals to 99 or bellow
Reply


Messages In This Thread
Armour / Health problem - by Ananisiki - 16.02.2013, 20:24
Re: Armour / Health problem - by park4bmx - 16.02.2013, 20:28
Re: Armour / Health problem - by Ananisiki - 17.02.2013, 00:11
Re: Armour / Health problem - by PT - 17.02.2013, 00:31
AW: Re: Armour / Health problem - by Nero_3D - 17.02.2013, 00:40
Re: Armour / Health problem - by Ananisiki - 17.02.2013, 01:28
Re: Armour / Health problem - by PT - 17.02.2013, 01:43

Forum Jump:


Users browsing this thread: 1 Guest(s)