Please help me for /sethealth
#9

pawn Код:
CMD:sethp(playerid, params[])
{
    new id, string[128], Float:health;
    if(pInfo[playerid][AdminLevel] <= 1) return SendClientMessage(playerid, COLOR_RED, "You are not an admin. Therefore you can not use this command.");
    else if(sscanf(params, "uf", id, health)) return SendClientMessage(playerid, -1, "SYNTAX: /SetHp [ID] [HP]");
    else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "The ID specified seems to be invalid.");
    else if(health < 0 || health > 100) return SendClientMessage(playerid, COLOR_RED, "You may only set health from 0 to 100.");
    else
    {
        format(string, sizeof(string), "You have set %s(%d)'s health to %f", GetName(id), id, health);
        SendClientMessage(playerid, COLOR_RED, string);

        format(string, sizeof(string), "%s(%d) has set your health to %f", GetName(playerid), playerid, health);
        SendClientMessage(playerid, COLOR_RED, string);

        SetPlayerHealth(id, health);
    }
    return 1;
}
Reply


Messages In This Thread
Please help me for /sethealth - by rashidkhoso37 - 21.09.2014, 06:23
Re: Please help me for /sethealth - by Ricagor - 21.09.2014, 06:28
Re: Please help me for /sethealth - by rashidkhoso37 - 21.09.2014, 06:34
Re: Please help me for /sethealth - by durd2001 - 21.09.2014, 06:52
Re: Please help me for /sethealth - by DobbysGamertag - 21.09.2014, 07:03
Re: Please help me for /sethealth - by Ricagor - 21.09.2014, 07:15
Re: Please help me for /sethealth - by mirza1221 - 21.09.2014, 07:15
Re: Please help me for /sethealth - by Ricagor - 21.09.2014, 07:18
Re: Please help me for /sethealth - by Ox1gEN - 21.09.2014, 07:34
Re: Please help me for /sethealth - by M0HAMMAD - 21.09.2014, 07:35

Forum Jump:


Users browsing this thread: 4 Guest(s)