Help with SWEP Ammo

I was wondering if there was a way to change the “Primary.Ammo” a SWEP uses on command. Such as:

if self.Owner:KeyPressed( IN_ATTACK2 ) then
SWEP.Primary.Ammo = "pistol"

I’ve tried doing the above and other variations but it seems that it’s not possible to change after the SWEP has been created. Does anyone know how/ is it not possible?

use SWEP.Secondary.Ammo instead.

Thanks for the response but the SWEP I’m making requires more than two ammo types. Six currently actually.

Then create variables for 4 more ammo types and modify your primary func to draw from each depending on what mode is selected

[editline]17th December 2013[/editline]

MAKE SURE the clip variables are networked somehow

If you’re talking about something like this:

SWEP.Primary.Ammo = itemammo[self.WallType]


Then it doesn’t work unfortunately.

no not like that
I mean create networked variables that act like fake ammo, then do some DrawHUD() shit to show those ammo counts

Ah I see, I’ll give it a shot thanks man! I’ll try to remember to post my code when I’m done for anyone who finds this in the future searching for an answer.

Alright took me some time because of all the Christmas stuff going on this week. Turns out that the code I use is so integrated into my gamemode that it’s impossible for me to do a simple copy/paste here. However if anyone needs some help with a project of theirs let me know and I can try to help. I’m normally on at least once a week and will be of as much assistance as possible.