Thanks to <VeCo> I understood what am I doing. So, here is the working code.
PHP Code:
#include <amxmodx>
public plugin_init()
{
register_plugin("Test", "0.0.1", "ConnorMcLeod")
register_message(get_user_msgid("SayText"), "Message_SayText")
}
public Message_SayText()
{
new szChannel[40]
get_msg_arg_string(2, szChannel, charsmax(szChannel))
if(equal(szChannel, "#Cstrike_Chat", 13))
{
if(equal(szChannel, "#Cstrike_Chat_All"))
{
format(szChannel, charsmax(szChannel), "^4[Haha] ^3%%s1 ^1: %%s2")
}
else
{
format(szChannel, charsmax(szChannel), "^4[Haha] ^3%s", szChannel)
}
set_msg_arg_string(2, szChannel)
}
}