/makeadmin commad
#8

Try that I hope Its work for you!!.

Код:
if(strcmp(cmd, "/makeadmin", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeadmin [playerid/PartOfName] [level]");
				return 1;
			}
			new para1;
			new level;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			level = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 10)
			{
			    if(IsPlayerConnected(para1))
			    {
			        if(para1 != INVALID_PLAYER_ID)
			        {
						GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						GiveNameSpace(sendername);
						GiveNameSpace(giveplayer);
						if(PlayerInfo[playerid][pAdmin] == 11) { sendername = "Hidden Admin"; }
						new Float:shealth;
	                    GetPlayerHealth(para1,shealth);
	                    SetPlayerHealthEx(para1,shealth);
	                    new Float:darmour;
	                    GetPlayerArmour(para1,darmour);
	                    SetPlayerArmourEx(para1,darmour);
						PlayerInfo[para1][pAdmin] = level;
						//printf("AdmCmd: %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
						format(string, sizeof(string), "   You have been promoted to a level %d admin by %s", level, sendername);
						SendClientMessage(para1, COLOR_WHITE, string);
						format(string, sizeof(string), "   You have promoted %s to a level %d admin.", giveplayer,level);
						SendClientMessage(playerid, COLOR_WHITE, string);
						format(string, sizeof(string), "[ID: %d]  %s has promoted %s [ID: %d] to a level %d admin.", playerid, sendername, giveplayer, para1,level);
						ABroadCast(COLOR_YELLOW, string, 1);
						
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command!");
			}
		}
		return 1;
	}
Just change the level of admin here which admin level will makeadmins...
Код:
if (PlayerInfo[playerid][pAdmin] >= 10)
Just looking for Rep..
Reply


Messages In This Thread
/makeadmin commad - by DannySnoopy - 18.08.2011, 13:42
Re: /makeadmin commad - by Pinguinn - 18.08.2011, 13:43
Re: /makeadmin commad - by DannySnoopy - 18.08.2011, 13:49
Re: /makeadmin commad - by ElieJabbour - 18.08.2011, 13:49
Re: /makeadmin commad - by PhoenixB - 18.08.2011, 13:49
Re: /makeadmin commad - by DannySnoopy - 18.08.2011, 13:53
Re: /makeadmin commad - by PhoenixB - 18.08.2011, 13:56
AW: /makeadmin commad - by umarmalik - 18.08.2011, 14:01
Re: /makeadmin commad - by ElieJabbour - 18.08.2011, 14:06
Re: /makeadmin commad - by DannySnoopy - 18.08.2011, 14:21
Re: /makeadmin commad - by Pinguinn - 18.08.2011, 14:47
Re: /makeadmin commad - by ElieJabbour - 18.08.2011, 14:52

Forum Jump:


Users browsing this thread: 1 Guest(s)