PLAYER/GetHandsModel

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Created page with "{{Func |Name=GetHandsModel |Parent=PLAYER |Description=Called on player spawn to determine which hand model to use |Realm= |IsClass=Yes |File_Name=gamemodes/base/gamemod...")
 
m (Template usage.)
 
(3 intermediate revisions by one user not shown)
Line 1: Line 1:
{{Func
+
{{Hook
 
|Name=GetHandsModel
 
|Name=GetHandsModel
 
|Parent=PLAYER
 
|Parent=PLAYER
 
|Description=Called on player spawn to determine which hand model to use
 
|Description=Called on player spawn to determine which hand model to use
|Realm=
+
|Realm=Client
 +
|Predicted=No
 
|IsClass=Yes
 
|IsClass=Yes
|File_Name=gamemodes/base/gamemode/player_class/player_default.lua
+
|File=gamemodes/base/gamemode/player_class/player_default.lua
|File_Line=137
+
|Line=121
 
}}
 
}}
 
{{Ret
 
{{Ret
 
|type=table
 
|type=table
|desc=info|A table containing model, skin and body
+
|desc=A table containing info about view model hands model to be set. See examples.
 +
}}
 +
{{Example
 +
|Description=Default action of player_default class
 +
|Code=function PLAYER:GetHandsModel()
 +
 
 +
-- return { model = "models/weapons/c_arms_cstrike.mdl", skin = 1, body = "0100000" }
 +
 
 +
local playermodel = player_manager.TranslateToPlayerModelName( self.Player:GetModel() )
 +
return player_manager.TranslatePlayerHands( playermodel )
 +
 
 +
end
 +
|Output=View model hands model is chosen according to players player model.
 
}}
 
}}

Latest revision as of 17:26, 26 January 2015

 PLAYER:GetHandsModel( )

Contents

Description

Called on player spawn to determine which hand model to use

Returns

table

A table containing info about view model hands model to be set. See examples.

Examples

Example

Default action of player_default class

function PLAYER:GetHandsModel()

	-- return { model = "models/weapons/c_arms_cstrike.mdl", skin = 1, body = "0100000" }

	local playermodel = player_manager.TranslateToPlayerModelName( self.Player:GetModel() )
	return player_manager.TranslatePlayerHands( playermodel )

end

Output:

View model hands model is chosen according to players player model.
Personal tools
Navigation