self.model = "";
self.modelindex = 0;
self.weapon = 0;
+ self.weaponname = "";
self.switchingweapon = 0;
self.weaponmodel = "";
self.weaponentity = world;
if(clienttype(self) == CLIENTTYPE_BOT && autocvar_g_botclip_collisions)
self.dphitcontentsmask |= DPCONTENTS_BOTCLIP;
self.frags = FRAGS_PLAYER;
- if(independent_players)
+ if(INDEPENDENT_PLAYERS)
MAKE_INDEPENDENT_PLAYER(self);
self.flags = FL_CLIENT;
self.takedamage = DAMAGE_AIM;
self.killcount = 0;
}
- self.cnt = WEP_LASER;
-
CL_SpawnWeaponentity();
self.alpha = default_player_alpha;
self.colormod = '1 1 1' * autocvar_g_player_brightness;
entity e;
e = get_weaponinfo(j);
if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
- self.weapon_load[j] = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
+ self.(weapon_load[j]) = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
}
oldself = self;
MUTATOR_CALLHOOK(PlayerSpawn);
self.switchweapon = w_getbestweapon(self);
- self.cnt = self.switchweapon;
+ self.cnt = -1; // W_LastWeapon will not complain
self.weapon = 0;
+ self.weaponname = "";
self.switchingweapon = 0;
if(!self.alivetime)
}
}
+float clientkilltime;
void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2 = spec
{
float killtime;
+ float starttime;
entity e;
if (gameover)
}
else
{
+ starttime = max(time, clientkilltime);
+
self.killindicator = spawn();
self.killindicator.owner = self;
self.killindicator.scale = 0.5;
setattachment(self.killindicator, self, "");
setorigin(self.killindicator, '0 0 52');
self.killindicator.think = KillIndicator_Think;
- self.killindicator.nextthink = time + (self.lip) * 0.05;
+ self.killindicator.nextthink = starttime + (self.lip) * 0.05;
+ clientkilltime = max(clientkilltime, self.killindicator.nextthink + 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"));
setattachment(e.killindicator, e, "");
setorigin(e.killindicator, '0 0 52');
e.killindicator.think = KillIndicator_Think;
- e.killindicator.nextthink = time + (e.lip) * 0.05;
+ e.killindicator.nextthink = starttime + (e.lip) * 0.05;
+ clientkilltime = max(clientkilltime, e.killindicator.nextthink + 0.05);
e.killindicator.cnt = ceil(killtime);
}
self.lip = 0;
}
}
+.float prevent_join_msgtime;
void LeaveSpectatorMode()
{
if(nJoinAllowed(1)) {
if (time < self.jointime + autocvar_welcome_message_time)
Send_CSQC_Centerprint_Generic_Expire(self, CPID_MOTD); // clear MOTD
+ if (self.prevent_join_msgtime)
+ {
+ Send_CSQC_Centerprint_Generic_Expire(self, CPID_PREVENT_JOIN);
+ self.prevent_join_msgtime = 0;
+ }
+
return;
} else {
if (g_ca && self.caplayer) {
}
else {
//player may not join because of g_maxplayers is set
- centerprint(self, PREVENT_JOIN_TEXT);
+ if (time - self.prevent_join_msgtime > 2)
+ {
+ Send_CSQC_Centerprint_Generic(self, CPID_PREVENT_JOIN, PREVENT_JOIN_TEXT, 0, 0);
+ self.prevent_join_msgtime = time;
+ }
}
}
}
}
}
-
+
PrintWelcomeMessage();
}
self.usekeypressed = self.BUTTON_USE;
PrintWelcomeMessage();
-
+
if(self.classname == "player") {
// if(self.netname == "Wazat")
// bprint(self.classname, "\n");