CMD:heal(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsAMedic(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to be a Medic to use this command.");
SetPlayerHealth(playerid, 100);
SetPlayerMoney(playerid, -45);
SendClientMessage(playerid, COLOR_GREY, "You have healed %s for 45$.");
return 1;
}
Shouldn't be GivePlayerMoney( playerid, -45 ); instead of SetPlayerMoney ?
|
CMD:heal(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsAMedic(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to be a Medic to use this command.");
//until here i get it, but this is strange
SetPlayerHealth(playerid, 100);//you set your own health?
SetPlayerMoney(playerid, -45);//you take away money from yourself?
SendClientMessage(playerid, COLOR_GREY, "You have healed %s for 45$.");//%s in a sendclientmessage? this won't work as you want..
return 1;
}
CMD:heal(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsAMedic(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to be a Medic to use this command.");
new id;
if (sscanf(params, "u", id)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /heal <playerid>");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
SetPlayerHealth(id, 100.0);
SendClientMessage(id, 0x00FF00AA, "You have been healed by a Medic!");
SendClientMessage(playerid, 0x00FF00AA, "You have healed the player.");
return 1;
}
CMD:heal(playerid, params[])
{
new playerb, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /heal [playerid]");
if(!IsAMedic(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to be a Medic to use this command.");
SetPlayerHealth(playerb, 100);
SetPlayerMoney(playerb, -45);
format(string, sizeof(string), "You have healed %s for 45$.", RPN(playerb));
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
CMD:heal(playerid, params[])
{
new playerb, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /heal [playerid]");
if(!IsAMedic(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to be a Medic to use this command.");
SetPlayerHealth(playerb, 100);
GiveZaiatMoney(playerb, -45);
format(string, sizeof(string), "You have healed %s for 45$.", RPN(playerb));
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}