View Single Post
Author Message
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 08-13-2011 , 22:19   [TF2] Model Manager 1.0.4 (08/03/2013)
Reply With Quote #1

Allows players to equip custom models. Let's not get Valve to shut this down, now, shall we?

Thanks to Damizean, this is basically his TF2 Equipment Manager plugin except with a model changer instead of a hat equipper.
Thanks to Sazpaimon for model conversion research.
Thanks to Pimpinjuice for reskin conversion research.

Small update 1.0.4 on 08/03/2013 to prevent errors (and to enforce the MAX_ITEMS limit, which is there so that you are less likely to get precache table overflows) and help determine how many models are loaded when you use tf_models_reload. Only the smx and sp files changed.

UPDATED 07/30/2013. All four files were changed. I'd suggest renaming tf/cfg/sourcemod/TF2_ModelManager.cfg to something else, finding the newly generated (lowercase) one after loading up the plugin (delete the file then restart the server else you'll just get the same old file you just renamed), then putting in whatever settings from the old one.

Cvars
  • tf_models_admin - Removed this cvar.
  • tf_models_admin_flags - Having one of these flags marks you as an administrator, for the ADMIN_DEFAULT item flag and for immunity to the lock command.
  • tf_models_admin_override - Clients with access to the "tf_models_admin_override_access" override (see the "admin overrides" link above) will see all the models in the list, rather than just the ones usable with their current class/team.
  • tf_models_announce - Announces usage and tips about equippable models.
  • tf_models_announce_plugin - Announces information of the plugin when joining.
  • tf_models_force_admins - Forces the default model for admin users (ADMIN_DEFAULT).
  • tf_models_force_users - Forces the default model for common users (USER_DEFAULT).
  • tf_models_delayonspawn - Amount of time to wait to re-equip a model after spawn. Apparently for compatibility with old melee plugins
  • tf_models_blocktriggers - Hides the chat (!mm) plugin triggers, so that when clients type them they don't show up in chat.
  • tf_models_list - Change the config file used to make the item list. Useful if you want to have a different set of models for each map. Files for this go in addons/sourcemod/configs/tf2modelmanager/.
Commands:
  • tf_models - Shows the model management menu. Set an admin override for this to control access to the model menu.
  • equip, mm, em, equipmodels - Aliases for tf_models, these obey the tf_models override.
  • tf_models_equip <target> <name> - Forces to equip a model onto a client. Don't need quotes around <name>, and it searches for a model in the list. Exact matches come first, then if more than one is found, it tells you what it found and asks for the command again.
  • tf_models_remove <target> - Forces to remove a model on the target.
  • tf_models_lock <target> <1/0> - Locks/unlocks the target's model so it can't be changed.
  • tf_models_override <target> <1/0> - Enables restriction overriding for the target (they can equip any model regardless of class/team).
  • tf_models_reload - Reparses the items file and rebuilds the model list.
Installation: (video tutorial is in the next post)
  • Unsupported for anything below SM 1.5
  • You need to have the clientprefs extension for SourceMod (it's a stock SourceMod extension, if I remember correctly)
  • Place tf2_modelmanager.smx in addons/sourcemod/plugins/
  • Place tf2_modelmanager.phrases.txt in addons/sourcemod/translations/
  • Place tf2_modellist.cfg in addons/sourcemod/configs/tf2modelmanager/. Make sure this is lowercase.
  • Once all of these are placed, either do 'sm plugins refresh' in console, change the map, or restart the server. Then, go to tf/cfg/sourcemod/tf2_modelmanager.cfg and change any cvars you want to change.
  • If you're compiling yourself, you need morecolors.inc. You'll also need the latest SM 1.5 includes.
  • Ignore the tag mismatches when compiling, I have no idea :/
Add items using the instructions in the tf2_modellist.cfg file. You NEED to populate this config with models to have models. You can create more cfg files in the same folder with different names and change the tf_models_list cvar to those names, in order to change up the model list (they're all in addons/sourcemod/configs/tf2modelmanager/). Basically, multiple item lists, but tf2_modellist.cfg is the default. The one provided comes with an example model.
READ ABOUT .dep FILES HERE. YOU NEED THESE FOR CUSTOM MODELS (models that aren't already in the game files. models/gman.mdl IS already in the game files, FYI)

Code:
CHANGELOG
08/03/2013(v1.0.4)
*Made plugin not error if you had more than 256 models, but log a message saying no more will be added. Seriously, stick to this limit, and don't complain if you don't and your server starts crashing due to precache errors.
*Added number of models to tf_models_reload output.
-Files changed: smx, sp

07/30/2013(v1.0.3)
*Admin overrides! Use them instead of the ADMIN_ONLY flag.
*Cvar and command changes, read up on it in the relevant sections above.
*Fixed the model list not updating properly on mapchanges/cvar changes.
*Fixed users not being recognized as admins if the flags were added later.
*The admin flag cvar now only applies for ADMIN_DEFAULT and whether tf_models_lock applies to a client. Use the "tf_models" override to control access to the menu.
*You can put models in tf/custom/owndirectory/, but the .dep file has to be in tf/models/... (the .dep file must also list the models as if they were in tf/models/..., but the models can be in the custom directory since that's how stuff works now).
*Protected the cookies used for the plugin.
*HIDE_WEAPONS now works.
*REMOVE_VALVE changed to HIDE_HATS (REMOVE_VALVE still works, but... eh)
*Unequipping a model now removes any particle effects that may have come with it (e.g. the Ghost models).
*Lowercase'd all the files because it was an issue for some people.
*If I missed anything in this list I'll add it later.

01/12/2012(v1.0.2)
*Fixed admin checks not working
*Allowed /mm, /em, /equip, /equipmodels, and /tf_models to be overridden in admin overrides.
*Changing class without respawning should now be accounted for in the plugin (will check on regen/locker touch)
*Accounted for Bootlegger not being a hat

08/17/2011(v1.0.1)
*Changed up the way items are found when using tf_models_equip
*Fixed IsValidClient
*If an admin forces a client to equip a model, and the client has the override flag, the model equips as opposed to rejecting based on class/team/etc.
*Brought back the /em alias because I am so used to it.

08/13/2011(v1.0.0)
*First release


Demonstration
(created by Rowedahelicon)
https://www.youtube.com/watch?v=IWuQaW18gWQ
Attached Files
File Type: sp Get Plugin or Get Source (tf2_modelmanager.sp - 5112 views - 69.9 KB)
File Type: smx tf2_modelmanager.smx (32.7 KB, 8254 views)
File Type: cfg tf2_modellist.cfg (3.4 KB, 9986 views)
File Type: txt tf2_modelmanager.phrases.txt (2.6 KB, 7811 views)
__________________
Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.

Last edited by FlaminSarge; 04-17-2020 at 07:00.
FlaminSarge is offline