Ulysses
General => Developers Corner => Topic started by: Bite That Apple on August 16, 2013, 04:53:36 AM
-
:'( Sadly this is not a ulx related question, I just feel it's best to ask it here first before going to other forums.. i.e. facepunch.
Anyways,
So for the last year I've been creating a gamemode called jokingly: Very Basic Team Deathmatch. Which in relatity it's not basic at all, and it's really complex actually.
You can see it here: http://steamcommunity.com/sharedfiles/filedetails/?id=116777393
Anyways, so ever since Garry (ugh... why does he do things) updated garry's mod to add.. "hands" on the weapons, the models of my gamemode no longer show the hands for the DEFAULT hl2 weapons that are default for garry's mod. I mean it's just annoying, it's not causing any problems or anything like that. I would like to know if anyone has a suggestion or fix, I've tried looking on the not well made wiki.garrysmod.com site for my 'hands help', but no luck at all.
So I just hope someone here can help me, thanks friends.
-
Actually, as soon as I posed this my friend on steam found out how to fix this. So yeah...
-
Maybe post the solution you found instead of just saying you found a solution and closing the thread.
This might still come up for people who have the same problem down the road.
-
Those who are having the same issue with the hand models not showing on your gamemode, or generally your server, you can either go here or just use the code (which I recommend):
http://facepunch.com/showthread.php?t=1285788
http://facepunch.com/showthread.php?t=1285087
Just place this in any server side file:
// I don't know how this works, nor do I care. It just gives my gamemode hands! - Msg From Apple
function HandsSpawn(ply)
local oldhands = ply:GetHands()
if ( IsValid( oldhands ) ) then oldhands:Remove() end
local hands = ents.Create( "gmod_hands" )
if ( IsValid( hands ) ) then
ply:SetHands( hands )
hands:SetOwner( ply )
-- Which hands should we use?
local cl_playermodel = ply:GetInfo( "cl_playermodel" )
local info = player_manager.TranslatePlayerHands( cl_playermodel )
if ( info ) then
hands:SetModel( info.model )
hands:SetSkin( info.skin )
hands:SetBodyGroups( info.body )
end
-- Attach them to the viewmodel
local vm = ply:GetViewModel( 0 )
hands:AttachToViewmodel( vm )
vm:DeleteOnRemove( hands )
ply:DeleteOnRemove( hands )
hands:Spawn()
end
end
hook.Add( "PlayerSpawn", "HandsSpawn", HandsSpawn )
Then place this in any client side file
// I don't know how this works, nor do I care. It just gives my gamemode hands! - Msg From Apple
function GM:PostDrawViewModel( vm, ply, weapon )
if ( weapon.UseHands || !weapon:IsScripted() ) then
local hands = LocalPlayer():GetHands()
if ( IsValid( hands ) ) then hands:DrawModel() end
end
end