/admins
#1

Hello how can i made a /admin command with this code
i mean
i want to detect that
if the player is level 1 it would say Moderator

Level 1 : Test
Level 2 : Moderator
Level 3 : Administrator
Level 4 : Owner

what will i do ? please help me

/admin


Код:
CMD:setlevel(playerid, params[])
{
	if(Pinfo[playerid][pLevel] >= 4 || IsPlayerAdmin(playerid))
	{
		new pID, Level;
		if(Level<1 || Level>4) return SendClientMessage(playerid, ERROR, "Admins are only from level 4.");
		if(sscanf(params, "ui", pID, Level)) return SendClientMessage(playerid, ERROR, "[Usage]: /SetLevel < Player ID > < Level >");

		if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "That user is not connected!");

		format(Msg, sizeof(Msg), "Admin: %s(%d) has given you admin level: %d", pName(playerid), playerid, Level);
		SendClientMessage(playerid, COLOR_LIGHTBLUE, Msg);

		format(Msg, sizeof(Msg), "You have been given admin level: %d to: %s(%d)", Level, pName(pID), pID);
		SendClientMessage(playerid, COLOR_LIGHTBLUE, Msg);

		return Pinfo[pID][pLevel] = Level;
	}
	else return AdminCMD(playerid, 3);
}
Reply


Messages In This Thread
/admins - by Artix - 22.12.2011, 15:17
Re: /admins - by [ABK]Antonio - 22.12.2011, 16:25
Re: /admins - by wildcookie007 - 22.12.2011, 16:25
Re: /admins - by Moras - 22.12.2011, 17:07

Forum Jump:


Users browsing this thread: 2 Guest(s)