357 ammo for DarkRP

How can I add 357 ammo to the DarkRP F4 menu?

I am using realistic CS:S weapons 4.0 and there is no way to buy ammo for the Deagle without spawning more guns or buying more shipments.

What files do I need to edit?

Note: I know basic stuff about Lua but I’m not that good at it so please be more explanatory if possible.

Just change the ammotype in CSSRealistic/lua/weapons/weapon_real_cs_desert_eagle/shared.lua
Find "SWEP.Primary.Ammo = “357"” and exchange that to “SWEP.Primary.Ammo = “pistol”” and it should work. It’s helluva lot easier than adding a new ammo type.

What are you talking bout Donkie? Not what he’s asking for…

He was saying that there was no way of getting ammo for the deagle, since it used the 357 ammo. DarkRP only got the pistol and smg ammo types. I said that, it’s much easier to just change the ammotype of deagle, to pistol, than adding a new ammotype to darkrp, which is alot harder.

He wants an item added to the F4 menu. That gives ammo. That’s not hard…

**[Player.GiveAmmo

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Player.GiveAmmo)**

As said, It’s harder than changing 6 letters in a line.

I’d say you’d also find a hard time stopping a Deagles magazine into an AK. But that might just be me.

Freze is right, Donkie step off your idea is stupid, just go to Madcows, which has a bunch of entities that give you ammo when you use them, very similar to darkrp’s ammo system. You can take the .357 ammo entity and put it in AddEntities.lua and add it using the AddEntity() function, or whatever it is.

This is easier than what Freze was suggesting, what he meant was… well before I get to that let me explain stuff lol

The way darkrp’s ammo thingies in the f4 menu work is, when you click on them you say something along the lines of /buypistolammo or something like that, and in GM:PlayerSay, there is a function(or a hook, I dont remember) that does ply:Give(“item_ammo_pistol”)

What freze was suggesting was to add another hook to GM:PlayerSay and adding another one of those icons to the f4 menu, what I would say to do is in the first paragraph(im lazy lawl)

Dingo dingo. I’m not working with darkrp. So i don’t know if there’s any addcustom entity functions.

His idea is not stupid at all. The only weapon, which cannot recieve ammo the ideal way, is the Deagle.
It makes more sense, changing the ammo used in the gun to “pistol”, instead of downloading an ammo entity and having to add it and if it doesent work, then that’s just more work.

Change 6 letters - Download ammo entity and add to the server + include it in the F4 menu’s files.
‘’’’_(o.o)_/’’’’

Oh. So what you’re suggesting is make DarkRP even more dumb.
If you’d atleast put a bit of realism. It’d have SOME.

Rather have more kinds of ammo.

I just dont see why having another kind of ammo, for just one single gun, would make it more fun.

Guns != RP.

And that’s totally relevant to this thread.

I know right?

More kinds of ammo != Better RP.

Add this to init.lua
[lua]
CreateConVar(“ammo357cost”,120) --120 can be whatever value
[/lua]
Go to main.lua in gamemode folder and look for

[lua]
if args == “rifle” then
ply:GiveAmmo(80, “smg1”)
elseif args == “shotgun” then
ply:GiveAmmo(50, “buckshot”)
elseif args == “pistol” then
ply:GiveAmmo(50, “pistol”)
end
[/lua]
It’s around line 1100

Change that to

[lua]
if args == “rifle” then
ply:GiveAmmo(80, “smg1”)
elseif args == “shotgun” then
ply:GiveAmmo(50, “buckshot”)
elseif args == “357” then
ply:GiveAmmo(50, “357”)
elseif args == “pistol” then
ply:GiveAmmo(50, “pistol”)
end
[/lua]

You can now say /buyammo 357. If you want to put it in the f4 menu, you’ll need to mod that too.

Go to showteamtabs.lua and look for
[lua]
AddIcon(“models/Items/BoxSRounds.mdl”, string.format(LANGUAGE.buy_a, “Pistol ammo”, CUR … tostring(GetConVarNumber(“ammopistolcost”))), “/buyammo pistol”)
AddIcon(“models/Items/BoxMRounds.mdl”, string.format(LANGUAGE.buy_a, “Rifle ammo”, CUR … tostring(GetConVarNumber(“ammoriflecost”))), “/buyammo rifle”)
AddIcon(“models/Items/BoxBuckshot.mdl”, string.format(LANGUAGE.buy_a, “Shotgun ammo”, CUR … tostring(GetConVarNumber(“ammoshotguncost”))), “/buyammo shotgun”)
[/lua]

Add this to the group
[lua]
AddIcon(“whatever the 357 ammoboxmodel is. You find it not me.”, string.format(LANGUAGE.buy_a, “357 ammo”, CUR … tostring(GetConVarNumber(“ammo357cost”))), “/buyammo 357”)
[/lua]

K so say i want to put multiple ammo types to be purchased in the same /buyammo command, how would I do that?

Like if I wanted the Rifle ammo to give: SMG ammo, and rpg_rounds (this is an example)

[lua]if args == “rifle” then
ply:GiveAmmo(80, “smg1”)
ply:GiveAmmo(10, “rpg_rounds”) – :smiley:
elseif args == “shotgun” then
ply:GiveAmmo(50, “buckshot”)
elseif args == “pistol” then
ply:GiveAmmo(50, “pistol”)
end[/lua]

You should just go with Pistol Ammo for the Deagle.
It’s waay too extra to have Deagles use their own special ammo.
And even if you decide to add the .357 rev, it’s still stupid.