Raised This Month: $ Target: $400
 0% 

Witch should i use, and how?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 12-27-2005 , 15:00   Witch should i use, and how?
Reply With Quote #1

To block the message #Game_bomb_pickup:
Code:
public event_Game_bomb_pickup() { client_print(0, print_center, " ") }

or should i use register_message (witch one is fastest/req. least CPU).
And how to use register_message, i didnt understand funcwiki!
__________________
Sig(h)!
Obbin is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 12-27-2005 , 15:08  
Reply With Quote #2

For such purpose your code wouldn't work good.
Because this is not a global event. So you shouldnt use id==0
" " space not necessary.

Example of using register_message:

Code:
#include <amxmodx> #include <engine> public plugin_init() {     register_message(get_user_msgid("SendAudio"), "msg_send_audio") } public msg_send_audio() {     // you can change arguments or block whole message here }
VEN is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 12-27-2005 , 15:52  
Reply With Quote #3

Would that block exactley Game_bomb_pickup?
__________________
Sig(h)!
Obbin is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 12-28-2005 , 01:59   Re: Witch should i use, and how?
Reply With Quote #4

Quote:
Originally Posted by obbin
To block the message #Game_bomb_pickup
Use this way
Code:
// #include <amxmodx> public plugin_init() {     register_event("TextMsg", "event_Game_bomb_pickup", "b", "2=#Game_bomb_pickup") } public event_Game_bomb_pickup(id) {     client_print(id, print_center, "") }

Quote:
Would that block exactley Game_bomb_pickup?
No.
This is just an example.
As you can see here "SendAudio" message id.
You can change this to "TextMsg" message id and check for 2nd argument inside function and then block message with return PLUGIN_HANDLED.
VEN is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 12-28-2005 , 05:04  
Reply With Quote #5

Thx
__________________
Sig(h)!
Obbin 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 16:09.


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