Garry's Mod Wiki

Revision Difference

player_manager.AddValidModel#568258

<function name="AddValidModel" parent="player_manager" type="libraryfunc"> <description> Associates a simplified name with a path to a valid player model. This is used to list all available player model in the Player Model Selector (via <page>player_manager.AllValidModels</page>), and to prevent players from being able to set any model as the player model. </description> <realm>Shared</realm> <file line="17-L25">lua/includes/modules/player_manager.lua</file> <args> <arg name="name" type="string">Short, simplified, unique player model name. (something like `"combine"` for the Combine Soldier player model)</arg> <arg name="model" type="string">The model path for this player model entry.</arg> <arg name="niceName" type="string" added="2026.08.14" default="nil">A user-friendly name of this model, such as `"Combine Soldier"`.⤶ ⤶ Can be a localization string starting with `"#"`.</arg>⤶ <arg name="category" type="string" added="2026.08.14" default="nil">A user-friendly category name for this model, such as `"Half-Life 2"`.⤶ ⤶ If not set, the model will appear in the "Other" category (localized to the player's language). ⤶ Can be a localization string starting with `"#"`.⤶ </arg>⤶ </args> </function>