The simplest and most used method is to register the client command "say" and "say_team":
PHP Code:
public plugin_init()
{
register_clcmd("say","cmdSay");
register_clcmd("say_team","cmdSayTeam");
}
public cmdSay(id)
{
new szSaid[64]
read_args(szSaid, charsmax(szSaid))
trim(szSaid)
// szSaid contains the string that the player said in "all chat"
}
public cmdSayTeam(id)
{
new szSaid[64]
read_args(szSaid, charsmax(szSaid))
trim(szSaid)
// szSaid contains the string that the player said in "team chat"
}
If you're in spectate, these same commands are triggered so you'll need to check their team to determine if they are in spectate.
__________________