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

Triggers


Post New Thread Reply   
 
Thread Tools Display Modes
Author
theY4Kman
Join Date: Jun 2007
Location: Yak
Plugin ID:
285
Plugin Version:
2.3.0
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    27 
    Plugin Description:
    Adds commandlist.txt functionality (From Mani) to SourceMod
    Old 02-15-2008 , 18:22   Triggers
    Reply With Quote #1

    To remedy FS#1059, I created this plugin. It does the same exact thing as commandlist.txt does for Mani Admin Plugin. EDIT: This plugin now offers more advanced features than Mani's commandlist.txt, such as variables and multiple flags.

    You create a commandlist.txt (or commandlist.cfg) file in your sourcemod/configs directory and enter the commands.

    I have written down all the instructions in the default commandlist.txt, which you can find in the archive files, or look at the copy and paste here:
    Code:
    // Triggers configuration file 
    //       by theY4Kman 
    // 
    // So, here's the rundown! 
    // Commands are entered using the format "<command> <flags> <replacement>" 
    //  
    // For example: 
    //    die C kill 
    //  
    // When the player types "die" into chat, it will run "kill" on them, 
    // forcing them to suicide. 
    // 
    // Here are the core flags (One needs at least one of these flags to do anything): 
    //  R - Rcon command 
    //      To run this, the user must have Rcon or Root access 
    //  C - Client command 
    //      Run on the player 
    //      Note: only commands with FCVAR_SERVER_CAN_EXECUTE will run 
    //  F - Fake client command 
    //      Runs a networked command as if a player had done it 
    //  S - Fake client say command 
    //      Convenience flag that runs a fake client command with "say" in front of it 
    //      So "hi S Hi!" is the same as "hi F say Hi!" 
    //  
    // These next flags are optional: 
    //  v - No variables (Disables the parsing of variables) 
    //      "hi S Hi, I'm %n!" will actually display "Hi, I'm %n!" 
    //  d - Do not display the player's message
    //  f - Begins a block denoting the flags necessary to run the trigger.
    //      After the letter, a block beginning with '{' and ending with '}' will contain
    //      admin flags required for this trigger. For example:
    //         "kick Rf{c} sm_kick"
    //      This will let any admin with the kick admin flag execute this trigger.
    //      If this flag is left out, Triggers will use the admin flags in the cvar "triggers_rcon"
    //      If one wishes to simply have a command without permissions, use a lone 'f' character.
    //         e.g., "killme Rf sm_slay %n" is the same as "killme Rf{} sm_slay %n" 
    // 
    // Yes, there are variables in this, if only a few. 
    // The variables are in C-type format, meaning they are a percent sign followed by a single character: 
    //  %i - The IP of the server 
    //  %s - The Steam ID of the player whom triggered the command 
    //  %n - The name of the player whom triggered the command 
    //  %u - The user ID of the player whom triggered the command 
    //  %h - The hostname of the server
    //  %c - Begins a custom ConVar block.
    //       This allows one to access ConVars besides "ip" and "hostname"
    //       To utilize it, use the same syntax as for the `f` flag:
    //          %c{convar_name}
    // To display a literal '%', prepend it with a backslash ('\') 
    // 
    // The only comment type available is the single line comment. 
    // To use it, place "//" IN FRONT OF THE LINE. It will not work anywhere else 
    // 
    // Note: For chat messages, the longest a message can be is 127 characters long. 
    //       This includes players' names, hostname, etc!
    Notes:
    • 'message' can currently only be one word -- I don't see this changing in the future. It's unnecessary most of the time, and would require work. Work. THIS IS AN OUTRAGE!
    Commands/Cvars:
    • triggers_version: The version of Triggers
    • triggers_reload: Clears the commandlist in memory and loads a new one. You can specify a filename to use for loading by calling it by "triggers_reload file"
    • triggers_rcon: The SourceMod Admin flags that allow someone to run an Rcon command. The person must have at least one of the flags (Flag reference here). (v2.2.0: This convar can be overridden on a per-trigger basis)
    Changelog:
    • 1.0.0
      * Initial upload
      * Basic functionality: Run a command when something is said
    • 1.1.0
      * Bug fix: Added 'F' and 'S' flags for fake client commands.
    • 1.2.0
      * Bug fix: Fixed the permission issues
    • 2.0.0
      * Multiple flags for each command
      * Variables
    • 2.1.0
      * triggers_rcon convar, allowing for custom access to Rcon triggers.
    • 2.1.1
      * Fixed command replacement parsing.
    • 2.2.0
      * Per-trigger RCON permissions
    • 2.2.1
      * Fixed per-trigger RCON permissions to allow empty permissions.
    • 2.3.0
      * Added custom ConVar variable
      * Added user ID variable
    teame06 is dumb

    Comments? Suggestions? REQUESTS? Tell me!
    Attached Files
    File Type: sp Get Plugin or Get Source (triggers.sp - 3278 views - 13.7 KB)
    File Type: rar triggers.7z.rar (10.7 KB, 1288 views)
    File Type: zip triggers.zip (11.4 KB, 1964 views)
    __________________
    http://y4kstudios.com
    Is that loud enough? Oh, while I have you, check out Viper.

    Last edited by theY4Kman; 09-19-2008 at 23:19. Reason: New version: 2.3.0
    theY4Kman is offline
    Send a message via ICQ to theY4Kman Send a message via AIM to theY4Kman Send a message via MSN to theY4Kman Send a message via Yahoo to theY4Kman Send a message via Skype™ to theY4Kman
    Extreme_One
    Veteran Member
    Join Date: Nov 2006
    Old 02-15-2008 , 19:12   Re: Triggers
    Reply With Quote #2



    This will be cool

    Thank you.

    Quick Query:

    If I did this:

    Code:
    !url C say /? url
    Client types !url and that would trigger the client to say /? url

    Or would I need to do:

    Code:
    !url C say "/? url"
    or maybe

    Code:
    !url C "say /? url"
    I just want to make sure I get the syntax correct. ;)
    __________________

    Last edited by Extreme_One; 02-15-2008 at 19:19.
    Extreme_One is offline
    theY4Kman
    Join Date: Jun 2007
    Location: Yak
    Old 02-15-2008 , 20:09   Re: Triggers
    Reply With Quote #3

    They all would work.

    The plugin parses the config by finding the first space, then selecting all the text behind it for the message. Next, it takes the letter after that first space for the type. Finally, it takes all of the text after the space behind the type character for the command. So...
    Code:
    !url C say /? url
    !url C "say /? url"
    !url C say "/? url"
    ...all do the same exact thing.
    __________________
    http://y4kstudios.com
    Is that loud enough? Oh, while I have you, check out Viper.
    theY4Kman is offline
    Send a message via ICQ to theY4Kman Send a message via AIM to theY4Kman Send a message via MSN to theY4Kman Send a message via Yahoo to theY4Kman Send a message via Skype™ to theY4Kman
    Extreme_One
    Veteran Member
    Join Date: Nov 2006
    Old 02-16-2008 , 05:10   Re: Triggers
    Reply With Quote #4

    Thanks theY4Kman
    __________________
    Extreme_One is offline
    Extreme_One
    Veteran Member
    Join Date: Nov 2006
    Old 02-16-2008 , 15:44   Re: Triggers
    Reply With Quote #5

    This has quite limited use

    Code:
    !url C say /? url
    Code:
    Extreme_One's Σvîl †ŵiή :  !url
    FCVAR_SERVER_CAN_EXECUTE prevented server running command: say
    __________________
    Extreme_One is offline
    theY4Kman
    Join Date: Jun 2007
    Location: Yak
    Old 02-16-2008 , 16:35   Re: Triggers
    Reply With Quote #6

    I shall fix it when I get home.

    Yeah, it's more of an announcement for anyone else using the plugin
    __________________
    http://y4kstudios.com
    Is that loud enough? Oh, while I have you, check out Viper.
    theY4Kman is offline
    Send a message via ICQ to theY4Kman Send a message via AIM to theY4Kman Send a message via MSN to theY4Kman Send a message via Yahoo to theY4Kman Send a message via Skype™ to theY4Kman
    Extreme_One
    Veteran Member
    Join Date: Nov 2006
    Old 02-16-2008 , 17:45   Re: Triggers
    Reply With Quote #7

    Quote:
    Originally Posted by theY4Kman View Post
    I shall fix it when I get home.

    Yeah, it's more of an announcement for anyone else using the plugin

    yeah the fix will be great
    __________________
    Extreme_One is offline
    theY4Kman
    Join Date: Jun 2007
    Location: Yak
    Old 02-18-2008 , 00:11   Re: Triggers
    Reply With Quote #8

    The new version is up! It still doesn't have multi-word functionality for the message, but I think I'll program that in only when someone needs it. Yeah, screw you; I'm lazy. I want to play TF2.
    __________________
    http://y4kstudios.com
    Is that loud enough? Oh, while I have you, check out Viper.
    theY4Kman is offline
    Send a message via ICQ to theY4Kman Send a message via AIM to theY4Kman Send a message via MSN to theY4Kman Send a message via Yahoo to theY4Kman Send a message via Skype™ to theY4Kman
    Extreme_One
    Veteran Member
    Join Date: Nov 2006
    Old 02-18-2008 , 15:14   Re: Triggers
    Reply With Quote #9

    Nice one.

    Thanks for the update.
    __________________
    Extreme_One is offline
    Rebell
    Veteran Member
    Join Date: Nov 2004
    Location: GERMANY
    Old 02-19-2008 , 02:40   Re: Triggers
    Reply With Quote #10

    GOODY ^^
    __________________
    Rebell 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 06:55.


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