GM:PlayerSetHandsModel

From Garry's Mod
Jump to: navigation, search
 GM:PlayerSetHandsModel( )

Contents

Description

Called whenever view model hands needs setting a model. By default this calls PLAYER:GetHandsModel and if that fails, sets the hands model according to his player model.

Arguments

Player ply

The player whose hands needs a model set

Arguments

Entity ent

The hands to set model of

Examples

Example

Sets the players hands to the model's hands.

function GM:PlayerSetHandsModel( ply, ent )
   local simplemodel = player_manager.TranslateToPlayerModelName(ply:GetModel())
   local info = player_manager.TranslatePlayerHands(simplemodel)
   if info then
      ent:SetModel(info.model)
      ent:SetSkin(info.skin)
      ent:SetBodyGroups(info.body)
   end
end


Personal tools
Navigation