case CMD_REQUEST_COMMAND:
{
if (argc >= 2)
- {
- string _classname = string_null;
- if (!IS_PLAYER(caller) && caller.caplayer)
- {
- // CA: make work team chat for killed players
- _classname = caller.classname;
- caller.classname = STR_PLAYER;
- }
-
Say(caller, true, NULL, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1);
- if (_classname)
- caller.classname = _classname;
- }
return; // never fall through to usage
}
msgin = formatmessage(source, msgin);
string colorstr;
- if (!IS_PLAYER(source))
+ if (!(IS_PLAYER(source) || source.caplayer))
colorstr = "^0"; // black for spectators
else if(teamplay)
colorstr = Team_ColorCode(source.team);
sourcecmsgstr = cmsgstr;
}
- if (!privatesay && source && !IS_PLAYER(source))
+ if (!privatesay && source && !(IS_PLAYER(source) || source.caplayer))
{
if (!game_stopped)
if (teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !warmup_stage))
ret = 1;
}
- if (privatesay && source && !IS_PLAYER(source))
+ if (privatesay && source && !(IS_PLAYER(source) || source.caplayer))
{
if (!game_stopped)
- if ((privatesay && IS_PLAYER(privatesay)) && ((autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !warmup_stage)))
+ if ((privatesay && (IS_PLAYER(privatesay) || privatesay.caplayer)) && ((autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !warmup_stage)))
ret = -1; // just hide the message completely
}
dedicated_print(msgstr); // send to server console too
if(sourcecmsgstr != "")
centerprint(source, sourcecmsgstr);
- FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it != source && it.team == source.team && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), {
+ FOREACH_CLIENT((IS_PLAYER(it) || it.caplayer) && IS_REAL_CLIENT(it) && it != source && it.team == source.team && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), {
sprint(it, msgstr);
if(cmsgstr != "")
centerprint(it, cmsgstr);
{
sprint(source, sourcemsgstr);
dedicated_print(msgstr); // send to server console too
- FOREACH_CLIENT(!IS_PLAYER(it) && IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), sprint(it, msgstr));
+ FOREACH_CLIENT(!(IS_PLAYER(it) || it.caplayer) && IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), sprint(it, msgstr));
}
else
{
dedicated_print(msgstr); // send to server console too
MX_Say(strcat(playername(source, true), "^7: ", msgin));
}
- FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), sprint(it, msgstr));
+ FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), sprint(it, msgstr));
}
}