• Is anything called when a player holds a weapon
    8 replies, posted
Is anything called when a player holds a weapon? I was looking at [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/WEAPON/Equip]WEAPON/Equip[/url], but that is when a player picks up a weapon, and even when they're not holding the weapon, the code will still run as if they were.
[url=http://wiki.garrysmod.com/page/WEAPON/Deploy]this?[/url]
Just check if the weapon currently being held is the one that you're doing stuff with?
[QUOTE=Neat-Nit;47146071][url=http://wiki.garrysmod.com/page/WEAPON/Deploy]this?[/url][/QUOTE] No I don't think that will work, where would I put the name of the weapon? [QUOTE=EvacX;47146075]Just check if the weapon currently being held is the one that you're doing stuff with?[/QUOTE] Okay, so would I use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/IsPlayerHolding]Entity:IsPlayerHolding[/url]
Sounds like you don't know what you're asking for. Since you linked to a WEAPON hook I assumed you wanted a WEAPON hook. [url=http://wiki.garrysmod.com/page/GM/PlayerSwitchWeapon]This[/url] is probably what you want.
Okay, can you forget what I said before? Now I'm asking if there is a way to see the name of the weapon a player is holding.
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/GetActiveWeapon]Player:GetActiveWeapon[/url] [editline]15th February 2015[/editline] Searching the wiki is easy, please look there first.
Ok sorry, I'll make sure to look on the wiki. Thanks for the answer!
You're welcome!
Sorry, you need to Log In to post a reply to this thread.