• Problem adding guns to my GMOD server.
    11 replies, posted
I'm in the process of building up a DarkRP server again and I'm running into a problem that when I code in 4 or more guns to the gun tab the guns and shipments tab disappear for GUN DEALER. I have no idea what the problem is. Thanks in advance for the help guys. =D =D
have you considered posting your shipments code?
Is it so you can yell at him for having workshop content on his server?
Well I know for sure that all my coding is correct, I checked and rechecked the codes and stuff. I'm thinking that there is some option somewhere that I don't know about doing this. This is a big problem I'm having and I can't open my server up until this is fixed because I want to add more guns. Please help.
Thanks. Now we have to rely on your promises, not knowing where the source of the problem is apart from the possibility that you might have installed a shitty F4 Menu that is coded from person with the brain of a chimpanzee. How do you expect us to help you if you are reluctant in giving us (the ones who actually want to help you) your code?
This is what I have so far currently with my entities.lua file: DarkRP.createShipment("Desert eagle", {     model = "models/weapons/w_pist_deagle.mdl",     entity = "fas2_deagle",     price = 14000,     amount = 10,     separate = true,     pricesep = 1400,     noship = false,     allowed = {TEAM_GUN},     category = "Other", }) DarkRP.createShipment("m1911", {     model = "models/weapons/w_1911.mdl",     entity = "fas2_m1911",     price = 12000,     amount = 10,     separate = true,     pricesep = 1200,     noship = false,     allowed = {TEAM_GUN},     category = "Other", }) DarkRP.createShipment("Automatic Pistol", {     model = "models/weapons/world/pistols/ots33.mdl",     entity = "fas2_ots33",     price = 20000,     amount = 10,     separate = true,     pricesep = 2000,     noship = false,     allowed = {TEAM_GUN},     category = "Other", }) DarkRP.createEntity("Tip Jar", {     ent = "darkrp_tip_jar",     model = "models/props_lab/jar01a.mdl",     price = 0,     max = 2,     cmd = "tipjar",     allowTools = true, }) if not DarkRP.disabledDefaults["modules"]["hungermod"] then     DarkRP.createEntity("Microwave", {         ent = "microwave",         model = "models/props/cs_office/microwave.mdl",         price = 400,         max = 1,         cmd = "buymicrowave",         allowed = TEAM_COOK     }) end DarkRP.createCategory{     name = "Other",     categorises = "entities",     startExpanded = true,     color = Color(0, 107, 0, 255),     canSee = fp{fn.Id, true},     sortOrder = 255, } DarkRP.createCategory{     name = "Other",     categorises = "shipments",     startExpanded = true,     color = Color(0, 107, 0, 255),     canSee = fp{fn.Id, true},     sortOrder = 255, } DarkRP.createCategory{     name = "Rifles",     categorises = "shipments",     startExpanded = true,     color = Color(0, 107, 0, 255),     canSee = fp{fn.Id, true},     sortOrder = 100, } DarkRP.createCategory{     name = "Shotguns",     categorises = "shipments",     startExpanded = true,     color = Color(0, 107, 0, 255),     canSee = fp{fn.Id, true},     sortOrder = 101, } DarkRP.createCategory{     name = "Snipers",     categorises = "shipments",     startExpanded = true,     color = Color(0, 107, 0, 255),     canSee = fp{fn.Id, true},     sortOrder = 102, } DarkRP.createCategory{     name = "Pistols",     categorises = "weapons",     startExpanded = true,     color = Color(0, 107, 0, 255),     canSee = fp{fn.Id, true},     sortOrder = 100, } DarkRP.createCategory{     name = "Other",     categorises = "weapons",     startExpanded = true,     color = Color(0, 107, 0, 255),     canSee = fp{fn.Id, true},     sortOrder = 255, } DarkRP.createCategory{     name = "Other",     categorises = "vehicles",     startExpanded = true,     color = Color(0, 107, 0, 255),     canSee = fp{fn.Id, true},     sortOrder = 255, } Everytime I add shipments/guns after "Automatic Pistol" the gun and shipments tab for some reason goes away on the f4 menu and I also tried taking off my arivia f4 menu addon and it does the same thing. Here is my entities.lua file after I add in a few more guns and the shipments and gun tab goes away: DarkRP.createShipment("Desert eagle", {     model = "models/weapons/w_pist_deagle.mdl",     entity = "fas2_deagle",     price = 14000,     amount = 10,     separate = true,     pricesep = 1400,     noship = false,     allowed = {TEAM_GUN},     category = "Other", }) DarkRP.createShipment("m1911", {     model = "models/weapons/w_1911.mdl",     entity = "fas2_m1911",     price = 12000,     amount = 10,     separate = true,     pricesep = 1200,     noship = false,     allowed = {TEAM_GUN},     category = "Other", }) DarkRP.createShipment("Automatic Pistol", {     model = "models/weapons/world/pistols/ots33.mdl",     entity = "fas2_ots33",     price = 20000,     amount = 10,     separate = true,     pricesep = 2000,     noship = false,     allowed = {TEAM_GUN},     category = "Other", }) DarkRP.createShipment("Mp5", {     model = "models/weapons/w_mp5.mdl",     entity = "fas2_mp5k",     price = 26000     amount = 10,     separate = true,     pricesep = 2600,     noship = false,     allowed = {TEAM_GUN},     category = "Rifles", }) DarkRP.createShipment("FAMAS", {     model = "models/weapons/w_rif_ak47.mdl",     entity = "weapon_ak472",     price = 28000,     amount = 10,     separate = true,     pricesep = 2800,     noship = false,     allowed = {TEAM_GUN},     category = "Rifles", }) DarkRP.createShipment("G36C", {     model = "models/weapons/w_g36e.mdl",     entity = "fas2_g36c",     price = 34000,     amount = 10,     separate = true,     pricesep = 3400,     noship = false,     allowed = {TEAM_GUN},     category = "Rifles", }) DarkRP.createShipment("M4A1", {     model = "models/weapons/w_m4.mdl",     entity = "fas2_m4a1",     price = 40000,     amount = 10,     separate = true,     pricesep = 4000,     noship = false,     allowed = {TEAM_GUN},     category = "Rifles", }) DarkRP.createEntity("Tip Jar", {     ent = "darkrp_tip_jar",     model = "models/props_lab/jar01a.mdl",     price = 0,     max = 2,     cmd = "tipjar",     allowTools = true, }) if not DarkRP.disabledDefaults["modules"]["hungermod"] then     DarkRP.createEntity("Microwave", {         ent = "microwave",         model = "models/props/cs_office/microwave.mdl",         price = 400,         max = 1,         cmd = "buymicrowave",         allowed = TEAM_COOK     }) end DarkRP.createCategory{     name = "Other",     categorises = "entities",     startExpanded = true,     color = Color(0, 107, 0, 255),     canSee = fp{fn.Id, true},     sortOrder = 255, } DarkRP.createCategory{     name = "Other",     categorises = "shipments",     startExpanded = true,     color = Color(0, 107, 0, 255),     canSee = fp{fn.Id, true},     sortOrder = 255, } DarkRP.createCategory{     name = "Rifles",     categorises = "shipments",     startExpanded = true,     color = Color(0, 107, 0, 255),     canSee = fp{fn.Id, true},     sortOrder = 100, } DarkRP.createCategory{     name = "Shotguns",     categorises = "shipments",     startExpanded = true,     color = Color(0, 107, 0, 255),     canSee = fp{fn.Id, true},     sortOrder = 101, } DarkRP.createCategory{     name = "Snipers",     categorises = "shipments",     startExpanded = true,     color = Color(0, 107, 0, 255),     canSee = fp{fn.Id, true},     sortOrder = 102, } DarkRP.createCategory{     name = "Pistols",     categorises = "weapons",     startExpanded = true,     color = Color(0, 107, 0, 255),     canSee = fp{fn.Id, true},     sortOrder = 100, } DarkRP.createCategory{     name = "Other",     categorises = "weapons",     startExpanded = true,     color = Color(0, 107, 0, 255),     canSee = fp{fn.Id, true},     sortOrder = 255, } DarkRP.createCategory{     name = "Other",     categorises = "vehicles",     startExpanded = true,     color = Color(0, 107, 0, 255),     canSee = fp{fn.Id, true},     sortOrder = 255, }
DarkRP.createShipment("Mp5", { model = "models/weapons/w_mp5.mdl", entity = "fas2_mp5k", price = 26000 amount = 10, separate = true, pricesep = 2600, noship = false, allowed = {TEAM_GUN}, category = "Rifles", }) "Well I know for sure that all my coding is correct, I checked and rechecked the codes and stuff." - Totally.
Although that is a problem, the other problem is the fact he has shipments in the entities.lua file in darkrp_customthings when it should be in the shipments.lua one.
if use code == true then use {} If you're to dumb to undertstand that, there is a button at the bottom of your screen (the "{}" one) that gives you a code box like above. There is a shipments.lua file in darkrpmodifaction for a reason. Im gonna help you solve your problem Look at this code: DarkRP.createShipment("Mp5", { model = "models/weapons/w_mp5.mdl", entity = "fas2_mp5k", price = 26000 amount = 10, separate = true, pricesep = 2600, noship = false, allowed = {TEAM_GUN}, category = "Rifles", }) Look at the very last line category = "Rifles", If you still can't figure it out, here is a spoiler that tells you what you did wrong you cant have a comma (",") at the very end. You also dont need noship -- The following fields are OPTIONAL. If you do not need them, or do not need to change them from their defaults, REMOVE them. noship = false, -- whether this item has a shipment allowed = {TEAM_GUN, TEAM_MEDIC}, -- OPTIONAL, which teams are allowed to buy this shipment/separate gun shipmodel = "models/items/item_item_crate.mdl", -- OPTIONAL, the model of the shipment (this crate is the default) customCheck = function(ply) return ply:Frags() < 10 end, -- OPTIONAL, extra conditions before people can purchase the shipment or separate item CustomCheckFailMsg = function(ply, shipment) return ply:Frags() >= 10 and "You killed too many people" end, -- Can be a simple string as well weight = 15, -- OPTIONAL, the weight of the shipment. The default is the weight of the shipment spareammo = 10, -- OPTIONAL, Add ammo to the default amount of ammo for every weapon clip1 = 10, -- OPTIONAL, The amount of bullets in the primary clip by default clip2 = 10, -- OPTIONAL, The amount of bullets in the secondary clip by default buttonColor = Color(255, 255, 255, 255), -- Optional: The color of the button in the F4 menu, label = "Super pistol", -- Optional: the text on the button in the F4 menu category = "Other", -- The name of the category it is in. Note: the category must be created! sortOrder = 100, -- The position of this thing in its category. Lower number means higher up. Right from the DarkRP wiki on shipments Use these in the future: Jobs, Shipments, Entities, Categorys, DarkRP Wiki
Having a comma at the very end of table doesn't ruin anything in lua. I meant that he missed a comma after the price value.
On my server, I forgot a comma and it fucked everything up
Problem has been fixed, it turns out I was just missing that comma. I feel like an idiot. Thanks for all the help guys.
Sorry, you need to Log In to post a reply to this thread.