void race_SendRankings(float pos, float prevpos, float del, float msg);
void send_CSQC_teamnagger() {
- WriteByte(0, SVC_TEMPENTITY);
- WriteByte(0, TE_CSQC_TEAMNAGGER);
-}
-
-void send_CSQC_cr_maxbullets(entity e) {
- msg_entity = e;
- WriteByte(MSG_ONE, SVC_TEMPENTITY);
- WriteByte(MSG_ONE, TE_CSQC_CR_MAXBULLETS);
- WriteByte(MSG_ONE, autocvar_g_balance_campingrifle_magazinecapacity);
+ WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
+ WriteByte(MSG_BROADCAST, TE_CSQC_TEAMNAGGER);
}
void Announce(string snd) {
self.frags = FRAGS_SPECTATOR;
}
-float RestrictSkin(float s)
-{
- if(!teams_matter)
- return s;
- if(s == 6)
- return 6;
- return mod(s, 3);
-}
-
void FixPlayermodel()
{
local string defaultmodel;
}
oldskin = self.skinindex;
- self.skinindex = RestrictSkin(stof(self.playerskin));
+ self.skinindex = stof(self.playerskin);
}
if(chmdl || oldskin != self.skinindex)
self.cnt = self.switchweapon;
self.weapon = 0;
+ self.wish_reload = 0;
+
if(!self.alivetime)
self.alivetime = time;
} else if(self.classname == "observer" || (g_ca && !allowed_to_spawn)) {
WriteCoord(MSG_ENTITY, self.ebouncefactor); // g_balance_grenadelauncher_bouncefactor
WriteCoord(MSG_ENTITY, self.ebouncestop); // g_balance_grenadelauncher_bouncestop
WriteByte(MSG_ENTITY, autocvar_g_balance_nex_secondary); // client has to know if it should zoom or not
- WriteByte(MSG_ENTITY, autocvar_g_balance_campingrifle_secondary); // client has to know if it should zoom or not
+ WriteByte(MSG_ENTITY, autocvar_g_balance_sniperrifle_secondary); // client has to know if it should zoom or not
WriteByte(MSG_ENTITY, serverflags); // client has to know if it should zoom or not
+ WriteByte(MSG_ENTITY, autocvar_g_balance_sniperrifle_magazinecapacity); // rifle max bullets
+ WriteCoord(MSG_ENTITY, autocvar_g_trueaim_minrange);
return TRUE;
}
void ClientKill_Now()
{
+ remove(self.killindicator);
+ self.killindicator = world;
+
if(self.killindicator_teamchange)
ClientKill_Now_TeamChange();
// in any case:
Damage(self, self, self, 100000, DEATH_KILL, self.origin, '0 0 0');
- if(self.killindicator)
- {
- dprint("Cleaned up after a leaked kill indicator.\n");
- remove(self.killindicator);
- self.killindicator = world;
- }
+ // now I am sure the player IS dead
}
void KillIndicator_Think()
{
ClientKill_Now(); // no oldself needed
return;
}
- else if(g_cts)
+ else if(g_cts && self.health == 1) // health == 1 means that it's silent
{
self.nextthink = time + 1;
self.cnt -= 1;
if(g_race_qualifying || g_cts)
killtime = 0;
- if(self.modelindex && self.deadflag == DEAD_NO)
- {
- killtime = max(killtime, self.clientkill_nexttime - time);
- self.clientkill_nexttime = time + killtime + autocvar_g_balance_kill_antispam;
- }
+ if(g_cts && self.killindicator && self.killindicator.health == 1) // self.killindicator.health == 1 means that the kill indicator was spawned by CTS_ClientKill
+ {
+ remove(self.killindicator);
+ self.killindicator = world;
+
+ ClientKill_Now(); // allow instant kill in this case
+ return;
+ }
self.killindicator_teamchange = targetteam;
if(!self.killindicator)
{
+ if(self.modelindex && self.deadflag == DEAD_NO)
+ {
+ killtime = max(killtime, self.clientkill_nexttime - time);
+ self.clientkill_nexttime = time + killtime + autocvar_g_balance_kill_antispam;
+ }
+
if(killtime <= 0 || !self.modelindex || self.deadflag != DEAD_NO)
{
ClientKill_Now();
self.killindicator.nextthink = time + (self.lip) * 0.05;
self.killindicator.cnt = ceil(killtime);
self.killindicator.count = bound(0, ceil(killtime), 10);
- sprint(self, strcat("^1You'll be dead in ", ftos(self.killindicator.cnt), " seconds\n"));
+ //sprint(self, strcat("^1You'll be dead in ", ftos(self.killindicator.cnt), " seconds\n"));
for(e = world; (e = find(e, classname, "body")) != world; )
{
{
// do nothing
}
- else if(g_freezetag && self.freezetag_frozen == 1)
+ else if(self.freezetag_frozen)
{
// do nothing
}
ClientKill_TeamChange(0);
}
-void CTS_ClientKill (entity e) // silent version of ClientKill
+void CTS_ClientKill (entity e) // silent version of ClientKill, used when player finishes a CTS run. Useful to prevent cheating by running back to the start line and starting out with more speed
{
e.killindicator = spawn();
e.killindicator.owner = e;
e.killindicator.think = KillIndicator_Think;
e.killindicator.nextthink = time + (e.lip) * 0.05;
e.killindicator.cnt = ceil(autocvar_g_cts_finish_kill_delay);
+ e.killindicator.health = 1; // this is used to indicate that it should be silent
e.lip = 0;
}
else if(autocvar_sv_teamnagger && !(autocvar_bot_vs_human && (c3==-1 && c4==-1)) && !g_ca) // teamnagger is currently bad for ca
send_CSQC_teamnagger();
- send_CSQC_cr_maxbullets(self);
-
CheatInitClient();
PlayerStats_AddPlayer(self);
self.modelflags &~= MF_ROCKET;
}
- self.effects &~= (EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT | EF_FLAME | EF_NODEPTHTEST);
+ self.effects &~= (EF_DIMLIGHT | EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT | EF_FLAME | EF_NODEPTHTEST);
if(!self.modelindex || self.deadflag) // don't apply the flags if the player is gibbed
return;
}
if(!zoomstate_set)
- SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX) || (self.BUTTON_ATCK2 && self.weapon == WEP_CAMPINGRIFLE && autocvar_g_balance_campingrifle_secondary == 0));
+ SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX) || (self.BUTTON_ATCK2 && self.weapon == WEP_SNIPERRIFLE && autocvar_g_balance_sniperrifle_secondary == 0));
float oldspectatee_status;
oldspectatee_status = self.spectatee_status;