AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Block a specific impulse, Here's how you do it (https://forums.alliedmods.net/showthread.php?t=2567)

devicenull 06-08-2004 22:38

Block a specific impulse, Here's how you do it
 
Code:
#include <amxmodx> #include <engine> public plugin_init() {     register_plugin("Block102","0.1","devicenull") } public client_prethink(id) {     new impulse     impulse = entity_get_int(id,EV_INT_impulse)     if (impulse==102) {         //To Block, uncomment next line         // entity_set_int(id,EV_INT_impulse,0)         //To Kick, uncomment below         // new name[32]         // get_user_name(id,name,32)         // server_cmd("amx_kick %s That command is blocked",name)         //Stop uncommenting         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }
Replace 102 with the impulse # to block

PM 06-09-2004 10:38

don't use return PLUGIN_xx. The return value in that function should be ignored (=> use return only). Returning PLUGIN_HANDLED makes me think you want to supercede prethink, which is not a good idea in my eyes (and, like i said, it should not be possible with the engine module).

BAILOPAN 06-09-2004 13:13

Engine for amxx 0.20 has an impulse blocker

AssKicR 06-09-2004 13:45

register_impulse right

BAILOPAN 06-09-2004 13:49

No

devicenull 06-09-2004 19:49

Quote:

Originally Posted by PM
don't use return PLUGIN_xx. The return value in that function should be ignored (=> use return only). Returning PLUGIN_HANDLED makes me think you want to supercede prethink, which is not a good idea in my eyes (and, like i said, it should not be possible with the engine module).

I really dont do much with the return, I use entity_set_int to set the impulse to 0.. which blocks it
the return was because the compiler said it should return stuff :)


Ooo... are we getting register_impulse in 0.20? Please?

PM 06-10-2004 05:15

well anyways only do retrun without a value. I noticed what actually blocks it (this question was already answered somewhere i think), but the return confuses people (like me :) )

BAILOPAN 06-10-2004 08:53

I'll think about it, personally I don't like register_impulse and see no reason for it, so I did client_impulse forward


All times are GMT -4. The time now is 14:43.

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