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

[ANY] No Admin Config


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Avo
Senior Member
Join Date: Apr 2012
Plugin ID:
3412
Plugin Version:
1.0
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Change configuration with or without admins
    Old 12-13-2012 , 22:57   [ANY] No Admin Config
    Reply With Quote #1

    [ANY] No Admin Config
    Version 1.0


    Description:
    Change configuration with or without admins. Useful for example to enable/disable Voting systems, Rock The Vote, Auto kick, ...

    Cvars:
    noadminconfig_version - plugin version
    noadminconfig_enabled - Enable No Admin Config (default 1)
    noadminconfig_adminflag - Admin Flags to watch (could be several) (default "k")
    noadminconfig_cfg_with - Config file to execute with admins (empty to disable) (default "sourcemod/noadminconfig_with.cfg")
    noadminconfig_cfg_without - Config file to execute without admins (empty to disable) (default "sourcemod/noadminconfig_without.cfg")
    noadminconfig_inform - Inform non-admins of config change (default 0)

    Installation:
    Create your with/without admins config files into cfg subdirectories. For example, default config file to execute with admins ("sourcemod/noadminconfig_with.cfg") would be actually in xxx/cfg/sourcemod/noadminconfig_with.cfg

    Versions History:
    • V1.0.0 (2012-12-14)
      • Initial Release
    Attached Files
    File Type: sp Get Plugin or Get Source (noadminconfig.sp - 1751 views - 5.1 KB)
    File Type: txt noadminconfig.phrases.txt (229 Bytes, 859 views)
    __________________

    Last edited by Avo; 12-13-2012 at 23:12.
    Avo is offline
    Sheepdude
    SourceMod Donor
    Join Date: Aug 2012
    Location: Chicago
    Old 01-02-2013 , 05:53   Re: [ANY] No Admin Config
    Reply With Quote #2

    Do not use convars for admin flags, as this bypasses the admin overrides system. Use CheckCommandAccess instead.
    __________________
    Sheepdude is offline
    Avo
    Senior Member
    Join Date: Apr 2012
    Old 01-02-2013 , 22:59   Re: [ANY] No Admin Config
    Reply With Quote #3

    I would for a simple admin command to check of course. But there isn't any command to check the access in this plugin, and it could be configure with several flags to check. So would really CheckCommandAccess be the fittest choice ?

    For the information, I used the same mechanism here than Anti-TK Manager, AFK Manager, and CS:S Team Balance, three well-known approved plugins, using it for the same reasons.
    __________________

    Last edited by Avo; 01-02-2013 at 23:00.
    Avo is offline
    Sheepdude
    SourceMod Donor
    Join Date: Aug 2012
    Location: Chicago
    Old 01-03-2013 , 02:30   Re: [ANY] No Admin Config
    Reply With Quote #4

    You make your own command name, such as "noadminconfig". It doesn't even have to be an actual command, just a text string that's unique to your plugin. This allows users to use the admin overrides system for your plugin.

    https://forums.alliedmods.net/showpo...39&postcount=3

    So yes, CheckCommandAccess is the fittest choice, even though both ways "work". And it's quite simple to implement.

    Code:
    if(CheckCommandAccess(client, "noadminconfig", ADMFLAG_VOTE, true))
    // Do stuff
    __________________
    Sheepdude is offline
    Avo
    Senior Member
    Join Date: Apr 2012
    Old 01-03-2013 , 07:54   Re: [ANY] No Admin Config
    Reply With Quote #5

    Ok thanks for the advice, I'll change it soon
    __________________
    Avo is offline
    Dr. McKay
    Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
    Join Date: Aug 2011
    Location: Atlantis
    Old 02-27-2013 , 22:43   Re: [ANY] No Admin Config
    Reply With Quote #6

    I think in this case a cvar is the best option. The overrides system doesn't allow you to specify multiple flags. If multiple flags are specified in the overrides system, the admin must have all flags in order for it to return true.
    __________________
    Dr. McKay 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 09:49.


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