Raised This Month: $ Target: $400
 0% 

Block a specific impulse, Here's how you do it


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 06-08-2004 , 22:38   Block a specific impulse, Here's how you do it
Reply With Quote #1

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
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 06-09-2004 , 10:38  
Reply With Quote #2

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).
__________________
hello, i am pm
PM is offline
BAILOPAN
Join Date: Jan 2004
Old 06-09-2004 , 13:13  
Reply With Quote #3

Engine for amxx 0.20 has an impulse blocker
__________________
egg
BAILOPAN is offline
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 06-09-2004 , 13:45  
Reply With Quote #4

register_impulse right
__________________
My Plugins

Got ??
AssKicR is offline
BAILOPAN
Join Date: Jan 2004
Old 06-09-2004 , 13:49  
Reply With Quote #5

No
__________________
egg
BAILOPAN is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 06-09-2004 , 19:49  
Reply With Quote #6

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?
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 06-10-2004 , 05:15  
Reply With Quote #7

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 )
__________________
hello, i am pm
PM is offline
BAILOPAN
Join Date: Jan 2004
Old 06-10-2004 , 08:53  
Reply With Quote #8

I'll think about it, personally I don't like register_impulse and see no reason for it, so I did client_impulse forward
__________________
egg
BAILOPAN 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 14:43.


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