Raised This Month: $32 Target: $400
 8% 

adminmenu custom


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
skut
New Member
Join Date: Sep 2022
Location: belgique
Old 09-28-2022 , 06:58   adminmenu custom
Reply With Quote #1

Hello
I would like to add two things in my personalized admin menu
1st: a restart of the server if the server lags too much for all admins
2nd: a vote to ask the question which game mode the player wants
but i can't do it can you help me
the rest works fine
thank you
here is my custom admin menu
"Commands"
{
"Observer un joueur"
{
"Observer le joueur"
{
"cmd" "sm_observe #1"
"admin" "sm_kick"
"execute" "player"
"1"
{
"type" "player"
"method" "name"
"title" "Joueur Ã* observer:"
}
}
"Stopper l'observation"
{
"cmd" "sm_endobserve"
"admin" "sm_kick"
"execute" "player"
}
}
"Restart"
{
"admin" "sm_generic"
"cmd" "mp_restartgame #1"
"execute" "server"
"1"
{
"type" "list"
"title" "How long?"
"1" "1"
"1." "Now"
"2" "15"
"2." "In 15 seconds"
}
}
"VoteMod"
{
"admin" "sm_generic"
"cmd" "sm_vote #1"
"execute" "server"
"1"
{
"type" "list"
"title" "Do you want the VIP Mod"
"1" "yes"
"2" "No"
"title" "Do you want the Flag Mod "
"1" "yes"
"2" "No"
}
}
}
}

Last edited by skut; 09-28-2022 at 07:01.
skut is offline
SyntX
Junior Member
Join Date: Sep 2022
Location: Kathmandu, Nepal
Old 10-14-2022 , 23:37   Re: adminmenu custom
Reply With Quote #2

copy this to ../addons/sourcemod/configs/adminmenu_custom.txt
"Commands"
{
"Observer un joueur"
{
"cmd" "sm_observe #1"
"admin" "sm_kick"
"execute" "player"
"1"
{
"type" "player"
"method" "name"
"title" "Joueur Ã* observer:"
}
}
"Stopper l'observation"
{
"cmd" "sm_endobserve"
"admin" "sm_kick"
"execute" "player"
}
"Restart"
{
"admin" "sm_generic"
"cmd" "mp_restartgame #1"
"execute" "server"
"1"
{
"type" "list"
"title" "how long?"
"1"
"1." "now"
"2" "15"
"2." "in 15 seconds"
}
}
"VoteMod"
{
"admin" "sm_generic"
"cmd" "sm_vote #1 #2"
"execute" "server"
"1"
{
"type" "list"
"title" "Do You want the VIP Mod?"
"1" "Yes."
"2" "No."
}
"2"
{
"type" "list"
"title" "Do you want the flag Mod?"
"1" "yes."
"2" "no."
}
}
}

i havent tested this, not sure if it will works correct or not
you did syntax wrong actually so i fixed
after save this
please do "sm plugins reload adminmenu" in your srcds console
__________________
Join Awesome Zombies Server :
Zombie Mod By NovaHunterZ | FastDL, Rank, SSD, Respawn | --> 54.36.111.64:27015
Zombie Riot By NovaHunterZ | FastDL, RPG, SSD, Skins, FreeVIP | --> 54.36.111.64:27025
---------------------------------
Discord Server : https://discord.gg/2DjsQ4xdd5

Last edited by SyntX; 10-14-2022 at 23:57. Reason: improved mistakes
SyntX is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-15-2022 , 17:13   Re: adminmenu custom
Reply With Quote #3

... use code tags, easier to read. You can also enter in "Go Advanced"

[code]asdasd
sad
asd
[/code]

Code:
asdasd
sad
asd
__________________
Do not Private Message @me
Bacardi is offline
skut
New Member
Join Date: Sep 2022
Location: belgique
Old 10-19-2022 , 17:46   Re: adminmenu custom
Reply With Quote #4

