SA-MP Forums Archive
Admin CMD - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Admin CMD (/showthread.php?tid=508921)



Admin CMD - Shazwan - 24.04.2014

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?


Re: Admin CMD - UfsDev - 24.04.2014

Code


Re: Admin CMD - DobbysGamertag - 24.04.2014

Like this:

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


Re: Admin CMD - Shazwan - 24.04.2014

Код:
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;
}



Re: Admin CMD - Shazwan - 24.04.2014

kk thanks rep+