• A few server running problems
    16 replies, posted
I seem to run into a few problems. A few are pointshop related, a few are not; Pointshop related: Players revert to map default playermodel when the round starts depending on the playermodel they choose. Here's code from one that doesn't revert. [code]ITEM.Name = 'Vector' ITEM.Price = 600 ITEM.Model = 'models/player/lordvipes/rerc_vector/vector_cvp.mdl' function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(2, function() ply:SetModel(self.Model) 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] And here's code from one that does revert [code]ITEM.Name = 'Angry Marine' ITEM.Price = 1600 ITEM.Model = 'models/player/lordvipes/angrymarines/angry_marine_cvp.mdl' ITEM.AllowedUserGroups = { "superadmin", "admin", "vip" } function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(2, function() ply:SetModel(self.Model) 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] Regarding Pointshop, if a playermodel has custom hands, is there a way to tell it to override the default TTT hands if said playermodel is selected? If not, is there a way to "buy" hands in Pointshop? --- Server related: No matter what, the server doesn't make players download addons via the workshop. Before it use to, now it doesn't want to. Instead people download from the server. Subscribing to the workshop collection does fix this, but that doesn't help people who are just joining and disconnect either due to long downloads, or net_maxfilesize being triggered. I feel dumb asking these things as it's most likely an easy fix.
1. Just curious, but does taking out the allowed user groups cause it to not revert? 2. [url]http://wiki.garrysmod.com/page/Using_Viewmodel_Hands[/url] Look at PlayerSetHandsModel. 3. You have a resource.AddWorkshop file, right? Also, put sv_allowdownload 0 in your server.cfg.
[QUOTE=code_gs;45324458]1. Just curious, but does taking out the allowed user groups cause it to not revert? 2. [url]http://wiki.garrysmod.com/page/Using_Viewmodel_Hands[/url] Look at PlayerSetHandsModel. 3. You have a resource.AddWorkshop file, right? Also, put sv_allowdownload 0 in your server.cfg.[/QUOTE] 1) Groups don't seem to matter, as the one I use, has the same group flags, but never reverts, even when others use it [code]ITEM.Name = 'Geth' ITEM.Price = 1200 ITEM.Model = 'models/player/lordvipes/me1_gethtrooper/geth_trooper_cvp.mdl' ITEM.AllowedUserGroups = { "superadmin", "admin", "vip" } function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(2, function() ply:SetModel(self.Model) 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] 2) I know that, but what code do I put in the pointshop file to tell it to use the hands? Do I just add [code]ITEM.Model = 'models/player/lordvipes/rerc_vector/arms/vectorarms_cvp.mdl'[/code] 3) Does resource.AddWorkshopfile work for collections, or do I have to list each addon?
1. Huh; I remember that patched a few months back; I'll look into it tomorrow. 2. In that timer.Simple you have in your code, also run ply:SetupHands(). 3. You have to list out every addon.
2) [code]ITEM.Name = 'Geth' ITEM.Price = 1200 ITEM.Model = 'models/player/lordvipes/me1_gethtrooper/geth_trooper_cvp.mdl' ITEM.AllowedUserGroups = { "superadmin", "admin", "vip" } function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(2, function() ply:SetModel(self.Model) end) ply:SetupHands 'models/player/lordvipes/me1_gethtrooper/Arms/getharms_cvp.mdl' 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] ? 3) resource.AddWorkshop goes in server.cfg, right?
2. No. Just put ply:SetupHands () after ply:SetModel() but before the end. 3. No, new file in lua/autorun/server.
[code]ITEM.Name = 'Geth' ITEM.Price = 1200 ITEM.Model = 'models/player/lordvipes/me1_gethtrooper/geth_trooper_cvp.mdl' ITEM.AllowedUserGroups = { "superadmin", "admin", "vip" } function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(2, function() ply:SetModel(self.Model) ply:SetupHands(models/player/lordvipes/me1_gethtrooper/Arms/getharms_cvp.mdl) 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] Do I still need to use this? [url]http://wiki.garrysmod.com/page/Using_Viewmodel_Hands[/url]
Don't put anything in the SetupHands parenthesis.
[QUOTE=code_gs;45324871]Don't put anything in the SetupHands parenthesis.[/QUOTE] [code]ITEM.Name = 'Geth' ITEM.Price = 1200 ITEM.Model = 'models/player/lordvipes/me1_gethtrooper/geth_trooper_cvp.mdl' ITEM.AllowedUserGroups = { "superadmin", "admin", "vip" } function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(2, 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] Then how will it know if said model uses custom hands? And where said hands are located?
If you read the function on the page I linked you, then you would know.
I did. Maybe I'm not just understanding correctly. Say I have like 5 playermodels that have custom arms. In order for them to work, I have to edit the TTT gamemode and add them in, then on the pointshop lua for each playermodel put ply:SetupHands() My best guess, and most likely a stupid one, is in the ttt gamemode, I put say ply:SetupHands( geth ), and continue as follows on the link. Then in the pointshop lua for geth, I put ply:SetupHands( geth ), yet you said put nothing in the parenthesis. Honestly I'm quite lost.
I don't understand what you're saying; does TTT override SetupHands or something?
Ok, maybe I'm just shit at explaining. I got maybe 8 playermodels in Pointshop, that if used in Sandbox have their own unique viewmodel arms. What I was asking is how do I allow each one to use their own unique arms in Pointshop. From what I read, what you linked to only would replace the viewmodel arms globally. Say like a Player uses the Geth Playermodel, it would use the Geth arms, then when he switches to Vector, it would use Vector's arms. Like that.
That's what SetupHands does. You don't have to send in the model because ply:GetModel() already does that.
Ok, I'm officially lost now. How will that even work if I can't put anything in "()" How will it know what pointshop goes to what hands? Do I add it into ttt's lua/cfg or make a new one ? If I'm stumped and lost on this, maybe I shouldn't be trying to start a server [editline]8th July 2014[/editline] Can I have an example that uses two pointshop player models, each with unique hands?
For the last time, if you read the page I linked, you would know how it works. [b]ply:GetModel() exists to get the player's model already, you don't have to send it in.[/b]
Sorry I made you mad code_gs, the whole thing was just giving me a mind bsod because from my view it runs on magic and unicorn tears. It never calling for the exact model is what through me off, way off. Sorry. [t]http://cloud-4.steampowered.com/ugc/55483889826454366/85C3AC09F7FF3BD1AC53994FBA4D51A0B1AB2741/[/t] It works, all I had to do was add one line of code to pointshop.
Sorry, you need to Log In to post a reply to this thread.