A CMD that bugs my server.
#4

so.. let me just check, you are sure of this command?
pawn Код:
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;
}
Use this command:
pawn Код:
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;
}
use this one, and tell me what happens
Reply


Messages In This Thread
A CMD that bugs my server. - by Strech - 09.08.2012, 17:40
Re: A CMD that bugs my server. - by PawnFox - 09.08.2012, 17:41
Re: A CMD that bugs my server. - by Strech - 09.08.2012, 17:42
Re: A CMD that bugs my server. - by Jstylezzz - 09.08.2012, 17:44
Re: A CMD that bugs my server. - by Dawnz - 09.08.2012, 17:46
Re: A CMD that bugs my server. - by Strech - 09.08.2012, 18:01
Re: A CMD that bugs my server. - by Dawnz - 09.08.2012, 18:06

Forum Jump:


Users browsing this thread: 1 Guest(s)