AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Searching for the better usage (https://forums.alliedmods.net/showthread.php?t=162898)

bibu 07-24-2011 09:09

Searching for the better usage
 
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.

Bugsy 07-24-2011 09:12

Re: Searching for the better usage
 
register_impulse as it requires no further conditionals and you wouldn't be calling your forward for every type of impulse.

Diegorkable 07-24-2011 09:20

Re: Searching for the better usage
 
#1 ofcourse

bibu 07-24-2011 09:25

Re: Searching for the better usage
 
Quote:

Originally Posted by Bugsy (Post 1517367)
no further conditionals and you wouldn't be calling your forward for every type of impulse.

Well there are just 2 AFAIK.

Bugsy 07-24-2011 09:50

Re: Searching for the better usage
 
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/

bibu 07-24-2011 09:52

Re: Searching for the better usage
 
Ok, thanks for this. :)


All times are GMT -4. The time now is 01:11.

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