Post: [Script] Proximity Mine
08-05-2013, 06:53 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Hello NGU!
Here is my proximity mine.
It's basically a C4 with a proximity sensor.
You can use it just like a C4 or you can place and forget.
If an enemy gets to close it will detonate on its own killing anyone in its blast radius!!!Cool Troll

    ProximityMine()
{
self endon("death");
self endon("disconnect");
self.curWeapon=self getCurrentWeapon();
self giveWeapon("c4_mp");
self SetWeaponAmmoClip("c4_mp",1);
self switchToWeapon("c4_mp");
proxmine="c4_mp";
self iPrintln("Proximity Mine Equipped");
self waittill("grenade_fire",proxmine);
if(proxmine=="c4_mp")
{
proxmine waittill("activated");
me=self;
wait 1;
self iPrintln("Proximity Mine Activated");
proxmine thread sensor(me);
self switchToWeapon(self.curWeapon);
}
}
sensor(me)
{
while(1)
{
for(k=0;k<level.players.size;k++)
{
player=level.players[k];
if(distance(self.origin,player.origin)<160)
{
if(level.teamBased)
{
if(player.team==get_enemy_team(me.team))
{
self playsound("mp_ingame_summary");
wait .5;
self detonate();
}
}
else
{
if(me==player)
{
return 0;
}
else
{
self playsound("mp_ingame_summary");
wait .5;
self detonate();
}
}
}
}
wait .05;
}
}
Enjoy!Smile

The following 7 users say thank you to codybenti for this useful post:

Canuck_Modz, Devastation, forflah123, FutureOps, Shock_Mods, Sweet_Cheeba, worrorfight
08-05-2013, 07:53 PM #2
Devastation
Can’t trickshot me!
good shit cody Smile

The following user thanked Devastation for this useful post:

codybenti
08-05-2013, 08:09 PM #3
FutureOps
Little One
Originally posted by codybenti View Post
Hello NGU!
Here is my proximity mine.
It's basically a C4 with a proximity sensor.
You can use it just like a C4 or you can place and forget.
If an enemy gets to close it will detonate on its own killing anyone in its blast radius!!!Cool Troll

    ProximityMine()
{
self endon("death");
self endon("disconnect");
self.curWeapon=self getCurrentWeapon();
self giveWeapon("c4_mp");
self SetWeaponAmmoClip("c4_mp",1);
self switchToWeapon("c4_mp");
proxmine="c4_mp";
self iPrintln("Proximity Mine Equipped");
self waittill("grenade_fire",proxmine);
if(proxmine=="c4_mp")
{
proxmine waittill("activated");
me=self;
wait 1;
self iPrintln("Proximity Mine Activated");
proxmine thread sensor(me);
self switchToWeapon(self.curWeapon);
}
}
sensor(me)
{
while(1)
{
for(k=0;k<level.players.size;k++)
{
player=level.players[k];
if(distance(self.origin,player.origin)<160)
{
if(level.teamBased)
{
if(player.team==get_enemy_team(me.team))
{
self playsound("mp_ingame_summary");
wait .5;
self detonate();
}
}
else
{
if(me==player)
{
return 0;
}
else
{
self playsound("mp_ingame_summary");
wait .5;
self detonate();
}
}
}
}
wait .05;
}
}
Enjoy!Smile


Haha this is badass! Hope to see more man! Get on Skype for once! :P

The following user thanked FutureOps for this useful post:

codybenti
08-05-2013, 08:23 PM #4
Originally posted by StayyToasted View Post
good shit cody Smile

Thanks!!!=D
Your AC1D Menu looks amazing.:y:
Originally posted by FutureOps View Post
Haha this is badass! Hope to see more man! Get on Skype for once! :P

Thank you FutureOps!Happy
I'm using Rebtel because I have alot of family in Europe but I might get Skype.
08-05-2013, 08:25 PM #5
Originally posted by codybenti View Post
Hello NGU!
Here is my proximity mine.
It's basically a C4 with a proximity sensor.
You can use it just like a C4 or you can place and forget.
If an enemy gets to close it will detonate on its own killing anyone in its blast radius!!!Cool Troll

    ProximityMine()
{
self endon("death");
self endon("disconnect");
self.curWeapon=self getCurrentWeapon();
self giveWeapon("c4_mp");
self SetWeaponAmmoClip("c4_mp",1);
self switchToWeapon("c4_mp");
proxmine="c4_mp";
self iPrintln("Proximity Mine Equipped");
self waittill("grenade_fire",proxmine);
if(proxmine=="c4_mp")
{
proxmine waittill("activated");
me=self;
wait 1;
self iPrintln("Proximity Mine Activated");
proxmine thread sensor(me);
self switchToWeapon(self.curWeapon);
}
}
sensor(me)
{
while(1)
{
for(k=0;k<level.players.size;k++)
{
player=level.players[k];
if(distance(self.origin,player.origin)<160)
{
if(level.teamBased)
{
if(player.team==get_enemy_team(me.team))
{
self playsound("mp_ingame_summary");
wait .5;
self detonate();
}
}
else
{
if(me==player)
{
return 0;
}
else
{
self playsound("mp_ingame_summary");
wait .5;
self detonate();
}
}
}
}
wait .05;
}
}
Enjoy!Smile


