103 if(!player) {
return 0; }
117 if(!player) {
return; }
122 if(spec_count >= MAX_SPECTATORS)
124 WriteByte(MSG_ENTITY, num_for_edict(it));
142 WriteHeader(MSG_ENTITY, ENT_CLIENT_CLIENTDATA);
161 CS(
this).clientdata.drawonlytoclient =
this;
162 CS(
this).clientdata.owner =
this;
167 delete(
CS(
this).clientdata);
168 CS(
this).clientdata =
NULL;
174 if (cd) { cd.SendFlags = 1; }
179 entity cd = CS(it).clientdata;
180 if (cd) { cd.SendFlags = 1; }
203 if(
substring(plyermodel, 0, 14) !=
"models/player/")
206 if(
substring(plyermodel, -4, 4) !=
".iqm" 207 &&
substring(plyermodel, -4, 4) !=
".zym" 208 &&
substring(plyermodel, -4, 4) !=
".dpm" 209 &&
substring(plyermodel, -4, 4) !=
".md3" 210 &&
substring(plyermodel, -4, 4) !=
".psk")
215 if(
substring(plyermodel, -9, 5) ==
"_lod1" ||
substring(plyermodel, -9, 5) ==
"_lod2")
217 if(plyermodel != strtolower(plyermodel))
230 precache_model(modelname);
231 _setmodel(e, modelname);
233 if(!autocvar_g_debug_globalsounds)
240 bool mutator_returnvalue =
MUTATOR_CALLHOOK(MakePlayerObserver,
this, is_forced);
241 bool recount_ready =
false;
249 Send_Effect(EFFECT_SPAWN_NEUTRAL, this.
origin,
'0 0 0', 1);
257 recount_ready =
true;
259 entcs_update_players(
this);
265 if (!spot)
LOG_FATAL(
"No spawnpoints for observers?!?");
268 setorigin(
this, spot.origin + STAT(PL_VIEW_OFS,
this));
271 setorigin(
this, this.
origin + STAT(PL_VIEW_OFS,
this) - STAT(PL_CROUCH_VIEW_OFS,
this));
282 if(!autocvar_g_debug_globalsounds)
289 setsize(
this, STAT(PL_CROUCH_MIN,
this), STAT(PL_CROUCH_MAX,
this));
300 PlayerStats_GameReport_Event_Player(
this, PLAYERSTATS_ALIVETIME,
time - this.
alivetime);
310 WaypointSprite_PlayerDead(
this);
314 Send_Notification(NOTIF_ONE_ONLY,
this, MSG_INFO, INFO_CHAT_NOSPECTATORS);
316 CS(
this).spectatortime =
time;
323 STAT(HUD,
this) = HUD_NORMAL;
344 STAT(RESPAWN_TIME,
this) = 0;
349 STAT(AIR_FINISHED,
this) = 0;
360 STAT(REVIVE_PROGRESS,
this) = 0;
366 STAT(WEAPONS,
this) =
'0 0 0';
378 this.exteriorweaponentity =
NULL;
388 for(
int slot = 0; slot <
MAX_AXH; ++slot)
393 if(axh.owner ==
this && axh !=
NULL && !wasfreed(axh))
397 if (mutator_returnvalue)
410 CS(
this).just_joined =
false;
425 string defaultmodel =
"";
440 if(defaultmodel ==
"")
451 for (
int i = 0; i < n; ++i)
452 if ((
argv(i) == player.playermodel && defaultskin ==
stof(player.playerskin)) ||
argv(i) ==
strcat(player.playermodel,
":", player.playerskin))
453 defaultmodel =
argv(i);
460 defaultmodel =
substring(defaultmodel, 0, i);
481 defaultmodel =
M_ARGV(0,
string);
482 defaultskin =
M_ARGV(1,
int);
486 if(defaultmodel !=
"")
488 if (defaultmodel != player.model)
493 setsize (player, m1, m2);
497 oldskin = player.skin;
498 player.skin = defaultskin;
500 if (player.playermodel != player.model || player.playermodel ==
"")
506 setsize (player, m1, m2);
512 oldskin = player.skin;
513 player.skin =
stof(player.playerskin);
517 oldskin = player.skin;
518 player.skin = defaultskin;
522 if(chmdl || oldskin != player.skin)
525 if(!autocvar_g_debug_globalsounds)
547 Send_Notification(NOTIF_ONE_ONLY,
this, MSG_CENTER, CENTER_JOIN_NOSPAWNS);
553 CS(
this).wasplayer =
true;
602 PS(
this).dual_weapons =
'0 0 0';
617 float f = game_starttime -
time;
624 StatusEffects_apply(STATUSEFFECT_SpawnShield,
this, shieldtime, 0);
630 STAT(RESPAWN_TIME,
this) = 0;
642 this.
angles = spot.angles;
655 STAT(REVIVE_PROGRESS,
this) = 0;
658 STAT(AIR_FINISHED,
this) = 0;
663 spawnevent.owner =
this;
675 for(
int slot = 0; slot <
MAX_AXH; ++slot)
680 if(axh.owner ==
this && axh !=
NULL && !wasfreed(axh))
684 this.spawnpoint_targ =
NULL;
687 this.
view_ofs = STAT(PL_VIEW_OFS,
this);
688 setsize(
this, STAT(PL_MIN,
this), STAT(PL_MAX,
this));
689 this.spawnorigin = spot.origin;
690 setorigin(
this, spot.origin +
'0 0 1' * (1 -
this.mins.z - 24));
698 this.swampslug =
NULL;
699 this.swamp_interval = 0;
703 IL_EACH(g_counters, it.realowner ==
this,
707 STAT(HUD,
this) = HUD_NORMAL;
727 CS(
this).killcount = 0;
728 CS(
this).startplaytime =
time;
742 this.counter_cnt = 0;
745 target_voicescript_clear(
this);
749 it.wr_resetplayer(it,
this);
755 this.(weaponentity).
weapon_load[it.m_id] = it.reloading_ammo;
765 string s = spot.target;
782 entity w_ent = this.(weaponentity);
786 w_ent.m_switchweapon = WEP_Null;
787 w_ent.m_weapon = WEP_Null;
788 w_ent.weaponname =
"";
789 w_ent.m_switchingweapon = WEP_Null;
823 bool use_spawnpoint = (!this.
enemy);
828 PS(
this).itemkeys = 0;
845 WriteHeader(MSG_ENTITY, _ENT_CLIENT_INIT);
858 WriteHeader(channel, ENT_CLIENT_INIT);
911 parm1 = -(86400 * 366);
937 CS(
this).parm_idlesince =
parm1;
938 if (
CS(
this).parm_idlesince == -(86400 * 366))
939 CS(
this).parm_idlesince =
time;
951 stuffcmd(e,
"cl_cmd settemp cl_prydoncursor_notrace 0\n");
952 if(autocvar_sv_gentle)
953 stuffcmd(e,
"cl_cmd settemp cl_gentle 1\n");
955 stuffcmd(e, sprintf(
"\ncl_jumpspeedcap_min \"%s\"\n", autocvar_sv_jumpspeedcap_min));
956 stuffcmd(e, sprintf(
"\ncl_jumpspeedcap_max \"%s\"\n", autocvar_sv_jumpspeedcap_max));
958 stuffcmd(e, sprintf(
"\ncl_shootfromfixedorigin \"%s\"\n", autocvar_g_shootfromfixedorigin));
965 if(list ==
"" || tofind ==
"")
980 if(p.netaddress ==
"local" || p.netaddress ==
"" || !
IS_REAL_CLIENT(p))
1000 #ifdef DP_EXT_PRECONNECT 1008 void ClientPreConnect(
entity this)
1023 if (
CS(
this).version_mismatch) {
1026 "\n^3Your client version is outdated.\n\n\n### YOU WON'T BE ABLE TO PLAY ON THIS SERVER ###\n\n\nPlease update!!!^8");
1029 "\n^3This server is using an outdated Xonotic version.\n\n\n ### THIS SERVER IS INCOMPATIBLE AND THUS YOU CANNOT JOIN ###.^8");
1039 string modifications =
M_ARGV(0,
string);
1048 else if(
cvar(
"g_balance_blaster_weaponstartoverride") == 0)
1049 modifications =
strcat(modifications,
", No start weapons");
1051 modifications =
strcat(modifications,
", Low gravity");
1053 modifications =
strcat(modifications,
", Weapons stay");
1055 modifications =
strcat(modifications,
", Jet pack");
1056 modifications =
substring(modifications, 2,
strlen(modifications) - 2);
1063 if(modifications !=
"")
1064 s =
strcat(s,
"^8\nactive modifications: ^3", modifications,
"^8\n");
1076 string mutator_msg =
"";
1078 mutator_msg =
M_ARGV(0,
string);
1080 s =
strcat(s, mutator_msg);
1084 s =
strcat(s,
"\n\n^8MOTD: ^7", strreplace(
"\\n",
"\n", motd));
1106 Send_Notification(NOTIF_ALL,
NULL, MSG_INFO, INFO_JOIN_CONNECT, this.
netname);
1114 PlayerStats_GameReport_AddEvent(sprintf(
"kills-%d", this.
playerid));
1118 PlayerStats_GameReport_AddPlayer(
this);
1125 CS(
this).just_joined =
true;
1128 stuffcmd(
this,
"cl_particles_reloadeffects\n");
1133 stuffcmd(
this,
"cmd clientversion $gameversion\n");
1141 stuffcmd(
this, sprintf(
"set _teams_available %d\n", t));
1145 stuffcmd(
this,
"set _teams_available 0\n");
1150 CS(
this).spectatortime =
time;
1156 CS(
this).jointime =
time;
1161 stuffcmd(
this,
"cl_cmd settemp chase_active 1\n");
1171 CSQCMODEL_AUTOINIT(
this);
1173 CS(
this).model_randomizer =
random();
1176 sv_notice_join(
this);
1181 Physics_UpdateStats(
this);
1184 it.init_for_player(it, this);
1195 CS(
this).motd_actived_time = -1;
1196 Send_Notification(NOTIF_ONE_ONLY,
this, MSG_CENTER, CENTER_MOTD,
getwelcomemessage(
this));
1214 PlayerStats_GameReport_FinalizePlayer(
this);
1217 if (
IS_PLAYER(
this)) Send_Effect(EFFECT_SPAWN_NEUTRAL, this.
origin,
'0 0 0', 1);
1222 Send_Notification(NOTIF_ALL,
NULL, MSG_INFO, INFO_QUIT_DISCONNECT, this.
netname);
1246 IL_EACH(g_counters, it.realowner ==
this,
1251 WaypointSprite_PlayerGone(
this);
1270 if ((this.
owner.alpha < 0) ||
this.owner.chatbubbleentity !=
this)
1283 this.mdl =
"models/sprites/minigame_busy.iqm";
1285 this.mdl =
"models/misc/chatbubble.spr";
1288 if ( this.
model != this.mdl )
1289 _setmodel(
this, this.mdl);
1320 float gametype_setting_tmp;
1332 if(it.team ==
this.team)
1335 if (sdelay_small_count == 0)
1336 sdelay_small_count = 1;
1337 if (sdelay_large_count == 0)
1338 sdelay_large_count = 1;
1345 if (sdelay_small_count == 0)
1350 sdelay_small_count = 1;
1355 sdelay_small_count = 2;
1358 if (sdelay_large_count == 0)
1363 sdelay_large_count = 1;
1368 sdelay_large_count = 2;
1375 if (pcount <= sdelay_small_count)
1376 sdelay = sdelay_small;
1377 else if (pcount >= sdelay_large_count)
1378 sdelay = sdelay_large;
1380 sdelay = sdelay_small + (sdelay_large - sdelay_small) * (pcount - sdelay_small_count) / (sdelay_large_count - sdelay_small_count);
1387 if(sdelay < sdelay_max)
1432 Send_Effect(EFFECT_RESPAWN_GHOST, this.
origin,
'0 0 0', 1);
1452 if(finished -
time < 6)
1459 if (this.
items & (IT_SUPERWEAPON | IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS))
1464 if (this.
items & (IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS))
1466 this.
items -= (this.
items & (IT_SUPERWEAPON | IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS));
1472 if((this.
items & IT_USING_JETPACK) && !
IS_DEAD(
this) && !game_stopped)
1486 int items_prev = this.
items;
1491 if (this.
items & IT_SUPERWEAPON)
1498 Send_Notification(NOTIF_ONE,
this, MSG_CENTER, CENTER_SUPERWEAPON_LOST);
1500 else if (this.
items & IT_UNLIMITED_SUPERWEAPONS)
1506 play_countdown(
this, StatusEffects_gettime(STATUSEFFECT_Superweapons,
this), SND_POWEROFF);
1507 if (
time > StatusEffects_gettime(STATUSEFFECT_Superweapons,
this))
1512 Send_Notification(NOTIF_ONE,
this, MSG_CENTER, CENTER_SUPERWEAPON_BROKEN);
1518 if (
time < StatusEffects_gettime(STATUSEFFECT_Superweapons,
this) || (this.
items & IT_UNLIMITED_SUPERWEAPONS))
1521 if(!(this.
items & IT_UNLIMITED_SUPERWEAPONS))
1524 Send_Notification(NOTIF_ALL,
NULL, MSG_INFO, INFO_SUPERWEAPON_PICKUP, this.
netname);
1525 Send_Notification(NOTIF_ONE,
this, MSG_CENTER, CENTER_SUPERWEAPON_PICKUP);
1530 if(StatusEffects_active(STATUSEFFECT_Superweapons,
this))
1535 else if(StatusEffects_active(STATUSEFFECT_Superweapons,
this))
1550 float CalcRegen(
float current,
float stable,
float regenfactor,
float regenframetime)
1552 if(current > stable)
1554 else if(current > stable - 0.25)
1557 return min(stable, current + (stable - current) * regenfactor * regenframetime);
1560 float CalcRot(
float current,
float stable,
float rotfactor,
float rotframetime)
1562 if(current < stable)
1564 else if(current < stable + 0.25)
1567 return max(stable, current + (stable - current) * rotfactor * rotframetime);
1571 float regenstable,
float regenfactor,
float regenlinear,
float regenframetime,
1572 float rotstable,
float rotfactor,
float rotlinear,
float rotframetime)
1575 float current = old;
1576 if(current > rotstable)
1578 if(rotframetime > 0)
1580 current =
CalcRot(current, rotstable, rotfactor, rotframetime);
1581 current =
max(rotstable, current - rotlinear * rotframetime);
1584 else if(current < regenstable)
1586 if(regenframetime > 0)
1588 current =
CalcRegen(current, regenstable, regenfactor, regenframetime);
1589 current =
min(regenstable, current + regenlinear * regenframetime);
1603 float max_mod, regen_mod, rot_mod, limit_mod;
1604 max_mod = regen_mod = rot_mod = limit_mod = 1;
1612 bool mutator_returnvalue =
MUTATOR_CALLHOOK(PlayerRegen,
this, max_mod, regen_mod, rot_mod, limit_mod, regen_health, regen_health_linear, regen_health_rot,
1613 regen_health_rotlinear, regen_health_stable, regen_health_rotstable);
1614 max_mod =
M_ARGV(1,
float);
1615 regen_mod =
M_ARGV(2,
float);
1616 rot_mod =
M_ARGV(3,
float);
1617 limit_mod =
M_ARGV(4,
float);
1618 regen_health =
M_ARGV(5,
float);
1619 regen_health_linear =
M_ARGV(6,
float);
1620 regen_health_rot =
M_ARGV(7,
float);
1621 regen_health_rotlinear =
M_ARGV(8,
float);
1622 regen_health_stable =
M_ARGV(9,
float);
1623 regen_health_rotstable =
M_ARGV(10,
float);
1625 float rotstable, regenstable, rotframetime, regenframetime;
1627 if(!mutator_returnvalue)
1628 if(!STAT(FROZEN,
this))
1634 RotRegen(
this, RES_ARMOR, limit_mod,
1639 regenstable = regen_health_stable * max_mod;
1640 rotstable = regen_health_rotstable * max_mod;
1644 regenstable, regen_health, regen_health_linear, regenframetime,
1645 rotstable, regen_health_rot, regen_health_rotlinear, rotframetime);
1654 if(this.event_damage)
1655 this.event_damage(
this,
this,
this, 1, DEATH_ROT.m_id,
DMG_NOWEP,
this.origin,
'0 0 0');
1658 if (!(this.
items & IT_UNLIMITED_AMMO))
1675 CS(
this).zoomstate = newzoom;
1678 zoomstate_set =
true;
1686 CS(
this).pressedkeys = 0;
1687 STAT(PRESSED_KEYS,
this) = 0;
1692 int keys = STAT(PRESSED_KEYS,
this);
1702 CS(
this).pressedkeys = keys;
1704 STAT(PRESSED_KEYS,
this) = keys;
1718 PS(
this) =
PS(spectatee);
1727 this.
effects = spectatee.effects & EFMASK_CHEAP;
1729 CS(
this).impulse = 0;
1731 this.
items = spectatee.items;
1732 STAT(LAST_PICKUP,
this) = STAT(LAST_PICKUP, spectatee);
1733 STAT(HIT_TIME,
this) = STAT(HIT_TIME, spectatee);
1734 STAT(AIR_FINISHED,
this) = STAT(AIR_FINISHED, spectatee);
1735 STAT(PRESSED_KEYS,
this) = STAT(PRESSED_KEYS, spectatee);
1736 STAT(WEAPONS,
this) = STAT(WEAPONS, spectatee);
1738 this.
view_ofs = spectatee.view_ofs;
1739 this.
velocity = spectatee.velocity;
1740 this.
dmg_take = spectatee.dmg_take;
1741 this.
dmg_save = spectatee.dmg_save;
1743 this.
v_angle = spectatee.v_angle;
1744 this.
angles = spectatee.v_angle;
1745 STAT(FROZEN,
this) = STAT(FROZEN, spectatee);
1746 STAT(REVIVE_PROGRESS,
this) = STAT(REVIVE_PROGRESS, spectatee);
1747 this.
viewloc = spectatee.viewloc;
1751 setsize(
this, spectatee.mins, spectatee.maxs);
1755 STAT(HUD,
this) = STAT(HUD, spectatee);
1756 if(spectatee.vehicle)
1758 this.
angles = spectatee.v_angle;
1762 this.vehicle_health = spectatee.vehicle_health;
1763 this.vehicle_shield = spectatee.vehicle_shield;
1764 this.vehicle_energy = spectatee.vehicle_energy;
1765 this.vehicle_ammo1 = spectatee.vehicle_ammo1;
1766 this.vehicle_ammo2 = spectatee.vehicle_ammo2;
1767 this.vehicle_reload1 = spectatee.vehicle_reload1;
1768 this.vehicle_reload2 = spectatee.vehicle_reload2;
1821 int oldspectatee_status =
CS(
this).spectatee_status;
1822 CS(
this).spectatee_status = spectatee_num;
1826 if (STAT(PRESSED_KEYS,
this))
1828 CS(
this).pressedkeys = 0;
1829 STAT(PRESSED_KEYS,
this) = 0;
1843 this.
enemy = spectatee;
1852 if(old_spectatee.(weaponentity).arc_beam)
1853 old_spectatee.(weaponentity).arc_beam.SendFlags |= ARC_SF_SETTINGS;
1861 if(spectatee.(weaponentity).arc_beam)
1862 spectatee.(weaponentity).arc_beam.SendFlags |= ARC_SF_SETTINGS;
1907 while(ent && ent != this.
enemy)
1953 { Send_Notification(NOTIF_ONE,
this, MSG_ANNCE, Announcer_PickNumber(CNT_RESPAWN, number)); }
1963 stuffcmd(
this,
"menu_showteamselect\n");
1977 Kill_Notification(NOTIF_ONE_ONLY,
this, MSG_CENTER, CPID_PREVENT_JOIN);
1986 Send_Notification(NOTIF_ALL,
NULL, MSG_INFO, INFO_JOIN_PLAY, this.
netname);
1996 player_limit =
M_ARGV(0,
int);
1997 return player_limit;
2022 int totalClients = 0;
2023 int currentlyPlaying = 0;
2036 else if(player_limit > 0 && currentlyPlaying < player_limit)
2037 free_slots =
min(
maxclients - totalClients, player_limit - currentlyPlaying);
2039 static float msg_time = 0;
2040 if(
this && !
INGAME(
this) && ignore && !free_slots &&
time > msg_time)
2042 Send_Notification(NOTIF_ONE_ONLY,
this, MSG_CENTER, CENTER_JOIN_PREVENT);
2043 msg_time =
time + 0.5;
2055 CS(
this).motd_actived_time =
time;
2060 CS(
this).motd_actived_time =
time;
2061 Send_Notification(NOTIF_ONE_ONLY,
this, MSG_CENTER, CENTER_MOTD,
getwelcomemessage(
this));
2069 CS(
this).motd_actived_time =
time;
2071 CS(
this).motd_actived_time = 0;
2076 CS(
this).motd_actived_time =
time;
2078 CS(
this).motd_actived_time = 0;
2079 Kill_Notification(NOTIF_ONE_ONLY,
this, MSG_CENTER, CPID_MOTD);
2086 CS(
this).motd_actived_time = -2;
2090 CS(
this).motd_actived_time = 0;
2094 Kill_Notification(NOTIF_ONE_ONLY,
this, MSG_CENTER, CPID_MOTD);
2103 CS(
this).motd_actived_time++;
2110 if (
CS(
this).version_mismatch)
return false;
2145 CS(
this).impulse = CHIMPULSE_SPEEDRUN.impulse;
2152 STAT(RESPAWN_TIME,
this) = 0;
2197 STAT(RESPAWN_TIME,
this) = 0;
2211 STAT(RESPAWN_TIME,
this) *= -1;
2220 stuffcmd(
this, sprintf(
"\ncl_shootfromfixedorigin \"%s\"\n", autocvar_g_shootfromfixedorigin));
2238 if(
WEP_CVAR(vortex, charge_always))
2239 W_Vortex_Charge(
this, weaponentity,
frametime);
2251 if (
WEP_CVAR(vortex, charge_rot_rate) && this.(weaponentity).
vortex_charge >
WEP_CVAR(vortex, charge_limit) && this.(weaponentity).vortex_charge_rottime <
time)
2274 CS(
this).impulse = 0;
2276 if (is_spec &&
CS(
this).
impulse == IMP_weapon_drop.impulse)
2278 STAT(CAMERA_SPECTATOR,
this) = (STAT(CAMERA_SPECTATOR,
this) + 1) % 3;
2279 CS(
this).impulse = 0;
2286 this.
flags &= ~FL_JUMPRELEASED;
2287 this.
flags |= FL_SPAWNING;
2290 this.
flags &= ~FL_JUMPRELEASED;
2293 }
else if (is_spec) {
2300 CS(
this).impulse = 0;
2301 }
else if (is_spec) {
2303 this.
flags &= ~FL_JUMPRELEASED;
2310 CS(
this).impulse = 0;
2313 this.
flags &= ~FL_JUMPRELEASED;
2322 bool wouldclip =
CS_CVAR(
this).cvar_cl_clippedspectating;
2324 wouldclip = !wouldclip;
2332 if(this.
flags & FL_SPAWNING)
2334 this.
flags &= ~FL_SPAWNING;
2338 CS(
this).autojoin_checked = -1;
2362 else if(autocvar_g_vehicles_enter)
2377 { closest_target = head; }
2379 else { closest_target = head; }
2385 if(closest_target) {
vehicles_enter(
this, closest_target);
return; }
2404 STAT(GUNALIGN,
this) =
CS_CVAR(
this).cvar_cl_gunalign;
2405 STAT(MOVEVARS_CL_TRACK_CANJUMP,
this) =
CS_CVAR(
this).cvar_cl_movement_track_canjump;
2407 WarpZone_PlayerPhysics_FixVAngle(
this);
2420 Send_Notification(NOTIF_ONE_ONLY,
this, MSG_INFO, INFO_QUIT_KICK_SPECTATING);
2424 zoomstate_set =
false;
2429 bool assume_unchanged = (
CS(
this).netname_previous ==
"");
2435 assume_unchanged =
false;
2441 sprint(
this,
"Warning: invisible names are not allowed.\n");
2442 assume_unchanged =
false;
2451 if (
CS(
this).version_nagtime &&
CS_CVAR(
this).cvar_g_xonoticversion &&
time >
CS(
this).version_nagtime) {
2452 CS(
this).version_nagtime = 0;
2471 Send_Notification(NOTIF_ONE_ONLY,
this, MSG_INFO, INFO_GODMODE_OFF, this.
max_armorvalue);
2482 this.
iceblock.alpha =
bound(0.2, 1 - STAT(REVIVE_PROGRESS,
this), 1);
2484 if (STAT(REVIVE_PROGRESS,
this) >= 1)
2496 if(this.event_damage)
2497 this.event_damage(
this,
this, this.
frozen_by, 1, DEATH_NADE_ICE_FREEZE.m_id,
DMG_NOWEP,
this.origin,
'0 0 0');
2499 else if (STAT(REVIVE_PROGRESS,
this) <= 0)
2513 if(!it.team || SAME_TEAM(this, it))
2514 Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_VEHICLE_ENTER);
2515 else if(autocvar_g_vehicles_steal)
2516 Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_VEHICLE_ENTER_STEAL);
2520 Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_VEHICLE_ENTER_GUNNER);
2536 error(
"Client can't be spawned as player on connection!");
2547 bool early_join_requested = (
CS(
this).autojoin_checked < 0);
2548 CS(
this).autojoin_checked = 1;
2566 if (!zoomstate_set) {
2567 bool wep_zoomed =
false;
2571 Weapon thiswep = this.(weaponentity).m_weapon;
2572 if(thiswep != WEP_Null && thiswep.wr_zoom)
2573 wep_zoomed += thiswep.wr_zoom(thiswep,
this);
2580 CS(
this).teamkill_soundtime = 0;
2582 entity e =
CS(
this).teamkill_soundsource;
2583 entity oldpusher = e.pusher;
2586 e.pusher = oldpusher;
2590 CS(
this).taunt_soundtime = 0;
2594 target_voicescript_next(
this);
2602 STAT(AIR_FINISHED,
this) = 0;
2608 if(STAT(AIR_FINISHED,
this) && STAT(AIR_FINISHED,
this) <
time)
2610 STAT(AIR_FINISHED,
this) = 0;
2614 if (!STAT(AIR_FINISHED,
this))
2616 if (STAT(AIR_FINISHED,
this) <
time)
2641 CS(
this).pm_frametime = 0;
2661 int totalClients = 0;
2686 CS(
this).parm_idlesince =
time;
2688 else if (
time -
CS(
this).parm_idlesince < 1)
2690 if (
CS(
this).idlekick_lasttimeleft)
2692 CS(
this).idlekick_lasttimeleft = 0;
2693 Kill_Notification(NOTIF_ONE_ONLY,
this, MSG_CENTER,
CPID_IDLING);
2701 float timeleft =
ceil(maxidle_time - (
time -
CS(
this).parm_idlesince));
2702 float countdown_time =
max(
min(10, maxidle_time - 1),
ceil(maxidle_time * 0.33));
2703 if (timeleft == countdown_time && !
CS(
this).idlekick_lasttimeleft)
2706 Send_Notification(NOTIF_ONE_ONLY,
this, MSG_CENTER, CENTER_MOVETOSPEC_IDLING, timeleft);
2708 Send_Notification(NOTIF_ONE_ONLY,
this, MSG_CENTER, CENTER_DISCONNECT_IDLING, timeleft);
2710 if (timeleft <= 0) {
2713 Send_Notification(NOTIF_ALL,
NULL, MSG_INFO, INFO_MOVETOSPEC_IDLING, this.
netname, maxidle_time);
2719 Send_Notification(NOTIF_ALL,
NULL, MSG_INFO, INFO_QUIT_KICK_IDLING, this.
netname, maxidle_time);
2723 else if (timeleft <= countdown_time) {
2724 if (timeleft !=
CS(
this).idlekick_lasttimeleft)
2725 play2(
this,
SND(TALK2));
2726 CS(
this).idlekick_lasttimeleft = timeleft;
2738 CS(
this).teamkill_complain = 0;
2739 CS(
this).teamkill_soundtime = 0;
2740 CS(
this).teamkill_soundsource =
NULL;
2749 setsize(
this, this.
mins, this.
maxs);
2757 CSQCMODEL_AUTOUPDATE(
this);
2761 else if (
IS_OBSERVER(
this) && STAT(PRESSED_KEYS,
this))
2763 CS(
this).pressedkeys = 0;
2764 STAT(PRESSED_KEYS,
this) = 0;
2767 if (this.waypointsprite_attachedforcarrier) {
2769 WaypointSprite_UpdateHealth(this.waypointsprite_attachedforcarrier, hp);
2772 CSQCMODEL_AUTOUPDATE(
this);
2784 store.button0 = (typing) ? 0 : this.
button0;
2786 store.button2 = (typing) ? 0 : this.
button2;
2787 store.button3 = (typing) ? 0 : this.
button3;
2789 store.button5 = (typing) ? 0 : this.
button5;
2810 store.ping = this.
ping;
2820 int fps = ReadShort();
entity random_start_ammo
Entity that contains amount of ammo to give with random start weapons.
int autocvar_sv_name_maxlength
float autocvar_g_balance_armor_rotlinear
float autocvar_g_balance_pause_health_regen_spawn
#define CSQCMODEL_EF_RESPAWNGHOST
#define PHYS_INPUT_BUTTON_ATCK2(s)
ERASEABLE void IL_REMOVE(IntrusiveList this, entity it)
Remove any element, anywhere in the list.
entity SelectSpawnPoint(entity this, bool anypoint)
void respawn(entity this)
string getwelcomemessage(entity this)
#define PHYS_INPUT_BUTTON_JUMP(s)
bool PlayerHeal(entity targ, entity inflictor, float amount, float limit)
#define IL_EACH(this, cond, body)
float autocvar_g_balance_pause_health_rot_spawn
int autocvar_sv_defaultplayerskin_pink
#define PHYS_INPUT_BUTTON_CHAT(s)
const float SOLID_SLIDEBOX
WepSet WEPSET_SUPERWEAPONS
void SpectateCopy(entity this, entity spectatee)
float weapon_load[REGISTRY_MAX(Weapons)]
float autocvar_g_balance_superweapons_time
void ClientInit_CheckUpdate(entity this)
void play_countdown(entity this, float finished, Sound samp)
const int WEP_FLAG_RELOADABLE
void GiveRandomWeapons(entity receiver, int num_weapons, string weapon_names, entity ammo_entity)
Give several random weapons and ammo to the entity.
IntrusiveList g_monster_targets
float autocvar_sv_player_scale
bool SetPlayerTeam(entity player, int team_index, int type)
Sets the team of the player.
bool autocvar_g_nodepthtestplayers
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 CPID_CAMPAIGN_MESSAGE
float autocvar_g_respawn_ghosts_speed
float g_nexball_meter_period
void ClientConnect(entity this)
ClientConnect
const int WATERLEVEL_SUBMERGED
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
#define PHYS_INPUT_BUTTON_HOOK(s)
float autocvar_g_balance_contents_damagerate
void W_WeaponFrame(Player actor,.entity weaponentity)
float get_model_parameters(string m, float sk)
int autocvar_sv_defaultplayerskin_blue
float warmup_start_ammo_shells
string autocvar_g_forced_team_otherwise
float autocvar_g_balance_contents_drowndelay
const int VOICETYPE_PLAYERSOUND
void player_regen(entity this)
const int TELEPORT_SIMPLE
Header file that describes the resource system.
float autocvar_g_balance_health_rot
void bot_relinkplayerlist()
#define w_getbestweapon(ent, wepent)
Header file that describes the handicap system.
float autocvar_sv_maxidle
float autocvar_g_balance_pause_armor_rot_spawn
const int TELEPORT_NORMAL
int autocvar_g_balance_fuel_rotstable
void bot_aim_reset(entity this)
#define IS_INDEPENDENT_PLAYER(e)
void ChatBubbleThink(entity this)
int autocvar_sv_maxidle_minplayers
int autocvar_sv_defaultplayerskin_red
void SetChangeParms(entity this)
void TeamBalance_Destroy(entity balance)
Destroy the team balance entity.
IntrusiveList g_damagedbycontents
void PlayerPostThink(entity this)
string autocvar_g_mutatormsg
void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
void navigation_dynamicgoal_init(entity this, bool initially_static)
ClientState CS(Client this)
void anticheat_spectatecopy(entity this, entity spectatee)
float autocvar_g_respawn_ghosts_fadetime
#define FOREACH_CLIENT(cond, body)
int autocvar_g_balance_armor_start
float CalcRegen(float current, float stable, float regenfactor, float regenframetime)
void PrintWelcomeMessage(entity this)
void part_minigame(entity player)
vector hook_shotorigin[4]
#define PHYS_INPUT_BUTTON_ZOOM(s)
bool autocvar_sv_defaultcharacterskin
bool PlayerInIPList(entity p, string iplist)
string autocvar_sv_defaultplayermodel
bool SpectateUpdate(entity this)
void PlayerState_attach(entity this)
void SUB_UseTargets(entity this, entity actor, entity trigger)
void player_powerups(entity this)
#define WEP_CVAR(wepname, name)
bool Spectate(entity this, entity pl)
void UpdatePlayerSounds(entity this)
Effect is being removed by a function, calls regular removal mechanics.
void W_ResetGunAlign(entity player, int preferred_alignment)
const int VOICETYPE_AUTOTAUNT
float DPCONTENTS_PLAYERCLIP
bool autocvar_g_forced_respawn
float autocvar_g_balance_armor_regenlinear
float autocvar_g_respawn_ghosts_time
const int CH_PLAYER_SINGLE
void TeamBalance_JoinBestTeam(entity player)
Assigns the given player to a team that will make the game most balanced.
string shootfromfixedorigin
bool autocvar_g_changeteam_banned
float autocvar_g_player_damageforcescale
const int EF_RESTARTANIM_BIT
void antilag_clear(entity e, entity store)
const float TIMEOUT_ACTIVE
string g_weaponarena_list
#define MAKE_INDEPENDENT_PLAYER(e)
vector cursor_trace_start
int autocvar_bot_vs_human
const float EF_NODEPTHTEST
string autocvar_sv_defaultplayermodel_blue
float autocvar_g_balance_fuel_rotlinear
NET_HANDLE(ENT_CLIENT_WARPZONE, bool isnew)
void Movetype_Physics_NoMatchTicrate(entity this, float movedt, bool isclient)
bool dropclient_schedule(entity this)
Schedules dropclient for a player and returns true; if dropclient is already scheduled (for that play...
bool autocvar_g_botclip_collisions
#define INDEPENDENT_PLAYERS
void PlayerPreThink(entity this)
vector cursor_trace_endpos
void bot_clientconnect(entity this)
void UpdateChatBubble(entity this)
void SetZoomState(entity this, float newzoom)
void vehicles_enter(entity pl, entity veh)
bool autocvar_g_respawn_ghosts
float g_weaponarena_random
float warmup_start_ammo_plasma
void anticheat_prethink(entity this)
IntrusiveList g_initforplayer
bool ShowTeamSelection(entity this)
int autocvar_sv_defaultplayerskin
string GetClientVersionMessage(entity this)
#define FOREACH_WORD(words, cond, body)
float autocvar_g_balance_fuel_rot
IntrusiveList g_bot_targets
const int WATERLEVEL_NONE
#define IS_REAL_CLIENT(v)
const int EF_TELEPORT_BIT
float compressShotOrigin(vector v)
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)
int Campaign_GetLevelNum()
float autocvar_g_balance_health_rotlinear
float autocvar_g_trueaim_minrange
float autocvar_g_balance_armor_rot
int autocvar_sv_maxidle_slots
bool SpawnEvent_Send(entity this, entity to, int sf)
#define setmodel(this, m)
string autocvar_sv_defaultplayercolors
#define MUTATOR_IS_ENABLED(this)
bool autocvar_sv_teamnagger
float autocvar_g_balance_health_regenstable
#define CHAT_NOSPECTATORS()
const float CONTENT_EMPTY
void Unfreeze(entity targ, bool reset_health)
const float EF_FULLBRIGHT
Effect is being forcibly removed without calling any additional mechanics.
Force the player to spectator team.
void IntermissionThink(entity this)
bool SpectateNext(entity this)
int autocvar_g_balance_armor_regenstable
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
float get_model_parameters_species
bool autocvar_sv_maxidle_slots_countbots
Player is joining spectators. //TODO: Remove?
int TeamBalance_GetAllowedTeams(entity balance)
Returns the bitmask of allowed teams.
float textLengthUpToLength(string theText, float maxWidth, textLengthUpToLength_lenFunction_t w)
float warmup_start_ammo_cells
bool MinigameImpulse(entity this, int imp)
bool autocvar_g_weaponswitch_debug
int Player_GetForcedTeamIndex(entity player)
Returns the index of the forced team of the given player.
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
entity AuxiliaryXhair[MAX_AXH]
void Portal_ClearAll(entity own)
float autocvar_g_balance_fuel_regen
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
float warmup_start_ammo_fuel
string autocvar_sv_defaultplayermodel_yellow
bool autocvar_sv_maxidle_alsokickspectators
string CheckPlayerModel(string plyermodel)
bool W_DualWielding(entity player)
#define WARMUP_START_WEAPONS
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
const int MAX_WEAPONSLOTS
void GetPressedKeys(entity this)
void monsters_setstatus(entity this)
#define PHYS_INPUT_BUTTON_USE(s)
int autocvar_sv_timeout_number
void PlayerUseKey(entity this)
float pauserothealth_finished
float CheatFrame(entity this)
int autocvar_sv_defaultplayerskin_yellow
bool joinAllowed(entity this)
void player_anim(entity this)
const float CONTENT_WATER
ERASEABLE int vercmp(string v1, string v2)
float autocvar_sv_maxidle_playertospectator
int autocvar_g_balance_armor_rotstable
float autocvar_g_balance_fuel_regenlinear
float CalcRot(float current, float stable, float rotfactor, float rotframetime)
float pauserotfuel_finished
float MOVETYPE_FLY_WORLDONLY
void PutObserverInServer(entity this, bool is_forced, bool use_spawnpoint)
putting a client as observer in the server
void send_CSQC_teamnagger()
string FallbackPlayerModel
bool autocvar_sv_q3compat_changehitbox
int player_getspecies(entity this)
#define PHYS_INPUT_BUTTON_ZOOMSCRIPT(s)
float pauserotarmor_finished
void ShowRespawnCountdown(entity this)
void player_setupanimsformodel(entity this)
float PlayerScore_Clear(entity player)
Initialize the score of this player if needed.
bool Ban_MaybeEnforceBanOnce(entity client)
#define PHYS_INPUT_BUTTON_ATCK(s)
float autocvar_g_ballistics_density_player
void GameLogEcho(string s)
void DecodeLevelParms(entity this)
bool autocvar_sv_defaultcharacter
bool autocvar_sv_showspectators
string autocvar_g_random_start_weapons
Holds a list of possible random start weapons.
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
void SetSpectatee(entity this, entity spectatee)
float disableclientprediction
entity WarpZone_FindRadius(vector org, float rad, bool needlineofsight)
int autocvar_g_balance_fuel_regenstable
const int CH_TRIGGER_SINGLE
#define BITSET(var, mask, flag)
float autocvar_g_balance_health_regen
float autocvar_g_balance_damagepush_speedfactor
float warmup_start_armorvalue
float GetResourceLimit(entity e, Resource res_type)
Returns the maximum amount of the given resource.
void RemoveGrapplingHooks(entity pl)
void DrownPlayer(entity this)
void Player_Physics(entity this)
void PM_UpdateButtons(entity this, entity store)
bool campaign_bots_may_start
campaign mode: bots shall spawn but wait for the player to spawn before they do anything in other gam...
float autocvar_gameversion
vector(float skel, float bonenum) _skel_get_boneabs_hidden
void WriteSpectators(entity player, entity to)
void SetSpectatee_status(entity this, int spectatee_num)
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 CPID_IDLING
string GameLog_ProcessIP(string s)
bool autocvar_g_fullbrightplayers
const int FROZEN_TEMP_REVIVING
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
const int VHF_MULTISLOT
Add random head angles each frame if health < 50%.
float autocvar_sv_foginterval
void CL_SpawnWeaponentity(entity actor,.entity weaponentity)
float warmup_start_ammo_rockets
float autocvar_g_maxplayers_spectator_blocktime
void ClientData_Touch(entity e)
void ClientData_Attach(entity this)
void ONREMOVE(entity this)
bool sv_ready_restart_after_countdown
void calculate_player_respawn_time(entity this)
void PutPlayerInServer(entity this)
void race_InitSpectator()
int autocvar_g_balance_contents_playerdamage_drowning
string autocvar_sv_defaultplayermodel_red
const int FRAGS_SPECTATOR
#define MUTATOR_CALLHOOK(id,...)
bool drag_undraggable(entity draggee, entity dragger)
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
void FixPlayermodel(entity player)
bool ClientData_Send(entity this, entity to, int sf)
bool PlayerThink(entity this)
entity weaponentities[MAX_WEAPONSLOTS]
float warmup_start_health
#define new_pure(class)
purely logical entities (.origin doesn't work)
bool Player_HasRealForcedTeam(entity player)
Returns whether player has real forced team.
bool autocvar_g_balance_teams
#define STATIC_METHOD(cname, name, prototype)
float pauseregen_finished
void setplayermodel(entity e, string modelname)
void Player_DetermineForcedTeam(entity player)
Determines the forced team of the player using current global config.
const float VOL_BASEVOICE
const int MOVETYPE_QCPLAYER
bool intermission_running
void SUB_SetFade(entity ent, float vanish_time, float fading_time)
int nJoinAllowed(entity this, entity ignore)
Determines whether the player is allowed to join.
void vehicles_exit(entity vehic, bool eject)
float autocvar_g_balance_health_regenlinear
float default_player_alpha
entity TeamBalance_CheckAllowedTeams(entity for_whom)
Checks whether the player can join teams according to global configuration and mutator settings...
bool SpectateSet(entity this)
int random_start_weapons_count
Number of random start weapons to give to players.
IntrusiveList g_ladderents
void PlayerState_detach(entity this)
#define sound(e, c, s, v, a)
void VoteCount(float first_count)
int autocvar_g_maxplayers
float autocvar_g_teamdamage_resetspeed
bool autocvar_sv_servermodelsonly
bool autocvar_sv_eventlog
void CopyBody(entity this, float keepvelocity)
ERASEABLE ACCUMULATE void Registry_send_all()
void Handicap_Initialize(entity player)
Initializes handicap to its default value.
bool autocvar_g_playerclip_collisions
#define GAMETYPE_DEFAULTED_SETTING(str)
float autocvar_g_balance_armor_blockpercent
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
float autocvar_g_balance_armor_regen
float autocvar_g_spawnshieldtime
bool PlayerInList(entity player, string list)
float autocvar_g_balance_health_rotstable
void ClientState_detach(entity this)
bool ClientInit_SendEntity(entity this, entity to, int sf)
string Campaign_GetMessage()
ERASEABLE bool fexists(string f)
float autocvar_g_player_brightness
float default_weapon_alpha
float autocvar_g_balance_pause_fuel_rot_spawn
float autocvar_g_respawn_ghosts_alpha
ERASEABLE bool isInvisibleString(string s)
void accuracy_resend(entity e)
void ObserverOrSpectatorThink(entity this)
#define PHYS_INPUT_BUTTON_INFO(s)
bool findinlist_abbrev(string tofind, string list)
#define FOREACH(list, cond, body)
string weaponorder_byimpulse
const int FROZEN_TEMP_DYING
#define PHYS_INPUT_BUTTON_MINIGAME(s)
const int VOICETYPE_LASTATTACKER_ONLY
void ClientInit_misc(entity this)
WepSet g_weaponarena_weapons
string autocvar_sv_defaultplayermodel_pink
void set_movetype(entity this, int mt)
void FixClientCvars(entity e)
void player_powerups_remove_all(entity this)
void ClientData_Detach(entity this)
bool SpectatePrev(entity this)
string cache_lastmutatormsg
string autocvar_g_xonoticversion
float PlayerScore_Set(entity player, PlayerScoreField scorefield, float score)
Sets the player's score to the score parameter.
void ImpulseCommands(entity this)
float warmup_start_ammo_nails
bool PlayerInIDList(entity p, string idlist)
int CountSpectators(entity player, entity to)