Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include maps\mp\_utility;
- #include common_scripts\utility;
- #include maps\mp\gametypes\_hud_util;
- #include maps\mp\gametypes\_hud_message;
- #include maps\mp\bots\_bot;
- #include maps/mp/gametypes/_globallogic;
- init()
- {
- level.debug = false;
- level thread setupLocations();
- level thread onPlayerConnect();
- }
- onPlayerConnect()
- {
- for(;;)
- {
- level waittill("connected", player);
- player.currentLocation = 0;
- player thread onPlayerSpawned();
- }
- }
- onPlayerSpawned()
- {
- self endon("disconnect");
- level endon("game_ended");
- for(;;)
- {
- self waittill("spawned_player");
- self teleportToCheckpoint();
- self thread buttons();
- self thread killMonitor();
- }
- }
- killMonitor()
- {
- self endon("disconnect");
- self endon("endMonitor");
- self endon("death");
- self.currentKills = self.pers["kills"];
- for(;;)
- {
- if(self.pers["kills"] != self.currentKills)
- {
- self.currentLocation += 1;
- if(self.currentLocation > level.locationData.maxSize)
- endgame("allies", "^2" + self.name + " ^7has completed the course!");
- self teleportToCheckpoint();
- self.currentKills = self.pers["kills"];
- }
- if(self is_bot() && self.pers["deaths"] >= 1)
- kick(self getentitynumber());
- wait 0.01;
- }
- }
- buttons()
- {
- self endon("disconnect");
- self endon("endButtons");
- self endon("death");
- self freezeControls(false);
- for(;;)
- {
- if(!level.debug)//Debug disabled
- {
- if(self actionSlotOneButtonPressed())//Teleport to checkpoint
- self teleportToCheckpoint();
- if(self actionSlotFourButtonPressed())//Spawn bot and teleport to crosshair
- {
- bot = addtestclient();
- bot.pers["team"] = "axis";
- bot.pers["isBot"] = 1;
- bot.pers["deaths"] = 0;
- bot thread bot_spawn_think("axis");
- bot thread killMonitor();
- wait 0.25;
- bot setOrigin(bullettrace(self gettagorigin("j_head"), self gettagorigin("j_head") + anglesToForward(self getplayerangles()) * 1000000, 0, self)["position"]);
- bot freezeControls(true);
- }
- }
- else //Debug enabled
- {
- if(self actionSlotOneButtonPressed())//Print location
- self iprintln("^5" + self getOrigin());
- if(self actionSlotFourButtonPressed())//Location ++
- {
- if(self.currentLocation != level.locationData.maxSize)
- self.currentLocation ++;
- self teleportToCheckpoint();
- }
- if(self actionSlotThreeButtonPressed())//Location --
- {
- if(self.currentLocation != 0)
- self.currentLocation --;
- self teleportToCheckpoint();
- }
- if(self actionSlotTwoButtonPressed())//Teleport to location
- self teleportToCheckpoint();
- }
- wait 0.01;
- }
- }
- teleportToCheckpoint()
- {
- self setOrigin(level.location[self.currentLocation]["location"]);
- self iprintln("^2Teleported to ^5" + level.location[self.currentLocation]["name"]);
- }
- setupLocations()
- {
- level.location = [];
- level.locationData = spawnStruct();
- if(getDVAR("mapname") == "mp_carrier")
- {
- level.location[0]["location"] = (-3232.01, 510.826, 117.926);
- level.location[0]["name"] = "Ramp";
- level.location[1]["location"] = (-5509.17, -935.95, 128.125);
- level.location[1]["name"] = "Black plane";
- level.location[2]["location"] = (-6410.84, -791.72, 29.2947);
- level.location[2]["name"] = "Ledge";
- level.locationData.maxSize = 2;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement