#include <common/gamemodes/_mod.qh>
#include <common/mapobjects/target/location.qh>
#include <common/mapobjects/triggers.qh>
+#include <common/notifications/all.qh>
#include <common/teams.qh>
#include <common/util.qh>
#include <common/weapons/weapon.qh>
#include <common/wepent.qh>
+#include <server/command/cmd.qh>
#include <server/command/common.qh>
#include <server/gamelog.qh>
#include <server/main.qh>
*/
int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodcontrol)
{
+ if(!autocvar_g_chat_allowed && IS_REAL_CLIENT(source))
+ {
+ Send_Notification(NOTIF_ONE_ONLY, source, MSG_INFO, INFO_CHAT_DISABLED);
+ return 0;
+ }
+
+ if(!autocvar_g_chat_private_allowed && privatesay)
+ {
+ Send_Notification(NOTIF_ONE_ONLY, source, MSG_INFO, INFO_CHAT_PRIVATE_DISABLED);
+ return 0;
+ }
+
+ if(!autocvar_g_chat_spectator_allowed && IS_OBSERVER(source))
+ {
+ Send_Notification(NOTIF_ONE_ONLY, source, MSG_INFO, INFO_CHAT_SPECTATOR_DISABLED);
+ return 0;
+ }
+
+ if(!autocvar_g_chat_team_allowed && teamsay)
+ {
+ Send_Notification(NOTIF_ONE_ONLY, source, MSG_INFO, INFO_CHAT_TEAM_DISABLED);
+ return 0;
+ }
+
if (!teamsay && !privatesay && substring(msgin, 0, 1) == " ")
msgin = substring(msgin, 1, -1); // work around DP say bug (say_team does not have this!)
if (!autocvar_g_chat_tellprivacy) { dedicated_print(msgstr); } // send to server console too if "tellprivacy" is disabled
if(!MUTATOR_CALLHOOK(ChatMessageTo, privatesay, source))
{
+ if(IS_REAL_CLIENT(source) && ignore_playerinlist(source, privatesay)) // check ignored players from personal chat log (from "ignore" command)
+ return -1; // no sending to this player, thank you very much
+
sprint(privatesay, msgstr);
if(cmsgstr != "")
centerprint(privatesay, cmsgstr);
sprint(source, sourcemsgstr);
dedicated_print(msgstr); // send to server console too
FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != source && CS(it).active_minigame == CS(source).active_minigame && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), {
+ if(IS_REAL_CLIENT(source) && ignore_playerinlist(source, it)) // check ignored players from personal chat log (from "ignore" command)
+ continue; // no sending to this player, thank you very much
+
sprint(it, msgstr);
});
event_log_msg = sprintf(":chat_minigame:%d:%s:%s", source.playerid, CS(source).active_minigame.netname, msgin);
if(sourcecmsgstr != "")
centerprint(source, sourcecmsgstr);
FOREACH_CLIENT((IS_PLAYER(it) || INGAME(it)) && IS_REAL_CLIENT(it) && it != source && it.team == source.team && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), {
+ if(IS_REAL_CLIENT(source) && ignore_playerinlist(source, it)) // check ignored players from personal chat log (from "ignore" command)
+ continue; // no sending to this player, thank you very much
+
sprint(it, msgstr);
if(cmsgstr != "")
centerprint(it, cmsgstr);
sprint(source, sourcemsgstr);
dedicated_print(msgstr); // send to server console too
FOREACH_CLIENT(!(IS_PLAYER(it) || INGAME(it)) && IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), {
+ if(IS_REAL_CLIENT(source) && ignore_playerinlist(source, it)) // check ignored players from personal chat log (from "ignore" command)
+ continue; // no sending to this player, thank you very much
+
sprint(it, msgstr);
});
event_log_msg = sprintf(":chat_spec:%d:%s", source.playerid, strreplace("\n", " ", msgin));
MX_Say(strcat(playername(source.netname, source.team, IS_PLAYER(source)), "^7: ", msgin));
}
FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), {
+ if(IS_REAL_CLIENT(source) && ignore_playerinlist(source, it)) // check ignored players from personal chat log (from "ignore" command)
+ continue; // no sending to this player, thank you very much
+
sprint(it, msgstr);
});
event_log_msg = sprintf(":chat:%d:%s", source.playerid, strreplace("\n", " ", msgin));
IL_EACH(((checkitems) ? g_items : g_locations), ((checkitems) ? (it.target == "###item###") : (it.classname == "target_location")),
{
- if ((it.items == IT_KEY1 || it.items == IT_KEY2) && it.target == "###item###")
+ if ((it.items == IT_KEY1 || it.items == IT_KEY2) && it.target == "###item###")
dist = it.oldorigin;
else
dist = it.origin;
case "l": replacement = NearestLocation(this.origin); break;
case "y": replacement = NearestLocation(cursor); break;
case "d": replacement = NearestLocation(this.death_origin); break;
+ case "o": replacement = vtos(this.origin); break;
+ case "O": replacement = sprintf("'%f %f %f'", this.origin.x, this.origin.y, this.origin.z); break;
case "w": replacement = WeaponNameFromWeaponentity(this, weaponentity); break;
case "W": replacement = GetAmmoName(this.(weaponentity).m_weapon.ammo_type); break;
case "x": replacement = ((cursor_ent.netname == "" || !cursor_ent) ? "nothing" : cursor_ent.netname); break;