Help for small thing :)
#8

pInfo[iTarget][pAdmin] = Level; is setting the admin level pretty much. Here is a basic command to set someone's admin level.

Код:
CMD:makeadmin(playerid,params[])
{
	if(pInfo[playerid][pAdmin] >=5 || IsPlayerAdmin(playerid))
	{
	    new iTarget,Level,String[128],StringTwo[128],LogString[128],AdmRank[50];
	    if(sscanf(params,"ud",iTarget,Level)) return SendClientMessage(playerid,COLOR_GREY,"Usage: /makeadmin [Playerid (or Name)] [Admin Level]");
        if(Level < 1 || Level > 5) return SendClientMessage(playerid, COLOR_GREY,"Error: Invalid Admin Level. [Admin Level 1 - 5]");
 		if(iTarget == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_GREY,"Error: Player Not Connected!");
	 	{
 	 	    pInfo[iTarget][pAdmin] = Level;
 	 	    
		}
	}
	else
	{
	    SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
	}
	return 1;
}
Suggest reading a tutorial on this kind of stuff. Here is a great one for you!

https://sampforum.blast.hk/showthread.php?tid=318307
Reply


Messages In This Thread
Help for small thing :) - by Ruffian - 10.09.2012, 23:37
Re: Help for small thing :) - by AaronKillz - 10.09.2012, 23:56
Re: Help for small thing :) - by Ruffian - 11.09.2012, 00:05
Re: Help for small thing :) - by AaronKillz - 11.09.2012, 00:16
Re: Help for small thing :) - by ddnbb - 11.09.2012, 00:37
Re: Help for small thing :) - by Never Forgive - 11.09.2012, 00:47
Re: Help for small thing :) - by Ruffian - 11.09.2012, 00:52
Re: Help for small thing :) - by Never Forgive - 11.09.2012, 00:58
Re: Help for small thing :) - by Ruffian - 11.09.2012, 01:01
Re: Help for small thing :) - by Ruffian - 11.09.2012, 12:05

Forum Jump:


Users browsing this thread: 1 Guest(s)