AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Can I use Ham_Weapon_PrimaryAttack to hook (https://forums.alliedmods.net/showthread.php?t=82302)

hzqst 12-20-2008 20:23

Can I use Ham_Weapon_PrimaryAttack to hook
 
1. Can I use Ham_Weapon_PrimaryAttack to hook primary attack event instead of using prethink?
2. Does it work for C4?(press +attack but not planting)

anakin_cstrike 12-21-2008 02:40

Re: Can I use Ham_Weapon_PrimaryAttack to hook
 
1. Yes...another method: playbackevent (FM) using primary weapons events, but is more code...(see VEN's tutorial)
2. I think you can use CmdStart, but i'm not sure if that is what you're looking for.

sorry for no examples

ConnorMcLeod 12-21-2008 04:17

Re: Can I use Ham_Weapon_PrimaryAttack to hook
 
1. You could, but this is called from weapons, not for players, and so you have to register the forward for every weapons type, then you have to filter too know if a shot will be done when the forward is called.
2. Should work.

If you stay with prethink thing, you should really use FM_CmdStart instead.


All times are GMT -4. The time now is 09:12.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.