Admin CMD
#1

Is there like, if he is a 99998 co owner level admin but, can we block him from set people to 99999 even himself cant set his admin level to 99999?
Reply
#2

Code
Reply
#3

Like this:

pawn Код:
if(setlevel > hislevel)return SendClientMessage(playerid,-1,"Nope");
Only, i dont have a clue what code you're using.
Reply
#4

Код:
CMD:makeadmin(playerid, params[])  {
	if(PlayerInfo[playerid][pAdmin] >= 99997) {

		new
			iAdminValue,
			iTargetID;

        if(makeadmindisable == 1) return SendClientMessage(playerid, COLOR_GREY, "This Command has been temporary disable.");
        else if(makeadmindisable == 0)
		if(sscanf(params, "ui", iTargetID, iAdminValue)) {
		SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid] [level]");
        SendClientMessageEx(playerid, COLOR_WHITE, "Admin Level: 3,4,5,6,1337,1338,1339, [Dont set yourself above 99997 or be demoted]");
                }
		else if(IsPlayerConnected(iTargetID)) {
		if(PlayerInfo[iTargetID][pHelper] >= 1) {
		SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot make community advisors admins!");
			}
			else {

				new
					szMessage[47 + (MAX_PLAYER_NAME * 2)];

				PlayerInfo[iTargetID][pAdmin] = iAdminValue;
				format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s.", iAdminValue, GetPlayerNameEx(playerid));
				SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, szMessage);
				format(szMessage, sizeof(szMessage), "You have promoted %s to a level %d admin.", GetPlayerNameEx(iTargetID),iAdminValue);
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);
			}
		}
		else SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
	}
	else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
	return 1;
}
Reply
#5

kk thanks rep+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)