Hooking +attack?
How would I hook +attack to check for a condition? I'm just now starting out in SM.
Edit: I should elaborate on what I'm trying to do since I've hooked the command and it's not working. Code:
As you can see, I just want to create a semi-auto firing mode for L4D but it's not working. |
Re: Hooking +attack?
AFAIK +attack can't be hooked. Try using an extension.
|
Re: Hooking +attack?
What do you mean?
|
Re: Hooking +attack?
he means that there are extensions (namely Duke Hacks) that may be able to do this for you. You can find them in the Extensions/Snippets forum.
alternatively you can use the dreaded OnGameFrame to detect the IN_ATTACK button flag. but I don't think ClientCommand will work that well for the -attack command. |
Re: Hooking +attack?
|
Re: Hooking +attack?
How would I hook it? Sorry, I'm really completely new to SM.
|
Re: Hooking +attack?
HookEvent("weapon_fire", Event_WeaponFire);
and make a callback. |
Re: Hooking +attack?
http://wiki.alliedmods.net/Events_(SourceMod_Scripting)
That alongside what Crimson has said should get you going |
Re: Hooking +attack?
Hmm. I still can't quite figure out how to limit it to just 1 shot per click though.
Code:
|
Re: Hooking +attack?
Well you cant block an attack with just an event hook, thats simply a notification when they fire. What you can do is hook it, and add 0.1 to their m_flPrimaryAttack or whatever that netprop is, so they will have to wait 0.1 second before firing again.
|
All times are GMT -4. The time now is 12:42. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.