SA-MP Forums Archive
HOw to limit the admin level to 5 - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: HOw to limit the admin level to 5 (/showthread.php?tid=258208)



HOw to limit the admin level to 5 - Artix - 29.05.2011

Guys how to set the admin level of this into 5?

Quote:

CMDetlevel(playerid, params[])
{
if(PVar[playerid][pLevel] >= 4 || IsPlayerAdmin(playerid))
{
new pID, Level;
if(sscanf(params, "ui", pID, Level)) return SendClientMessage(playerid, COLOR_RED, "* 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 PVar[pID][pLevel] = Level;
}
else return AdminCMD(playerid, 3);
}

GUYS PLEASE I NEED HELP


Re: HOw to limit the admin level to 5 - Jeffry - 29.05.2011

Do you want that only Level 5 Admins can USE the command?
Or do you want that you cannot set a higher level than 5?


Re: HOw to limit the admin level to 5 - Jay. - 29.05.2011

Quote:
Originally Posted by Artix
Посмотреть сообщение
Guys how to set the admin level of this into 5?



GUYS PLEASE I NEED HELP
Change this

pawn Код:
if(PVar[playerid][pLevel] >= 4|| IsPlayerAdmin(playerid))
change the 4 to 5


Re: HOw to limit the admin level to 5 - Artix - 29.05.2011

no i want to limit the level into 5
becasue when i use
/setlevel

it is unlimited level like
/setelvel 0 142342252352

it would set his level into that
now how can i limit it into 5?


Re: HOw to limit the admin level to 5 - Babul - 29.05.2011

Код:
CMD:setlevel(playerid, params[])
{
	if(PVar[playerid][pLevel] >= 4 || IsPlayerAdmin(playerid))
	{
		new pID, Level;
		if(sscanf(params, "ui", pID, Level)) return SendClientMessage(playerid, COLOR_RED, "* Usage: /SetLevel < Player ID > < Level (1-5) >");
		
		if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "That user is not connected!");
		if(Level<1 || Level>5) return SendClientMessage(playerid, COLOR_RED, "Admin levels range from 1 to 5.");
		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 PVar[pID][pLevel] = Level;
	}
	else return AdminCMD(playerid, 3);
}



Re: HOw to limit the admin level to 5 - Artix - 29.05.2011

thanks bro