So here's what I did, used some arena code pasted over parts of ReadyCount:
- Code: Select all
void ReadyCount()
{
local entity e;
local float r, p;
FOR_EACH_REALPLAYER(e)
{
p += 1;
if(e.ready)
r += 1;
}
if(p && r == p)
{
self = nextent(world);
while(self)
{
if(self.classname == "droppedweapon" // cleanup
|| self.classname == "gib"
|| self.classname == "body")
{
remove(self);
}
else if(self.flags & FL_ITEM) // reset items
{
self.model = self.mdl;
self.solid = SOLID_TRIGGER;
setorigin (self, self.origin);
self.think = SUB_Null;
self.nextthink = 0;
self.effects = self.effects - (self.effects & EF_STARDUST);
}
else if(self.flags & FL_PROJECTILE) // remove any projectiles left
{
sound(self, CHAN_BODY, "misc/null.wav", 1, ATTN_NORM);
remove(self);
}
else if(self.isdecor)
{
removedecor(self);
}
else if(self.flags & FL_CLIENT) // reset all players
{
if(self.spawned)
PutClientInServer();
else
PutObserverInServer();
}
self = nextent(self);
}
}
Would it work?
Basically, what would happen is that when players type "Ready", map would reset like in arena mode instead of restarting the map, and hopefully players would stay in the team slot they were (no need to reselect a team). I am not sure about the teams part, as arena doesn't use teams. If not, maybe force suicide to all players so they respawn all fresh?
If this does work, then all that needs to be added is a countdown before the actual map reset (it would wait for countdown to be finished before reseting), and something that sets current game time back to 0 (or add 15 minutes to timelimit if not possible, tho that would be a bit messy I guess) and fragcount for all players back to 0.