AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] Class Target Filters (v1.3 - 2/7/14) (https://forums.alliedmods.net/showthread.php?t=214895)

ReFlexPoison 05-01-2013 00:59

[TF2] Class Target Filters (v1.3 - 2/7/14)
 
4 Attachment(s)
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

salsav91 05-01-2013 05:27

Re: [TF2] Class Targeting
 
Does this allow @!heavy So it effects everyone but the heavy class?

ReFlexPoison 05-01-2013 15:55

Re: [TF2] Class Targeting
 
Quote:

Originally Posted by salsav91 (Post 1943551)
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 05-05-2013 21:56

Re: [TF2] Class Targeting
 
Version 1.1

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

ReFlexPoison 10-05-2013 20:25

Re: [TF2] Class Target Filters
 
Version 1.2

Changes:
  • Added team specific target filters

WildCard65 02-07-2014 16:44

Re: [TF2] Class Target Filters
 
Seems like the filters are a bit reversed, @scouts targets anyone not a scout and @spies targets anyone not a spy.

ddhoward 02-07-2014 17:32

Re: [TF2] Class Target Filters
 
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

Root_ 02-07-2014 17:40

Re: [TF2] Class Target Filters
 
Use Tries and ignore first character (@) (and (!) if opposite), so strPattern[1] will return 'spies' instead of @spies and so on.

ReFlexPoison 02-07-2014 18:08

Re: [TF2] Class Target Filters
 
Quote:

Originally Posted by ddhoward (Post 2096968)
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.

Mitchell 02-26-2014 13:02

Re: [TF2] Class Target Filters (v1.3 - 2/7/14)
 
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.


All times are GMT -4. The time now is 17:56.

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