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

[TF2] Class Target Filters (v1.3 - 2/7/14)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Plugin ID:
3636
Plugin Version:
1.3
Plugin Category:
Admin Commands
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    97 
    Plugin Description:
    Add target filters for TF2 classes
    Old 05-01-2013 , 00:59   [TF2] Class Target Filters (v1.3 - 2/7/14)
    Reply With Quote #1

    Class Target Filters

    Description:
    Add target filters for TF2 classes. No control variables required. Straight forward plugins +
    Examples: (See full list below)
    • sm_beacon @heavies (Beacons all heavies)
    • sm_slay @!demos (Slays all but demos)
    • sm_noclip @scouts (Enables noclip on all scouts)
    Target Filters:

    Version Log:
    • Version 1.3 (2/7/14)
      • Fixed opposite target filters
      • Now properly unloads target filters upon plugin unload
    • Version 1.2
      • Added team specific target filters
    • Version 1.1
      • Added @!class targeting to select all but that specific class
      • Added @demomen
    • Version 1.0
      • Initial Release
    My Plugins
    intox Gaming
    Attached Files
    File Type: sp Get Plugin or Get Source (classtargeting.sp - 17874 views - 26.5 KB)

    Last edited by ReFlexPoison; 02-07-2014 at 18:08. Reason: 1.3
    ReFlexPoison is offline
    salsav91
    Senior Member
    Join Date: Aug 2012
    Location: Where Lollichops sleep
    Old 05-01-2013 , 05:27   Re: [TF2] Class Targeting
    Reply With Quote #2

    Does this allow @!heavy So it effects everyone but the heavy class?
    __________________


    Check out my pony animations. http://www.youtube.com/salsav91
    salsav91 is offline
    ReFlexPoison
    ☠☠☠
    Join Date: Jul 2011
    Location: ☠☠☠
    Old 05-01-2013 , 15:55   Re: [TF2] Class Targeting
    Reply With Quote #3

    Quote:
    Originally Posted by salsav91 View Post
    Does this allow @!heavy So it effects everyone but the heavy class?
    Only if sourcemod creates opposite multi target systems when one is created. I'll check when I get home.
    ReFlexPoison is offline
    ReFlexPoison
    ☠☠☠
    Join Date: Jul 2011
    Location: ☠☠☠
    Old 05-05-2013 , 21:56   Re: [TF2] Class Targeting
    Reply With Quote #4

    Version 1.1

    Changes:
    • Added @!class targeting to select all but that specific class
    • Added @demomen

    Last edited by ReFlexPoison; 10-05-2013 at 20:26.
    ReFlexPoison is offline
    ReFlexPoison
    ☠☠☠
    Join Date: Jul 2011
    Location: ☠☠☠
    Old 10-05-2013 , 20:25   Re: [TF2] Class Target Filters
    Reply With Quote #5

    Version 1.2

    Changes:
    • Added team specific target filters
    ReFlexPoison is offline
    WildCard65
    Veteran Member
    Join Date: Aug 2013
    Location: Canada
    Old 02-07-2014 , 16:44   Re: [TF2] Class Target Filters
    Reply With Quote #6

    Seems like the filters are a bit reversed, @scouts targets anyone not a scout and @spies targets anyone not a spy.
    WildCard65 is offline
    ddhoward
    Veteran Member
    Join Date: May 2012
    Location: California
    Old 02-07-2014 , 17:32   Re: [TF2] Class Target Filters
    Reply With Quote #7

    You may also want to replace some strings in the StrContains functions:
    Spoiler

    also

    Code:
    	new bool:bOpposite;
    	if(StrContains(strPattern, "!") == -1)
    		bOpposite = true;
    As I'm sure you're already aware, StrContains returns -1 if the string was NOT found. So you're setting bOpposite to true if ! was NOT in the @filter.



    I find it a little bit ridiculous that the plugin has been downloaded 70 times with NO ONE ELSE reporting these errors over the last 4 months until WildCard chimed in.

    Also, you should add this to OnPluginEnd(). Unlike most other things, Sourcemod does NOT seem to automatically handle this when a plugin is unloaded.

    Spoiler
    __________________

    Last edited by ddhoward; 02-07-2014 at 17:44.
    ddhoward is offline
    Root_
    Veteran Member
    Join Date: Jan 2012
    Location: ryssland
    Old 02-07-2014 , 17:40   Re: [TF2] Class Target Filters
    Reply With Quote #8

    Use Tries and ignore first character (@) (and (!) if opposite), so strPattern[1] will return 'spies' instead of @spies and so on.
    __________________


    dodsplugins.com - Plugins and Resources for Day of Defeat
    http://twitch.tv/zadroot
    Root_ is offline
    ReFlexPoison
    ☠☠☠
    Join Date: Jul 2011
    Location: ☠☠☠
    Old 02-07-2014 , 18:08   Re: [TF2] Class Target Filters
    Reply With Quote #9

    Quote:
    Originally Posted by ddhoward View Post
    As I'm sure you're already aware, StrContains returns -1 if the string was NOT found. So you're setting bOpposite to true if ! was NOT in the @filter.

    Also, you should add this to OnPluginEnd(). Unlike most other things, Sourcemod does NOT seem to automatically handle this when a plugin is unloaded.
    I released this plugin with relatively no testing, thanks for catching that. Updated with the above changes.

    Last edited by ReFlexPoison; 02-07-2014 at 18:09.
    ReFlexPoison is offline
    Mitchell
    ~lick~
    Join Date: Mar 2010
    Old 02-26-2014 , 13:02   Re: [TF2] Class Target Filters (v1.3 - 2/7/14)
    Reply With Quote #10

    I ended up making a new fork of this (not official)
    I have yet to test any of it, but it compiles (good enough right?)
    I've named it to Super Targeting, since ive used your code as a base (which has barely any of it left) i'm asking you if you want to convert this thread into that, or if you would rather start a new thread.
    After i get to do the testing for this plugin it should be able to have things added on, hence the 'super' in "Super Targeting".
    There is a config for server operators to add onto, right now it has 278 filters in it. There is little to no documentation on how the config is setup, i will soon be adding onto that. The idea is solid and would make your plugin obsolete. And honestly I didn't like how most of this was hard-coded into the plugin, giving operators no control over what filters they actually want, or even use.
    But anyways, the Repo is over here: https://bitbucket.org/MitchDizzle/super-targeting feel free to check it out. Once i test it either by tommorrow it will be read for a release.

    Run-Down of Super Targeting Features:
    This plugin allows a simple config to be added and server operators are allowed to customize how the filters work. If you wanted to add a filter such as @ihateeveryone to filter everybody it's possible! or if you wanted to define @ihateblue to target all blue players you could do that also. If you would like to customize the message that is outputted that is possible too! So say you define @custom to have a message of 'all players in my custom filter' it would print out "Admin: targeted all players in my custom filter', or depending on the plugin that uses the process string, etc.
    Mitchell 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 14:58.


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