CMD:healme(playerid, params[])
{
new Float:health;
if(GetPlayerMoney(playerid) < 900) return SendClientMessage(playerid, -1, "{FF0000}You don't have enough cash to heal yourself.");
SendClientMessage(playerid, -1, "{00CC00}You have healed your self.");
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, 100);
else // that line<<<<<<<<<<<<<
{
SetTimer("ICanHeal", 480000, true);
SendClientMessage(playerid, -1, "{FF0000}You can't heal yourself now.");
}
if(health == 100)
{
return SendClientMessage(playerid, -1, "{FF0000}Your health is already full.");
}
return 1;
}
forward ICanHeal(playerid);
public ICanHeal(playerid)
{
SendClientMessage(playerid, -1, "{FF0000}You can heal yourself now. [/Healme]");
return 1;
}
Hello, i got little error. what's the problem?
ATTENTION: DO NOT Give me a NEW command that YOU made, ONLY fix the error. PHP код:
|
new heal[MAX_PLAYERS];
CMD:healme(playerid, params[])
{
new Float:health;
if(GetPlayerMoney(playerid) < 900) return SendClientMessage(playerid, -1, "{FF0000}You don't have enough cash to heal yourself.");
if(heal[playerid] == 1) return SendClientMessage(playerid, -1, "{FF0000}You cant heal yourself.");
if(health == 100)
{
return SendClientMessage(playerid, -1, "{FF0000}Your health is already full.");
}
SendClientMessage(playerid, -1, "{00CC00}You have healed your self.");
heal[playerid] = 1;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, 100);
SetTimer("ICanHeal", 480000, true);
SendClientMessage(playerid, -1, "{FF0000}You can't heal yourself now.");
return 1;
}
forward ICanHeal(playerid);
public ICanHeal(playerid)
{
SendClientMessage(playerid, -1, "{FF0000}You can heal yourself now. [/Healme]");
heal[playerid] = 0;
return 1;
}
if(heal[playerid] == 0) return SendClientMessage(playerid, -1, "{FF0000}You cant heal yourself.");
It should be 0
pawn Код:
|
if(something) // Codes
SetPlayerHealth(playerid, 100)
// Codes between if and else ^
else // Codes
if(something) // Codes
else // Codes
SetPlayerHealth(playerid, 100)
// Codes not between if and else ^
if(GetPlayerMoney(playerid) < 900) return SendClientMessage(playerid, -1, "{FF0000}You don't have enough cash to heal yourself.");
else
{
SetTimer("ICanHeal", 480000, true);
SendClientMessage(playerid, -1, "{FF0000}You can't heal yourself now.");
}
SendClientMessage(playerid, -1, "{00CC00}You have healed your self.");
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, 100);
CMD:healme(playerid, params[])
{
new Float:health;
if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid, -1, "{FF0000}ERROR: You don't got enough cash to heal yourself.");
if(heal[playerid] < 90) return SendClientMessage(playerid, -1, "{FF0000}No need to heal yourself. Only if it's lower than 90 you can heal yourself.");
if(health < 100)
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, -1, "{FF9933}You have healed yourself.");
SetTimerEx("HealMessage", 480000, false, "i", playerid);
}
else
{
SendClientMessage(playerid, -1, "{FF0000}You can't heal yourself now.");
heal[playerid] = 0;
}
return 1;
}
forward HealMessage(playerid);
public HealMessage(playerid)
{
SendClientMessage(playerid, -1, "{FF0000}You can heal yourself now.");
heal[playerid] = 1;
return 1;
}
if(health < 100) { SetPlayerHealth(playerid, 100); SendClientMessage(playerid, -1, "{FF9933}You have healed yourself."); SetTimerEx("HealMessage", 480000, false, "i", playerid); heal[playerid] = 0; } else if(heal == 0) { SendClientMessage(playerid, -1, "{FF0000}You can't heal yourself now."); }