Garry's Mod

Garry's Mod

View Stats:
razgraz Sep 14, 2014 @ 1:09pm
DarkRP FAS:2 ammo bug. (Still unsolved) Necrothread
Hi, Im working on a darkrp server of my own, and I have most of the content down, shipments, printers etc. However I am having a issue with FAS:2 ammo types, whenever try to add ammo under this directory:

C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\garrysmod\addons\darkrpmodification-master\lua\darkrp_customthings\ammo.lua

It doesnt show up under the ammo catagory in F4 Menu, So I used a topic from facepunch and followed a "fix" that worked for the OP, It had to do with placing the codes under:

C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\garrysmod\addons\darkrpmodification-master\lua\darkrp_customthings\entities.lua

So I copied what the guy had from pastebin and pasted it into entities.lua and while the ammo shows up under the F4 entities tab, more than half the ammo doesnt spawn and gives the error:


[ERROR] gamemodes/darkrp/gamemode/modules/base/sv_entityvars.lua:230: attempt to compare nil with number
1. customEntityLimitReached - gamemodes/darkrp/gamemode/modules/base/sv_entityvars.lua:230
2. callback - gamemodes/darkrp/gamemode/modules/base/sh_createitems.lua:369
3. unknown - gamemodes/darkrp/gamemode/modules/chat/sv_chat.lua:141
4. unknown - lua/includes/modules/concommand.lua:69


Can someone help me to either get the custom ammo to show up in ammo.lua or help me fix the error above?
Last edited by razgraz; Dec 1, 2015 @ 3:23pm
< >
Showing 1-4 of 4 comments
Caleb Dec 3, 2014 @ 12:09am 
Am I late?

GAMEMODE:AddAmmoType(".50 AE", ".50 AE Ammo", "models/weapons/w_ammobox_thrown.mdl", 100, 30)

GAMEMODE:AddAmmoType(".45 ACP", ".45 ACP Ammo", "models/weapons/w_ammobox_thrown.mdl", 100, 30)

GAMEMODE:AddAmmoType(".357 SIG", ".357 SIG Ammo", "models/weapons/w_ammobox_thrown.mdl", 100, 30)

GAMEMODE:AddAmmoType("12 Gauge", "12 Gauge Ammo", "models/weapons/w_ammobox_thrown.mdl", 100, 30)

GAMEMODE:AddAmmoType("9x19MM", "9x19MM Ammo", "models/weapons/w_ammobox_thrown.mdl", 100, 30)

GAMEMODE:AddAmmoType("23x75MMR", "23x75MMR Ammo", "models/weapons/w_ammobox_thrown.mdl", 100, 30)

GAMEMODE:AddAmmoType(".44 Magnum", ".44 Magnum Ammo", "models/weapons/w_ammobox_thrown.mdl", 100, 30)

GAMEMODE:AddAmmoType("40MM HE", "40MM HE Ammo", "models/weapons/w_ammobox_thrown.mdl", 100, 30)

GAMEMODE:AddAmmoType(".380 ACP", ".380 ACP Ammo", "models/weapons/w_ammobox_thrown.mdl", 100, 30)

GAMEMODE:AddAmmoType("5.45x39MM", "5.45x39MM Ammo", "models/weapons/w_ammobox_thrown.mdl", 100, 30)

GAMEMODE:AddAmmoType("5.56x45MM", "5.56x45MM Ammo", "models/weapons/w_ammobox_thrown.mdl", 100, 30)

GAMEMODE:AddAmmoType(".50 BMG", ".50 BMG Ammo", "models/weapons/w_ammobox_thrown.mdl", 100, 30)

GAMEMODE:AddAmmoType("7.62x39MM", "7.62x39MM Ammo", "models/weapons/w_ammobox_thrown.mdl", 100, 30)

GAMEMODE:AddAmmoType(".454 Casull", ".500 SW Ammo", "models/weapons/w_ammobox_thrown.mdl", 100, 30)

GAMEMODE:AddAmmoType("7.62x51MM", "7.62x51MM Ammo", "models/weapons/w_ammobox_thrown.mdl", 100, 30)

GAMEMODE:AddAmmoType("10x25MM", "10x25MM Ammo", "models/weapons/w_ammobox_thrown.mdl", 100, 30)

