Gamemode.PlayerSetModel

From GMod Wiki

Revision as of 15:19, 17 February 2011 by BlackVoid (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NamePlayerSetModel
SyntaxGM:PlayerSetModel( Player Player )
DescriptionCalled whenever a player spawns and must choose a model. A good place to assign a model to a player.
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerSetModel]Gamemode.PlayerSetModel [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionChanges the player's model to Odessa when the player spawns.
Used onNewerServer.png
Code
util.PrecacheModel( "models/player/odessa.mdl" )
function GM:PlayerSetModel( ply )
 
	ply:SetModel( "models/player/odessa.mdl" )
 
end
OutputThe player's model is changed to Odessa every time they try to set their model.

Additional Notes

See Also


Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox