function chat() {
// event
var user_id = Entity.GetEntityFromUserID(Event.GetInt("userid"));
var text = Event.GetString("text");
// netvar
var team = Entity.GetProp(user_id, "CBaseEntity", "m_iTeamNum");
// csgo_english.txt : 1048
var location = Entity.GetProp(user_id, "CBasePlayer", "m_szLastPlaceName");
// chat
var name = Entity.GetName(user_id);
var alive = Entity.IsAlive(user_id) ? "" : " *DEAD*";
var string;
if (!Entity.IsEnemy(user_id))
return;
// ClientModeShared::FireGameEvent?
switch (team) {
case 2:
string = " \x09 ● " + alive + "(Terrorist) " + name + " @ \x04" + location + " :\x01 " + text;
break;
case 3:
string = " \x09 ● \x0B " + alive + "(Counter-Terrorist) " + name + " @ \x04" + location + " :\x01 " + text;
break
default:
return;
}
Cheat.PrintChat(string + "\n");
}
Cheat.RegisterCallback("player_say", "chat")