07.01.2018, 09:57
Hey guys, I previously cut and pasted my admin script to my GM, and well everything works fine except my setlevel command, which can only be used if the player logs in as Rcon Admin. When it was a FS, it worked but now as I placed it in my GM, everything works fine except this command.....
I use ZCMD, so as the Admin FS. Here is the /rcon setlevel cmd
Any ideas how to make this command work again?
I use ZCMD, so as the Admin FS. Here is the /rcon setlevel cmd
Код:
public OnRconCommand(cmd[]) { new params[130]; sscanf(cmd, "s[128]s[128]", cmd, params); if(!strcmp(cmd, "setlevel", true)) { new lookupid, level; if(sscanf(params, "ui", lookupid, level)) { print(""#COL_RED"Usage: /rcon setlevel (player: id/name) (level: 0-2)"); } else if(!IsPlayerConnected(lookupid)) { print(""#COL_RED"That player isn't connected to the server."); } else if(!IsValidAdminLevel(level)) { print(""#COL_RED"You have entered an invalid admin level."); } else { new string[144]; 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); } } return 1; }