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

[CS:GO] Restricted Commands


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Gdk
Member
Join Date: Oct 2014
Plugin ID:
4950
Plugin Version:
Plugin Category:
General Purpose
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Plays a negative sound when players type a restricted command
    Old 12-10-2015 , 12:59   [CS:GO] Restricted Commands
    Reply With Quote #1

    Description:

    Everyone knows that valve has restricted use of some plugins, yet people always type !knife, !skins, etc. This plugin has the option to play a game sound and or display a message when players type a restricted command.

    Commands to restrict are read from: addons/sourcemod/configs/restricted_commands.ini

    Messages are read from: addons/sourcemod/translations/restrictedcommands.phrases.txt

    Cvars:

    1. sm_restricted_commands_enabled: Enables or disables the plugin (Default: 1)
    2. sm_restricted_commands_message_enabled: Enables or disables sending a message (Default: 1)
    3. sm_restricted_commands_sound: Sound to be played (Default: random)
    4. sm_restricted_commands_sound_enabled: Enables or disables playing a sound (Default: 1)
    5. sm_restricted_commands_admin_flag: Do not display message and sound to admins with this flag. Valid flags: any, abcdefghijkmnzop (Default: any)
    6. sm_restricted_commands_block_chat: Whether to block restricted commands in chat (Default: 1)

    Sound:

    By default plays a random negative sound from selected bot radio sounds.

    To change the sound change sm_restricted_commands_sound

    Examples:
    error.wav
    /buttons/weapon_cant_buy.wav
    /player/vo/fbihrt/radiobotreponsenegative09.wav

    More game sounds can be found using gcfscape

    Base path is the sound folder (ie csgo/sound/)

    To Do (maybe lol):

    Add color
    More translations

    Download:

    https://github.com/RavageCS/Restricted-Commands
    Attached Files
    File Type: zip Restricted-Commands.zip (16.6 KB, 147 views)

    Last edited by Gdk; 03-03-2022 at 08:02.
    Gdk is offline
    supreeda
    Senior Member
    Join Date: Jul 2015
    Old 12-12-2015 , 13:15   Re: [CS:GO] Restricted Commands
    Reply With Quote #2

    n1 ! for this

    but i think you must edit when they dont have permission sound will play ^^

    it very cool if you can do !

    Last edited by supreeda; 12-12-2015 at 13:16.
    supreeda is offline
    Gdk
    Member
    Join Date: Oct 2014
    Old 12-13-2015 , 13:36   Re: [CS:GO] Restricted Commands
    Reply With Quote #3

    Sorry I dont understand what you mean
    Gdk is offline
    sneaK
    SourceMod Moderator
    Join Date: Feb 2015
    Location: USA
    Old 12-13-2015 , 14:25   Re: [CS:GO] Restricted Commands
    Reply With Quote #4

    Quote:
    Originally Posted by Gdk View Post
    Sorry I dont understand what you mean
    I think he means if you don't have access to a restricted command (for example, a normal user who tries to access sm_admin)
    __________________
    sneaK is offline
    Gdk
    Member
    Join Date: Oct 2014
    Old 12-13-2015 , 15:04   Re: [CS:GO] Restricted Commands
    Reply With Quote #5

    Quote:
    Originally Posted by blackhawk74 View Post
    I think he means if you don't have access to a restricted command (for example, a normal user who tries to access sm_admin)
    Should be easy enough. I can do this and add a cvar to enable it.
    Gdk is offline
    Gdk
    Member
    Join Date: Oct 2014
    Old 12-15-2015 , 10:05   Re: [CS:GO] Restricted Commands
    Reply With Quote #6

    Eh, wasnt as easy as i thought it would be. I had trouble with CheckCommandAccess Function. CheckCommandAccess Function doesnt seem to work even in the default plugin adminhelp.smx. If I am understanding correctly it is supposed to only show the client commands they have flags and thus access to use, but it instead shows all commands.

    Code:
    while (ReadCommandIterator(CmdIter, Name, sizeof(Name), Flags, Desc, sizeof(Desc)))
    {
    	if ((StrContains(Name, arg, false) != -1) && CheckCommandAccess(client, Name, Flags))
    	{
    		PrintToConsole(client, "[%03d] %s - %s", i++, Name, (Desc[0] == '\0') ? NoDesc : Desc);
    	}
    }
    Gdk is offline
    supreeda
    Senior Member
    Join Date: Jul 2015
    Old 12-15-2015 , 22:02   Re: [CS:GO] Restricted Commands
    Reply With Quote #7

    Quote:
    Originally Posted by blackhawk74 View Post
    I think he means if you don't have access to a restricted command (for example, a normal user who tries to access sm_admin)
    ty for explan


    Quote:
    Originally Posted by Gdk View Post
    Eh, wasnt as easy as i thought it would be. I had trouble with CheckCommandAccess Function. CheckCommandAccess Function doesnt seem to work even in the default plugin adminhelp.smx. If I am understanding correctly it is supposed to only show the client commands they have flags and thus access to use, but it instead shows all commands.

    Code:
    while (ReadCommandIterator(CmdIter, Name, sizeof(Name), Flags, Desc, sizeof(Desc)))
    {
    	if ((StrContains(Name, arg, false) != -1) && CheckCommandAccess(client, Name, Flags))
    	{
    		PrintToConsole(client, "[%03d] %s - %s", i++, Name, (Desc[0] == '\0') ? NoDesc : Desc);
    	}
    }
    Yea nice
    supreeda is offline
    Gdk
    Member
    Join Date: Oct 2014
    Old 01-18-2016 , 10:01   Re: [CS:GO] Restricted Commands
    Reply With Quote #8

    Added a couple things, using github only now for better organizing.

    Last edited by Gdk; 01-18-2016 at 10:02.
    Gdk is offline
    nguyenbaodanh
    AlliedModders Donor
    Join Date: Jun 2007
    Location: HCMC, Vietnam
    Old 06-27-2017 , 06:24   Re: [CS:GO] Restricted Commands
    Reply With Quote #9

    Add a bypass flag for admin please!
    __________________
    nguyenbaodanh is offline
    Gdk
    Member
    Join Date: Oct 2014
    Old 07-12-2017 , 18:52   Re: [CS:GO] Restricted Commands
    Reply With Quote #10

    Quote:
    Originally Posted by nguyenbaodanh View Post
    Add a bypass flag for admin please!
    I'm working on some other plugins first, but I will update this
    Gdk 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 15:07.


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