Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Minefields
#1
Good morning

Ill try to revive this section a bit, Nyan Cat 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:

Reply

#2
Minas
[Image: MaEIQ.png]
Reply

#3
(07-19-2011, 11:51)Pozzuh Wrote: Minas

Yes, Nyan Cat
Reply

#4
how to add different places of mines on different maps?
[Image: r212360a129ce9b84444093b6cd2699013a1fbn155.png]
Reply

#5
(08-21-2011, 16:08)G-Man Wrote: how to add different places of mines on different maps?

Code:
if(getDvar("mapname") == "mp_invasion")
{
    minefields = [];
    minefields[0] = CrearMina((151,211,-244));
    minefields[1] = CrearMina((-26,721,-247));
}
Reply

#6
Saw some functions of this in cod4 raw folder if i'm right.
Reply

#7
(08-21-2011, 20:34)Justin Wrote: Saw some functions of this in cod4 raw folder if i'm right.

Its in mw2 too, Smile
Reply



Forum Jump:


Users browsing this thread:
3 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.