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;
252 sourcemsgstr =
strcat(privatemsgprefix,
substring(sourcemsgstr, privatemsgprefixlen, -1));
255 if(source &&
CS(source).muted)
264 sprint(source,
strcat(
"^3CHAT FLOOD CONTROL: ^7wait ^1",
265 ftos(source.(flood_field) - mod_time),
"^3 seconds\n"));
285 string event_log_msg =
"";
287 if(sourcemsgstr !=
"" && ret != 0)
291 sprint(source, sourcemsgstr);
292 if(sourcecmsgstr !=
"" && !privatesay)
297 sprint(source, sourcemsgstr);
304 sprint(privatesay, msgstr);
311 sprint(source, sourcemsgstr);
319 event_log_msg = sprintf(
":chat_minigame:%d:%s:%s", source.playerid,
CS(source).
active_minigame.netname, msgin);
324 sprint(source, sourcemsgstr);
326 if(sourcecmsgstr !=
"")
336 event_log_msg = sprintf(
":chat_team:%d:%d:%s", source.playerid, source.team, strreplace(
"\n",
" ", msgin));
340 sprint(source, sourcemsgstr);
348 event_log_msg = sprintf(
":chat_spec:%d:%s", source.playerid, strreplace(
"\n",
" ", msgin));
353 sprint(source, sourcemsgstr);
363 event_log_msg = sprintf(
":chat:%d:%s", source.playerid, strreplace(
"\n",
" ", msgin));
380 IL_EACH(list, (checkitems ? (it.target ==
"###item###") : (it.classname ==
"target_location")),
382 if ((it.items == IT_KEY1 || it.items == IT_KEY2) && it.target ==
"###item###")
387 dist = vec3(dist.x * axismod.x, dist.y * axismod.y, dist.z * axismod.z);
388 float len = vlen2(dist);
391 for (l = 0; l < num_nearest; ++l)
393 if (len < nearest_length[l])
409 num_nearest = num_nearest + 1;
414 for (
int j = 0; j < num_nearest; ++j)
421 LOG_TRACEF(
"Nearest point (%s) is not visible, using a visible one.",
428 if (num_nearest == 0)
431 LOG_TRACE(
"Not seeing any location point, using nearest as fallback.");
448 string ret =
"somewhere";
475 entity wepent = this.(weaponentity);
478 else if(wepent.m_weapon != WEP_Null)
479 return wepent.m_weapon.m_name;
480 else if(wepent.m_switchweapon != WEP_Null)
481 return wepent.m_switchweapon.m_name;
487 entity wepent = this.(weaponentity);
488 string fallback =
"N/A";
491 else if(wepent.m_weapon.ammo_type != RES_NONE)
492 return wepent.m_weapon.ammo_type.m_name;
493 else if(wepent.m_switchweapon.ammo_type != RES_NONE)
494 return wepent.m_switchweapon.ammo_type.m_name;
504 string escape,escape_token;
505 bool warn_slash =
false;
547#define ON_SLASH() MACRO_BEGIN warn_slash = false; if(escape_token != "\\") break; MACRO_END
548#define NO_SLASH() MACRO_BEGIN if(escape_token == "\\") break; MACRO_END
551 if(escape_token ==
"\\")
557 case "%": replacement =
"%"; warn_slash =
false;
break;
558 case "\\":
ON_SLASH(); replacement =
"\\";
break;
559 case "n":
ON_SLASH(); replacement =
"\n";
break;
566 case "O":
NO_SLASH(); replacement = sprintf(
"'%f %f %f'", this.
origin.x,
this.origin.y,
this.origin.z);
break;
569 case "x":
NO_SLASH(); replacement = ((cursor_ent.netname ==
"" || !cursor_ent) ?
"nothing" : cursor_ent.netname);
break;
579 replacement =
M_ARGV(2,
string);
586 PrintToChat(
this, sprintf(
"^3WARNING: unsupported \"\\%s\" expansion, use \"%%%s\"", escape, escape));
588 p = p +
strlen(replacement);
596 text =
strcat(
"\{1}^7", text,
"\n");
612 text =
strcat(
"\{1}^7", text,
"\n");
628 text =
strcat(
"\{1}^7", text,
"\n");
631 if (it.team == team_num)
#define MUTATOR_CALLHOOK(id,...)
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
float mapvote_initialized
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]