Your own weapon slot...

Hello. I am working on my first sweps, and I have a queation. Is this posible to create your own weapon slot? Like this… We have code:



SWEP.PrintName         = "Dragon pistols!"  
SWEP.Slot                  = %yourownnumberhere%  
SWEP.SlotPos             = 1  
SWEP.DrawAmmo       = true
SWEP.DrawCrosshair   = true  
SWEP.ViewModelFlip   = true  
SWEP.ViewModelFOV   = 64  
SWEP.ViewModel         = "models/weapons/v_pistol.mdl"  
SWEP.WorldModel       = "models/weapons/w_pistol.mdl"  
SWEP.ReloadSound     = "weapons/shotgun/pistol_reload.wav"  
SWEP.HoldType           = "pistol"  


Sooo… Can I do this? Or, is this just enterned into GMod client/server code?

Any thing is possible, but you would have to recode the game so I am going to say No.

The weapon slots are built into Garrys Mod and cannot be modified, if you wish to do so you must recode Garrys Mod and … just nevermind. Only use 1-6

You can block the default from being drawn with

and then make your own.

Please next time dont answer unless you know what your talking about help that is incorrect is not help at all is it

I knew what I was talking about . . . .

No you didn’t, You don’t have to “recode the game” to have extra weapon slots, Lua was embedded into garrysmod for this exact reason, adding extra functionality.

I don’t understand where that attitude comes from. Just because you can’t think of a way to do something, or something that someone else has done uses a strange/hacky method of doing something, doesn’t mean it can’t or hasn’t been done. The assertion of this sort of ignorance is prevalent throughout facepunch, and doesn’t belong in any of the lua sections. If you don’t know what you are talking about (despite your assertion that you do, I know that you are just too proud to admit that you don’t), you shouldn’t assert any opinion at all that gives a definite answer for the sake that you may spread your own ignorance to another. As bad as ignorance is, ignorance being taught as fact is a thousand times worse.

This would be pretty simple to do, actually. You’d have to iterate through the player’s weapon list, and create a custom panel for new weapon entries, then turn off the old indicators, and create keyboard binds for the new panel. You should also be able to detect mousewheel activity pretty easily to change the highlighted panel.

Then, it’s as simple as detecting weapon pickups, etc, and creating a new panel for it.

Of course, in order for this to work, you’re going to have to account for EVERY sort of weapon on the server, so it won’t be particularly practical unless you are creating a closed mod that isn’t meant to be used with other sweps defined by the server.