[Any] Dynamic Targeting
This plugin will NOT function correctly on servers where MaxClients is greater than 32.
sm_dtarget Command Usage:
This plugin is primarily geared toward server admins who really know what they are doing. The plugin provides a number of targeting filters which can each be configured with great flexibility. This allows admins to target EXACTLY who they want to target, all at once. This plugin will find its greatest use when being used in cfg files, rather than by typing out the command each time.
For example, let's say a TF2 server admin wanted to teleport the entirety of RED team to his crosshair with the sm_tele command, but wanted to EXCLUDE both himself, and his friend. The following would achieve that goal:
Code: /dtarget @prd1 @red - (@me + myFriend)
/tele @prd1The plugin provides:
These numbers cannot be changed without editing and recompiling the plugin.
- 10 static, private filters, numbered 0-9. EXAMPLE: @prs0
- 10 static, public filters, numbered 0-9. EXAMPLE: @pbs9
- 10 dynamic, private filters, numbered 0-9. EXAMPLE: @prd5
- 30 dynamic, public filters, numbered 0-29. EXAMPLE: @pbd29
- A matching "inverse" filter corresponding to each filter listed above. EXAMPLE: @!prs0
As shown above, each filter can be described as either static or dynamic, and as either private or public.
One quirk to be aware of is how "@me" works in public filters. In a static public filter, "@me" will always refer to the person who configured the filter. In a dynamic public filter, it will refer to the person who is currently using the filter to target players.
- A static filter will have an 's' after the pb/pr. A filter that is "static" is called so because its targets do not change once configured. Consider the following:
Code: sm_dtarget @pbs1 @deadThis will cause all players who are currently dead to be stored in the filter "@pbs1". The filter will continue to target these same players even after they respawn. Players who were alive when the filter was configured will NOT be targeted, even if they happen to be dead when the filter is used in a command. Once the filter is configured, the specific players it targets will not change until they either leave the game, or the filter is reconfigured.
- A dynamic filter will have a 'd' after the pb/pr. A filter that is "dynamic" is called so because its targets are recalculated every time the filter is used. Consider the following:
Code: /dtarget @prd2 @red - @meThe above command would cause the filter "@prd2" to target all players who are red, and exclude the command user. If a player switches to the blue team, he will no longer be targeted by that filter.
- A private filter will have a "pr" after the '@' and before the s/d. Private filters are called so because each player can independently configure his own filters. If AdminOne sets @prs1 to target a group of players, and AdminTwo sets @prs1 to target a different combination of players, AdminOne will still be able to use @prs1 to target the players that HE configured.
- A public filter will have a "pb" after the '@' and before the s/d. Public filters are the opposite of private filters, in that if AdminOne sets a public filter to target a combination of players, and then AdminTwo comes along and sets that SAME public filter to target a different combination of players, it will target the second combination for both of them.
A player cannot configure public filters without access to the override sm_dynamictargeting_changepublic (default access, generic), and cannot use these filters in other commands without access to sm_dynamictargeting_usepublic (default access, public.)
The syntax of the sm_dtarget is as follows:
Code: sm_dtarget @filter <targets>The first argument is simply the filter you wish to configure. @pbd4, @prs3, etc. Do not use the inverse "@!" filters here.
The rest of the command string is used to select players.
- Parenthesis are usable here, which will cause a given part of the string to be processed before others.
- Parenthesis can be nested within other parenthesis.
- When using a player's name, you should probably use quotation marks around the name. You NEED to use quotes if the name has a parenthesis character in it, or a space in it.
- Operators are as follows. With the exception of + and -, most would require basic knowledge of bitwise operators.
- | or +, which combines two groups into one. The bitwise OR.
- &, which selects only players who would be targeted by BOTH terms around the &. This is the bitwise AND.
- ^, which selects only players who would be targeted by ONLY ONE of the terms around the ^. Not zero, not both, just one. This is the bitwise XOR.
- !&, the bitwise NAND.
- !^, the bitwise XNOR
- !|, the bitwise NOR.
- -, which will return players who are in the first operand, but not in the second.
- Enable the ability to use the NOT operator (~, !) when configuring a filter.
- Enable use of the plugin on servers with more than 32 player slots
- Enable use of a cfg file that would auto-populate the dynamic public filters with a given string on boot
- Enable changing of the amount of filters through cvars, rather than through edit/recompile
- Enable customization of what each filter "group" is named.
- Video demonstration.
- sm_dynamictargeting_logging 1 - Controls how command usage is logged.
- 0 : Completely disables logging.
- 1 : Enables basic logging. The logs will show when a filter is configured, and also the filter string used to configure it.
- 2 : Enables semi-basic logging. The logs will show all of the above, as well as show a list of who exactly static filters were configured to target.
- 3 : Enables verbose logging. The logs will show all of the above, but also show a list of who exactly was targeted by a dynamic filter, every time it's used.
- sm_dynamictargeting_update 2 - Controls Updater compatibility
- 0 : Completely disables Updater integration
- 1 : Updater will notify you in Updater.log if an update becomes available.
- 2 : Updater will automatically download any updates. They will be installed on the next server start or map change.
- 3 : Updater will automatically download and immediately install any updates. This WILL interfere stored filters!
To install, simply ensure that your Sourcemod installation is up to date, and place the attached SMX in your plugins folder.
Please also consider installing Updater. This will let you automatically keep your plugins up-to-date. Updater is NOT required for Dynamic Targeting to function.
The plugin requires custom includes. As such, it does not compile here on the forums. Includes required to compile the plugin are:
- 15.1025 - Initial release, first post of this thread.
Wyświetl pełny artykuł