Raised This Month: $32 Target: $400
 8% 

Solved [HELP] Stopping Brass Event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hellmonja
Senior Member
Join Date: Oct 2015
Old 08-10-2019 , 15:12   [HELP] Stopping Brass Event
Reply With Quote #1

Any way to stop an event? I'm trying to stop the Brass event (https://wiki.alliedmods.net/Half-Lif...e_Events#Brass) for M3, Scout, and AWP, but nothing works. Here's what I have so far:
PHP Code:
register_event("Brass""Event_Brass""a");
...
public 
Event_Brass()
{
    new 
user read_data(15);
    
client_print(userprint_chat"BRASS!");

    return 
PLUGIN_HANDLED

The client_print is there to tell me if it's hooked, and it is so far. But it doesn't stop the shell that's ejecting after you shoot...
__________________

Last edited by hellmonja; 08-10-2019 at 23:51.
hellmonja is offline
thEsp
BANNED
Join Date: Aug 2017
Old 08-10-2019 , 15:23   Re: [HELP] Stopping Brass Event
Reply With Quote #2

Register (hook) it as a message?
thEsp is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 08-10-2019 , 15:29   Re: [HELP] Stopping Brass Event
Reply With Quote #3

Quote:
Originally Posted by thEsp View Post
Register (hook) it as a message?
What do you mean?
PHP Code:
register_event("Brass""Event_Brass""a"); 
Like this?...
__________________
hellmonja is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 08-10-2019 , 16:11   Re: [HELP] Stopping Brass Event
Reply With Quote #4

Code:
register_message(get_user_msgid("Brass"), "EjectBrass"); ... public EjectBrass() {     return PLUGIN_HANDLED; }

or hook Ham_Weapon_PrimaryAttack and set the m_flEjectBrass member to 0.0
__________________









Last edited by CrazY.; 08-10-2019 at 16:13.
CrazY. is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-10-2019 , 17:13   Re: [HELP] Stopping Brass Event
Reply With Quote #5

register_event is a post hook, you can not block anything.
register_message is a pre hook.
__________________
HamletEagle is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 08-10-2019 , 23:37   Re: [HELP] Stopping Brass Event
Reply With Quote #6

Quote:
Originally Posted by CrazY. View Post
Code:
register_message(get_user_msgid("Brass"), "EjectBrass"); ... public EjectBrass() {     return PLUGIN_HANDLED; }

or hook Ham_Weapon_PrimaryAttack and set the m_flEjectBrass member to 0.0
It works! Thank you! So basically I just had to switch from event to message, I didn't understand that the first thEsp told me. Finally fixed it after a long while.

Quote:
Originally Posted by HamletEagle View Post
register_event is a post hook, you can not block anything.
register_message is a pre hook.
Very good to know, thank you very much! I'm sure I'll keep that in mind from now on...
__________________

Last edited by hellmonja; 08-10-2019 at 23:51. Reason: grammar
hellmonja is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-11-2019 , 01:46   Re: [HELP] Stopping Brass Event
Reply With Quote #7

You also can block the message using set_msg_block(get_user_userid("Brass"), BLOCK_SET) it will be much better.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 08-11-2019 at 01:46.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply


Thread Tools
Display Modes

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 19:01.


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