HOw to limit the admin level to 5
#1

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
Reply
#2

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?
Reply
#3

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
Reply
#4

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?
Reply
#5

Код:
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);
}
Reply
#6

thanks bro
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)