I hooked msg, but get Native Error when try Read "msg_name" as String, as Int, as message and as repeted too. I need hide only Decoy's msg, not all. I use search in bins and find only this. Help me, pls.
Code:
CCSUsrMsg_RadioText
msg_dst (
client (
msg_name (
params ( ""
My code:
PHP Code:
public OnPluginStart()
{
HookUserMessage(GetUserMessageId("RadioText"), OnRadioText, true);
}
public Action:OnRadioText(UserMsg:msg_id, Handle:hBf, const iaPlayers[], iPlayersNum, bool:bReliable, bool:bInit)
{
new String:sText[512];
if (GetUserMessageType() == UM_Protobuf) {
PrintToServer("msg_dst: %d, client: %d", PbReadInt(hBf, "msg_dst"), PbReadInt(hBf, "client"));
PbReadString(hBf, "msg_name", sText, 512, 0);
PrintToServer("%s", sText);
PbReadString(hBf, "params", sText, 512, 0);
PrintToServer("%s", sText);
} else {
BfReadString(hBf, sText, 64);
}
return Plugin_Continue;
}