Question about something with my command
#1

Код:
CMD:setjoblevel(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 5)
	{
    	new targetid, job, level;
		if(sscanf(params, "uii", targetid, level)) return SendClientMessage(playerid, -1, "/setjoblevel [playerid/partofname] [job] [level]");
		SendClientMessage(playerid, -1, "1. Drug Dealer, 2. UPS worker.");
		if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "That player is not currently online!");
		if(!(-1 < job < 2)) return SendClientMessage(playerid, -1, "There are only two jobs currently!");
		if(!(-1 < level < 8)) return SendClientMessage(playerid, -1, "The highest level for all jobs is 8!");
		
	}
	else
	{
	    SendClientMessage(playerid, -1, "You must be an administrator to use this command!");
	}
}
Код:
if(!(-1 < job < 2)) return SendClientMessage(playerid, -1, "There are only two jobs currently!");
if(!(-1 < level < 8)) return SendClientMessage(playerid, -1, "The highest level for all jobs is 8!");
What I was wondering is in relation to these above statements. Should I just use switch(level) and then switch(job), then cases in order to create what I was trying to do (which is basically be able to choose which job to set to level 8 or under), or is there some other way I'm missing?

I was using these two variables in an enum in order to store the levels and how much the player needs to level up (Which has already been done in a different section of code)
Код:
UPSlevel, UPSjoblevel[7]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)