Post: Airdrop Trap
07-13-2012, 10:18 AM #1
KingcreekS
NOTHING IS IMPOSSIBL
(adsbygoogle = window.adsbygoogle || []).push({});


Credits:
zxz0O0

Code:
    #include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;

init()
{
precacheShader("cardicon_thebomb");
//Custom scripts are processed before built-in so we need to wait
thread initType();
}

initType()
{
while(!isDefined(level.lowSpawn))
wait 0.2;

maps\mp\killstreaks\_airdrop::addCrateType("airdrop", "trap", 13/*Change this if you want to change the weight*/, ::TrapCrateThink);
maps\mp\killstreaks\_airdrop::addCrateType("airdrop_mega", "trap", 12/*Change this if you want to change the weight*/, ::TrapCrateThink);

//regenerate the max weighted value
//not needed if editing _airdrop.gsc
foreach (dropType, crateTypes in level.crateTypes)
{
level.crateMaxVal[dropType] = 0;
foreach ( crateType, crateWeight in level.crateTypes[dropType] )
{
if ( !crateWeight )
continue;

level.crateMaxVal[dropType] += crateWeight;
level.crateTypes[dropType][crateType] = level.crateMaxVal[dropType];
}
}
}

TrapCrateThink(dropType)
{
self endon("death");
self.usedBy = [];
if(!isDefined(dropType))
dropType = "airdrop";
random = randomInt(12);

c = 0;
fakeType = "ammo";
foreach(crateType,crateWeight in level.crateTypes[dropType])
{
if(c==random)
{
fakeType = crateType;
break;
}
c++;
}
if(!isDefined(game["strings"][fakeType + "_hint"]))
fakeType = "ammo";

if (!level.teamBased)
{
maps\mp\killstreaks\_airdrop::crateSetupForUse(gam e["strings"][fakeType + "_hint"], "all", maps\mp\killstreaks\_killstreaks::getKillstreakCra teIcon(fakeType));

if(isDefined(self.owner))
{
self maps\mp\_entityheadIcons::setHeadIcon(self.owner, "cardicon_thebomb", (0,0,24), 10, 10);
self disablePlayerUse( self.owner );
}
}
else
{
maps\mp\killstreaks\_airdrop::crateSetupForUse(gam e["strings"][fakeType + "_hint"], "all", maps\mp\killstreaks\_killstreaks::getKillstreakCra teIcon(fakeType));
self maps\mp\killstreaks\_airdrop::setUsableByTeam(getO therTeam(self.team));

self maps\mp\_entityheadIcons::setHeadIcon(self.team, "cardicon_thebomb", (0,0,24), 10, 10);
}
self thread crateEnemyCaptureThink();

self waittill("captured", player);
self playsound("javelin_clu_lock");
wait 1;

playfx(level.chopper_fx["explode"]["death"]["cobra"], self.origin, (0,0,1));
self playSound("cobra_helicopter_crash");

if(isDefined(self.owner) && isPlayer(self.owner))
self RadiusDamage(self.origin, 500, 200, 50, self.owner, "MOD_EXPLOSIVE", "bomb_site_mp");
else
self RadiusDamage(self.origin, 500, 200, 50, undefined, "MOD_EXPLOSIVE", "bomb_site_mp");

self maps\mp\killstreaks\_airdrop::deleteCrate();
}

crateEnemyCaptureThink()
{
while(isDefined(self))
{
self waittill("trigger", player);

if(isDefined(self.owner) && player==self.owner)
continue;

useEnt = self maps\mp\killstreaks\_airdrop::createUseEnt();
result = useEnt maps\mp\killstreaks\_airdrop::useHoldThink(player) ;

if(isDefined(useEnt))
useEnt delete();

if(!result)
continue;

self notify("captured", player);
}
}
(adsbygoogle = window.adsbygoogle || []).push({});

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

Correy, Ghost1990, iHmPanda, TheFallen, Uk_ViiPeR
07-13-2012, 12:34 PM #2
LightModz
League Champion
Originally posted by TheHellboy View Post


Credits:
zxz0O0

Code:
    #include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;

init()
{
precacheShader("cardicon_thebomb");
//Custom scripts are processed before built-in so we need to wait
thread initType();
}

initType()
{
while(!isDefined(level.lowSpawn))
wait 0.2;

maps\mp\killstreaks\_airdrop::addCrateType("airdrop", "trap", 13/*Change this if you want to change the weight*/, ::TrapCrateThink);
maps\mp\killstreaks\_airdrop::addCrateType("airdrop_mega", "trap", 12/*Change this if you want to change the weight*/, ::TrapCrateThink);

//regenerate the max weighted value
//not needed if editing _airdrop.gsc
foreach (dropType, crateTypes in level.crateTypes)
{
level.crateMaxVal[dropType] = 0;
foreach ( crateType, crateWeight in level.crateTypes[dropType] )
{
if ( !crateWeight )
continue;

level.crateMaxVal[dropType] += crateWeight;
level.crateTypes[dropType][crateType] = level.crateMaxVal[dropType];
}
}
}

