Clientside UserMessages: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Thunder4ik (talk | contribs) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Multiple issues| | |||
{{Dead end|date=January 2024}} | |||
{{Orphan|date=January 2024}} | |||
}} | |||
This code lets you send usermessages to clients completely clientside. (This code only works in the Client project) | This code lets you send usermessages to clients completely clientside. (This code only works in the Client project) | ||
Line 8: | Line 13: | ||
#include "tier0/memdbgon.h" | #include "tier0/memdbgon.h" | ||
CON_COMMAND_F( | CON_COMMAND_F(testum, "TEEEST", FCVAR_CLIENTCMD_CAN_EXECUTE) { | ||
CUtlBuffer msg_data; | CUtlBuffer msg_data; | ||
msg_data.PutChar(0); | msg_data.PutChar(0); |
Latest revision as of 08:50, 21 January 2024

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)

This article has no
links to other VDC articles. Please help improve this article by adding links
that are relevant to the context within the existing text.
January 2024


January 2024

This article is an orphan, meaning that few or no articles link to it.
You can help by
adding links to this article from other relevant articles.
January 2024
You can help by

January 2024
This code lets you send usermessages to clients completely clientside. (This code only works in the Client project)
#include "cbase.h"
#include "usermessages.h"
#include "utlbuffer.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
CON_COMMAND_F(testum, "TEEEST", FCVAR_CLIENTCMD_CAN_EXECUTE) {
CUtlBuffer msg_data;
msg_data.PutChar(0);
msg_data.PutString("BAM, SayText");
msg_data.PutChar(1);
usermessages->DispatchUserMessage(usermessages->LookupUserMessage("SayText"), bf_read(msg_data.Base(), msg_data.TellPut()));
}