• Pointshop Playermodel First Person Hands Issue
    9 replies, posted
Hello everyone, so recently I have been getting asked why the player model hands on my TTT server dont show up for them. I told them I didnt know and that I would look into it. 6 hours later, I have came up short with no working answers. Here is what I have attempted: [CODE]function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(1, function() ply:SetModel(self.Model) ply:GetHands():Remove() ply:SetupHands() end) end function ITEM:OnHolster(ply) if ply._OldModel then ply:SetModel(ply._OldModel) end end function ITEM:PlayerSetModel(ply) ply:SetModel(self.Model) end[/CODE] [CODE]function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(1, function() ply:SetModel(self.Model) ply:SetupHands() end) end function ITEM:OnHolster(ply) if ply._OldModel then ply:SetModel(ply._OldModel) end end function ITEM:PlayerSetModel(ply) ply:SetModel(self.Model) end[/CODE] Now, when I switch my server to sandbox mode for testing purposes, I am able to change my player model just fine and I see the hands. I assume from this that pointshop doesnt have a function, or lacks to call the function to draw the hands of the given player model. Knowing how big the gmod scripting community is, I assume someone knows a fix for this. [B]Pointshop Player Model Hands:[/B] [IMG]http://i.imgur.com/gpEOTc7.png[/IMG] [B]Sandbox Player Model Hands: (different player model at the time of taking picture)[/B] [IMG]http://i.imgur.com/jrAZw0P.png[/IMG]
Rename your addons folder and unsubscribe / disable addons from downloading. Rename server directory where all server downloads go into. Connect to your server just as another player would and see if you see the hands. If not, then some addon may be missing. If you use FastDL, make sure it is set up properly: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/server_srcds_steamcmd/fastdl_setup_instructions.lua.html[/url] If you want to automate addon downloading to client, take a look at this: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/server_srcds_steamcmd/setting_up_downloads_using_recursive_resource_system.lua.html[/url] Also, Make sure clients have games mounted that the server has mounted. If the model shows up as an error, ask the clients for the "Failed to load model ......" error message in console. It'll let you know which models they're missing vs which ones they have.
Call ply:SetupHands() after setting the player model. ( After calling ply:SetModel() )
[QUOTE=Robotboy655;46867512]Call ply:SetupHands() after setting the player model. ( After calling ply:SetModel() )[/QUOTE] So, this. [CODE]function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end ply:SetModel(self.Model) ply:SetupHands() end function ITEM:OnHolster(ply) if ply._OldModel then ply:SetModel(ply._OldModel) end end function ITEM:PlayerSetModel(ply) ply:SetModel(self.Model) ply:SetupHands() end[/CODE] Sorry, still newer to lua. :P
In OnHolster too.
[QUOTE=Robotboy655;46868491]In OnHolster too.[/QUOTE] I attempted with a different character model too, same thing. Wont show hands. [CODE]ITEM.Name = 'Link' ITEM.Price = 2500 ITEM.Model = 'models/player/pyroteknik/link_hw.mdl' function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(1, function() ply:SetModel(self.Model) end) ply:SetupHands(seld.Model) end function ITEM:OnHolster(ply) if ply._OldModel then ply:SetModel(ply._OldModel) ply:SetupHands() end end function ITEM:PlayerSetModel(ply) ply:SetModel(self.Model) ply:SetupHands(self.Model) end[/CODE] link lua file: Workshop link: [url]http://steamcommunity.com/sharedfiles/filedetails/?id=366580133&searchtext=[/url] [CODE] if(SERVER)then player_manager.AddValidModel( "Link (Hyrule Warriors)", "models/player/pyroteknik/link_hw.mdl") AddCSLuaFile( "hwlinkpl.lua" ) end if (SERVER) then resource.AddFile( "models/player/pyroteknik/link_hw.dx80.vtx" ) resource.AddFile( "models/player/pyroteknik/link_hw.dx90.vtx" ) resource.AddFile( "models/player/pyroteknik/link_hw.mdl" ) resource.AddFile( "models/player/pyroteknik/link_hw.phy" ) resource.AddFile( "models/player/pyroteknik/link_hw.sw.vtx" ) resource.AddFile( "models/player/pyroteknik/link_hw.vvd" ) resource.AddFile( "materials/models/player/link_hw/link.vmt" ) resource.AddFile( "materials/models/player/link_hw/link.vtf" ) resource.AddFile( "materials/models/player/link_hw/link2.vmt" ) resource.AddFile( "materials/models/player/link_hw/link2.vtf" ) resource.AddFile( "materials/models/player/link_hw/link3.vmt" ) resource.AddFile( "materials/models/player/link_hw/link3.vtf" ) resource.AddFile( "materials/models/player/link_hw/link4.vmt" ) resource.AddFile( "materials/models/player/link_hw/link4.vtf" ) resource.AddFile( "materials/models/player/link_hw/link5.vmt" ) resource.AddFile( "materials/models/player/link_hw/link5.vtf" ) resource.AddFile( "materials/models/player/link_hw/link_normal.vtf" ) end[/CODE]
First of all, your pointshop code is all wrong again. [code] ITEM.Name = 'Link' ITEM.Price = 2500 ITEM.Model = 'models/player/pyroteknik/link_hw.mdl' function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(1, function() ply:SetModel(self.Model) ply:SetupHands() end) end function ITEM:OnHolster(ply) if ply._OldModel then ply:SetModel(ply._OldModel) ply:SetupHands() end end function ITEM:PlayerSetModel(ply) ply:SetModel(self.Model) ply:SetupHands() end [/code] Secondly, lets clarify, by "not see the hands model" do you mean the hands not being there at all or the hands using the wrong model? Thirdly, the player model you provided does not have custom player model arms, so citizen arms will be used regardless. And lastly, you should call player_manager.AddValidModel on the client too.
[QUOTE=Robotboy655;46871063]First of all, your pointshop code is all wrong again. [code] ITEM.Name = 'Link' ITEM.Price = 2500 ITEM.Model = 'models/player/pyroteknik/link_hw.mdl' function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(1, function() ply:SetModel(self.Model) ply:SetupHands() end) end function ITEM:OnHolster(ply) if ply._OldModel then ply:SetModel(ply._OldModel) ply:SetupHands() end end function ITEM:PlayerSetModel(ply) ply:SetModel(self.Model) ply:SetupHands() end [/code] Secondly, lets clarify, by "not see the hands model" do you mean the hands not being there at all or the hands using the wrong model? Thirdly, the player model you provided does not have custom player model arms, so citizen arms will be used regardless. And lastly, you should call player_manager.AddValidModel on the client too.[/QUOTE] Ah ok, I thought that even if there was no model for the hands listed after using the resource generator, that there was still player arms. My bad. Also, the normal civilian hands do show up, but I am attempting to get the hands of the models, etc to show first person and not only to everyone else. (via the hands). I see where my lua was wrong however. I put "ply:SetupHands()" on a new line and not on the same line as the equip function. (my spacing was a little funky too). So for the player model lua, I would do the following: (I used a model that for sure has a hand model) [CODE]if(SERVER) then player_manager.AddValidModel( "Master Chief", "models/Halo4/Spartans/masterchief_player.mdl" ) player_manager.AddValidHands( "Master Chief", "models/Halo4/Spartans/Arms/c_arms_chief.mdl", 0, "00000000" ) AddCSLuaFile( "chief_playermodel.lua" ) end if(CLIENT) then player_manager.AddValidModel( "Master Chief", "models/Halo4/Spartans/masterchief_player.mdl" ) player_manager.AddValidHands( "Master Chief", "models/Halo4/Spartans/Arms/c_arms_chief.mdl", 0, "00000000" ) end <add resource code here> end[/CODE] Interestingly enough, when I was watching a tutorial, the if(CLIENT) never showed up, so I assume that I would delete it and do just if(SERVER). Thanks for informing me.
Instead of that you could and should do this: [code] AddCSLuaFile() -- Adds the file it is called in. player_manager.AddValidModel( "Master Chief", "models/Halo4/Spartans/masterchief_player.mdl" ) player_manager.AddValidHands( "Master Chief", "models/Halo4/Spartans/Arms/c_arms_chief.mdl", 0, "00000000" ) [/code]
[QUOTE=Robotboy655;46872682]Instead of that you could and should do this: [code] AddCSLuaFile() -- Adds the file it is called in. player_manager.AddValidModel( "Master Chief", "models/Halo4/Spartans/masterchief_player.mdl" ) player_manager.AddValidHands( "Master Chief", "models/Halo4/Spartans/Arms/c_arms_chief.mdl", 0, "00000000" ) [/code][/QUOTE] So I don't need to bother listing the lua file in AddCSLuaFile as long as its in the file I am listing. And, I assume I still need if(Client) and if(SERVER).
Sorry, you need to Log In to post a reply to this thread.