[Help]: makeadmin command!
#10

Try this 1

Код:
CMD:makeadmin(playerid, params[])  {
	if(IsPlayerAdmin(playerid)) { //now need to rcon login to make some 1 admin

		new
			iAdminValue,
			iTargetID;

		if(sscanf(params, "ui", iTargetID, iAdminValue)) {
			SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid] [level]");
		}
		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), "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;
}
Reply


Messages In This Thread
[Help]: makeadmin command! - by Areax - 25.05.2013, 18:05
Re: [Help]: makeadmin command! - by Kindred - 25.05.2013, 18:08
Re: [Help]: makeadmin command! - by Areax - 25.05.2013, 18:18
Re: [Help]: makeadmin command! - by DobbysGamertag - 25.05.2013, 18:28
Re: [Help]: makeadmin command! - by Areax - 25.05.2013, 18:42
Re: [Help]: makeadmin command! - by Areax - 25.05.2013, 19:09
Re: [Help]: makeadmin command! - by DobbysGamertag - 25.05.2013, 19:18
Re: [Help]: makeadmin command! - by Areax - 25.05.2013, 19:27
Re: [Help]: makeadmin command! - by Areax - 25.05.2013, 20:41
Re: [Help]: makeadmin command! - by kosa451 - 25.05.2013, 21:23

Forum Jump:


Users browsing this thread: 1 Guest(s)