/makeadmin
#1

When im a Level 99998 admin and i tried to make players 99999 admin. It will return SendClientMessage(playerid,COLOR_WHITE, "You cannot make players 99999 Admin. Only Server Owner can do that!");

But how can i do that?

Here is my /makeadmin code

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

		new
		iAdminValue,
		iTargetID;

		if(sscanf(params, "ui", iTargetID, iAdminValue)) {
			SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid] [level]");
			SendClientMessageEx(playerid, COLOR_GRAD1, "Server Moderator[1], Junior Admin[2], General Admin[3], Senior Admin[4], Head Admin[1337]");
			SendClientMessageEx(playerid, COLOR_GRAD1, "Server Manager[1338], Server Co-Owner[99998], Server Owner[99999]");
		}
		else if(IsPlayerConnected(iTargetID))
		{
			new
			szMessage[47 + (MAX_PLAYER_NAME * 2)];

			PlayerInfo[iTargetID][pAdmin] = iAdminValue;
			format(szMessage, sizeof(szMessage), "AdmCmd: %s has promoted %s to a level %d admin.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID), iAdminValue);
			ABroadCast(COLOR_LIGHTRED,szMessage, 2);
			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;
}
Thanks in advance!
Reply


Messages In This Thread
/makeadmin - by ChristianIvann09 - 04.04.2014, 10:15
Re: /makeadmin - by Mriss - 04.04.2014, 10:18
Re: /makeadmin - by ChristianIvann09 - 04.04.2014, 10:28
Re: /makeadmin - by biker122 - 04.04.2014, 11:05
Re: /makeadmin - by Bingo - 04.04.2014, 11:14
Re: /makeadmin - by BigBrainAFK - 04.04.2014, 11:16
Re: /makeadmin - by ChandraLouis - 04.04.2014, 11:19
Re: /makeadmin - by biker122 - 04.04.2014, 11:20
Re: /makeadmin - by Bingo - 04.04.2014, 11:21
Re: /makeadmin - by ChuckyBabe - 04.04.2014, 11:41

Forum Jump:


Users browsing this thread: 1 Guest(s)