CounterStrike clone
Created By: | Koolio |
eMail: | koolio@mdqnet.net |
Difficulty Scale: | Hard |
/* ============ SelectSpawnPoint Returns the entity to spawn at ============ */ entity() SelectSpawnPoint = { local entity spot; local entity thing; local float pcount; // testinfo_player_start is only found in regioned levels spot = find (world, classname, "testplayerstart"); if (spot) return spot; // choose a info_player_deathmatch point //if (coop) Koolio, no coop play, we need coop starts for the counters //{ // lastspawn = find(lastspawn, classname, "info_player_coop"); // if (lastspawn == world) // lastspawn = find (lastspawn, classname, "info_player_start"); // if (lastspawn != world) // return lastspawn; //} //else if ((deathmatch) && (self.team == TERROR_TEAM)) // <-- changed that { spot = lastspawn; while (1) { spot = find(spot, classname, "info_player_deathmatch"); if (spot != world) { if (spot == lastspawn) return lastspawn; pcount = 0; thing = findradius(spot.origin, 32); while(thing) { if (thing.classname == "player") pcount = pcount + 1; thing = thing.chain; } if (pcount == 0) { lastspawn = spot; return spot; } } } } else if ((deathmatch) && (self.team == COUNTER_TEAM)) // <-- changed that { spot = lastspawn; while (1) { spot = find(spot, classname, "info_player_coop"); if (spot != world) { if (spot == lastspawn) return lastspawn; pcount = 0; thing = findradius(spot.origin, 32); while(thing) { if (thing.classname == "player") pcount = pcount + 1; thing = thing.chain; } if (pcount == 0) { lastspawn = spot; return spot; } } } } if (serverflags) { // return with a rune to start spot = find (world, classname, "info_player_start2"); if (spot) return spot; } spot = find (world, classname, "info_player_start"); if (!spot) error ("PutClientInServer: no info_player_start on level"); return spot; };As you can see we use coop starts for Counters and Deathmatch starts for Terrors. I also disabled coop start because Terrors and Counters would start next to eachothers in coop mode. This is almost the same like in normal counter-strike. I did a check to see if we're in Deathmatch and what team we have (I explained these in the last tut) and if so it points to the proper start.