07.01.2018, 14:01
Conver to ZCMD.
Now you can decide to take it on rcon or admin level:
or
PHP код:
CMD:setlevel(playerid, params[])
{
new string[144] lookupid, level;
if(sscanf(params, "ui", lookupid, level)) return print(""#COL_RED"Usage: /rcon setlevel (player: id/name) (level: 0-2)");
if(!IsValidAdminLevel(level)) return print(""#COL_RED"You have entered an invalid admin level.");
if(!IsPlayerConnected(lookupid)) return print(""#COL_RED"That player isn't connected to the server.");
aUserInfo[lookupid][user_info_admin_level] = level;
if(IsPlayerOnDuty(lookupid))
{
SetPlayerSkin(lookupid, pBeforeOnDutyInfo[lookupid][0]);
SetPlayerHealth(lookupid, 100.0);
SetPlayerColor(lookupid, pBeforeOnDutyInfo[lookupid][1]);
psOnDuty[lookupid] = false;
}
format(string, sizeof(string), "{%06x}You have set %s(%d) admin level to %d.", GetPlayerAdminLevelColor(lookupid) >>> 8, AddPertinence(ReturnPlayerName(lookupid)), lookupid, level);
print(string);
format(string, sizeof(string), "Your admin level has been set to %d.", level);
SendClientMessage(lookupid, GetPlayerAdminLevelColor(lookupid), string);
new log[144];
format(log, sizeof(log), "%s(%d) admin level has been set to %d.", AddPertinence(ReturnPlayerName(lookupid)), lookupid, level);
RegisterLog("scriptfiles/Admin Log/rconlog", log);
}
PHP код:
IsPlayerAdmin(playerid)
PHP код:
if(aUserInfo[lookupid][user_info_admin_level] == 0 ) return //scm no admin