Question of user's message

I have met the problem to use user’s message to transfer data between client and server side… I just do the following procedures, by which I expect that by typing command 'Remessage" in server side, the client side can show the Msg “The message has been received!!”… Client side file is stored at ‘lua\autorun\client’ and server side file is put at ‘lua\autorun\server’

On client side:
[lua]
function my_message_hook( um )
Msg( “The message has been received!!” )
end
usermessage.Hook(“my_message”, my_message_hook)
[/lua]

On the server side:
[lua]
function Remessage()
local rp = RecipientFilter() – Grab a CRecipientFilter object
rp:AddAllPlayers() – Send to all players!
umsg.Start(“my_message”, rp)
umsg.End()
end
concommand.Add(“Remessage”,Remessage)
[/lua]

However, in console after I type in Remessage, nothing happens… Anyone knows the reason?

Thank you very much!

its usermessage not user’s message. And i dont see any problems in your code. Is there an error?

No error report. The problem is that, when I type Remessage in console, nothing happens, rather than “The message has been received!!” shows in console.

Recipient filter is deprecated. Try this.

[lua]
– CLIENT
function my_message_hook( um )
Msg( "The message has been received!!
" )
end
usermessage.Hook(“my_message”, my_message_hook)

– SERVER

function Remessage()
umsg.Start(“my_message”)
umsg.End()
end
concommand.Add(“Remessage”,Remessage)
[/lua]

Though, there’s no reason for yours not to work.

Huh. Since when? And what other way is there to send usermessages to multiple clients, but not all?

A table of players.

[editline]08:52PM[/editline]

I think.