TrapCrateThink(dropType)
{
self endon("death");
self.usedBy = [];
if(!isDefined(dropType))
dropType = "airdrop";
random = randomInt(12);

c = 0;
fakeType = "ammo";
foreach(crateType,crateWeight in level.crateTypes[dropType])
{
if(c==random)
{
fakeType = crateType;
break;
}
c++;
}
if(!isDefined(game["strings"][fakeType + "_hint"]))
fakeType = "ammo";

if (!level.teamBased)
{
maps\mp\killstreaks\_airdrop::crateSetupForUse(gam e["strings"][fakeType + "_hint"], "all", maps\mp\killstreaks\_killstreaks::getKillstreakCra teIcon(fakeType));

if(isDefined(self.owner))
{
self maps\mp\_entityheadIcons::setHeadIcon(self.owner, "cardicon_thebomb", (0,0,24), 10, 10);
self disablePlayerUse( self.owner );
}
}
else
{
maps\mp\killstreaks\_airdrop::crateSetupForUse(gam e["strings"][fakeType + "_hint"], "all", maps\mp\killstreaks\_killstreaks::getKillstreakCra teIcon(fakeType));
self maps\mp\killstreaks\_airdrop::setUsableByTeam(getO therTeam(self.team));

self maps\mp\_entityheadIcons::setHeadIcon(self.team, "cardicon_thebomb", (0,0,24), 10, 10);
}
self thread crateEnemyCaptureThink();

self waittill("captured", player);
self playsound("javelin_clu_lock");
wait 1;

playfx(level.chopper_fx["explode"]["death"]["cobra"], self.origin, (0,0,1));
self playSound("cobra_helicopter_crash");

if(isDefined(self.owner) && isPlayer(self.owner))
self RadiusDamage(self.origin, 500, 200, 50, self.owner, "MOD_EXPLOSIVE", "bomb_site_mp");
else
self RadiusDamage(self.origin, 500, 200, 50, undefined, "MOD_EXPLOSIVE", "bomb_site_mp");

self maps\mp\killstreaks\_airdrop::deleteCrate();
}

crateEnemyCaptureThink()
{
while(isDefined(self))
{
self waittill("trigger", player);

if(isDefined(self.owner) && player==self.owner)
continue;

useEnt = self maps\mp\killstreaks\_airdrop::createUseEnt();
result = useEnt maps\mp\killstreaks\_airdrop::useHoldThink(player) ;

if(isDefined(useEnt))
useEnt delete();

if(!result)
continue;

self notify("captured", player);
}
}


this has already been made, why post it on ngu when you can get it from almost every patch now :derp:
07-13-2012, 12:57 PM #3
Ghost1990
12-28-2012
Originally posted by LightModz View Post
this has already been made, why post it on ngu when you can get it from almost every patch now :derp:


Ah yes, I was using your blackrain edit awhile ago, and you must have used one of the first fake CPs? because the capture bar showed only on the person who called it in, not the person trying to capture it, plus after it gets captured, the icon (green/ red CP) continues to appear on the map even after the CP disappears, and the little bird loops in and out of the map (only drops 1 CP) Well atleast on highrise (only map it was tested on)

The following user thanked Ghost1990 for this useful post:

LightModz
07-13-2012, 01:01 PM #4
LightModz
League Champion
Originally posted by Ghost1990 View Post
Ah yes, I was using your blackrain edit awhile ago, and you must have used one of the first fake CPs? because the capture bar showed only on the person who called it in, not the person trying to capture it, plus after it gets captured, the icon (green/ red CP) continues to appear on the map even after the CP disappears, and the little bird loops in and out of the map (only drops 1 CP) Well atleast on highrise (only map it was tested on)

oh thanks didnt know that :p
07-13-2012, 02:27 PM #5
xGLoTTeRCriimEx
Bounty hunter
lol nice work
07-21-2012, 12:18 AM #6
HackersForHire
Climbing up the ladder
Ive never seen this before haha! Definately going in my patch
07-24-2012, 07:21 AM #7
IVisionsI
IM WHITE
Ok il put it in

---------- Post added at 11:21 PM ---------- Previous post was at 11:20 PM ----------

I cant get it to work :(
07-28-2012, 01:52 PM #8
Nice looks good
07-28-2012, 05:46 PM #9
Correy
I'm the Original
it functions perfect to MW3 style. Smile

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo