[HELP]: /heal command
#1

Hi!

How can I make an admin command /heal [id] [How much health]

Sorry for my bad English...
Reply
#2

https://sampwiki.blast.hk/wiki/Fast_Commands
Reply
#3

Made in 20 seconds and not tested, this is a basic /heal command:

pawn Код:
CMD:heal(playerid, params[])
{
    new hp;
    new destid;
    if(sscanf(params,"ud",destid,hp)) return SCM(playerid, -1,"Usage: /heal <playerid> <ammount>");
    SetPlayerHealth(destid,hp);
    SendClientMessage(playerid, pink, "Player healed");
    return 1;
}
Reply
#4

pawn Код:
CMD:heal(playerid, params[])
{
    new pID, health;
    if(sscanf(params, "ud", pID, health)) return SendClientMessage(playerid, -1, "/heal id health");
    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, -1, "Player not connected.");
    SetPlayerHealth(pID, health);
    return 1;
}
Reply
#5

Quote:
Originally Posted by ]Rafaellos[
Посмотреть сообщение
pawn Код:
CMD:heal(playerid, params[])
{
    new pID health;
    if(sscanf(params, "ud", pID, health)) return SendClientMessage(playerid, -1, "/heal id health");
    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, -1, "Player not connected.");
    SetPlayerHealth(pID, health);
    return 1;
}
That won't work. You forgot a comma.
Reply
#6

Edited, thanks Skyrise.
Reply
#7

Thanks guys, It's working.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)