madcow wepons /drop glitch!!

trying to finish a darkrp server.
for some reason when people drop grenades and knifes they get an extra one if they pick it up . is there a way to fix that or make player not drop grenades or knifes.

If you don’t want to touch your weapon base, then just remove one when they pick one up.

[editline]15th October 2011[/editline]

Also, I suggest you read this. http://www.facepunch.com/showthread.php?t=792401

There’s not much we can do now, we need code and errors.

well i wouldn’t mind messing with it . it looks like when they drop it they lose the weapon but there ammo stays with them. theirs no errors that i see . i might make a vid to show what i am talking about.

So take their ammo when they drop?

i would make an if command to do that but i don’t know the drop command

[editline]15th October 2011[/editline]

ok i have it somewhat working. all i did was wen to the main.lua and under the dropwepon function i added this

[lua] ply:RemoveAmmo (1, “Grenade”) [/lua]

i just figured out that if another weapon had the same ammo type it will remove it as well so instead i did this

[lua] if ply:GetActiveWeapon():GetClass() == “weapon_class” then
ply:RemoveAmmo (1, “ammotype”)
end[/lua]

and then i changed the weapons with the same ammo type so something different.

thank you guys for trying to help

Post your dropweapon function here please

Update your DarkRP version.

its already updated to the latest if you where asking me

the drop function is in the darkrp main.lua folder at line 384. some ware around there

Im not downloading darkrp just to fix something for you…

This was fixed in i231- Feb 19, 2010.

[editline]16th October 2011[/editline]

If you’re running vanilla it should work.

i already fixed it