You would use TextMsg to do that. I implemented the following code based on regamedll source, refer to for more examples. Make sure you to not pass a string with length greater than 190 characters, otherwise the server will probably crash.
Code:
enum
{
HUD_PRINTNOTIFY = 1,
HUD_PRINTCONSOLE,
HUD_PRINTTALK,
HUD_PRINTCENTER,
HUD_PRINTRADIO
}
new gmsgTextMsg
...
public plugin_init()
{
gmsgTextMsg = get_user_msgid("TextMsg")
}
...
// Print to everyone
UTIL_ClientPrintAll(msg_dest, msg_name[], param1[]="", param2[]="", param3[]="", param4[]="")
{
message_begin(MSG_ALL, gmsgTextMsg)
write_string(msg_name)
if (param1[0])
write_string(param1)
if (param2[0])
write_string(param2)
if (param3[0])
write_string(param3)
if (param4[0])
write_string(param4)
message_end()
}
// Print to single client
UTIL_ClientPrint(client, msg_dest, msg_name[], param1[]="", param2[]="", param3[]="", param4[]="")
{
message_begin(MSG_ONE, gmsgTextMsg, _, client)
write_string(msg_name)
if (param1[0])
write_string(param1)
if (param2[0])
write_string(param2)
if (param3[0])
write_string(param3)
if (param4[0])
write_string(param4)
message_end()
}
// Usage
UTIL_ClientPrintAll(HUD_PRINTCENTER, "#Bomb_Defused")
__________________