Raised This Month: $ Target: $400
 0% 

[CSS] weapon_fire not good for pistols


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 09-16-2010 , 21:43   [CSS] weapon_fire not good for pistols
Reply With Quote #1

If you're going to hook weapon_fire for pistols, DON'T DO IT!
The event gets called billions of times if the client holds his +attack button.
Hook bullet_impact instead.

Here an example from one of my plugins:
Code:
public Action:EventBulletImpact(Handle:event, const String:name[], bool:dontBroadcast) {     new client = GetClientOfUserId(GetEventInt(event, "userid"))         ,weapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");         if (weapon == specialWeapon) {               MyFunction(client); // MyFunction needs to be called ONCE for each weapon fire, so bullet_impact is the right way to do it.     }         return Plugin_Continue; }

BULLET_IMPACT IS CREDIT TO PLUGIN!
Seta00 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 18:16.


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