Admin level problem.
#2

Код:
dcmd_ban(playerid, params[])
{
	if(PlayerInfo[playerid][AdminLevel] <= 2) return SendClientMessage(playerid, COLOR_RED, "Sorry, You need to be a level 2 or higher admin to use this command");
	new id, reason[64];
	if (sscanf(params, "uz", id, reason)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/ban <playerid/partname> <reason (optional)>\"");
	else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
	else
	{
		BanEx(id, reason);
		format(reason, sizeof (reason), "You have been banned%s%s.", reason[0] ? (" for: ") : (""), reason);
		SendClientMessage(id, 0xFF0000AA, reason);
		SendClientMessage(playerid, 0x00FF00AA, "Player banned");
	}
	return 1;
}
You put the condtion : PlayerInfo[playerid][AdminLevel] >= 2 , so if you are Admin level greater or equal to 2, then it will tell you need to be higher level. It should be less than or equal to. :P

Reply


Messages In This Thread
Admin level problem. - by -Rebel Son- - 06.06.2010, 15:06
Re: Admin level problem. - by DJDhan - 06.06.2010, 15:14
Re: Admin level problem. - by -Rebel Son- - 06.06.2010, 15:48

Forum Jump:


Users browsing this thread: 1 Guest(s)