thanks I will try
skut is offline
McRi0t
Junior Member
Join Date: Oct 2022
Old 10-20-2022 , 17:32   Re: adminmenu custom
Reply With Quote #5

Friendly Hijacking of this post for my own adminmenu_custom.cfg . I've been avoiding this for a long time thinking I could script this myself but I keep running into issues getting it to work. Apparently I suck at this.

I'm looking for someone to help me understand how to get these custom commands working. I'm also happy to chat with someone on Steam. Temp Friend Link: https://s.team/p/mcpck/ndhtkghv

1. I am trying to link other menus together ( if this is possible? ) for example abm-menu and sm_tele
So far I can either get both the menus to show up but they won't execute. It's driving me crazy.

2. The other issue I'm having but this might be due to the ABM plugin being old ( I am using the latest fork I could find of ABM ) When go to add 1 bot it adds 2 bots *shrug* not as important but would be nice to have working properly.

I'm trying to learn and understand this all so in the future I can add my own stuff but ultimately I would like this working. I'm happy to chat with someone on steam that know a lot about this stuff. I've been running my dedicated server off and on and have learned a lot, largely due to these forums. Really hoping someone can help me with this.

Thank You

Code:
"Commands"
{

"Teleport Menu"
		{
			"cmd"		"sm_tele"
			"admin"		"sm_ban"
			"execute"	"server"
			"1"
		}
		
"ABM Menu"
		{
			"cmd"		"abm-menu"
			"admin"		"sm_ban"
			"execute"	"server"
			"1"
		}
	
	"Bots Menu"
	{
		"Add Bots"
		{
		"cmd"		"abm-mk @1"
		"admin"		"sm_kick"
		"execute"	"server"
		"1"
			{
			"type"	"list"
			"title"	"Add Bots:"
			"1"		"1 2"
			"1."	"1 Bot"
			"2"		"2 2"
			"2."	"2 Bots"
			"3"		"3 2"
			"3."	"3 Bots"

			}
		}
		
		
		"Remove Bots"
		{
		"cmd"		"abm-rm @1"
		"admin"		"sm_kick"
		"execute"	"server"
		"1"
			{
			"type"	"list"
			"title"	"Remove Bots:"
			"1"		"1 2"
			"1."	"1 Bot"
			"2"		"2 2"
			"2."	"2 Bots"
			"3"		"3 2"
			"3."	"3 Bots"
			"4"		"2"
			"4."	"Remove All Bots"

			}
		}
	}

	
	"Server Cvars"
	{
		"Password"
		{
			"cmd"		"sv_password #1"
			"admin"		"sm_kick"
			"execute"	"server"
			"1"
			{
				"type" 		"list"
				"title"		"Passwords:"
				"1"		"notarealpassword"
				"2"		"randompassword"
				"3"		"happybirthday"
				"4"		"helloworld"
			}
						
		}
	}
}
McRi0t is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-21-2022 , 02:54   Re: adminmenu custom
Reply With Quote #6

Sourcemod dynamic Adminmenu custom
is just simple plugin what build command line with parameters to execute from server console or player console.

PHP Code:
// Custom admin menu commands.
// For more information:
//
// http://wiki.alliedmods.net/Custom_Admin_Menu_%28SourceMod%29
//
// Note: This file must be in Valve KeyValues format (no multiline comments)
//

