Hello everyone,
This question is really bothering me, since I couldn't finish this.
I've tried to hook the radio sounds we have in CS:GO, such as "Enemy Spotted", "Planting the Bomb", etc, but I couldn't hook them with total success.
I know it's possible to hook some commands, like "enemyspot" for the radio commands, but for the grenades it's not possible.
Then I tried by hooking the "player_radio" event, but without any success (only hooks some radio commands, same as I said before);
Then I tried to use a part of the code that
Bacardi showed here (with protobuf ofc), but without any success (it doesn't show anything in the logs).
Some part of the code is here (its just to log when it's used the SendRadio, and yes, no error logs found):
Code
PHP Code:
#include <sourcemod> #include <sdkhooks> #pragma newdecls required UserMsg SendAudio ; public Plugin myinfo = { name = "Radio Hooks" , author = "Hallucinogenic Troll" , description = "" , version = "1.0" , url = "http://www.sourcemod.net/" }; public void OnPluginStart () { SendAudio = GetUserMessageId ( "SendAudio" ); if( SendAudio != INVALID_MESSAGE_ID ) HookUserMessage ( SendAudio , UserMsgSendAudio , true ); else SetFailState ( "GetUserMessageId of SendAudio" ); } public Action UserMsgSendAudio ( UserMsg msg_id , Protobuf pb , const int [] players , int playersNum , bool reliable , bool init ) { char buffer [ 256 ]; LogMessage ( "-------------------------------------------------" ); LogMessage ( "------------------ RADIO SOUNDS ------------------" ); LogMessage ( "-------------------------------------------------" ); pb . ReadString ( "radio_sound" , buffer , sizeof ( buffer )); LogMessage ( "Buffer: %s" , buffer ); return Plugin_Handled ; }
For what I've tested, is possible to change by hooking "RadioText", but when trying to block the message, the sound is still played (I even tried to emit a sound at the same time as the radiotext is used, but the original sound emits before).
Someone has any ideas?
If you don't understand, I'll try to explain in another way (my english is kinda rubbish).
__________________