Admin Commands
#6

pawn Код:
//=====[Set HP]=====
CMD:sethp(playerid, params[])
{
        if(PlayerInfo[playerid][Adminlevel] < 4) return SendClientMessage(playerid,COLOR_RED,"You're not allowed to use this command!");
        new targetid,
                health;
        if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"[ERROR] Player not connected!");
        if(sscanf(params, "ui", targetid, health)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /sethp [PlayerID/PartOfName] [Amount]");

        SetPlayerHealth(targetid, health);

        return 1;
}
if(PlayerInfo[playerid][Adminlevel] < 4 reads the players admin level - you should obviously replace it with your function for getting the players admlvl. Other than that, this function is quite simple. Remember to define the colors at top of your script, else it will return errors, aswell as including sscanf.
Reply


Messages In This Thread
Admin Commands - by efrim123 - 19.08.2013, 10:13
Re: Admin Commands - by JeaSon - 19.08.2013, 10:17
Re: Admin Commands - by efrim123 - 19.08.2013, 10:37
Re: Admin Commands - by Giroud12 - 19.08.2013, 10:42
Re: Admin Commands - by efrim123 - 19.08.2013, 10:46
Re: Admin Commands - by zaider - 19.08.2013, 10:47
Re: Admin Commands - by efrim123 - 19.08.2013, 10:52
Re: Admin Commands - by zaider - 19.08.2013, 10:53
Re: Admin Commands - by zaider - 19.08.2013, 10:56
Re: Admin Commands - by efrim123 - 19.08.2013, 10:59

Forum Jump:


Users browsing this thread: 3 Guest(s)