I need help with /sethealth
#2

Try This

pawn Код:
CMD:sethealth(playerid, params[])
{
    new string[128], playa, health;
    if(sscanf(params, "ud", playa, health))
    {
        SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /sethealth [playerid/partofname] [hp]");
        return 1;
    }
    if(PlayerInfo[playerid][pAdmin] >= 6)
    {
        if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
        {
            SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
            return 1;
        }
        if(IsPlayerConnected(playa)) {
            if(playa != INVALID_PLAYER_ID)
            {
                SetPlayerHealth(playa, health);
                format(string, sizeof(string), "You have set %s's health to %d.", GetPlayerNameEx(playa), health);
                SendClientMessage(playerid, COLOR_WHITE, string);
                format(string, sizeof(string), "AdmCmd: %s has set %s's health to %d.", GetPlayerNameEx(playerid), GetPlayerNameEx(playa), health);
                ABroadCast(COLOR_LIGHTRED,string, 4);
                format(string, sizeof(string), "Admin %s had set your health to %d.", GetPlayerNameEx(playerid), health);
                SendClientMessage(playa, COLOR_WHITE, string);
            }
        }
        else SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified.");
    }
    else {
        SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
    }
    return 1;
}
Reply


Messages In This Thread
I need help with /sethealth - by AleckRP - 25.08.2014, 12:18
Re: I need help with /sethealth - by NewbieTester - 25.08.2014, 12:24
Re: I need help with /sethealth - by AleckRP - 25.08.2014, 12:38
Re: I need help with /sethealth - by AleckRP - 25.08.2014, 12:46
Re: I need help with /sethealth - by NewbieTester - 25.08.2014, 12:51
Re: I need help with /sethealth - by AleckRP - 25.08.2014, 12:59
Re: I need help with /sethealth - by Stinged - 25.08.2014, 13:07
Re: I need help with /sethealth - by AleckRP - 25.08.2014, 22:40
Re: I need help with /sethealth - by IceCube! - 25.08.2014, 22:46
Re: I need help with /sethealth - by AleckRP - 25.08.2014, 22:53

Forum Jump:


Users browsing this thread: 5 Guest(s)