mine()
{
self endon("disconnected");
self endon("minaDown");
self endon("spawned");
name = self.name;
trace = bulletTrace(self.origin + (0, 0, 40), self.origin + (0, 0, -3000), false, undefined);
self.mine["mine"] = spawn("script_model", self.origin + (0, 0, 1));
self.mine["mine"] setModel("xmodel/bx_zombie_mine");
self.mine["cankill"] = true;
self.mine["trig"] = false;
dist = distance(self.mine["mine"].origin, trace["position"]);
time = (dist / level.zom["mine_speed"]);
if (dist <= 128) {
self.mine["mine"].origin = trace["position"];
}
angle = self.mine["mine"] maps\mp\_utility::getPlant();
self.mine["mine"].angles = angle.angles;
self.mine["mine"] playSound("stickybomb_plant");
wait 0.1;
while (self.mine["cankill"]) {
if (!isalive(self)) {
self.mina--;
if (isdefined(self.mine["mine"])) self.mine["mine"] delete();
self notify("minaDown");
}
players = getentarray("player", "classname");
for (i = 0; i < players.size; i++) {
if (isDefined(players[i].pers["team"]) && players[i].pers["team"] == "axis" && players[i].sessionstate == "playing" && !players[i].spawnprotected && !players[i].trigmine && players[i] != self) {
if (isDefined(self.mine["mine"]) && distance(players[i].origin, self.mine["mine"].origin) < 32 && !players[i].spawnprotected && !self.mine["trig"]) {
players[i] playsound("minefield_click");
players[i].trigmine = true;
self.mine["trig"] = true;
self.mine["mine"] movez(52, 0.2);
wait 0.2;
players[i].trigmine = false;
self.mine["cankill"] = false;
self.mine["mine"] playsound("explo_mine");
playfx(level._effect["nuki"], self.mine["mine"].origin);
self thread killArround();
self.mine["mine"] delete();
self.mina--;
wait 0.05;
}
}
}
wait 0.01;
}
}
killArround()
{
self endon("spawned");
self endon("disconnected");
self endon("player_killed");
self endon("disconnect");
self endon("death");
self endon("joined_spectators");
players = getentarray("player", "classname");
for (i = 0; i < players.size; i++) {
if (isDefined(players[i].pers["team"]) && players[i].pers["team"] == "axis" && players[i].sessionstate == "playing" && !players[i].spawnprotected) {
if (distancesquared(players[i].origin, self.mine["mine"].origin) < 25000 && !players[i].spawnprotected) {
finishPlayerDamage = bulletTrace(players[i] getEye(), self.mine["mine"].origin + (0, 0, 10), false, undefined);
if (finishPlayerDamage["fraction"] == 1)
players[i] playSound("zom_mine_kill");
damage1 = players[i].health + 10;
dir = vectortoangles(self.mine["mine"].origin - players[i].origin);
dir = ((dir[0] / 360), (dir[1] / 360), (dir[2] / 360));
players[i][
[level.callbackPlayerDamage]
](self, self, damage1, 1, "MOD_PROJECTILE_SPLASH", "mine_mp", self.mine["mine"].origin, dir, "none", 3);
}
}
}
}
Here is Mine script.