102 if(!player)
return 0;
121 if(spec_count >= MAX_SPECTATORS)
123 WriteByte(MSG_ENTITY, num_for_edict(it));
165 to.ignore_list_send_time = 0;
175 CS(
this).clientdata.drawonlytoclient =
this;
176 CS(
this).clientdata.owner =
this;
181 delete(
CS(
this).clientdata);
182 CS(
this).clientdata =
NULL;
188 if (cd) cd.SendFlags = 1;
190 if (to_spectators_too)
193 entity cd_spec = CS(it).clientdata;
194 if (cd_spec) cd_spec.SendFlags = cd.SendFlags;
218 if(
substring(plyermodel, 0, 14) !=
"models/player/")
221 if(
substring(plyermodel, -4, 4) !=
".iqm"
222 &&
substring(plyermodel, -4, 4) !=
".zym"
223 &&
substring(plyermodel, -4, 4) !=
".dpm"
224 &&
substring(plyermodel, -4, 4) !=
".md3"
225 &&
substring(plyermodel, -4, 4) !=
".psk")
229 if(
substring(plyermodel, -9, 5) ==
"_lod1" ||
substring(plyermodel, -9, 5) ==
"_lod2")
243 precache_model(modelname);
244 _setmodel(e, modelname);
263 bool mutator_returnvalue =
MUTATOR_CALLHOOK(MakePlayerObserver,
this, is_forced);
264 bool recount_ready =
false;
267 bool was_player =
false;
291 bool is_observepoint = (spot !=
NULL);
294 if (!spot)
LOG_FATAL(
"No spawnpoints for observers?!?");
301 setorigin(
this, this.
origin +
STAT(PL_VIEW_OFS,
this) -
STAT(PL_CROUCH_VIEW_OFS,
this));
319 setsize(
this,
STAT(PL_CROUCH_MIN,
this),
STAT(PL_CROUCH_MAX,
this));
343 CS(
this).spectatortime =
time;
374 STAT(RESPAWN_TIME,
this) = 0;
379 STAT(AIR_FINISHED,
this) = 0;
394 STAT(WEAPONS,
this) =
'0 0 0';
416 for(
int slot = 0; slot <
MAX_AXH; ++slot)
421 if(axh.owner ==
this && axh !=
NULL && !wasfreed(axh))
425 if (mutator_returnvalue)
438 CS(
this).just_joined =
false;
456 string defaultmodel =
"";
471 if(defaultmodel ==
"")
482 for (
int i = 0; i < n; ++i)
483 if ((
argv(i) == player.playermodel && defaultskin ==
stof(player.playerskin)) ||
argv(i) ==
strcat(player.playermodel,
":", player.playerskin))
484 defaultmodel =
argv(i);
491 defaultmodel =
substring(defaultmodel, 0, i);
512 defaultmodel =
M_ARGV(0,
string);
513 defaultskin =
M_ARGV(1,
int);
517 if(defaultmodel !=
"")
519 if (defaultmodel != player.model)
524 setsize (player, m1, m2);
529 player.skin = defaultskin;
533 if (player.playermodel != player.model || player.playermodel ==
"")
539 setsize (player, m1, m2);
546 player.skin =
stof(player.playerskin);
551 player.skin = defaultskin;
555 if(chmdl ||
oldskin != player.skin)
596 else if (this.
team <= 0)
654 PS(
this).dual_weapons =
'0 0 0';
682 STAT(RESPAWN_TIME,
this) = 0;
698 this.
angles = spot.angles;
711 STAT(AIR_FINISHED,
this) = 0;
716 spawnevent.owner =
this;
728 for(
int slot = 0; slot <
MAX_AXH; ++slot)
733 if(axh.owner ==
this && axh !=
NULL && !wasfreed(axh))
741 setsize(
this,
STAT(PL_MIN,
this),
STAT(PL_MAX,
this));
743 setorigin(
this, spot.origin +
'0 0 1' * (1 -
this.mins.z - 24));
781 CS(
this).killcount = 0;
782 CS(
this).startplaytime =
time;
804 it.wr_resetplayer(it,
this);
811 this.(weaponentity).
weapon_load[it.m_id] = it.reloading_ammo;
818 string s = spot.target;
835 entity w_ent = this.(weaponentity);
839 w_ent.m_switchweapon = WEP_Null;
840 w_ent.m_weapon = WEP_Null;
841 w_ent.weaponname =
"";
842 w_ent.m_switchingweapon = WEP_Null;
878 bool use_spawnpoint = (!this.
enemy);
883 PS(
this).itemkeys = 0;
964 parm1 = -(86400 * 366);
990 CS(
this).parm_idlesince =
parm1;
991 if (
CS(
this).parm_idlesince == -(86400 * 366))
992 CS(
this).parm_idlesince =
time;
1004 stuffcmd(e,
"cl_cmd settemp cl_prydoncursor_notrace 0\n");
1005 if(autocvar_sv_gentle)
1006 stuffcmd(e,
"cl_cmd settemp cl_gentle 1\n");
1018 if(list ==
"" || tofind ==
"")
1033 if(p.netaddress ==
"local" || p.netaddress ==
"" || !
IS_REAL_CLIENT(p))
1055#ifdef DP_EXT_PRECONNECT
1063void ClientPreConnect(
entity this)
1088 if (
CS(
this).version_mismatch)
1109 string modifications =
M_ARGV(0,
string);
1112 modifications =
strcat(modifications,
", No start weapons");
1114 modifications =
strcat(modifications,
", Low gravity");
1116 modifications =
strcat(modifications,
", Weapons stay");
1118 modifications =
strcat(modifications,
", Jetpack");
1119 modifications =
substring(modifications, 2,
strlen(modifications) - 2);
1179 CS(
this).just_joined =
true;
1183 stuffcmd(
this,
"cl_particles_reloadeffects\n");
1188 stuffcmd(
this,
"cmd clientversion $gameversion\n");
1196 stuffcmd(
this, sprintf(
"set _teams_available %d\n", t));
1200 stuffcmd(
this,
"set _teams_available 0\n");
1205 CS(
this).spectatortime =
time;
1206 CS(
this).jointime =
time;
1213 stuffcmd(
this,
"cl_cmd settemp chase_active 1\n");
1217 stuffcmd(
this, sprintf(
"cl_cmd settemp _hud_panel_quickmenu_file_from_server %s\n",
"wpeditor.txt"));
1224 CS(
this).model_randomizer =
random();
1236 it.init_for_player(it, this);
1246 CS(
this).muted =
true;
1354 if (ownr.alpha < 0 || ownr.chatbubbleentity !=
this)
1357 ownr.chatbubbleentity =
NULL;
1367 this.
mdl =
"models/sprites/minigame_busy.iqm";
1369 this.
mdl =
"models/misc/chatbubble.spr";
1373 _setmodel(
this, this.
mdl);
1403 float gametype_setting_tmp;
1416 if(it.team ==
this.team)
1419 if (sdelay_small_count == 0)
1420 sdelay_small_count = 1;
1421 if (sdelay_large_count == 0)
1422 sdelay_large_count = 1;
1430 if (sdelay_small_count == 0)
1435 sdelay_small_count = 1;
1440 sdelay_small_count = 2;
1443 if (sdelay_large_count == 0)
1448 sdelay_large_count = 1;
1453 sdelay_large_count = 2;
1460 if (pcount <= sdelay_small_count)
1461 sdelay = sdelay_small;
1462 else if (pcount >= sdelay_large_count)
1463 sdelay = sdelay_large;
1465 sdelay = sdelay_small + (sdelay_large - sdelay_small) * (pcount - sdelay_small_count) / (sdelay_large_count - sdelay_small_count);
1472 if(sdelay < sdelay_max)
1534 float time_left = finished -
time;
1572 int items_prev = this.
items;
1636float CalcRegen(
float current,
float stable,
float regenfactor,
float regenframetime)
1638 if(current > stable)
1640 else if(current > stable - 0.25)
1643 return min(stable, current + (stable - current) * regenfactor * regenframetime);
1646float CalcRot(
float current,
float stable,
float rotfactor,
float rotframetime)
1648 if(current < stable)
1650 else if(current < stable + 0.25)
1653 return max(stable, current + (stable - current) * rotfactor * rotframetime);
1657 float regenstable,
float regenfactor,
float regenlinear,
float regenframetime,
1658 float rotstable,
float rotfactor,
float rotlinear,
float rotframetime)
1661 float current = old;
1662 if(current > rotstable)
1664 if(rotframetime > 0)
1666 current =
CalcRot(current, rotstable, rotfactor, rotframetime);
1667 current =
max(rotstable, current - rotlinear * rotframetime);
1670 else if(current < regenstable)
1672 if(regenframetime > 0)
1674 current =
CalcRegen(current, regenstable, regenfactor, regenframetime);
1675 current =
min(regenstable, current + regenlinear * regenframetime);
1689 float max_mod, regen_mod, rot_mod, limit_mod;
1690 max_mod = regen_mod = rot_mod = limit_mod = 1;
1698 bool mutator_returnvalue =
MUTATOR_CALLHOOK(PlayerRegen,
this, max_mod, regen_mod, rot_mod, limit_mod, regen_health, regen_health_linear, regen_health_rot,
1699 regen_health_rotlinear, regen_health_stable, regen_health_rotstable);
1700 max_mod =
M_ARGV(1,
float);
1701 regen_mod =
M_ARGV(2,
float);
1702 rot_mod =
M_ARGV(3,
float);
1703 limit_mod =
M_ARGV(4,
float);
1704 regen_health =
M_ARGV(5,
float);
1705 regen_health_linear =
M_ARGV(6,
float);
1706 regen_health_rot =
M_ARGV(7,
float);
1707 regen_health_rotlinear =
M_ARGV(8,
float);
1708 regen_health_stable =
M_ARGV(9,
float);
1709 regen_health_rotstable =
M_ARGV(10,
float);
1711 float rotstable, regenstable, rotframetime, regenframetime;
1713 if(!mutator_returnvalue)
1724 regenstable = regen_health_stable * max_mod;
1725 rotstable = regen_health_rotstable * max_mod;
1728 RotRegen(
this, RES_HEALTH, limit_mod,
1729 regenstable, regen_health, regen_health_linear, regenframetime,
1730 rotstable, regen_health_rot, regen_health_rotlinear, rotframetime);
1739 if(this.event_damage)
1740 this.event_damage(
this,
this,
this, 1, DEATH_ROT.m_id,
DMG_NOWEP,
this.origin,
'0 0 0');
1760 CS(
this).zoomstate = newzoom;
1771 CS(
this).pressedkeys = 0;
1772 STAT(PRESSED_KEYS,
this) = 0;
1777 int keys =
STAT(PRESSED_KEYS,
this);
1787 CS(
this).pressedkeys = keys;
1789 STAT(PRESSED_KEYS,
this) = keys;
1803 PS(
this) =
PS(spectatee);
1813 CS(
this).impulse = 0;
1815 this.
items = spectatee.items;
1816 STAT(LAST_PICKUP,
this) =
STAT(LAST_PICKUP, spectatee);
1817 STAT(HIT_TIME,
this) =
STAT(HIT_TIME, spectatee);
1818 STAT(AIR_FINISHED,
this) =
STAT(AIR_FINISHED, spectatee);
1819 STAT(PRESSED_KEYS,
this) =
STAT(PRESSED_KEYS, spectatee);
1820 STAT(WEAPONS,
this) =
STAT(WEAPONS, spectatee);
1822 this.
view_ofs = spectatee.view_ofs;
1823 this.
velocity = spectatee.velocity;
1824 this.
dmg_take = spectatee.dmg_take;
1825 this.
dmg_save = spectatee.dmg_save;
1827 this.
v_angle = spectatee.v_angle;
1828 this.
angles = spectatee.v_angle;
1829 this.
viewloc = spectatee.viewloc;
1832 setorigin(
this, spectatee.origin);
1833 setsize(
this, spectatee.mins, spectatee.maxs);
1837 STAT(HUD,
this) =
STAT(HUD, spectatee);
1838 if(spectatee.vehicle)
1840 this.
angles = spectatee.v_angle;
1905 int oldspectatee_status =
CS(
this).spectatee_status;
1906 CS(
this).spectatee_status = spectatee_num;
1910 if (
STAT(PRESSED_KEYS,
this))
1912 CS(
this).pressedkeys = 0;
1913 STAT(PRESSED_KEYS,
this) = 0;
1945 this.
enemy = spectatee;
1954 if(old_spectatee.(weaponentity).arc_beam)
1963 if(spectatee.(weaponentity).arc_beam)
2010 while(ent && ent != this.
enemy)
2068 stuffcmd(
this,
"_scoreboard_team_selection 1\n");
2094 if (this.team < 0 && this.team_selected > 0
2095 && it.wants_join == this.team_selected)
2096 player_with_dibs = it;
2099 --clients_remaining;
2104 for (; clients_remaining; --clients_remaining)
2107 float strongest_autoselect_client_skill = 0;
2108 FOREACH_CLIENT(it.wants_join < 0 || (it ==
this && it.team <= 0),
2110 float it_skill = it.m_skill_mu ? it.m_skill_mu : server_skill_average;
2111 if (it_skill > strongest_autoselect_client_skill)
2113 strongest_autoselect_client = it;
2114 strongest_autoselect_client_skill = it_skill;
2117 if (strongest_autoselect_client ==
this)
2124 else if (strongest_autoselect_client)
2125 Join(strongest_autoselect_client,
false);
2138 else if (player_with_dibs)
2166 player_limit =
M_ARGV(0,
int);
2188 int totalClients = 0;
2189 int currentlyPlaying = 0;
2199 int free_slots =
max(0, player_limit - currentlyPlaying);
2205 if(
this && !free_slots)
2206 Send_Notification(NOTIF_ONE_ONLY,
this, MSG_CENTER, CENTER_JOIN_PREVENT_MAXPLAYERS, player_limit);
2221 if (QueuedPlayersReady(this, false))
2225 this.team_selected = team_index;
2229 Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, APP_TEAM_NUM(Team_IndexToTeam(team_index), CENTER_JOIN_PREVENT_QUEUE_TEAM_CONFLICT), it.netname);
2230 this.wants_join = -1;
2231 this.team_selected = -1;
2240 if (team_index <= 0)
2265 if (
CS(
this).version_mismatch)
2267 Send_Notification(NOTIF_ONE_ONLY,
this, MSG_CENTER, CENTER_JOIN_PREVENT_VERSIONMISMATCH);
2283 Send_Notification(NOTIF_ONE_ONLY,
this, MSG_CENTER, CENTER_JOIN_PREVENT_FORCEDSPEC);
2296 if (this.
ping <= 0)
return false;
2306 if (team_index == 0)
2315 if (team_index == 0)
2338 string str = sprintf(
2339 "^7ent #%d\n^8 netname: ^3%s\n^8 classname: ^5%s\n^8 origin: ^2'%s'",
2340 etof(ent), ent.netname, ent.classname,
vtos(ent.origin));
2341 debug_text_3d((ent.absmin + ent.absmax) * 0.5, str, 0, 7,
'0 0 0');
2381 CS(
this).impulse = CHIMPULSE_SPEEDRUN.impulse;
2390 STAT(RESPAWN_TIME,
this) = 0;
2435 STAT(RESPAWN_TIME,
this) = 0;
2449 STAT(RESPAWN_TIME,
this) *= -1;
2476 if(
WEP_CVAR(WEP_VORTEX, charge_always))
2486 float chargelimit =
WEP_CVAR(WEP_VORTEX, charge_limit);
2487 float chargerate =
WEP_CVAR(WEP_VORTEX, charge_rot_rate);
2488 if(
WEP_CVAR(WEP_VORTEX, charge_rot_unequipped_rate) && this.(weaponentity).
m_weapon != WEP_VORTEX)
2490 chargelimit =
WEP_CVAR(WEP_VORTEX, charge_rot_unequipped_limit);
2491 chargerate =
WEP_CVAR(WEP_VORTEX, charge_rot_unequipped_rate);
2517 CS(
this).impulse = 0;
2519 if (is_spec &&
CS(
this).
impulse == IMP_weapon_drop.impulse)
2521 STAT(CAMERA_SPECTATOR,
this) = (
STAT(CAMERA_SPECTATOR,
this) + 1) % 3;
2522 CS(
this).impulse = 0;
2531 CS(
this).autojoin_checked = 1;
2536 if(this.(weaponentity).
m_weapon == WEP_Null)
2554 Send_Notification(NOTIF_ONE_ONLY,
this, MSG_CENTER, CENTER_SPECTATE_SPEC_NOTALLOWED);
2566 CS(
this).impulse = 0;
2578 CS(
this).impulse = 0;
2598 bool wouldclip =
CS_CVAR(
this).cvar_cl_clippedspectating;
2600 wouldclip = !wouldclip;
2618 CS(
this).autojoin_checked = -1;
2647 else if(autocvar_g_vehicles_enter)
2654 float head_dist2, closest_dist2 = 0;
2655 for (; head; head = head.chain)
2658 if (!closest || head_dist2 < closest_dist2)
2660 closest_dist2 = head_dist2;
2706 error(
"Client can't be spawned as player on connection!");
2719 bool early_join_requested = (
CS(
this).autojoin_checked < 0);
2720 CS(
this).autojoin_checked = 1;
2730 CS(
this).autojoin_checked = -1;
2740 bool wep_zoomed =
false;
2745 if(thiswep != WEP_Null && thiswep.
wr_zoom)
2746 wep_zoomed += thiswep.
wr_zoom(thiswep,
this);
2754 CS(
this).teamkill_soundtime = 0;
2756 entity e =
CS(
this).teamkill_soundsource;
2757 entity oldpusher = e.pusher;
2760 e.pusher = oldpusher;
2765 CS(
this).taunt_soundtime = 0;
2778 STAT(AIR_FINISHED,
this) = 0;
2784 if(
STAT(AIR_FINISHED,
this) &&
STAT(AIR_FINISHED,
this) <
time)
2786 STAT(AIR_FINISHED,
this) = 0;
2790 if (!
STAT(AIR_FINISHED,
this))
2792 if (
STAT(AIR_FINISHED,
this) <
time)
2842 CS(
this).pressedkeys = 0;
2843 STAT(PRESSED_KEYS,
this) = 0;
2847 CS(
this).pm_frametime = 0;
2887 STAT(GUNALIGN,
this) =
CS_CVAR(
this).cvar_cl_gunalign;
2888 STAT(MOVEVARS_CL_TRACK_CANJUMP,
this) =
CS_CVAR(
this).cvar_cl_movement_track_canjump;
2900 ||
CS(
this).autojoin_checked == 0)
2902 CS(
this).spectatortime =
time;
2903 if (
CS(
this).autojoin_checked)
2906 else if (
time > cutoff)
2914 bool assume_unchanged = (
CS(
this).netname_previous ==
"");
2920 assume_unchanged =
false;
2926 sprint(
this,
"Warning: invisible names are not allowed.\n");
2927 assume_unchanged =
false;
2936 if (
CS(
this).version_nagtime &&
CS_CVAR(
this).cvar_g_xonoticversion &&
time >
CS(
this).version_nagtime)
2938 CS(
this).version_nagtime = 0;
2976 if (!head.team ||
SAME_TEAM(
this, head))
2978 else if (autocvar_g_vehicles_steal)
2996 int totalClients = 0;
3021 CS(
this).parm_idlesince =
time;
3023 else if (
time -
CS(
this).parm_idlesince < 1)
3025 if (
CS(
this).idlekick_lasttimeleft)
3027 CS(
this).idlekick_lasttimeleft = 0;
3037 float timeleft =
ceil(maxidle_time - (
time -
CS(
this).parm_idlesince));
3038 float countdown_time =
max(
min(10, maxidle_time - 1),
ceil(maxidle_time * 0.33));
3039 if (timeleft == countdown_time && !
CS(
this).idlekick_lasttimeleft)
3044 Send_Notification(NOTIF_ONE_ONLY,
this, MSG_CENTER, CENTER_MOVETOSPEC_IDLING, timeleft);
3047 Send_Notification(NOTIF_ONE_ONLY,
this, MSG_CENTER, CENTER_DISCONNECT_IDLING, timeleft);
3075 else if (timeleft <= countdown_time
3078 if (timeleft !=
CS(
this).idlekick_lasttimeleft)
3080 CS(
this).idlekick_lasttimeleft = timeleft;
3092 CS(
this).teamkill_complain = 0;
3093 CS(
this).teamkill_soundtime = 0;
3094 CS(
this).teamkill_soundsource =
NULL;
3112 store.button0 = (typing) ? 0 : this.
button0;
3114 store.button2 = (typing) ? 0 : this.
button2;
3115 store.button3 = (typing) ? 0 : this.
button3;
3117 store.button5 = (typing) ? 0 : this.
button5;
3138 store.ping = this.
ping;
3148 int fps = ReadShort();
void accuracy_resend(entity e)
force a resend of a player's accuracy stats
float frame
primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
void anticheat_spectatecopy(entity this, entity spectatee)
void anticheat_prethink(entity this)
void antilag_clear(entity e, entity store)
void navigation_dynamicgoal_init(entity this, bool initially_static)
IntrusiveList g_bot_targets
void bot_aim_reset(entity this)
int bots_would_leave
how many bots would leave so humans can replace them
void bot_relinkplayerlist()
string autocvar_g_playban_list
string autocvar_g_chatban_list
#define MUTATOR_CALLHOOK(id,...)
#define MUTATOR_IS_ENABLED(this)
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
#define BITSET(var, mask, flag)
float CheatFrame(entity this)
bool drag_undraggable(entity draggee, entity dragger)
float CheatsAllowed(entity this, float imp, int argc, float cheatframe, bool logattempt, bool ignoredead)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
entity AuxiliaryXhair[MAX_AXH]
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
virtual void wr_zoom()
(BOTH) weapon specific zoom reticle
int spectatee_status
the -1 disables HUD panels before CSQC receives necessary data
vector hook_shotorigin[4]
void ignore_list_update_on_connection(entity this)
Updates ignore list of all the players.
void ignore_list_send(entity this)
void ignore_remove_player(entity this, entity ignore, bool from_db_too)
Removes a player from the ignore list of another player.
float ignore_list_send_time
const int IGNORE_LIST_SEND_NOW
#define debug_text_3d(...)
const int IT_USING_JETPACK
const int IT_UNLIMITED_AMMO
const int IT_UNLIMITED_SUPERWEAPONS
#define setmodel(this, m)
void Physics_UpdateStats(entity this)
vector autocvar_sv_player_viewoffset
#define PHYS_INPUT_BUTTON_JUMP(s)
float autocvar_sv_jumpspeedcap_min
#define PHYS_INPUT_BUTTON_HOOK(s)
#define PHYS_INPUT_BUTTON_CHAT(s)
#define PHYS_INPUT_BUTTON_ZOOMSCRIPT(s)
#define PHYS_INPUT_BUTTON_MINIGAME(s)
float autocvar_sv_jumpspeedcap_max
#define PHYS_INPUT_BUTTON_USE(s)
#define PHYS_INPUT_BUTTON_ATCK(s)
#define PHYS_INPUT_BUTTON_ZOOM(s)
#define PHYS_INPUT_BUTTON_ATCK2(s)
string playername(string thename, int teamid, bool team_colorize)
vector healtharmor_maxdamage(float h, float a, float armorblock, int deathtype)
Notification Announcer_PickNumber(int type, int num)
float compressShotOrigin(vector v)
float textLengthUpToLength(string theText, int maxLength, textLengthUpToLength_lenFunction_t w)
float get_model_parameters(string m, float sk)
float get_model_parameters_species
string strtolower(string s)
const int FL_JUMPRELEASED
const int FRAGS_PLAYER
not 0 because all fields are initially 0
const int FRAGS_SPECTATOR
engine expects this value
const float MOVE_NOMONSTERS
const float SOLID_SLIDEBOX
const float CONTENT_WATER
const float EF_FULLBRIGHT
float DPCONTENTS_PLAYERCLIP
const float EF_NODEPTHTEST
const float CONTENT_EMPTY
const int EF_TELEPORT_BIT
const int EF_RESTARTANIM_BIT
#define CSQCMODEL_AUTOUPDATE(e)
#define CSQCMODEL_EF_RESPAWNGHOST
#define CSQCMODEL_AUTOINIT(e)
int autocvar_bot_vs_human
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
float autocvar_g_balance_armor_blockpercent
IntrusiveList g_damagedbycontents
float autocvar_g_teamdamage_resetspeed
float autocvar_g_balance_damagepush_speedfactor
float disableclientprediction
vector cursor_trace_start
vector cursor_trace_endpos
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
WriteString(chan, ent.netname)
WriteByte(chan, ent.angles.y/DEC_FACTOR)
SetResourceExplicit(ent, RES_ARMOR, ReadByte() *DEC_FACTOR)) ENTCS_PROP(NAME
void entcs_update_players(entity player)
ERASEABLE bool fexists(string f)
string GameLog_ProcessIP(string s)
void GameLogEcho(string s)
bool autocvar_sv_eventlog
void UpdatePlayerSounds(entity this)
const int VOICETYPE_LASTATTACKER_ONLY
bool autocvar_g_debug_globalsounds
Use new sound handling.
const int VOICETYPE_PLAYERSOUND
#define PlayerSound(this, def, chan, vol, voicetype, pitchscale)
const int VOICETYPE_AUTOTAUNT
void Handicap_Initialize(entity player)
Initializes handicap to its default value.
float Handicap_GetTotalHandicap(entity player, bool receiving)
Returns the total handicap of the player.
Header file that describes the handicap system.
float handicap_avg_taken_sum
float handicap_avg_given_sum
void IntermissionThink(entity this)
void Send_NextMap_To_Player(entity pl)
bool intermission_running
ERASEABLE void IL_REMOVE(IntrusiveList this, entity it)
Remove any element, anywhere in the list.
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define IL_EACH(this, cond, body)
bool Ban_MaybeEnforceBanOnce(entity client)
#define FOREACH_WORD(words, cond, body)
#define FOREACH(list, cond, body)
void SUB_UseTargets(entity this, entity actor, entity trigger)
IntrusiveList g_ladderents
#define PutClientInServer
#define NET_HANDLE(id, param)
#define WriteHeader(to, id)
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
entity WarpZone_SearchInRadius(vector org, float rad, float nomonsters, WarpZone_FindRadius_cond_callback_t cb)
Modified findradius aware of warpzones, that only includes entities that meet the "cb" criteria.
vector WarpZone_UnTransformOrigin(entity wz, vector org)
Transforms origin org backwards through warpzone wz, as the inverse of WarpZone_TransformOrigin.
noref entity WarpZone_SearchInRadius_otherent
Free to use in the callback.
int MapInfo_Get_ByName(string pFilename, float pAllowGenerate, Gametype pGametypeToSet)
void MapInfo_ClearTemps()
string MapInfo_Map_author
string MapInfo_Map_titlestring
void set_movetype(entity this, int mt)
void Movetype_Physics_NoMatchTicrate(entity this, float movedt, bool isclient)
const int MOVETYPE_QCPLAYER
const int WATERLEVEL_SUBMERGED
const int WATERLEVEL_NONE
const int MOVETYPE_FLY_WORLDONLY
const int MOVETYPE_NOCLIP
@ STATUSEFFECT_REMOVE_CLEAR
Effect is being forcibly removed without calling any additional mechanics.
@ STATUSEFFECT_REMOVE_NORMAL
Effect is being removed by a function, calls regular removal mechanics.
@ STATUSEFFECT_REMOVE_TIMEOUT
@ RACE_NET_CHECKPOINT_CLEAR
void sv_notice_join(entity _to)
s1 s2 s1 s2 FLAG s1 s2 FLAG spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 NAME CPID_PREVENT_JOIN
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
s1 s2 s1 s2 FLAG s1 s2 FLAG spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 CPID_IDLING
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
void Kill_Notification(NOTIF broadcast, entity client, MSG net_type, CPID net_cpid)
#define APP_TEAM_NUM(num, prefix)
#define TRANSMUTE(cname, this,...)
#define new_pure(class)
purely logical entities (not linked to the area grid)
#define STATIC_METHOD(cname, name, prototype)
void PlayerStats_GameReport_FinalizePlayer(entity p)
void PlayerStats_GameReport_AddPlayer(entity e)
void PlayerStats_GameReport_AddEvent(string event_id)
const string PLAYERSTATS_ALIVETIME
#define PlayerStats_GameReport_Event_Player(ent, eventid, val)
void Portal_ClearAll(entity own)
bool autocvar_sv_q3compat_changehitbox
ERASEABLE void RandomSelection_Init()
#define RandomSelection_AddEnt(e, weight, priority)
entity RandomSelection_chosen_ent
ERASEABLE ACCUMULATE void Registry_send_all()
float PlayerScore_Set(entity player, PlayerScoreField scorefield, float score)
Sets the player's score to the score parameter.
bool PlayerScore_Clear(entity player)
Initialize the score of this player if needed.
#define AVAILABLE_TEAMS
Number of teams that exist currently.
void W_NextWeapon(entity this, int list,.entity weaponentity)
Goto next weapon.
#define w_getbestweapon(ent, wepent)
bool autocvar_g_weaponswitch_debug
int Campaign_GetLevelNum()
bool campaign_bots_may_start
campaign mode: bots shall spawn but wait for the player to spawn before they do anything in other gam...
#define CHAT_NOSPECTATORS()
void player_powerups_remove_all(entity this, bool allow_poweroff_sound)
int player_getspecies(entity this)
bool SpectateSet(entity this)
void play_countdown(entity this, float finished, Sound samp)
void SpectateCopy(entity this, entity spectatee)
void WriteSpectators(entity player, entity to)
int CountSpectators(entity player, entity to)
float CalcRegen(float current, float stable, float regenfactor, float regenframetime)
void GiveWarmupResources(entity this)
entity SelectObservePoint(entity this)
bool ShowTeamSelection(entity this)
bool SpectateUpdate(entity this)
void DrownPlayer(entity this)
void GetPressedKeys(entity this)
void PlayerUseKey(entity this)
void ClientData_Detach(entity this)
void player_powerups(entity this)
void SendWelcomeMessage(entity this, int msg_type)
bool PlayerUseKey_EnterVehicle_cond(entity e)
void UpdateChatBubble(entity this)
void FixClientCvars(entity e)
bool PlayerInIDList(entity p, string idlist)
void SetZoomState(entity this, float newzoom)
string CheckPlayerModel(string plyermodel)
void PutObserverInServer(entity this, bool is_forced, bool use_spawnpoint)
putting a client as observer in the server
bool Vehicle_Enter_cond(entity e)
void player_regen(entity this)
void Player_Physics(entity this)
bool SpectateNext(entity this)
void ChatBubbleThink(entity this)
void respawn(entity this)
void PutPlayerInServer(entity this)
void calculate_player_respawn_time(entity this)
float CalcRot(float current, float stable, float rotfactor, float rotframetime)
void ClientInit_CheckUpdate(entity this)
bool PlayerThink(entity this)
bool ClientInit_SendEntity(entity this, entity to, int sf)
void ObserverOrSpectatorThink(entity this)
bool PlayerInIPList(entity p, string iplist)
bool queuePlayer(entity this, int team_index)
void ShowRespawnCountdown(entity this)
int nJoinAllowed(entity this)
Determines how many player slots are free.
void PM_UpdateButtons(entity this, entity store)
void SetSpectatee_status(entity this, int spectatee_num)
bool Spectate(entity this, entity pl)
bool joinAllowed(entity this, int team_index)
bool findinlist_abbrev(string tofind, string list)
void FixPlayermodel(entity player)
bool SpectatePrev(entity this)
void PlayerFrame(entity this)
bool PlayerInList(entity player, string list)
void ClientData_Attach(entity this)
void RotRegen(entity this, Resource res, float limit_mod, float regenstable, float regenfactor, float regenlinear, float regenframetime, float rotstable, float rotfactor, float rotlinear, float rotframetime)
void DecodeLevelParms(entity this)
void show_entnum(entity this)
string shootfromfixedorigin
void Join(entity this, bool queued_join)
it's assumed this isn't called for bots (campaign_bots_may_start, centreprints)
void ClientInit_misc(entity this)
void SetSpectatee(entity this, entity spectatee)
void setplayermodel(entity e, string modelname)
string FallbackPlayerModel
void ClientData_Touch(entity e, bool to_spectators_too)
bool ClientData_Send(entity this, entity to, int sf)
string autocvar_sv_quickmenu_file
float autocvar_sv_maxidle
string autocvar_g_xonoticversion
bool autocvar_g_respawn_ghosts
bool autocvar_g_forced_respawn
string weaponorder_byimpulse
float autocvar_g_balance_pause_health_rot_spawn
bool autocvar_sv_servermodelsonly
bool autocvar_sv_teamnagger
string autocvar_g_mutatormsg
bool autocvar_sv_spectate
#define INDEPENDENT_PLAYERS
bool autocvar_g_fullbrightplayers
IntrusiveList g_observepoints
bool autocvar_g_botclip_collisions
float autocvar_sv_player_scale
float autocvar_g_balance_pause_armor_rot_spawn
int autocvar_sv_maxidle_minplayers
IntrusiveList g_initforplayer
int autocvar_g_balance_armor_start
float autocvar_sv_maxidle_playertospectator
float autocvar_g_balance_pause_fuel_rot_spawn
float autocvar_g_maxplayers_spectator_blocktime
#define IS_INDEPENDENT_PLAYER(e)
float pauserotfuel_finished
float autocvar_g_respawn_ghosts_time
float autocvar_g_respawn_ghosts_alpha
bool autocvar_sv_maxidle_slots_countbots
bool autocvar_g_playerclip_collisions
bool autocvar_g_nodepthtestplayers
float pauseregen_finished
#define GAMETYPE_DEFAULTED_SETTING(str)
#define MAKE_INDEPENDENT_PLAYER(e)
int autocvar_g_maxplayers
float pauserothealth_finished
float autocvar_g_respawn_ghosts_speed
float autocvar_g_player_brightness
float autocvar_g_player_damageforcescale
float pauserotarmor_finished
int autocvar_sv_name_maxlength
float autocvar_gameversion
int autocvar_sv_maxidle_slots
float autocvar_g_respawn_ghosts_fadetime
bool autocvar_sv_show_entnum
float autocvar_g_balance_pause_health_regen_spawn
bool autocvar_sv_maxidle_alsokickspectators
bool autocvar_sv_foginterval
bool autocvar_sv_showspectators
int autocvar_sv_timeout_number
const float TIMEOUT_ACTIVE
void VoteCount(float first_count)
void ReadyRestart(bool forceWarmupEnd)
string autocvar_sv_vote_master_ids
void RemoveGrapplingHooks(entity pl)
void ImpulseCommands(entity this)
void GiveRandomWeapons(entity receiver, int num_weapons, string weapon_names, entity ammo_entity)
Give several random weapons and ammo to the entity.
float autocvar_g_balance_superweapons_time
bool dropclient_schedule(entity this)
Schedules dropclient for a player and returns true; if dropclient is already scheduled (for that play...
bool autocvar_sv_autopause
int autocvar_g_balance_contents_playerdamage_drowning
float autocvar_g_balance_contents_drowndelay
float autocvar_g_balance_contents_damagerate
void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
void player_anim(entity this)
bool PlayerHeal(entity targ, entity inflictor, float amount, float limit)
void player_setupanimsformodel(entity this)
void CopyBody(entity this, float keepvelocity)
string autocvar_sv_defaultplayermodel_blue
int autocvar_sv_defaultplayerskin_pink
float score_frame_dmgtaken
int autocvar_sv_defaultplayerskin_yellow
string autocvar_sv_defaultplayermodel_yellow
string autocvar_sv_defaultplayermodel_red
string autocvar_sv_defaultplayercolors
bool autocvar_sv_defaultcharacter
int autocvar_sv_defaultplayerskin_blue
float autocvar_g_spawnshieldtime
int autocvar_sv_defaultplayerskin_red
int autocvar_sv_defaultplayerskin
string autocvar_sv_defaultplayermodel
string autocvar_sv_defaultplayermodel_pink
bool autocvar_sv_defaultcharacterskin
void race_SendNextCheckpoint(entity e, float spec)
bool autocvar_g_allow_checkpoints
bool SpawnEvent_Send(entity this, entity to, int sf)
entity SelectSpawnPoint(entity this, bool anypoint)
bool W_DualWielding(entity player)
void WarpZone_PlayerPhysics_FixVAngle(entity this)
const float VOL_BASEVOICE
const int CH_TRIGGER_SINGLE
const int CH_PLAYER_SINGLE
#define sound(e, c, s, v, a)
void play2(entity e, string filename)
void stopsound(entity e, int chan)
void PlayerState_attach(entity this)
void bot_clientconnect(entity this)
void ClientState_detach(entity this)
void PlayerState_detach(entity this)
void DecodeLevelParms(entity this)
ClientState CS(Client this)
void StatusEffects_remove(StatusEffect this, entity actor, int removal_type)
float StatusEffects_gettime(StatusEffect this, entity actor)
bool StatusEffects_active(StatusEffect this, entity actor)
void StatusEffects_apply(StatusEffect this, entity actor, float eff_time, int eff_flags)
void ONREMOVE(entity this)
ERASEABLE int vercmp(string v1, string v2)
ERASEABLE bool isInvisibleString(string s)
void SUB_SetFade(entity ent, float vanish_time, float fading_time)
bool MinigameImpulse(entity this, int imp)
void part_minigame(entity player)
void monsters_setstatus(entity this)
bool monster_attack
indicates whether an entity can be attacked by monsters
float spawn_time
delay monster thinking until spawn animation has completed
IntrusiveList g_monster_targets
float g_nexball_meter_period
float GetResourceLimit(entity e, Resource res_type)
Returns the maximum amount of the given resource.
Header file that describes the resource system.
float autocvar_g_balance_armor_rotlinear
int autocvar_g_balance_fuel_rotstable
float autocvar_g_balance_fuel_regen
float autocvar_g_balance_armor_regen
float autocvar_g_balance_fuel_regenlinear
float autocvar_g_balance_health_rotstable
float autocvar_g_balance_health_regenstable
int autocvar_g_balance_armor_regenstable
float autocvar_g_balance_health_rotlinear
float autocvar_g_balance_health_regenlinear
float autocvar_g_balance_fuel_rotlinear
int autocvar_g_balance_fuel_regenstable
float autocvar_g_balance_armor_rot
float autocvar_g_balance_health_regen
int autocvar_g_balance_armor_rotstable
float autocvar_g_balance_health_rot
float autocvar_g_balance_fuel_rot
float autocvar_g_balance_armor_regenlinear
#define GameRules_scoring_add(client, fld, value)
void vehicles_enter(entity pl, entity veh)
void vehicles_exit(entity vehic, bool eject)
const float vehicle_shield
If ent is player this is 0..100 indicating precentage of shield left on vehicle. If ent is vehicle,...
const float vehicle_reload2
If ent is player this is 0..100 indicating percentage of secondary reload status. If ent is vehicle,...
const float vehicle_ammo1
If ent is player this is 0..100 indicating percentage of primary ammo left UNLESS value is already st...
const float vehicle_health
If ent is player this is 0..100 indicating precentage of health left on vehicle. Vehicle's value is t...
const float vehicle_energy
If ent is player this is 0..100 indicating precentage of energy left on vehicle. If ent is vehicle,...
const int VHEF_NORMAL
User pressed exit key.
const int VHEF_RELEASE
Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (n...
const float vehicle_ammo2
If ent is player this is 0..100 indicating percentage of secondary ammo left. If ent is vehicle,...
float autocvar_g_vehicles_enter_radius
const float vehicle_reload1
If ent is player this is 0..100 indicating percentage of primary reload status. If ent is vehicle,...
bool QueuedPlayersReady(entity this, bool checkspecificteam)
Returns true when enough players are queued that the next will join directly to the only available te...
bool TeamBalance_QueuedPlayersTagIn(entity ignore)
Joins queued player(s) to team(s) with a shortage, this should be more robust than only replacing the...
void TeamBalance_Destroy(entity balance)
Destroy the team balance entity.
void TeamBalance_RemoveExcessPlayers(entity ignore)
bool QueueNeeded(entity client, int team_index)
void TeamBalance_JoinBestTeam(entity player)
Assigns the given player to a team that will make the game most balanced.
bool Player_HasRealForcedTeam(entity player)
Returns whether player has real forced team.
bool SetPlayerTeam(entity player, int team_index, int type)
Sets the team of the player.
int Player_GetForcedTeamIndex(entity player)
Returns the index of the forced team of the given player.
int TeamBalance_GetAllowedTeams(entity balance)
Returns the bitmask of allowed teams.
entity TeamBalance_CheckAllowedTeams(entity for_whom)
Checks whether the player can join teams according to global configuration and mutator settings.
bool TeamBalance_AreEqual(entity ignore, bool would_leave)
int TeamBalance_FindBestTeam(entity balance, entity player, bool ignore_player)
Finds the team that will make the game most balanced if the player joins it.
string autocvar_g_forced_team_otherwise
@ TEAM_FORCE_DEFAULT
Don't force any team.
bool autocvar_g_balance_teams_remove
@ TEAM_CHANGE_AUTO
The team was selected by autobalance.
@ TEAM_CHANGE_MANUAL
Player has manually selected their team.
@ TEAM_CHANGE_SPECTATOR
Player is joining spectators. //TODO: Remove?
bool autocvar_g_balance_teams
int Team_IndexToTeam(int index)
Converts team index into team value.
const int TELEPORT_NORMAL
const int TELEPORT_SIMPLE
void WarpZone_crosshair_trace_plusvisibletriggers(entity pl)
float autocvar_g_trueaim_minrange
float autocvar_g_ballistics_density_player
#define IS_REAL_CLIENT(v)
#define FOREACH_CLIENT(cond, body)
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
const int VHF_MULTISLOT
Vehicle has multiple player slots.
void target_voicescript_next(entity pl)
void target_voicescript_clear(entity pl)
void W_Vortex_Charge(entity actor,.entity weaponentity, float dt)
float vortex_charge_rottime
bool waypointeditor_enabled
void WaypointSprite_PlayerGone(entity this)
void WaypointSprite_PlayerDead(entity this)
void WaypointSprite_UpdateHealth(entity e, float f)
entity waypointsprite_attachedforcarrier
void WriteWepSet(float dst, WepSet w)
void W_PROP_reload(int chan, entity to)
string autocvar_g_shootfromfixedorigin
entity exteriorweaponentity
#define WEP_CVAR(wep, name)
WepSet WEPSET_SUPERWEAPONS
const int MAX_WEAPONSLOTS
const int WEP_FLAG_RELOADABLE
can has reload
entity weaponentities[MAX_WEAPONSLOTS]
void W_WeaponFrame(Player actor,.entity weaponentity)
void CL_SpawnWeaponentity(entity actor,.entity weaponentity)
Spawn weaponentity for client.
void W_ResetGunAlign(entity player, int preferred_alignment)
float weapon_load[REGISTRY_MAX(Weapons)]
float warmup_start_ammo_cells
#define WARMUP_START_WEAPONS
entity random_start_ammo
Entity that contains amount of ammo to give with random start weapons.
string autocvar_g_random_start_weapons
Holds a list of possible random start weapons.
float warmup_start_ammo_rockets
float warmup_start_ammo_shells
bool autocvar_sv_mapformat_is_quake3
int random_start_weapons_count
Number of random start weapons to give to players.
float warmup_start_ammo_nails
float default_weapon_alpha
WepSet g_weaponarena_weapons
float default_player_alpha
string cache_lastmutatormsg
float warmup_start_health
bool autocvar_sv_dedicated
bool observe_blocked_if_eliminated
float warmup_start_ammo_fuel
bool sv_ready_restart_after_countdown
float warmup_start_armorvalue