Page 1 of 1

[SourceMod] Model Reservation 1.0.1.1

Posted: Tue May 31, 2011 3:47 pm
by TESLA-X4
Just thought I'd throw this together for the sake of anyone who wanted to restrict the use of certain models to a particular group of people, for whatever reason. Basically, the use of certain models can be restricted to a list of Steam IDs (on a per-model basis). Any player not in the whitelist for that model will be forced to switch back to a default model again and issued a warning (changeable to a kick or ban via a ConVar). Adding or removing of reserved models can be done via commands or by hand-editing the config file (not recommended unless you've studied the source to see the format of the file). Models can be associated with non-admin players, but this must first be done by an admin with appropriate privileges.

Configuration:
/sourcemod/data/modelreserve.txt: Automatically generated on initial plugin load, use it to configure which models to reserve, then reload it with the console command 'sm_modelreservation_reload'. (Keyvalues format, only edit this if you know what you're doing!)

Commands & Console Variables:
sm_reservemodel - Reserves your current model for use by yourself (requires 'Cheats' admin flag).
sm_reservemodelid <Steam ID> <full model path> - Reserves the specified model for use by the specified Steam ID (requires both 'Cheats' and 'Rcon' admin flag).
sm_unreservemodel <model path as listed in keyvalues (server only)> - This is a dynamic command that operates differently depending on whether it is entered into the server console or a client's console. Server console: Unreserves the specified model from all clients, making it public again. Client console: Unreserves your current model from only yourself, others reserving the model remain unaffected. (requires 'Cheats' admin flag).
sm_unreservemodelid <Steam ID> <full model path> - Unreserves the specified model from the specified Steam ID (requires both 'Cheats' and 'Rcon' admin flag).

sm_modelreservation_reload
sm_modelreserve_reload
sm_reservemodel_reload
Aliased server-side console commands to force a reload of the Model Reservation config file.

sm_modelreservation_action - Action to perform on a client who attempts to use a reserved model unsuccessfully. (0 = kick, 1 = ban), defaults to 0.
sm_modelreservation_maxstrikes - Number of strikes a player can get before the action specified by 'sm_modelreservation_action' is performed (-1 to disable), defaults to 5.
sm_modelreservation_banduration - Sets the ban duration for offending players (only applicable if 'sm_modelreservation_action' is 2, use 0 for a permanent ban but, really, that's unnecessarily harsh!), defaults to 5.

Dependencies:
None.

Installation:
- Place modelreservation.smx into the /sourcemod/plugins directory.
- Place modelreservation.phrases.txt into the /sourcemod/translations directory. (Don't forget to install the translations for other languages as well!)

Changelog:

Code: Select all

Version 1.0.1.1
-----------------------
+ Added exploit fix for illegal model changing

Version 1.0.1
-----------------------
! Fixed players potentially getting set to default models of the incorrect gender upon denial
! Fixed incorrect command description for command sm_unreservemodelid
! Removed 'Rcon' admin flag requirement for command sm_unreservemodel
! Changed command sm_unreservemodel to work in two modes:
  - Entered into the server console, it requires a model to be specified (and removes ALL Steam ID entries for that model, similar to how it worked back in 1.0.0)
  - Entered into a client's console, it always uses the client's current model instead (no support for manual model specification)
- Removed 'warn' option from ConVar sm_modelreservation_action (set sm_modelreservation_maxstrikes to -1 instead for the same effect)
+ Added 'strikes' system, controlled by a new ConVar sm_modelreservation_maxstrikes
+ Added new command aliases sm_modelreserve_reload and sm_reservemodel_reload
+ Added Japanese translations (thanks, Snowman7!)

Version 1.0.0
-----------------------
Initial release
Notes:
In case you haven't already noticed, this is a plugin for server operators, not clients.

Known Bugs/Limitations/Future Improvements:
- Only model paths that begin with models/player/ are supported.
- An alternate mode to permit non-admins to reserve their model (and only if they can actually use it; might not be implemented due to concerns regarding abuse).
- Per-model configuration of actions to be taken on clients who attempt to use the model unsuccessfully.

Download:
Get Plugin or Get Source
Browse all released versions here.

P.S.: I understand that this plugin may be rather controversial, therefore, please feel free to delete this thread if it is deemed inappropriate. Guess that's not necessary, after all. Image

Re: [SourceMod] Model Reservation 1.0.0

Posted: Tue May 31, 2011 4:08 pm
by MaestraFĂ©nix
Perfect. This will end the controversy that i have with a model. Thanks Tesla :3

Re: [SourceMod] Model Reservation 1.0.0

Posted: Tue May 31, 2011 4:41 pm
by Baddtraxx
interesting o_ o

Re: [SourceMod] Model Reservation 1.0.0

Posted: Tue May 31, 2011 4:50 pm
by Shana
TESLA-X4 wrote: P.S.: I understand that this plugin may be rather controversial, therefore, please feel free to delete this thread if it is deemed inappropriate.
No, this is perfect, thanks!

Re: [SourceMod] Model Reservation 1.0.0

Posted: Wed Jun 01, 2011 1:13 pm
by Keychain
This is more useful than you think it is. Trust me on this one.

Re: [SourceMod] Model Reservation 1.0.1

Posted: Sun Jun 05, 2011 12:04 pm
by TESLA-X4
The plugin has been updated, please see the first post for details.