Raised This Month: $ Target: $400
 0% 

blocking fire in client side


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
larnk
Member
Join Date: Dec 2004
Old 02-13-2005 , 01:14   blocking fire in client side
Reply With Quote #1

I have searched the forums, in general, using
entity_set_int(id,entity_get_init(id,EV_INT_b utton)& ~IN_ATTACK))
to block fire, but in the client, we still see rapid fire and hear fire sound.
If we can real block firing in the client side ?

for example, when we are reloading ammos, press fire is no use, without fire, but I do not the how to make a fake reloading event....
larnk is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-13-2005 , 02:07  
Reply With Quote #2

You can try this, but I haven't tested.

Code:
public client_PreThink(id) {   if(!is_user_alive(id)) {     return PLUGIN_CONTINUE;   }   new button = entity_get_int(id,EV_INT_button);   if(button & IN_ATTACK) {     entity_set_int(id,EV_INT_button,button & ~IN_ATTACK);     entity_set_int(id,EV_INT_weaponanim,0);   }   return PLUGIN_CONTINUE; }

It's your basic stop firing code with the added reset of weaponanim, but you would still hear the sound and muzzle flash. I suppose you could catch the emitting of the sound with FakeMeta and stop it, but it would be hard (with so many different firing sounds).
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
larnk
Member
Join Date: Dec 2004
Old 02-13-2005 , 03:57  
Reply With Quote #3

well, thank you for your kind...

I have tried useing client_PreThink... but still hear sound..

I mean If we can set the weapon is busy or is reloading ammos...just like when Reload is pressed in client side....
larnk is offline
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 02-13-2005 , 11:15   hmmm
Reply With Quote #4

Instead of:

Code:
entity_get_int(id,EV_INT_button)

Use:

Code:
if(get_user_button(id) & IN_ATTACK) {

Less lines and is easier to use.
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
Reply



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 19:20.


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