GAMEMODE:AddAmmoType("9x18MM", "9x18MM Ammo", "models/weapons/w_ammobox_thrown.mdl", 100, 30)
rat balls Feb 2, 2015 @ 7:08am 
For anyone still getting this, the user above's works, just change the models of all of them to models/items/boxmrounds.mdl
Spoody Dec 1, 2015 @ 3:21pm 
Does anyone know how to edit the SWEP.Primary.Ammo? I try and it gives me an error. For example, I try to switch .375 stig to .45 ACP for a universal pistol ammo, but it tells me I have an unfinished string and the weapon stops showing up in the weapons menu. Any suggestions? At this rate I will just have to say which ammo goes where and thats a lot of work.
Last edited by Spoody; Dec 1, 2015 @ 3:22pm
iZanTic Nov 9, 2016 @ 11:00am 
Here i fix the code so it is easy to edit in the future.
Also you can add what ever model you feel like, just hold Q and find a model you
want and right click and copy then paste the model.

DarkRP.createAmmoType(".50 AE", {
name = ".50 AE Ammo",
model = "models/weapons/w_ammobox_thrown.mdl",
price = 100,
amountGiven = 30
})

DarkRP.createAmmoType(".45 ACP", {
name = ".45 ACP Ammo",
model = "models/weapons/w_ammobox_thrown.mdl",
price = 100,
amountGiven = 30
})

DarkRP.createAmmoType(".357 SIG", {
name = ".357 SIG Ammo",
model = "models/weapons/w_ammobox_thrown.mdl",
price = 100,
amountGiven = 30
})

DarkRP.createAmmoType("12 Gauge", {
name = "12 Gauge Ammo",
model = "models/weapons/w_ammobox_thrown.mdl",
price = 100,
amountGiven = 30
})

DarkRP.createAmmoType("9x19MM", {
name = "9x19MM Ammo",
model = "models/weapons/w_ammobox_thrown.mdl",
price = 100,
amountGiven = 30
})

DarkRP.createAmmoType("23x75MMR", {
name = "23x75MMR Ammo",
model = "models/weapons/w_ammobox_thrown.mdl",
price = 100,
amountGiven = 30
})

DarkRP.createAmmoType(".44 Magnum", {
name = ".44 Magnum Ammo",
model = "models/weapons/w_ammobox_thrown.mdl",
price = 100,
amountGiven = 30
})

DarkRP.createAmmoType("40MM HE", {
name = "40MM HE Ammo",
model = "models/weapons/w_ammobox_thrown.mdl",
price = 100,
amountGiven = 30
})

DarkRP.createAmmoType(".380 ACP", {
name = ".380 ACP Ammo",
model = "models/weapons/w_ammobox_thrown.mdl",
price = 100,
amountGiven = 30
})

DarkRP.createAmmoType("5.45x39MM", {
name = "5.45x39MM Ammo",
model = "models/weapons/w_ammobox_thrown.mdl",
price = 100,
amountGiven = 30
})

DarkRP.createAmmoType("5.56x45MM", {
name = "5.56x45MM Ammo",
model = "models/weapons/w_ammobox_thrown.mdl",
price = 100,
amountGiven = 30
})

DarkRP.createAmmoType(".50 BMG", {
name = ".50 BMG Ammo",
model = "models/weapons/w_ammobox_thrown.mdl",
price = 100,
amountGiven = 30
})

DarkRP.createAmmoType("7.62x39MM", {
name = "7.62x39MM Ammo",
model = "models/weapons/w_ammobox_thrown.mdl",
price = 100,
amountGiven = 30
})

DarkRP.createAmmoType(".454 Casull", {
name = ".500 SW Ammo",
model = "models/weapons/w_ammobox_thrown.mdl",
price = 100,
amountGiven = 30
})

DarkRP.createAmmoType("7.62x51MM", {
name = "7.62x51MM Ammo",
model = "models/weapons/w_ammobox_thrown.mdl",
price = 100,
amountGiven = 30
})

DarkRP.createAmmoType("10x25MM", {
name = "10x25MM Ammo",
model = "models/weapons/w_ammobox_thrown.mdl",
price = 100,
amountGiven = 30
})

DarkRP.createAmmoType("9x18MM", {
name = "9x18MM Ammo",
model = "models/weapons/w_ammobox_thrown.mdl",
price = 100,
amountGiven = 30
})
Last edited by iZanTic; Nov 9, 2016 @ 11:01am
< >
Showing 1-4 of 4 comments
Per page: 15 30 50

Date Posted: Sep 14, 2014 @ 1:09pm
Posts: 4