Quote:
Originally Posted by DevconeS
Blocking buttons like IN_ATTACK in PreThink isn't very good. It just works for the knife and not that good.
I recommend the use of FM_CmdStart because it causes a better result than in PretThink and you're able to block all the weapon attacks.
Code:
// Put this in plugin init (yes it's for hooking the forward)
register_forward(FM_CmdStart,"fwd_CmdStart")
// Put this somewhere in the code ;)
public fwd_CmdStart(id, uc_handle, seed) {
if(!is_user_alive(id)) return FMRES_IGNORED
new buttons = get_uc(uc_handle,UC_Buttons)
if(buttons & IN_ATTACK) {
buttons &= ~IN_ATTACK
set_uc(uc_handle,UC_Buttons,buttons)
}
return FMRES_HANDLED
}
|
So far preThink is the tried and true method. There's never one solution to a problem
EDIT: Ok, I've just tried it and it seems to work the same way as preThink? Nothing different...
__________________
My 3D Art: http://k-c-e.deviantart.com/
[img]http://img213.**************/img213/7132/userbar152416mp2.gif[/img]
[img]http://img65.**************/img65/5606/userbar152433ie5.gif[/img]
[img]http://img223.**************/img223/7576/userbar152440yk6.gif[/img]