Raised This Month: $ Target: $400
 0% 

Blocking weapon fire, including client-side sounds/animations


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
DevconeS
Member
Join Date: May 2006
Location: Switzerland
Old 07-12-2006 , 20:28   Re: Blocking weapon fire, including client-side sounds/animations
Reply With Quote #4

Quote:
Originally Posted by KCE
Code:
//fakemeta method public PlayerPreThink( id ) {     //Do whatever checks you need to do and whatnot...         if( !is_user_alive(id) )         return FMRES_IGNORED;         //Remove the attack button from their button mask         set_pev( id, pev_button, pev(id,pev_button) & ~IN_ATTACK );     return FMRES_HANDLED; }
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 }

Last edited by DevconeS; 07-12-2006 at 20:38.
DevconeS is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:52.


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