• [Help] How to Override weapon selection menu? Is there a Hook?
    5 replies, posted
Allright, So I just put my finishing touches on the HUD I have been working on, which is pretty much a 100% custom VGUI. (Or it is going to once I implement a few things I cant find hooks for, like this.) I need to override the selection menu for the weapons, but I cannot seem to find any hooks for it in order to draw my own info into it. Anyone have any ideas on how I can go about this?
Try this: [b][url=wiki.garrysmod.com/?title=Gamemode.HUDShouldDraw]Gamemode.HUDShouldDraw [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
[url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index689f.html[/url] [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexf193.html[/url]
[QUOTE=skullorz;36425688]Try this: [b][url=wiki.garrysmod.com/?title=Gamemode.HUDShouldDraw]Gamemode.HUDShouldDraw [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b][/QUOTE] [QUOTE=cis.joshb;36427202][url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index689f.html[/url] [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexf193.html[/url][/QUOTE] Well with the combination of both of your suggestions, I can Disable the default one... However, I already knew that. I don't really think this answers my question on how to go about replacing the default one... or perhaps I am missing something. CHudWeaponSelection is an element. Not sure if I can ovverride that, but surely I can make my own and display that instead. Question is... how? How do I get the selections of the weapons and switch once the player clicks, etc?
PlayerBindPress - For selecting weapons HUDShouldDraw - For disabling hl2 weapon selection being drawn HUDPaint - For your new weapon selection.
[QUOTE=Aide;36453055]PlayerBindPress - For selecting weapons HUDShouldDraw - For disabling hl2 weapon selection being drawn HUDPaint - For your new weapon selection.[/QUOTE] [lua] function HUDPlayerBind(ply,cmd,held) if cmd == "slot1" then //Do stuff to select the weapon. end end [/lua] I should also mention that the "use" command will be handy when you're near the finish of this thing.
Sorry, you need to Log In to post a reply to this thread.