07-19-2011, 11:46
Good morning
Ill try to revive this section a bit, this script will allow you to make minefields, just add them as how I do, you can also spawn them in the maps you want with using: getDvar("mapname") = "mp_map", like in zombie mapedits. To use this thread it from Init():
Save this as _minefields.gsc and paste it in Modfolder\maps\mp
Video:
Ill try to revive this section a bit, this script will allow you to make minefields, just add them as how I do, you can also spawn them in the maps you want with using: getDvar("mapname") = "mp_map", like in zombie mapedits. To use this thread it from Init():
Code:
level thread maps\mp\_minefields::minefields();
Save this as _minefields.gsc and paste it in Modfolder\maps\mp
Code:
minefields()
{
minefields = []; //Add more here
minefields[0] = CrearMina((151,211,-244));
minefields[1] = CrearMina((-26,721,-247));
level._effect["mine_explosion"] = loadfx ("explosions/artilleryExp_dirt_brown");
}
CrearMina(posicion)
{
Mina = spawn("script_model",posicion);
Mina setmodel("c130_zoomrig");
trigger = spawn( "trigger_radius", posicion, 0, 50, 50 );
trigger thread Minas(posicion);
}
Minas(posicion)
{
self endon("disconnect");
while(1)
{
self waittill( "trigger", player );
if(Distance(posicion, Player.origin) <= 150)
{
self.minefield = true;
self playsound ("claymore_activated");
wait(.5);
wait(randomFloat(.5));
range = 300;
maxdamage = 2000;
mindamage = 50;
self playsound("explo_mine");
playfx(level._effect["mine_explosion"], posicion);
radiusDamage(posicion, range, maxdamage, mindamage);
wait 1;
}
wait .25;
}
}
minefield_think()
{
while (1)
{
self waittill ("trigger",other);
if(isPlayer(other))
other thread minefield_kill(self);
}
}
minefield_kill(trigger)
{
if(isDefined(self.minefield))
return;
self.minefield = true;
self playsound ("minefield_click");
wait(.5);
wait(randomFloat(.5));
if(isdefined(self) && self istouching(trigger))
{
origin = self getorigin();
range = 300;
maxdamage = 2000;
mindamage = 50;
self playsound("explo_mine");
playfx(level._effect["mine_explosion"], origin);
radiusDamage(origin, range, maxdamage, mindamage);
}
self.minefield = undefined;
}
Video: