Garry's Mod

Garry's Mod

Chuck's Weaponry 2.0
SERVER OWNER / DARK-RP THREAD
Having issues with this addon on your DarkRP server? Here's some fixes to some of your issues you might be having.

Disable All Attachments (for entire server):
-- Put it in /lua/autorun/server/something.lua RunConsoleCommand("cw_disable_all_attachments_on_spawn", " ")

Job Example; Spawn With CW Gun, Ammo (and also set custom Bodygroup :hatanon:):
TEAM_GUN = DarkRP.createJob("Gun Dealer", { color = Color(255, 140, 0, 255), model = { "models/happy_mask_salesman.mdl", "models/player/monk.mdl" }, description = [[A Gun Dealer is the only person who can sell guns to other people. Make sure you aren't caught selling illegal firearms to the public! You might get arrested!]], weapons = {"cw_m3super90", "weapon_fists"}, ammo = { ["12 Gauge"] = 30, }, command = "gundealer", max = 2, salary = GAMEMODE.Config.normalsalary, admin = 0, vote = false, hasLicense = false, category = "Citizens", -- Use PlayerLoadout instead of PlayerSpawn PlayerLoadout = function(ply) if ply:GetModel() == "models/happy_mask_salesman.mdl" then ply:SetBodygroup(1,1) end end })
This is using the Happy Mask Salesman Model:
I did that so players could spawn with the backpack lol, I got a general Idea what values to use based on the modelviewer (I used Crowbar to view bodygroups)
I had to extract the customizable weaponry addon and read the lua's
(for example customizable_weaponry_2_0\lua\weapons\cw_m3super90\shared.lua).
You gotta look for whatever value is assigned to the SWEP.Primary.Ammo flag.
so both
PlayerLoadout = function(ply) ply:SetAmmo(120, "12 Gauge") end,
and
ammo = { [".44 Magnum"] = 30, ["12 Gauge"] = 15, },
will work, I prefer the second option however.

DarkRP Weapons Shipments Example!
Check it out here: https://gist.github.com/g-l-i-t-c-h-o-r-s-e/da0fe88c39784a17879c67da92af3c1c

If you have any other helpful tips for DarkRP Setup, or other stuff, post it here!
Last edited by Pandela⚞⚝; 23 May, 2020 @ 6:54pm