// ============
// clan arena
// ============
-set g_ca 0 "Clan Arena: Played in rounds, once you're dead you're out! The team with survivors wins the round."
-set g_ca_point_limit 10 "point limit 10 is standard for clan arena"
-set g_ca_point_leadlimit 0
-set g_ca_spectate_enemies 0 "Allow spectating enemy player by dead player during clan arena games."
+set g_ca 0 "Clan Arena: Played in rounds, once you're dead you're out! The team with survivors wins the round"
+seta g_ca_point_limit -1 "Clan Arena point limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
+seta g_ca_point_leadlimit -1 "Clan Arena point lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
+set g_ca_spectate_enemies 0 "Allow spectating enemy player by dead player during clan arena games"
set g_ca_warmup 10 "how long the players will have time to run around the map before the round starts"
set g_ca_damage2score_multiplier 0.01
set g_ca_round_timelimit 180 "round time limit in seconds"
REGISTER_GAMETYPE(_("Capture the Flag"),ctf,g_ctf,CTF,"timelimit=20 caplimit=10 leadlimit=0");
#define g_ctf IS_GAMETYPE(CTF)
-REGISTER_GAMETYPE(_("Clan Arena"),ca,g_ca,CA,"timelimit=20 pointlimit=10 leadlimit=0");
+REGISTER_GAMETYPE(_("Clan Arena"),ca,g_ca,CA,"timelimit=20 pointlimit=10 teams=2 leadlimit=0");
#define g_ca IS_GAMETYPE(CA)
REGISTER_GAMETYPE(_("Domination"),dom,g_domination,DOMINATION,"timelimit=20 pointlimit=200 teams=2 leadlimit=0");
self.punchvector = '0 0 0';
self.oldvelocity = self.velocity;
self.fire_endtime = -1;
+ self.event_damage = func_null;
}
.float model_randomizer;
if(self.killindicator_teamchange)
ClientKill_Now_TeamChange();
- // in any case:
- Damage(self, self, self, 100000, DEATH_KILL, self.origin, '0 0 0');
+ if(IS_PLAYER(self))
+ Damage(self, self, self, 100000, DEATH_KILL, self.origin, '0 0 0');
// now I am sure the player IS dead
}
float currentlyPlaying = 0;
FOR_EACH_REALCLIENT(e)
- if(IS_PLAYER(e) || e.caplayer == 1)
+ if(IS_PLAYER(e) || e.caplayer)
currentlyPlaying += 1;
if(currentlyPlaying < autocvar_g_maxplayers)
* g_maxplayers_spectator_blocktime seconds
*/
void checkSpectatorBlock() {
- if(IS_SPEC(self) || IS_OBSERVER(self)) {
+ if(IS_SPEC(self) || IS_OBSERVER(self))
+ if(!self.caplayer)
+ if(IS_REAL_CLIENT(self))
+ {
if( time > (self.spectatortime + autocvar_g_maxplayers_spectator_blocktime) ) {
Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_QUIT_KICK_SPECTATING);
dropclient(self);
self.flags &= ~FL_ONGROUND;
// dying animation
self.deadflag = DEAD_DYING;
+
// when to allow respawn
calculate_player_respawn_time();
{
if(!IS_PLAYER(self) && !lockteams)
{
+ if(self.caplayer)
+ return;
if(nJoinAllowed(self))
{
if(autocvar_g_campaign) { campaign_bots_may_start = 1; }
}
}
- if(IS_PLAYER(self) && autocvar_sv_spectate == 1)
- ClientKill_TeamChange(-2); // observe
-
- // in CA, allow a dead player to move to spectators (without that, caplayer!=0 will be moved back to the player list)
- // note: if arena game mode is ever done properly, this needs to be removed.
- if(self.caplayer && (IS_SPEC(self) || IS_OBSERVER(self)))
+ if((IS_PLAYER(self) || self.caplayer) && autocvar_sv_spectate == 1)
{
- sprint(self, "WARNING: you will spectate in the next round.\n");
- self.caplayer = 0;
+ if(self.caplayer && (IS_SPEC(self) || IS_OBSERVER(self)))
+ sprint(self, "WARNING: you will spectate in the next round.\n");
+ ClientKill_TeamChange(-2); // observe
}
}
return; // never fall through to usage
FOR_EACH_REALPLAYER(client)
{
self = client;
+ if(self.caplayer)
+ self.caplayer = 0;
PutObserverInServer();
++i;
}
if(!IS_SPEC(client) && !IS_OBSERVER(client))
{
self = client;
+ if(self.caplayer)
+ self.caplayer = 0;
PutObserverInServer();
successful = strcat(successful, (successful ? ", " : ""), client.netname);
{
blockSpectators = 1;
entity plr;
- FOR_EACH_CLIENT(plr) //give every spectator <g_maxplayers_spectator_blocktime> seconds time to become a player
+ FOR_EACH_REALCLIENT(plr) //give every spectator <g_maxplayers_spectator_blocktime> seconds time to become a player
{
if(IS_SPEC(plr) || IS_OBSERVER(plr))
+ if(!plr.caplayer)
{
plr.spectatortime = time;
Send_Notification(NOTIF_ONE_ONLY, plr, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime);
MUTATOR_HOOKFUNCTION(ca_PutClientInServer)
{
if(!allowed_to_spawn)
+ if(IS_PLAYER(self)) // this is true even when player is trying to join
{
self.classname = "observer";
if(self.jointime != time) //not when connecting
FOR_EACH_CLIENT(self)
{
self.killcount = 0;
+ if(!self.caplayer && IS_BOT_CLIENT(self))
+ {
+ self.team = -1;
+ self.caplayer = 1;
+ }
if(self.caplayer)
{
self.classname = "player";