Hay, so I'm trying to get the actual part of the radio message by hooking the RadioText event:
But I'm running into some issues while printing it, this is the output I get:
This is the code I'm using and according to
this post it worked for him as he described, I'm using
this site to find the structure of radio messages.
PHP Code:
public void OnPluginStart()
{
HookUserMessage(GetUserMessageId("RadioText"), Event_RadioMsg, true);
}
public Action Event_RadioMsg(UserMsg msg_id, Handle bf, const int[] players, int playersNum, bool reliable, bool init)
{
if(GetUserMessageType() == UM_Protobuf)
{
PbReadString(bf, "msg_name", g_Message, 512);
PrintToServer("%s", g_Message);
}
else
{
BfReadString(bf, g_Message, 64);
}
return Plugin_Continue;
}
Does someone know how I can print "Roger that!" in the chat and not "@ (RADIO): "?