Raised This Month: $51 Target: $400
 12% 

Enable plugins for players with specific flag


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OZZI
Junior Member
Join Date: Feb 2021
Old 02-02-2021 , 13:47   Enable plugins for players with specific flag
Reply With Quote #1

So i want to enable a plugin for a player with the flag "a", but all I can seem to find is how to enable commands so only a player with a certain flag can use that command, but not on a plugin level.

I have tried making my own "admin menu" to see if you could enable it through that and only enable it for that player, but either it doesn't work and the plugin doesn't enable for the player or the plugin works, but the whole server can now use it.

Is there a way I can do this, a piece of code i could paste in to the scripting file of the plugin or is it just not possible?
OZZI is offline
TomL.
Veteran Member
Join Date: Oct 2017
Location: Germany
Old 02-02-2021 , 14:24   Re: Enable plugins for players with specific flag
Reply With Quote #2

I'm not exactly sure what your issue is but you can identify specific players by using the steamid.
Maybe this helps.

Last edited by TomL.; 02-02-2021 at 14:27.
TomL. is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 02-02-2021 , 14:42   Re: Enable plugins for players with specific flag
Reply With Quote #3

Its not possible to load the plugin for specific player as the plugin loads on the server. You can check if the connected player has a set flag and execute your plugin function based on that.

Show me your code.
__________________
Spirit_12 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-04-2021 , 00:18   Re: Enable plugins for players with specific flag
Reply With Quote #4

1.) Do not give "z" root flag to anyone.
2.) Build just normal admin menu option, with specific access. Restrict with flag "z".
3.) Create admin group, use override to let admin in group to access in menu option, without given a flag "z"


You just need understand more about admin system.
__________________
Do not Private Message @me
Bacardi is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 02-04-2021 , 00:51   Re: Enable plugins for players with specific flag
Reply With Quote #5

Ozzi... I'm sure there is an answer to your question. However, we don't seem to be understanding exactly what you are trying to do.

You should post your plugin (or a link to it) so we can better understand what you are trying to do. Do you want ALL players with the 'a' flag to use the command/plugin, or just player Bob with flag 'a'?
PC Gamer is offline
OZZI
Junior Member
Join Date: Feb 2021
Old 02-04-2021 , 15:12   Re: Enable plugins for players with specific flag
Reply With Quote #6

So i tried following a guide on how to create your own admin menu

adminmenu_custom.txt
HTML Code:
"Commands"
{
	"vip" 
	{
		"Show Damage" 
		{
			"cmd"			"@1"
			"admin"			"vip"
			"execute" 		"player"
			"1"
			{
				"title" 	"Show Damage"
				"type"		"list"
				"1"			"sm_show_damage 1"
				"1."		"Enable"
                "1"			"sm_show_damage 0"
				"1."		"Disable"
			}
		}
adminmenu_sorting.txt
HTML Code:
/**
 * The default sorting is designed to look familiar to Mani's admin menu.
 * You may re-order items here for your own menu.  Any items not explicitly 
 * sorted will be sorted by their final translated phrases for each given client.
 */

"Menu"
{
	"PlayerCommands"
	{
		"item"		"sm_slay"
		"item"		"sm_slap"
		"item"		"sm_kick"
		"item"		"sm_ban"
		"item"		"sm_gag"
		"item"		"sm_burn"		
		"item"		"sm_beacon"
		"item"		"sm_freeze"
		"item"		"sm_timebomb"
		"item"		"sm_firebomb"
		"item"		"sm_freezebomb"
	}

	"ServerCommands"
	{
		"item"		"sm_map"
		"item"		"sm_execcfg"
		"item"		"sm_reloadadmins"
	}

	"VotingCommands"
	{
		"item"		"sm_cancelvote"
		"item"		"sm_votemap"
		"item"		"sm_votekick"
		"item"		"sm_voteban"
	}
    
    "Vip Menu"
	{
		"item"		"Show Damage"
	}
}
I have tried implementing it into the server, but when i press enable nothing happens.

Hope it help.
OZZI is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-04-2021 , 18:03   Re: Enable plugins for players with specific flag
Reply With Quote #7

We don't know your SourceMod plugins. It depends how plugin have made to work.

I have huge doubt that plugin what you are trying to use is not working like you wanted.
Guess is, sm_show_damage is console variable (cvar), and it work only from server console.
And it just enable/disable messages from all players.
- I could be wrong.

You need clarify more what you want exactly. Or what plugins you are using.
You maybe need as custom plugin for your purpose.


Anyway.
I demonstrate what you can do with SourceMod admin system.

admins.cfg
Spoiler


admin_groups.cfg
Spoiler


admin_overrides.cfg
Spoiler


adminmenu_custom.txt
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"
{
	"VIP Menu"
	{
		"admin" "vip_menu_access"

		"Show Damage"
		{
			"admin"	"vip_menu_access"
			"cmd"	"sm_showdamage @1"
			"1"
			{
				"title"	"Show Damage !!"
				"type"	"onoff"
			}
		}
		"Show Money"
		{
			"admin"	"vip_menu_money"
			"cmd"	"sm_showmoney @1"
			"1"
			{
				"title"	"Show Money !!"
				"type"	"onoff"
			}
		}
	}
}
adminmenu_sorting.txt
Code:
/**
 * The default sorting is designed to look familiar to Mani's admin menu.
 * You may re-order items here for your own menu.  Any items not explicitly 
 * sorted will be sorted by their final translated phrases for each given client.
 */

"Menu"
{

	"VIP Menu"
	{
		"item"		"Show Money"
		"item"		"Show Damage"
	}

	"PlayerCommands"
	{
		"item"		"sm_slap"
		"item"		"sm_slay"
		"item"		"sm_kick"
		"item"		"sm_ban"
		"item"		"sm_gag"
		"item"		"sm_burn"		
		"item"		"sm_beacon"
		"item"		"sm_freeze"
		"item"		"sm_timebomb"
		"item"		"sm_firebomb"
		"item"		"sm_freezebomb"
	}

	"ServerCommands"
	{
		"item"		"sm_map"
		"item"		"sm_execcfg"
		"item"		"sm_reloadadmins"
	}

	"VotingCommands"
	{
		"item"		"sm_cancelvote"
		"item"		"sm_votemap"
		"item"		"sm_votekick"
		"item"		"sm_voteban"
	}
}
But Custom admin menu have limitations tough.

Name:  Desktop Screenshot 2021.02.05 - 00.33.50.28.jpg
Views: 188
Size:  64.9 KB
__________________
Do not Private Message @me

Last edited by Bacardi; 02-04-2021 at 18:05.
Bacardi is offline
OZZI
Junior Member
Join Date: Feb 2021
Old 02-05-2021 , 13:09   Re: Enable plugins for players with specific flag
Reply With Quote #8

https://forums.alliedmods.net/showthread.php?t=318545

Here is the link to the plugin im using. Hope it helps.
OZZI is offline
Reply



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 01:37.


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