AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [CSS] Detect messages before being received (https://forums.alliedmods.net/showthread.php?t=230868)

Paaf 12-03-2013 13:48

[CSS] Detect messages before being received
 
Hi everyone,

I would like to detect messages before being received by clients. In my plugin, I need to hook every messages with HookUserMessage so that I can also detect plugin messages. This is my code so far :

PHP Code:

public OnPluginStart()
{
    
g_textmsg GetUserMessageId("TextMsg");
    
HookUserMessage(g_textmsgUserMessageHooktrue);     
}
 
public 
Action:UserMessageHook(UserMsg:msg_idHandle:bf, const players[], playersNumbool:reliablebool:init)
{
...


I would like to know which client the message is sent to ? Can I find this in bf variable ? const players[] array ?

Thk you for your help,

11530 12-03-2013 14:30

Re: [CSS] Detect messages before being received
 
Quote:

Originally Posted by Paaf (Post 2068248)
const players[] array ?

Yes.

Paaf 12-03-2013 14:50

Re: [CSS] Detect messages before being received
 
How ? What is this array made of ?

Mitchell 12-03-2013 15:12

Re: [CSS] Detect messages before being received
 
Quote:

Originally Posted by Paaf (Post 2068270)
How ? What is this array made of ?

loop through the array, and itll show all the client indexs that the message was sent to.

Paaf 12-03-2013 16:06

Re: [CSS] Detect messages before being received
 
It works,

Thank you ;)


All times are GMT -4. The time now is 10:40.

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