can someone help with /makeadmin
#5

If you have enum PlayerStatistics
Add something under that like.
Adminlevel,
Then you can continue on with creating your command.

EDIT:
If you've done that, heres my command, it should work if you've added the enum.
Код:
command(adminlevel, playerid, params[])
{
	new id, level, string[128];
	if(sscanf(params, "ud", id, level))
	{
	    if(Player[playerid][AdminLevel] >= 1338)
	    {
			SendClientMessage(playerid, WHITE, "SYNTAX: /adminlevel [playerid] [new level]");
		}
	}
	else
	{
	    if(Player[playerid][AdminLevel] >= 6)
	    {
	        if(Player[id][AdminLevel] == 0 && level >= 1)
	        {
                if(level >= Player[playerid][AdminLevel])
                {
                    SendClientMessage(playerid, WHITE, "You can only hire an admin to a lower level.");
                }
                else
                {
	                Player[id][AdminLevel] = level;
			        format(string, sizeof(string), "%s has been hired to admin level %d by %s.", GetName(id), level, GetName(playerid));
			        SendToAdmins(ADMINORANGE, string, 0);
			        StatLog(string);
			        
				    if(Player[id][AdminPIN] == 0)
				    {
				        TogglePlayerControllable(id, false);
				        SendClientMessage(id, WHITE, "You don't have an admin PIN set. Please now set one, it must be numeric only and 6 characters in length.");
				        ShowPlayerDialog(id, 9843, DIALOG_STYLE_INPUT, "Authentication (Admin PIN)", "Please enter your desired PIN.", "Done", "Cancel");
				    }
				    else
				    {
				        Player[id][PINUnauthedTime] = 1;
				        SendClientMessage(id, WHITE, "You have 10 seconds to login before you are auto-kicked.");
				        TogglePlayerControllable(id, false);
						ShowPlayerDialog(id, 9842, DIALOG_STYLE_INPUT, "Authentication (Admin PIN)", "Please enter your additional admin PIN to continue.", "Login", "Cancel");
					}
		        }
            }
	        else if(level >= Player[playerid][AdminLevel])
    	    {
        	    SendClientMessage(playerid, WHITE, "You're unable to execute this action.");
        	}
        	else if(level >= Player[id][AdminLevel])
	    	{
	        	format(string, sizeof(string), "%s has been promoted to admin level %d by %s.", GetName(id), level, GetName(playerid));
	        	SendToAdmins(ADMINORANGE, string, 0);
	        	Player[id][AdminLevel] = level;
		        StatLog(string);
		    }
		    else if(level < 1)
		    {
		        format(string, sizeof(string), "%s has been removed from the admin team by %s.", GetName(id), GetName(playerid));
		        SendToAdmins(ADMINORANGE, string, 0);
		        Player[id][AdminLevel] = level;
		        Player[id][AdminDuty] = 0;
		        SetPlayerName(id, Player[id][NormalName]);
		        StatLog(string);
		    }
		    else if(level < Player[id][AdminLevel])
		    {
		        format(string, sizeof(string), "%s has been demoted to admin level %d by %s.", GetName(id), level, GetName(playerid));
		        SendToAdmins(ADMINORANGE, string, 0);
		        Player[id][AdminLevel] = level;
		        StatLog(string);
		    }
		}
    }
	return 1;
}
Reply


Messages In This Thread
can someone help with /makeadmin - by cluckintucker - 17.11.2012, 13:35
Re: can someone help with /makeadmin - by Joshswag - 17.11.2012, 13:36
Re: can someone help with /makeadmin - by cluckintucker - 17.11.2012, 13:39
Re: can someone help with /makeadmin - by AaronKillz - 17.11.2012, 13:48
Re: can someone help with /makeadmin - by Joshswag - 17.11.2012, 13:52
Re: can someone help with /makeadmin - by zDivine - 17.11.2012, 14:02
Re: can someone help with /makeadmin - by cluckintucker - 17.11.2012, 15:14
Re: can someone help with /makeadmin - by zDivine - 17.11.2012, 15:36

Forum Jump:


Users browsing this thread: 2 Guest(s)