/heal Command
#4

pawn Код:
dcmd_heal(playerid,params[])
{
    new id;
//  if(!IsAMedic(playerid))
//  return SendClientMessage(playerid, -1, "You need to be a medic to use that command!");
    if(sscanf(params,"u",id))return SendClientMessage(playerid,-1,"/heal <id>");
    else
    {
        SetPlayerHealth(id,100);
        GameTextForPlayer(id,"healed by medic",2000,1);
    }
    return 1;
}
it compiles fine, and works with ZCMD. Not too sure about DCMD though, just checked sa-mp wiki. Hopefully it works ok for you. SSCANF is needed by the way

EDIT: scrolled down on the wiki, found this:

pawn Код:
dcmd_heal(playerid, params[])
{
        new id;
    if (!strlen(params)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/heal <playerid>\"");
    id = strval(params);
    if (!IsPlayerConnected(id))SendClientMessage(playerid, 0xFF0000AA, "Player not found");
    SetPlayerHealth(id, 100.0);
    SendClientMessage(id, 0x00FF00AA, "You have been healed");
    SendClientMessage(playerid, 0x00FF00AA, "Player healed");
    return 1;
}
Now you have free choice of command
Reply


Messages In This Thread
/heal Command - by NoahF - 25.05.2013, 16:46
Re: /heal Command - by Hoborific - 25.05.2013, 16:51
Re: /heal Command - by NoahF - 25.05.2013, 16:53
Re: /heal Command - by DobbysGamertag - 25.05.2013, 16:57
Re: /heal Command - by Hoborific - 25.05.2013, 16:58
Re: /heal Command - by NoahF - 25.05.2013, 17:05

Forum Jump:


Users browsing this thread: 1 Guest(s)