AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Witch should i use, and how? (https://forums.alliedmods.net/showthread.php?t=22466)

Obbin 12-27-2005 15:00

Witch should i use, and how?
 
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!
:)

VEN 12-27-2005 15:08

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 }

Obbin 12-27-2005 15:52

Would that block exactley Game_bomb_pickup?

VEN 12-28-2005 01:59

Re: Witch should i use, and how?
 
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.

Obbin 12-28-2005 05:04

:D :D Thx


All times are GMT -4. The time now is 16:09.

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