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

Setting command flag from config


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
condolent
AlliedModders Donor
Join Date: Jan 2016
Location: gc_sLocation;
Old 08-16-2017 , 04:29   Setting command flag from config
Reply With Quote #1

Hi,
I've seen some plugins have in their config a section where you can set which flag is the servers' VIP-group and such.
I know that it's better to use command-override for commands instead of doing it in the config, but out of curiosity; how would I be able to set a commands' flag from a section of my config?

Example:
PHP Code:
ConVar cv_admFlag;
cv_admFlag CreateConVar("sm_plugin_adminflag""b""The flag required to execute admin commands for this plugin."FCVAR_NOTIFY);
RegAdminCmd("sm_mycommand"Command_MyCommandcv_admFlag); 
Getting the stringvalue of the flag obviously don't work since it's not a string parameter that's needed in the code.
So how can I do this??
__________________
condolent is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 08-16-2017 , 04:34   Re: Setting command flag from config
Reply With Quote #2

https://sm.alliedmods.net/new-api/admin/ReadFlagString
But as you said should't hardcode it in with CheckCommandAccess
hmmmmm is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-16-2017 , 12:35   Re: Setting command flag from config
Reply With Quote #3

- random admin with CVAR or RCON access
- change letters or remove from "sm_plugin_adminflag"
- end result ?

- using lot of plugins on server, which have coded to use admin letters to access into some features.
- you want deny one of those admin groups to not get feature from one plugin
- how would you then override admin access to that one certain plugin feature ?



Just learn to use CheckCommandAccess + admin configs|overrides
It's not hard.
It all work when not grant anyone with ROOT flag "z"
__________________
Do not Private Message @me

Last edited by Bacardi; 08-16-2017 at 12:37. Reason: My english is perfect
Bacardi 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 05:34.


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