• No hands?
    14 replies, posted
Could anybody take a look at this and see if anything is wrong? for some reason I dont have hands.. :? [url]http://pastebin.com/HGEGCK8s[/url]
I thought you just add SWEP.UseHands = true to the SWEP file, I may be wrong
[url]http://wiki.garrysmod.com/page/Using_Viewmodel_Hands[/url]
[QUOTE=CalvinTheCat;41679871]Could anybody take a look at this and see if anything is wrong? for some reason I dont have hands.. :? [url]http://pastebin.com/HGEGCK8s[/url][/QUOTE] Shit, sorry I was a bit vague, I tried posting this thread like 10 times but my internet pooped out. Anyhow that is from a simple TDM gamemode I'm working on, when I hold a gun I have no hands. Im using mad cows weapons too.
Chain: [url]http://www.facepunch.com/showthread.php?t=1290005[/url]
[QUOTE=Tomvdr;41688788]Chain: [url]http://www.facepunch.com/showthread.php?t=1290005[/url][/QUOTE] If you'd look at the pastebin, you'd see I have that.
[QUOTE=CalvinTheCat;41688840]If you'd look at the pastebin, you'd see I have that.[/QUOTE] You don't have the part that actually renders the hands.
[QUOTE=Robotboy655;41688982]You don't have the part that actually renders the hands.[/QUOTE] I have it in cl_init.lua, still no hands.
[QUOTE=CalvinTheCat;41689137]I have it in cl_init.lua, still no hands.[/QUOTE] See second post then.
[QUOTE=Robotboy655;41689389]See second post then.[/QUOTE] Could you send me a link? that chain is incredibly confusing.
[QUOTE=Aj;41680070]I thought you just add SWEP.UseHands = true to the SWEP file, I may be wrong[/QUOTE]
[QUOTE=Robotboy655;41691001][/QUOTE] Nope. Tried even with my own swep that uses SWEP.UseHands = true. [url]http://imgur.com/o1jqa2Q[/url] Wat do
Are you using player classes? The way I got the custom hands to work was ensure my player class had the UseVMHands set to true, and on PlayerSpawn; activate the class: [lua]// // // function GM:PlayerSpawn( Player ) Player:EnableCustomCollisions( true ); Player:SetCustomCollisionCheck( true ) player_manager.SetPlayerClass( Player, "player_acecool_dev" ) player_manager.OnPlayerSpawn( Player ) player_manager.RunClass( Player, "Spawn" ) hook.Call( "PlayerSetModel", GAMEMODE, Player ) hook.Call( "PlayerLoadout", GAMEMODE, Player ) return true; end[/lua] Here's my class file: [lua]// local PLAYER_CLASS = {} PLAYER_CLASS.DisplayName = "AcecoolDev Player Class" PLAYER_CLASS.WalkSpeed = 100 -- How fast to move when not running PLAYER_CLASS.RunSpeed = 300 -- How fast to move when running PLAYER_CLASS.CrouchedWalkSpeed = 0.3 -- Multiply move speed by this when crouching PLAYER_CLASS.DuckSpeed = 0.3 -- How fast to go from not ducking, to ducking PLAYER_CLASS.UnDuckSpeed = 0.3 -- How fast to go from ducking, to not ducking PLAYER_CLASS.JumpPower = 160 -- How powerful our jump should be PLAYER_CLASS.CanUseFlashlight = false -- Can we use the flashlight PLAYER_CLASS.MaxHealth = 100 -- Max health we can have PLAYER_CLASS.StartHealth = 100 -- How much health we start with PLAYER_CLASS.StartArmor = 0 -- How much armour we start with PLAYER_CLASS.DropWeaponOnDie = false -- Do we drop our weapon when we die PLAYER_CLASS.TeammateNoCollide = false -- Do we collide with teammates or run straight through them PLAYER_CLASS.AvoidPlayers = false -- Automatically swerves around other players PLAYER_CLASS.UseVMHands = true -- Uses viewmodel hands -- -- Name: PLAYER:GetHandsModel -- Desc: Called on player spawn to determine which hand model to use -- Arg1: -- Ret1: table|info|A table containing model, skin and body -- function PLAYER_CLASS:GetHandsModel() local cl_playermodel = self.Player:GetInfo( "cl_playermodel" ) return player_manager.TranslatePlayerHands( cl_playermodel ) end player_manager.RegisterClass( "player_acecool_dev", PLAYER_CLASS, "player_default" )[/lua]
[QUOTE=Acecool;41694075]Are you using player classes? The way I got the custom hands to work was ensure my player class had the UseVMHands set to true, and on PlayerSpawn; activate the class: [lua]// // // function GM:PlayerSpawn( Player ) Player:EnableCustomCollisions( true ); Player:SetCustomCollisionCheck( true ) player_manager.SetPlayerClass( Player, "player_acecool_dev" ) player_manager.OnPlayerSpawn( Player ) player_manager.RunClass( Player, "Spawn" ) hook.Call( "PlayerSetModel", GAMEMODE, Player ) hook.Call( "PlayerLoadout", GAMEMODE, Player ) return true; end[/lua] Here's my class file: [lua]// local PLAYER_CLASS = {} PLAYER_CLASS.DisplayName = "AcecoolDev Player Class" PLAYER_CLASS.WalkSpeed = 100 -- How fast to move when not running PLAYER_CLASS.RunSpeed = 300 -- How fast to move when running PLAYER_CLASS.CrouchedWalkSpeed = 0.3 -- Multiply move speed by this when crouching PLAYER_CLASS.DuckSpeed = 0.3 -- How fast to go from not ducking, to ducking PLAYER_CLASS.UnDuckSpeed = 0.3 -- How fast to go from ducking, to not ducking PLAYER_CLASS.JumpPower = 160 -- How powerful our jump should be PLAYER_CLASS.CanUseFlashlight = false -- Can we use the flashlight PLAYER_CLASS.MaxHealth = 100 -- Max health we can have PLAYER_CLASS.StartHealth = 100 -- How much health we start with PLAYER_CLASS.StartArmor = 0 -- How much armour we start with PLAYER_CLASS.DropWeaponOnDie = false -- Do we drop our weapon when we die PLAYER_CLASS.TeammateNoCollide = false -- Do we collide with teammates or run straight through them PLAYER_CLASS.AvoidPlayers = false -- Automatically swerves around other players PLAYER_CLASS.UseVMHands = true -- Uses viewmodel hands -- -- Name: PLAYER:GetHandsModel -- Desc: Called on player spawn to determine which hand model to use -- Arg1: -- Ret1: table|info|A table containing model, skin and body -- function PLAYER_CLASS:GetHandsModel() local cl_playermodel = self.Player:GetInfo( "cl_playermodel" ) return player_manager.TranslatePlayerHands( cl_playermodel ) end player_manager.RegisterClass( "player_acecool_dev", PLAYER_CLASS, "player_default" )[/lua][/QUOTE] Interesting, I'll try it later, really tired.
[QUOTE=CalvinTheCat;41694450]Interesting, I'll try it later, really tired.[/QUOTE] Sweet! It works. Thanks!
Sorry, you need to Log In to post a reply to this thread.