Scripting Help
#2

Код:
CMD:setpro(playerid,params[])
{
	if(pInfo[playerid][pLogged] == 1)
	{
		if(pInfo[playerid][pAdminLevel] >= 8)
		{
			new targetid,level,string[256];
			if(sscanf(params, "ud", targetid, level)) return  SendClientMessage(playerid,-1,""chat" /setpro [playerid] [level]");
			if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online");
			if(level < 0 || level > 10) return SendClientMessage(playerid,-1,""chat"  Admin levels are ONLY between 1-10");

			pInfo[targetid][pAdminLevel] = level;

			format(string, sizeof(string), ""chat""COL_LIGHTBLUE" %s %s have given admin status of %d to %s",GetAdminName(playerid),PlayerName(playerid),level,PlayerName(targetid));
			SendClientMessageToAll(-1,string);
			printf("%s %s have given admin status of %d to %s",GetAdminName(playerid),PlayerName(playerid),level,PlayerName(targetid));
		}
		else {
			SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" You do not have the right admin permissions for this command!");
		}
	}
    else if(pInfo[playerid][pLogged] == 0)
	{
		SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" Nice try u fucking fag gay!");
		printf("%s has been kicked for trying to use a command without being logged in!", PlayerName(playerid));
		Kick(playerid);
	}
	return 1;
}
This command is how an admin, adds another.

Код:
if(pInfo[playerid][pAdminLevel] >= 8)
Change that to this...

Код:
if(pInfo[playerid][pAdminLevel] >= 8||IsPlayerAdmin(playerid))
You'll then be able to promote people via that command. (Once the userfile is saved and an admin is set you could remove the addition from the command)


Other than that, you have to edit the userfile, whilst someone is offline, and change the pAdminLevel user ini.
Reply


Messages In This Thread
Scripting Help - by Istrator - 23.01.2018, 13:53
Re: Scripting Help - by Sew_Sumi - 23.01.2018, 15:13
Re: Scripting Help - by Istrator - 02.04.2018, 15:06

Forum Jump:


Users browsing this thread: 1 Guest(s)