27int Say(
entity source,
int teamsay,
entity privatesay,
string msgin,
bool floodcontrol)
43 Send_Notification(NOTIF_ONE_ONLY, source, MSG_INFO, INFO_CHAT_SPECTATOR_DISABLED);
53 if (!teamsay && !privatesay &&
substring(msgin, 0, 1) ==
" ")
96 string colorprefix = (strdecolorize(namestr) == namestr) ?
"^3" :
"^7";
98 string msgstr =
"", cmsgstr =
"";
100 int privatemsgprefixlen = 0;
103 bool found_me = (
substring(msgin, 0, 4) ==
"/me ");
106 string newnamestr = ((teamsay) ?
strcat(colorstr,
"(", colorprefix, namestr, colorstr,
")",
"^7") :
strcat(colorprefix, namestr,
"^7"));
112 msgstr =
strcat(
"\{1}\{13}* ", colorprefix, namestr,
"^3 tells you: ^7");
113 privatemsgprefixlen =
strlen(msgstr);
114 msgstr =
strcat(msgstr, msgin);
115 cmsgstr =
strcat(colorstr, colorprefix, namestr,
"^3 tells you:\n^7", msgin);
125 msgstr =
strcat(
"\{1}\{13}^4* ",
"^7", msgin);
128 msgstr =
strcat(
"\{1}\{13}", colorstr,
"(", colorprefix, namestr, colorstr,
") ^7", msgin);
129 cmsgstr =
strcat(colorstr,
"(", colorprefix, namestr, colorstr,
")\n^7", msgin);
138 msgstr =
strcat(
"\{1}^4* ^7", msgin);
142 msgstr =
strcat(msgstr, (namestr !=
"") ?
strcat(colorprefix, namestr,
"^7: ") :
"^7");
143 msgstr =
strcat(msgstr, msgin);
147 msgstr =
strcat(strreplace(
"\n",
" ", msgstr),
"\n");
150 string fullmsgstr = msgstr;
151 string fullcmsgstr = cmsgstr;
157 if(floodcontrol && source)
159 float flood_spl, flood_burst, flood_lmax;
182 flood_burst =
max(0, flood_burst - 1);
201 msgstr =
strcat(msgstr,
"\n");
206 if (mod_time >= source.(flood_field))
220 string sourcemsgstr, sourcecmsgstr;
225 sourcemsgstr =
strcat(msgstr,
"\n^3CHAT FLOOD CONTROL: ^7message too long, trimmed\n");
230 sourcemsgstr = fullmsgstr;
231 sourcecmsgstr = fullcmsgstr;
237 sourcemsgstr = msgstr;
238 sourcecmsgstr = cmsgstr;
250 sourcemsgstr =
strcat(privatemsgprefix,
substring(sourcemsgstr, privatemsgprefixlen, -1));
253 if(source &&
CS(source).muted)
262 sprint(source,
strcat(
"^3CHAT FLOOD CONTROL: ^7wait ^1",
ftos(source.(flood_field) - mod_time),
279 string event_log_msg =
"";
281 if(sourcemsgstr !=
"" && ret != 0)
285 sprint(source, sourcemsgstr);
286 if(sourcecmsgstr !=
"" && !privatesay)
291 sprint(source, sourcemsgstr);
299 sprint(privatesay, msgstr);
306 sprint(source, sourcemsgstr);
314 event_log_msg = sprintf(
":chat_minigame:%d:%s:%s", source.playerid,
CS(source).
active_minigame.netname, msgin);
319 sprint(source, sourcemsgstr);
321 if(sourcecmsgstr !=
"")
331 event_log_msg = sprintf(
":chat_team:%d:%d:%s", source.playerid, source.team, strreplace(
"\n",
" ", msgin));
335 sprint(source, sourcemsgstr);
343 event_log_msg = sprintf(
":chat_spec:%d:%s", source.playerid, strreplace(
"\n",
" ", msgin));
349 sprint(source, sourcemsgstr);
359 event_log_msg = sprintf(
":chat:%d:%s", source.playerid, strreplace(
"\n",
" ", msgin));
375 IL_EACH(list, (checkitems ? (it.target ==
"###item###") : (it.classname ==
"target_location")),
377 if ((it.items == IT_KEY1 || it.items == IT_KEY2) && it.target ==
"###item###")
382 dist = vec3(dist.x * axismod.x, dist.y * axismod.y, dist.z * axismod.z);
383 float len = vlen2(dist);
386 for (l = 0; l < num_nearest; ++l)
388 if (len < nearest_length[l])
409 for (
int j = 0; j < num_nearest; ++j)
416 LOG_TRACEF(
"Nearest point (%s) is not visible, using a visible one.",
423 if (num_nearest == 0)
426 LOG_TRACE(
"Not seeing any location point, using nearest as fallback.");
443 string ret =
"somewhere";
470 entity wepent = this.(weaponentity);
473 else if(wepent.m_weapon != WEP_Null)
474 return wepent.m_weapon.m_name;
475 else if(wepent.m_switchweapon != WEP_Null)
476 return wepent.m_switchweapon.m_name;
482 entity wepent = this.(weaponentity);
483 string fallback =
"N/A";
486 else if(wepent.m_weapon.ammo_type != RES_NONE)
487 return wepent.m_weapon.ammo_type.m_name;
488 else if(wepent.m_switchweapon.ammo_type != RES_NONE)
489 return wepent.m_switchweapon.ammo_type.m_name;
499 string escape,escape_token;
500 bool warn_slash =
false;
542#define ON_SLASH() MACRO_BEGIN warn_slash = false; if(escape_token != "\\") break; MACRO_END
543#define NO_SLASH() MACRO_BEGIN if(escape_token == "\\") break; MACRO_END
546 if(escape_token ==
"\\")
552 case "%": replacement =
"%"; warn_slash =
false;
break;
553 case "\\":
ON_SLASH(); replacement =
"\\";
break;
554 case "n":
ON_SLASH(); replacement =
"\n";
break;
561 case "O":
NO_SLASH(); replacement = sprintf(
"'%f %f %f'", this.
origin.x,
this.origin.y,
this.origin.z);
break;
564 case "x":
NO_SLASH(); replacement = ((cursor_ent.netname ==
"" || !cursor_ent) ?
"nothing" : cursor_ent.netname);
break;
574 replacement =
M_ARGV(2,
string);
581 PrintToChat(
this, sprintf(
"^3WARNING: unsupported \"\\%s\" expansion, use \"%%%s\"", escape, escape));
591 text =
strcat(
"\{1}^7", text,
"\n");
607 text =
strcat(
"\{1}^7", text,
"\n");
623 text =
strcat(
"\{1}^7", text,
"\n");
626 if (it.team == team_num)
#define MUTATOR_CALLHOOK(name,...)
#define M_ARGV(idx, type)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
limitations: NULL cannot be present elements can only be present once a maximum of IL_MAX lists can e...
bool ignore_playerinlist(entity this, entity pl)
Checks if pl is ignored by this (permanently or for the current match).
#define autocvar_timelimit
string playername(string thename, int teamid, bool team_colorize)
string getWrappedLineLen(int maxLength, textLengthUpToLength_lenFunction_t tw)
string getWrappedLine_remaining
void GameLogEcho(string s)
bool autocvar_sv_eventlog
#define IL_EACH(this, cond, body)
IntrusiveList g_locations
noref int autocvar_developer
string trigger_magicear_processmessage_forallears(entity source, float teamsay, entity privatesay, string msgin)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
string WeaponNameFromWeaponentity(entity this,.entity weaponentity)
ERASEABLE void DebugPrintToChatAll(string text)
Prints the string to all clients' chat if the server cvar "developer" is not 0.
entity findnearest(vector point, bool checkitems, vector axismod)
ERASEABLE void PrintToChat(entity client, string text)
Print the string to the client's chat.
string NearestLocation(vector p)
string PlayerHealth(entity this)
string formatmessage(entity this, string msg)
string AmmoNameFromWeaponentity(entity this,.entity weaponentity)
ERASEABLE void DebugPrintToChatTeam(int team_num, string text)
Print the string to chat of all clients of the specified team if the server cvar "developer" is not 0...
int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodcontrol)
message "": do not say, just test flood control return value: 1 = accept 0 = reject -1 = fake accept
ERASEABLE void PrintToChatAll(string text)
Prints the string to all clients' chat.
ERASEABLE void DebugPrintToChat(entity client, string text)
Print the string to the client's chat if the server cvar "developer" is not 0.
ERASEABLE void PrintToChatTeam(int team_num, string text)
Print the string to chat of all clients of the specified team.
bool autocvar_g_chat_allowed
bool autocvar_g_chat_team_allowed
bool autocvar_g_chat_flood_notify_flooder
float autocvar_g_chat_flood_lmax
float autocvar_g_chat_flood_burst_tell
float autocvar_g_chat_flood_lmax_team
bool autocvar_g_chat_show_playerid
float autocvar_g_chat_flood_lmax_tell
entity nearest_entity[NUM_NEAREST_ENTITIES]
float autocvar_g_chat_flood_spl_tell
bool autocvar_g_chat_teamcolors
#define CHAT_NOSPECTATORS()
float autocvar_g_chat_flood_spl
float autocvar_g_chat_flood_spl_team
bool autocvar_g_chat_spectator_allowed
float autocvar_g_chat_flood_burst_team
float floodcontrol_chattell
bool autocvar_g_chat_tellprivacy
float nearest_length[NUM_NEAREST_ENTITIES]
const float NUM_NEAREST_ENTITIES
float autocvar_g_chat_flood_burst
bool autocvar_g_chat_private_allowed
float floodcontrol_chatteam
void dedicated_print(string input)
print(), but only print if the server is not local
ClientState CS(Client this)
ERASEABLE string seconds_tostring(float seconds)
if(frag_attacker.flagcarried)
string Team_ColorCode(int teamid)
void WarpZone_crosshair_trace_plusvisibletriggers(entity pl)
#define IS_REAL_CLIENT(v)
#define FOREACH_CLIENT(cond, body)
entity weaponentities[MAX_WEAPONSLOTS]