Well, i have a plugin that replace some messages like "Terrorists Win!", "The bomb has been planted!" and so.. But message like "Enemy spotted." , "Defusing bomb WITHOUT Defuse kit." , "Press the BUY key to purchase items." , "Free Chase Cam" and etc won't change..
WHY ? and How to replace this messages ? ;)
example:
PHP Code:
new const g_szOriginal[][] = {
"#CTs_Win",
"#Terrorists_Win"
}
#define MAX_REPLACE sizeof(g_szOriginal)
new const g_szReplace[MAX_REPLACE][] = {
"Counter-Terrorists Win!",
"Terrorists Win!"
};
enum _:RGB { R, G, B };
new const g_iColor[MAX_REPLACE][RGB] = {
{255, 255, 255},
{255, 255, 255}
};
new const g_iEffect[MAX_REPLACE] = {
0,
0
};
new const Float:g_fTime[MAX_REPLACE] = {
3.0,
2.0
};
new Trie:g_tReplacements
#define toColor(%1) (%1 == -1 ? random(256) : %1)
public plugin_init() {
register_message(get_user_msgid("TextMsg"), "Message_TextMsg")
g_tReplacements = TrieCreate()
for(new i = 0; i < MAX_REPLACE; i++)
{
TrieSetCell(g_tReplacements, g_szOriginal[i], i);
}
}
public Message_TextMsg(iMsgId, iMsgDest, id) {
if( !id && get_msg_arg_int(1) == print_center )
{
new szMessage[64], index
get_msg_arg_string(2, szMessage, charsmax(szMessage))
if( TrieGetCell(g_tReplacements, szMessage, index) )
{
set_dhudmessage(
.red = toColor(g_iColor[index][R]),
.green = toColor(g_iColor[index][G]),
.blue = toColor(g_iColor[index][B]),
.effects = g_iEffect[index],
.holdtime = g_fTime[index],
.fxtime = g_fTime[index]
);
show_dhudmessage(0, g_szReplace[index])
return PLUGIN_HANDLED
}
}
return PLUGIN_CONTINUE
}