Thread: _minefield.gsc

Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    Yamato's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    839
    Reputation
    13
    Thanks
    152
    My Mood
    Amazed
    This is something I did sometime ago, I recomend you to add the if(getdvarmapnameblablabla) to make different mine spots for each map and change the model(claymore for example). This of here is in Rust, close to TF141 Spawn place. To use it, in _rank.gsc, in Init(), put :

    Code:
    	level thread maps\mp\_minefields::minefields();
    Code:
    minefields() //Mine Fields by Yamato
    {
    	minefields = []; 
    	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;
    }

  2. The Following User Says Thank You to Yamato For This Useful Post:

    TechnoX (06-11-2011)

  3. #17
    TechnoX's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    Logitech G510.
    Posts
    154
    Reputation
    11
    Thanks
    3
    My Mood
    Yeehaw
    Awesome, thanks allot.
    I have big mess.

  4. #18
    YuDi21's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    mp_complex
    Posts
    141
    Reputation
    12
    Thanks
    35
    My Mood
    Angelic
    tip:maps\mp\gametypes\_weapons.gsc
    try to find smth using "claymore" tag

  5. #19
    TechnoX's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    Logitech G510.
    Posts
    154
    Reputation
    11
    Thanks
    3
    My Mood
    Yeehaw
    Its to draw the model of the claymore on the player body if you have it in your class, right?

  6. #20
    Yamato's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    839
    Reputation
    13
    Thanks
    152
    My Mood
    Amazed
    No, there is also a tag in the claymore to play the lasers FX, I took this from SP, it should work in MP too, I havent tried


    Code:
    	PlayFXOnTag( getfx( "claymore_laser" ), self, "tag_fx" );

  7. #21
    YuDi21's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    mp_complex
    Posts
    141
    Reputation
    12
    Thanks
    35
    My Mood
    Angelic
    try cod4 claymore FXs
    level.C4FXid = loadfx( "misc/light_c4_blink" );
    level.claymoreFXid = loadfx( "misc/claymore_laser" );

  8. #22
    YuDi21's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    mp_complex
    Posts
    141
    Reputation
    12
    Thanks
    35
    My Mood
    Angelic
    LOOOLm try function
    OBJECT detonate();

  9. #23
    TechnoX's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    Logitech G510.
    Posts
    154
    Reputation
    11
    Thanks
    3
    My Mood
    Yeehaw
    Ok i will take a look.

Page 2 of 2 FirstFirst 12