[TF2] Session Flags
v. 14.0829.0
"Selling noclip 4 1 rec hurhurhur"
Command Usage:
Spoiler
The syntax of the command is as follows:
Code: sm_flags <target> <+/-/%/=/_> <flags>
- The first argument is simply the clients that you want to use the command on. The plugin uses ProcessTargetString, and therefore supports targeting by name, SteamID, userID, @all, @!me, etc.
- The second argument is the operator. This tells the plugin what you want to do with the specified flags. More on this later. If you skip this argument and go right on to the third one, the plugin will assume that you meant to put a + symbol.
- The third argument is simply a list of flags that you want to affect. With one exception, the command user can never affect a flag that he himself does not have access to, nor can he target those with a higher immunity. (Of course, root users are considered to have all flags and are always exempt from immunity restrictions.) Rather than type out all 21 flag letters, you can type the @ symbol here to quickly indicate that you wish to affect all flags.
- + adds the flags specified. For example, if someAdmin used this command:
Code: sm_flags somePlayer + abcdefgThe above command would give the somePlayer player the a, b, c, d, e, f, and g flags. If somePlayer already had one of those flags, that flag is not touched. Further, if the command user doesn't himself have access to one of those flags, then the flag will not be changed for somePlayer.
If you leave off the operator from the command, and instead put flags right after the target argument, the plugin will assume that you want to add flags. - - removes the flags specified. For example:
Code: sm_flags somePlayer - @The above command would remove all flags from somePlayer, leaving him with no flags. If somePlayer had flags that someAdmin did not, somePlayer will keep those flags.
- % toggles the flags specified. For example:
Code: sm_flags somePlayer % opqrstThe above command would toggle all the CUSTOM# flags on somePlayer. The flags he had, he will no longer have, and he will gain the flags he did have. If someAdmin did not have access to one of these flags, then that flag will not be changed for somePlayer.
- = sets the flags on the target user to whatever has been specified. For example:
Code: sm_flags somePlayer = aopqrstThe above command would first remove all flags from somePlayer that someAdmin also had access to, and then give somePlayer the reserved slot and all CUSTOM# flags, assuming that someAdmin also had access to these flags.
When using this operator, putting "0" for the flags will indicate that you want to remove all flags; this is the same as using @ with - - _ resets the flags on the target user to how they were just before this command was first used on them.
For example, let's say that somePlayer joins the server with the flags "abcopqr". Whenever any admin uses one of the previous operators on somePlayer, the plugin will save his "real" flags before changing them. Let's say that admins had somehow used any combination of the previous operators to remove all flags but 'a' from him, and then give him 's' and 't'.
Code: sm_flags somePlayer = astThe following command would restore somePlayer's flags to "abcopqr".
Code: sm_flags somePlayer _ @Similarly, running the following command instead would remove only the 's' flag, and restore somePlayer's access to the 'b' flag.
Code: sm_flags somePlayer _ bsIf, and only if, someAdmin has access to the override sm_sessionflags_reset, he can use the _ operator to reset flags that he himself does not have access to. By default, this feature is basically disabled, as the override defaults to ROOT access.
If this command is used (through ANY operator) to change a player's flags, and his flags end up matching what was saved as his "real" flags, then the plugin will "forget" that his flags were ever changed at all. This will allow other plugins to change flags without too much conflict.
- sm_sessionflags_logging 2 - Controls how command usage is logged.
- 0 : Completely disables logging.
- 1 : Enables basic logging. If targeting a single player, the logs will show detailed information about what changes were made to that player's flags. If multiple players were targeted, this information is not shown.
- 2 : Enables verbose logging. The logs will show a seperate line for each player who had their flags changed, with information about what flags were changed.
- sm_sessionflags_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 with the _ operator, as all players' saved flags will be cleared!
Compiling: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.
ChangelogThe plugin requires custom includes. As such, it does not compile here on the forums. Includes required to compile the plugin are:
Spoiler
- 2013-11-30 - Original version posted by NIGathan
- 14.0829.0 - Initial release, first post of this thread.
If you like what you see here, please consider donating~
Attached Files sessionflags.smx (8.6 KB) Get Plugin or Get Source (sessionflags.sp - 10.7 KB)
Wyświetl pełny artykuł