"Commands"
{
    
"My Menu Section"    // in adminmenu_sorting.txt - You can use/add same sections names, PlayerCommands, ServerCommands, VotingCommands
    
{

        
"My 1st command"
        
{
            
"cmd"        "@1 @2 @3 @4 #5"
            "1"
            
{
                
"title"        "Choose command"
                "1"            "say_team"
                "2"            "say"
                "3"            "sm_say"
            
}
            
"2"
            
{
                
"title"    "Parameter 1"
                "1"        "ABC"
                "2"        "DEF"
            
}
            
"3"
            
{
                
"title"    "Parameter 2"
                "1"        "123"
                "2"        "\"456\""
            
}
            
"4"
            
{
                
"title"    "Parameter 3"
                "1"        " "
                "1."    "space"
                "2"        "-"
                "2."    "line"
            
}
            
"5"
            
{
                
"title"        "Parameter 4"
                "type"        "groupplayer"
                "method"    "name"
            
}
        }
        
"Second command"
        
{
            
"cmd"    "say Hello #1 to you too!"
            "1"
            
{
                
"title"    "Say hello back to player"
                "type"    "player"
            
}
        }
    }
    
    
"VotingCommands"
    
{
        
"PAM!"
        
{
            
"cmd"    "say Headshot!"
            "execute"    "server"
        
}
    }

- If you have another plugin what open it own menu, you can only open that menu from here, that is all.
- If another plugin add menu and commands in SourceMod Adminmenu, you maybe can arrange those, using other adminmenu txt files.

Admin menu custom is just simple, do not overthink or invent new sub-menu methods.

Code:
"Commands"
{
	"[Menu section]"
	{
		"[Menu command]"
		{
			"cmd"	"[command or cvar and parameters here]"
		}
	}
}

Hint and Tips!
- Don't target and execute command by player name!
If plugin command is build right way, use players #userid

"method" "userid"
__________________
Do not Private Message @me

Last edited by Bacardi; 10-21-2022 at 02:58.
Bacardi is offline
McRi0t
Junior Member
Join Date: Oct 2022
Old 10-21-2022 , 12:32   Re: adminmenu custom
Reply With Quote #7

Thanks, This made a lot more sense I think. Your examples helped.

Just to be absolutely clear. It's impossible to use adminmenu_custom.cfg to link other plugin menus?

so this can't work?

Code:
"Commands"
{

	"VotingCommands"
	{
		"Vote Difficulty"
		{
		"cmd"		"sm_vd" // vote difficulty plugin has it's own menu
		"execute"	"server"
		}
	}
}
it shows up in the list but won't execute :/
I was really hoping to link menus together (maybe theirs a plugin that helps with this?) I just didn't want to bind 50 keys to individual menus.

Thank you for the reply appreciate it.

Last edited by McRi0t; 10-21-2022 at 12:33.
McRi0t is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-21-2022 , 15:19   Re: adminmenu custom
Reply With Quote #8

No, you can not "link" menus. SourceMod admin menu custom is just simple plugin, doesn't understand what other plugins do.

Editing another plugin source code you can do menus work how you like it.

But look again if that plugin what you try to get work, use commands, so you can build that in custom menu and get it work.

Use your own console, to execute command with parameters.

If you execute command from "server" side, there is no way to get some commands to work (like for example open menu).
__________________
Do not Private Message @me
Bacardi is offline
McRi0t
Junior Member
Join Date: Oct 2022
Old 10-21-2022 , 20:30   Re: adminmenu custom
Reply With Quote #9

Quote:
Originally Posted by Bacardi View Post
No, you can not "link" menus. SourceMod admin menu custom is just simple plugin, doesn't understand what other plugins do.

Editing another plugin source code you can do menus work how you like it.

But look again if that plugin what you try to get work, use commands, so you can build that in custom menu and get it work.

Use your own console, to execute command with parameters.

If you execute command from "server" side, there is no way to get some commands to work (like for example open menu).
Fair enough, thank you for your help.

I think going beyond this is a bit out of my range of skills, I can build you a computer/server from the ground up setup and manage business grade networks & VPNs but scripting and coding, nope. lol. I try though . It's tobad it's not easier to link plugin menus together so I can have an all-in-one key bind.

I love plugins but it gets cumbersome binding so many keys and recalling what menu they are for. Anyway, I will continue on trying to perfect my server, this helped a lot though. Thanks again!
McRi0t is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode