Problem with a command related to health
#2

Try something like this:

pawn Код:
CMD:sethealth(playerid, params[])
{
    new user, health
    if(!IsAdminLevel(playerid, 1)) return ERROR(playerid, "You need a higher administrator level to use this command.");
    if(!sscanf(params, "ui", user, health))
    {
        if(user != INVALID_PLAYER_ID)
        {
            SetPlayerHealth(user, health);
        }
        if(user == playerid)
        {
            AdmCmd(playerid, "You have successfully set your health to %.1f.", health);
        }
        else if
        {
            AdmCmd(playerid, "You have successfully set %s's health to %.1f.", GetName(user), health);
            AdmCmd(playerid, "Administrator %s has set your health to %.1f.", GetName(playerid), health);
        }
        else return SendClientMessage(playerid, red, "That player is offline.");
    }
    else return SendClientMessage(playerid, white, "/sethealth [playerid] [amount]");
    return 1;
    CMDMessageToAdmins(playerid, "sethealth");
}
Reply


Messages In This Thread
Problem with a command related to health - by Magic_Time - 22.02.2015, 16:46
Re: Problem with a command related to health - by xXSPRITEXx - 22.02.2015, 16:53
Re: Problem with a command related to health - by zork - 22.02.2015, 16:56
AW: Problem with a command related to health - by Nero_3D - 22.02.2015, 17:11
Re: Problem with a command related to health - by Magic_Time - 22.02.2015, 18:14

Forum Jump:


Users browsing this thread: 3 Guest(s)