SA-MP Forums Archive
Help with Admin Cmds - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with Admin Cmds (/showthread.php?tid=68586)

Pages: 1 2


Help with Admin Cmds - Taz86 - 11.03.2009

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.




Re: Help with Admin Cmds - Pyrokid - 11.03.2009

A simple if statement can fix that.

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



Re: Help with Admin Cmds - Taz86 - 11.03.2009

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


Re: Help with Admin Cmds - Pyrokid - 11.03.2009

pastebin.com

Paste the whole nuke code there.


Re: Help with Admin Cmds - Taz86 - 11.03.2009

Thats not just the nuke.

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


Re: Help with Admin Cmds - Taz86 - 11.03.2009

Still to make it with pastbin?


Re: Help with Admin Cmds - Pyrokid - 11.03.2009

Yes still paste it on pastebin.com.


Re: Help with Admin Cmds - Taz86 - 11.03.2009

I Sended you PM


Re: Help with Admin Cmds - Taz86 - 11.03.2009

Here is the full Admin FS By Seif

http://pastebin.com/m3c6e0de5


Re: Help with Admin Cmds - Pyrokid - 11.03.2009

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.


Re: Help with Admin Cmds - Taz86 - 11.03.2009

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


Re: Help with Admin Cmds - Pyrokid - 11.03.2009

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.


Re: Help with Admin Cmds - Taz86 - 11.03.2009

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)



Re: Help with Admin Cmds - Pyrokid - 11.03.2009

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;
    }



Re: Help with Admin Cmds - Taz86 - 11.03.2009

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


Re: Help with Admin Cmds - Pyrokid - 11.03.2009

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);
            }



Re: Help with Admin Cmds - Taz86 - 11.03.2009

Grr, I cant make it!!!


Re: Help with Admin Cmds - Pyrokid - 11.03.2009

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.


Re: Help with Admin Cmds - Taz86 - 11.03.2009

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?


Re: Help with Admin Cmds - Pyrokid - 11.03.2009

Sure, put the commands in pastebin.