Maximum Anount
#1

What is the code to make a maximum amount you can do like,

/setadmin [Playerid] [1-6] How to make it if they do /setadmin 0 77 make it not work, I want it to be 1-6
Reply
#2

pawn Код:
if(Level < 1 || Level > 6)
Reply
#3

thanks man! +rep 4 u!
Reply
#4

Heres the script can u insert that code into it?
Код:
CMD:setadmin(playerid, params[])
{
	if(IsPlayerConnected(playerid))

	{
		if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][Admin] >= 9)

		{
			new sendername[MAX_PLAYER_NAME];
			new giveplayername[MAX_PLAYER_NAME];
			new giveplayerid,level;
			GetPlayerName(playerid, sendername, sizeof(sendername));
			GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
			if (!sscanf(params, "ii", giveplayerid,level))

			{
				if (giveplayerid != INVALID_PLAYER_ID)

				{
					new string[128];
					format(string, sizeof(string), "The admin %s has made you a level %d admin",sendername,level);
					SendClientMessage(giveplayerid, COLOR_GRAD1, string);
					format(string, sizeof(string), "You have made %s a level %d admin",giveplayername,level);
					SendClientMessage(playerid, COLOR_GRAD1, string);
					PlayerInfo[giveplayerid][Admin] = level;

				}

			}
			else SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setadmin [playerid] [level]");

		}
		else SendClientMessage(playerid, 0xFF0000FF, "Only admins can use this command!!");

	}
	return 1;
}
Idk how to put that LOL
Reply
#5

EDIT: Did not refresh, already answered

pawn Код:
COMMAND:hello( playerid, params[] )
{
     new player, level ;
     if( sscanf( params, "ud", player, level ) ) return 0;
     if( !(0 < level < 7) ) return 0;
...
Reply
#6

Coudl u just put it in the script?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)