[Help] Adding New Administrator Levels.
#1

Alright Look im kinda new with all of this...
But i got one beautiful Script.

I have the admin levels: 1,2,3,4 & Lead Admin.
They all work & have working commands...

BUT

Now i want to do this: Make like an Job/Faction/Anything, And if you are in That Job/Faction/Anything than you can do several commands that i can chose, Which will be admin commands.

In short i want to make some kind of job, And if you are in that job you are able to do administrator commands.

Musts:
-Other players can NOT know that your an admin or something so the commands must be executable without /aduty or /adminlogin


Can anyone make something like this, Or help me make this.
Reply
#2

someone help me please :$
Reply
#3

Quote:
Originally Posted by up2u
Посмотреть сообщение
someone help me please :$
Show us an admin command, and let use know how you check whatever faction an player is in.
Reply
#4

Quote:
Originally Posted by up2u
Посмотреть сообщение
if(strcmp(cmd, "/skick", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /skick [playerid/PartOfName] [reason]");
return 1;
}
if(GetPVarInt(playerid, "AdminLogged") == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "Your not logged in through the admin panel, /adminlogin.");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playerid][pHidden] == 1) { sendername = "Hidden Admin"; }
else if(PlayerInfo[playerid][pAdmin] == 11) { sendername = "Hidden Admin"; }
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /skick [playerid/PartOfName] [reason]");
return 1;
}
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Kick yourself!"); return 1; }
if(PlayerInfo[giveplayerid][pAdmin] >= 1)
{
if(PlayerInfo[playerid][pAdmin] < 10)
{
SendClientMessage(playerid, COLOR_GRAD2, "Your admin level is too low to kick other admins.");
return 1;
}
}
format(string, sizeof(string), "AdmCmd: %s was kicked by Silent Admin, reason: %s", giveplayer, (result));
ABroadCast(COLOR_YELLOW, string,1);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", giveplayer,sendername, (result));
//KickLog(string);
PlayerInfo[giveplayerid][pKicks] += 1;
Kick(giveplayerid);
return 1;
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
Basically what i want is just any Joinable faction/job/thing and i want to be able to add commands for that faction/job/thing

EDIT:

What if i give you my whole script, And you add an new Job, Which has all administrator commands for all levels, Doesn't need /aduty to use, Doesn't need /adminlogin to use + it says Silent admin at every command.

I would be greatfull for life if you can do this
Reply
#5

Код:
 if(strcmp(cmd, "/skick", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	    	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /skick [playerid/PartOfName] [reason]");
				return 1;
			}
			if(GetPVarInt(playerid, "AdminLogged") == 0)
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Your not logged in through the admin panel, /adminlogin.");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
				if(IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
					    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						if(PlayerInfo[playerid][pHidden] == 1) { sendername = "Hidden Admin"; }
						else if(PlayerInfo[playerid][pAdmin] == 11) { sendername = "Hidden Admin"; }
						new length = strlen(cmdtext);
						while ((idx < length) && (cmdtext[idx] <= ' '))
						{
							idx++;
						}
						new offset = idx;
						new result[128];
						while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
						{
							result[idx - offset] = cmdtext[idx];
							idx++;
						}
						result[idx - offset] = EOS;
						if(!strlen(result))
						{
							SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /skick [playerid/PartOfName] [reason]");
							return 1;
						}
						if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Kick yourself!"); return 1; }
						if(PlayerInfo[giveplayerid][pAdmin] >= 1)
						{
						    if(PlayerInfo[playerid][pAdmin] < 10)
						    {
						    	SendClientMessage(playerid, COLOR_GRAD2, "Your admin level is too low to kick other admins.");
							    return 1;
						    }
						}
						format(string, sizeof(string), "AdmCmd: %s was kicked by Silent Admin, reason: %s", giveplayer, (result));
						ABroadCast(COLOR_YELLOW, string,1);
						GetPlayerName(playerid, sendername, sizeof(sendername));
						format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", giveplayer,sendername, (result));
						//KickLog(string);
						PlayerInfo[giveplayerid][pKicks] += 1;
						Kick(giveplayerid);
						return 1;
					}
				}
			}
			else
			{
				format(string, sizeof(string), "   %d is not an active player.", giveplayerid);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
Reply
#6

at this line : if (PlayerInfo[playerid][pAdmin] >= 1) change to :

if (PlayerInfo[playerid][pAdmin] >= 1 || GetPlayerJob(playerid) == JOB_POLICE)

define JOB_POLICE :

pawn Код:
#define JOB_POLICE 1
define the getplayerjob stock :

pawn Код:
stock GetPlayerJob(playerid)
{
     return PlayerInfo[playerid][Job];
}
If Job isn't defined in your pInfo enumerator :

pawn Код:
enum pInfo
{
     Job,
}
Reply
#7

Added everything, But my script doesn't have the Job named JOB_POLICE

Should i change that name to an excising job?
Reply
#8

What Are you serious An Admin Job?

WTF......
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)