DarkRP Question Regarding Ammo

Is there a way to add an entity to the ammo tab.

I have tons of guns on my server all with different ammo types, some of which are entities.

DarkRP.createEntity(“Ammo Pack”, {
ent = “cw_ammo_kit_small”,
model = “models/Items/BoxMRounds.mdl”,
price = 100,
max = 2,
cmd = “buysmallammokit”,
catagory = “Ammo”,

I would like to make that entity show up in the ammo tab. Right now it shows up in entity tab because of the CW weps ammo pack entity.

yeah i dont think this is possible.

Check how other ammo entities that are in the game by default were added.

[editline]8th March 2016[/editline]

Try this:
[lua]DarkRP.createAmmoType(“cw_ammo_kit_small”, {
name = “Stalkers Delicious Ammo”,
model = “models/Items/BoxMRounds.mdl”,
price = 100,
amountGiven = 30,
})[/lua]

The CW weapons use ents for ammo.

I tried this and it spawns the model but it does not give ammo.

Oh, I think its gonna be annoying to do then. One way is to edit the F4 menu to allow entities to be spawned from it, which is annoying. The other way is to edit all the CW guns to use the ammo that you create with DarkRP, which is also annoying.

well i would edit the F4 but its a ScriptFodder F4 and the author wont give me permission to have it edited. Also he’s too busy to fix it for me.

You can shove his “permission” in his ass, just edit it yourself.

If we’re talking about CW2.0, I used the whole bullet name (i.e. 7.62x56mm or .50 AE and the like) and it worked out pretty fine

If you’re using DarkRP 2.6+, you can use subcategories for ammo crates on the entities tab.

You can find the kind of ammo the weapon uses on the weapon’s lua file, just look for Primary.Ammo or something like that.

IIRC (didn’t check, lost my ammo.lua file some months ago) you do this:


DarkRP.createAmmoType("7.62x56mm", {
    name = "7.62x56mm rifle ammo",
    model = "models/Items/BoxMRounds.mdl",
    price = 100,
    amountGiven = 30,
})

EDIT: Just extracted the CW2 files, on customizable_weaponry_2.0\lua\weapons\cw_ak74\shared.lua, by the bottom (line 144 in this case) you can find the ammo type



SWEP.Primary.ClipSize		= 30
SWEP.Primary.DefaultClip	= 30
SWEP.Primary.Automatic		= true
SWEP.Primary.Ammo			= "5.45x39MM"


I’m not using the normal CW wep ammo. I’m using the ammo crate ents.

ent = “cw_ammo_kit_small”,
model = “models/Items/BoxMRounds.mdl”,

snip

Check your license.txt that came with the addon. If the author hasn’t edited it and is using the default, it gives you explicit rights to modify the addon in any way you see fit provided you don’t redistribute it.