Help with Admin Cmds
#1

Hey all
Mybe it worng place, so tell me where to post it please.


I have Seif Admin systam.

And all of the nuke and slap etc...


So I got admins and I did on them nuke, and they did on me back, So I need you to tell me what line to put that they will not be able to do all the cmd on me. xD

Thats all.


Thanks.

Reply
#2

A simple if statement can fix that.

pawn Code:
if(this == that) { //do something; return 1; }
Reply
#3

I didnt get it :S
Sry
Can you expline me more about it?
Reply
#4

pastebin.com

Paste the whole nuke code there.
Reply
#5

Thats not just the nuke.

I want them that they will not be able to do any of the admin cmds on me
Reply
#6

Still to make it with pastbin?
Reply
#7

Yes still paste it on pastebin.com.
Reply
#8

I Sended you PM
Reply
#9

Here is the full Admin FS By Seif

http://pastebin.com/m3c6e0de5
Reply
#10

http://pastebin.com/f4c2442d0

I added this:
pawn Code:
if (AccountInfo[giverplayerid][AdminLevel] >= AccountInfo[playerid][AdminLevel])
          {
            SendClientMessage(playerid, GREY, "You cannot nuke admins higher or equal to you");
            return 1;
          }
Meaning, if the level of the person receiving the nuke is greater than or equal to the person using the command, it won't work.

You can add that to every command and edit it as you feel.
Reply
#11

ok thnx
But where to put it,
Like look in the /freeze, Where i need to put the line?
And on others, where?
Reply
#12

I've made an edit. Use this: http://pastebin.com/f4c2442d0 instead.

Put that code right under where giveplayerid is defined in every command.

Let me know if you get problems.
Reply
#13

I think its good.

Here:
Код:
	if(strcmp(cmd, "/freeze", true) == 0) // Freezes the player. Prevents him from moving
	{
		new reason[128];
		if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, GREY, "USAGE: /freeze [playername/id] [reason]");
				SendClientMessage(playerid, GREY, "FUNCTION: Will freeze the specified player.");
				return 1;
			}

			new giveplayerid = ReturnUser(tmp);
			if(giveplayerid != INVALID_PLAYER_ID)
					  if (AccountInfo[giverplayerid][AdminLevel] >= AccountInfo[playerid][AdminLevel])
		  {
		    SendClientMessage(playerid, GREY, "You cannot nuke admins higher or equal to you");
		    return 1;
		  }
			{
			  GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
				GetPlayerName(playerid, sendername, sizeof(sendername));
				reason = bigstrtok(cmdtext, idx);
				if(!strlen(reason)) return SendClientMessage(playerid, GREY, "USAGE: /freeze [playername/id] [reason]");
				format(string, sizeof(string), "Administrator %s froze %s. [Reason: %s ]", sendername, giveplayername, reason);
	 			SendClientMessageToAdmins(ADMIN_RED, string, 1);
				TogglePlayerControllable(giveplayerid, false);
			}
			else if(giveplayerid == INVALID_PLAYER_ID)
			{
				format(string, sizeof(string), "%d is not an active player.", giveplayerid);
				SendClientMessage(playerid, GREY, string);
			}
		}
		else SendClientMessage(playerid, GREY, "You are not an admin with the required level.");
		return 1;
	}

I add this After this:

new giveplayerid = ReturnUser(tmp);
if(giveplayerid != INVALID_PLAYER_ID)
Reply
#14

No, that would give you an error. It's supposed to be like this.
pawn Код:
if(strcmp(cmd, "/freeze", true) == 0) // Freezes the player. Prevents him from moving
    {
        new reason[128];
        if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, GREY, "USAGE: /freeze [playername/id] [reason]");
                SendClientMessage(playerid, GREY, "FUNCTION: Will freeze the specified player.");
                return 1;
            }

            new giveplayerid = ReturnUser(tmp);
            if (AccountInfo[giverplayerid][AdminLevel] >= AccountInfo[playerid][AdminLevel])
          {
            SendClientMessage(playerid, GREY, "You cannot nuke admins higher or equal to you");
            return 1;
          }
            if(giveplayerid != INVALID_PLAYER_ID)
            {
              GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
                GetPlayerName(playerid, sendername, sizeof(sendername));
                reason = bigstrtok(cmdtext, idx);
                if(!strlen(reason)) return SendClientMessage(playerid, GREY, "USAGE: /freeze [playername/id] [reason]");
                format(string, sizeof(string), "Administrator %s froze %s. [Reason: %s ]", sendername, giveplayername, reason);
                SendClientMessageToAdmins(ADMIN_RED, string, 1);
                TogglePlayerControllable(giveplayerid, false);
            }
            else if(giveplayerid == INVALID_PLAYER_ID)
            {
                format(string, sizeof(string), "%d is not an active player.", giveplayerid);
                SendClientMessage(playerid, GREY, string);
            }
        }
        else SendClientMessage(playerid, GREY, "You are not an admin with the required level.");
        return 1;
    }
Reply
#15

Sry, But what did you add here?
]
I cant find, Sry im still new to Pawno
Reply
#16

You did it like this:
pawn Код:
new giveplayerid = ReturnUser(tmp);
            if(giveplayerid != INVALID_PLAYER_ID) //Here's your mistake.
            if (AccountInfo[giverplayerid][AdminLevel] >= AccountInfo[playerid][AdminLevel])
          {
            SendClientMessage(playerid, GREY, "You cannot nuke admins higher or equal to you");
            return 1;
          }
            {
              GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
                GetPlayerName(playerid, sendername, sizeof(sendername));
                reason = bigstrtok(cmdtext, idx);
                if(!strlen(reason)) return SendClientMessage(playerid, GREY, "USAGE: /freeze [playername/id] [reason]");
                format(string, sizeof(string), "Administrator %s froze %s. [Reason: %s ]", sendername, giveplayername, reason);
                SendClientMessageToAdmins(ADMIN_RED, string, 1);
                TogglePlayerControllable(giveplayerid, false);
            }
When it's supposed to be like this:
pawn Код:
new giveplayerid = ReturnUser(tmp);
            if (AccountInfo[giverplayerid][AdminLevel] >= AccountInfo[playerid][AdminLevel])
          {
            SendClientMessage(playerid, GREY, "You cannot nuke admins higher or equal to you");
            return 1;
          } //The if goes right below where giveplayerid is defined.
            if(giveplayerid != INVALID_PLAYER_ID)
            {
              GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
                GetPlayerName(playerid, sendername, sizeof(sendername));
                reason = bigstrtok(cmdtext, idx);
                if(!strlen(reason)) return SendClientMessage(playerid, GREY, "USAGE: /freeze [playername/id] [reason]");
                format(string, sizeof(string), "Administrator %s froze %s. [Reason: %s ]", sendername, giveplayername, reason);
                SendClientMessageToAdmins(ADMIN_RED, string, 1);
                TogglePlayerControllable(giveplayerid, false);
            }
Reply
#17

Grr, I cant make it!!!
Reply
#18

Well what's the error? I'm pretty sure I showed you a good code. I can't test it because I don't use strtok but I'm pretty sure it should work.
Reply
#19

No
I just dont get whereto put the code you gave,

Can you do it for me please?
I just need the code on like 6 Cmds?
Reply
#20

Sure, put the commands in pastebin.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)