Raised This Month: $ Target: $400
 0% 

Searching for the better usage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bibu
Veteran Member
Join Date: Sep 2010
Old 07-24-2011 , 09:09   Searching for the better usage
Reply With Quote #1

I need to check, if a player uses his spray and flashlight command, what's better to use?

Method #1:

PHP Code:
register_impulse(201"FwdImpulse_201")
register_impulse(100"FwdImpulse_100"
Method #2:

Using "client_impulse" ( http://www.amxmodx.org/funcwiki.php?go=func&id=384 ) and checking their the type of it.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-24-2011 , 09:12   Re: Searching for the better usage
Reply With Quote #2

register_impulse as it requires no further conditionals and you wouldn't be calling your forward for every type of impulse.
__________________
Bugsy is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-24-2011 , 09:25   Re: Searching for the better usage
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
no further conditionals and you wouldn't be calling your forward for every type of impulse.
Well there are just 2 AFAIK.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-24-2011 , 09:20   Re: Searching for the better usage
Reply With Quote #4

#1 ofcourse
Diegorkable is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-24-2011 , 09:50   Re: Searching for the better usage
Reply With Quote #5

I only saw one other in the command list.. Either way you choose won't have much if any affect on performance on your plugin. One you need to check the impulse # and the other you don't.

http://www.counter-strike.com/comman...onsole_server/
__________________
Bugsy is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-24-2011 , 09:52   Re: Searching for the better usage
Reply With Quote #6

Ok, thanks for this.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
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 01:11.


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