2 .string chmap, gametype;
5 void target_changelevel_use(entity this, entity actor, entity trigger)
7 if(this.spawnflags & 2)
9 // simply don't react if a non-player triggers it
10 if(!IS_PLAYER(actor)) { return; }
12 actor.chlevel_targ = this;
16 // let's not count bots
17 FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {
19 if(it.chlevel_targ == this)
22 if(plnum < ceil(realplnum * min(1, this.count))) // 70% of players
26 if(this.gametype != "")
27 MapInfo_SwitchGameType(MapInfo_Type_FromString(this.gametype));
30 localcmd("endmatch\n");
32 localcmd(strcat("changelevel ", this.chmap, "\n"));
35 spawnfunc(target_changelevel)
37 this.use = target_changelevel_use;
39 if(!this.count) { this.count = 0.7; }