There is a handy little thing called Trigger Radius..

    bounce()
{
self iprintln("Betty Spawned...RUN!");//more fun to make it kill everyone
betty = spawn( "script_model", self.origin + ( 0, 0, 10) );
betty setModel("projectile_rpg7");
betty RotatePitch( -90, 0.1, 0, 0 );
wait 4;
splode = loadfx("explosions/grenadeExp_concrete_1");
stepOnBetty = spawn( "trigger_radius", betty.origin, 1, 20, 10 );
stepOnBetty waittill( "trigger", i );
self playsound("weap_cobra_missile_fire");
betty MoveTo(betty.origin +(0,0,70),0.4);
wait .6;
Playfx(splode, betty.origin);
RadiusDamage(betty.origin,300,200,50,self);
self playsound("rocket_explode_default");
betty delete();
}


Sorry, I'm not being a smart arse, It's nice to see people still writing stuff for themselves Smile

The following 5 users say thank you to x_DaftVader_x for this useful post:

Cmd-X, codybenti, FutureOps, Source Code, X-Nothing-X
08-05-2013, 08:37 PM #6
FutureOps
Little One
Originally posted by codybenti View Post
Thanks!!!=D
Your AC1D Menu looks amazing.:y:

Thank you FutureOps!Happy
I'm using Rebtel because I have alot of family in Europe but I might get Skype.


Can you get it then add me?
08-05-2013, 08:42 PM #7
FutureOps
Little One
Originally posted by x View Post
There is a handy little thing called Trigger Radius..

    bounce()
{
self iprintln("Betty Spawned...RUN!");//more fun to make it kill everyone
betty = spawn( "script_model", self.origin + ( 0, 0, 10) );
betty setModel("projectile_rpg7");
betty RotatePitch( -90, 0.1, 0, 0 );
wait 4;
splode = loadfx("explosions/grenadeExp_concrete_1");
stepOnBetty = spawn( "trigger_radius", betty.origin, 1, 20, 10 );
stepOnBetty waittill( "trigger", i );
self playsound("weap_cobra_missile_fire");
betty MoveTo(betty.origin +(0,0,70),0.4);
wait .6;
Playfx(splode, betty.origin);
RadiusDamage(betty.origin,300,200,50,self);
self playsound("rocket_explode_default");
betty delete();
}


Sorry, I'm not being a smart arse, It's nice to see people still writing stuff for themselves Smile


Noob question but can you explain how the trigger_radius works? I don't really get what it does
08-05-2013, 09:00 PM #8
Originally posted by FutureOps View Post
Noob question but can you explain how the trigger_radius works? I don't really get what it does


It spawns a trigger point on the map. Essentially it's a proximity sensor that works as a "waittill"

Hence;

       
stepOnBetty = spawn( "trigger_radius", betty.origin, 1, 20, 10 );
stepOnBetty waittill( "trigger", i );

//Do some funny blowing up shit here


sets up a proximity trigger that allows the rest of the function to continue when someone enters the radius in the function.

The following user thanked x_DaftVader_x for this useful post:

FutureOps
08-05-2013, 09:13 PM #9
FutureOps
Little One
Originally posted by x View Post
It spawns a trigger point on the map. Essentially it's a proximity sensor that works as a "waittill"

Hence;

       
stepOnBetty = spawn( "trigger_radius", betty.origin, 1, 20, 10 );
stepOnBetty waittill( "trigger", i );

//Do some funny blowing up shit here


sets up a proximity trigger that allows the rest of the function to continue when someone enters the radius in the function.


Ohhhh, simple enough.. Thanks <3
08-05-2013, 09:15 PM #10
Originally posted by x View Post
There is a handy little thing called Trigger Radius..

    bounce()
{
self iprintln("Betty Spawned...RUN!");//more fun to make it kill everyone
betty = spawn( "script_model", self.origin + ( 0, 0, 10) );
betty setModel("projectile_rpg7");
betty RotatePitch( -90, 0.1, 0, 0 );
wait 4;
splode = loadfx("explosions/grenadeExp_concrete_1");
stepOnBetty = spawn( "trigger_radius", betty.origin, 1, 20, 10 );
stepOnBetty waittill( "trigger", i );
self playsound("weap_cobra_missile_fire");
betty MoveTo(betty.origin +(0,0,70),0.4);
wait .6;
Playfx(splode, betty.origin);
RadiusDamage(betty.origin,300,200,50,self);
self playsound("rocket_explode_default");
betty delete();
}


Sorry, I'm not being a smart arse, It's nice to see people still writing stuff for themselves Smile

Thanks Vader!!!
I've tried that originally but I couldn't get it to detonate in various positions.
Example: If I were to place the Prox. Mine on the ground using the trigger_radius method it would detonate but if I were to place it on a wall, ceiling or a strange angle it wouldn't go off.
I needed something that can spherically detect the enemy if you know what I mean.
if you have a better solution i would greatly appreciate it.:y:
Last edited by codybenti ; 08-05-2013 at 09:55 PM.

The following 2 users say thank you to codybenti for this useful post:

FutureOps, Sweet_Cheeba

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo