23.02.2018, 14:27
Quote:
its like you store level ( PlayerData[playerid][level] , you make a new variable for admin ( [playerid][admin], and at the admins commands check if his [admin] level is big enough.
|
PHP код:
enum AdminLevel
{
Level
}
new PlayerInfo[MAX_PLAYERS][AdminLevel];
PHP код:
CMD:sethp(playerid, params[])
{
if(PlayerInfo[playerid][Level] < 1) return SendClientMessage(playerid, -1, "{C3C3C3}(INFO) You don't have the priviliges to use this command.");
{
new amount, str[128], target;
if(sscanf(params, "ui", target, amount)) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) /sethp [id] [amount]");
format(str, sizeof(str), "{EFB509}(INFO) An admin has set your health to %d", amount);
SendClientMessage(target, -1, str);
SetPlayerHealth(target, amount);
return 1;
}
PHP код:
if(PlayerInfo[playerid][Level] < 1)
PS: you should just starting learning about player enumerations, you are like stuck on a simple code