2 .string chmap, gametype;
6 void spawnfunc_target_changelevel_use()
8 if(self.spawnflags & 2)
10 // simply don't react if a non-player triggers it
11 if(!IS_PLAYER(activator)) { return; }
13 activator.chlevel_targ = self;
18 // let's not count bots
19 FOR_EACH_REALPLAYER(head)
22 if(head.chlevel_targ == self)
25 if(plnum < ceil(realplnum * min(1, self.count))) // 70% of players
29 if(self.gametype != "")
30 MapInfo_SwitchGameType(MapInfo_Type_FromString(self.gametype));
33 localcmd("endmatch\n");
35 localcmd(strcat("changelevel ", self.chmap, "\n"));
38 void spawnfunc_target_changelevel()
40 self.use = spawnfunc_target_changelevel_use;
42 if(!self.count) { self.count = 0.7; }