I set up a usermessage so i can tell the server to send a menu to the player who did the command... But I forgot how to make a specific player receive the menu, no one else... How can I do that?
Hopefully that made sense, I can't think right now..
umsg.Start( Message Name, Player Receiving )
That will send the usermessage ONLY to that player?
[QUOTE=InfernalCookie;34450253]That will send the usermessage ONLY to that player?[/QUOTE]
Yes. What else would be the point of a parameter that filters recipients?
I don't know... I'm new to usermessages...
[QUOTE=wizardsbane;34450480]Yes. What else would be the point of a parameter that filters recipients?[/QUOTE]
No need to be rude, he only asked a question.
[QUOTE=InfernalCookie;34450253]That will send the usermessage ONLY to that player?[/QUOTE]
If you use the player argument, it will only send to the player stated, ad if you leave it empty, it'll send to everyone
There's also a third option to use a recipient filter
Normally, at this point I'd direct you towards the wiki, since I haven't personally used it, but as you know the wiki's down and it's a little awkward to find the pages
It should be something along the lines of:
[lua]local f = RecipientFilter()
f:AddPlayer( ply )
f:AddPlayer( ply2 )
SendUserMessage("UserMessage", f)[/lua]
[QUOTE=InfernalCookie;34450630]I don't know... I'm new to usermessages...[/QUOTE]
If you're new to usermessages, I think I should tell you that there's two ways of sending usermessages, [lua]umsg.Start("Usermessage", ply)
umsg.String("String!")
umsg.End()
//And
SendUserMessage("Usermessage", ply)[/lua] Not sure if there's any real benefit, but using the second one makes for neater code, as long as you're not sending any additional variables
Sorry, you need to Log In to post a reply to this thread.