Release Airdrop Trap
#1
Hello guys,

I have made a new mod for MW2, it's the airdrop trap from MW3 Nyan Cat

Here is a video of it:


The code:
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(game["strings"][fakeType + "_hint"], "all", maps\mp\killstreaks\_killstreaks::getKillstreakCrateIcon(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(game["strings"][fakeType + "_hint"], "all", maps\mp\killstreaks\_killstreaks::getKillstreakCrateIcon(fakeType)); self maps\mp\killstreaks\_airdrop::setUsableByTeam(getOtherTeam(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); } }

If you use 4d1, you can just put the code in a custom gsc script. Otherwise you can easily insert it in _airdrop.gsc. And if you want to change the weight of the trap you can just change the number I marked in the code.

Thanks to @Rendflex for testing and helping
[Image: azuw.jpg]
Reply

#2
can we make a code together ? i mean me and you , (thats my dream , to make a code with you , yamato , OrangePL , Rendflex) :B
Reply

#3
edited php tag, please dont use this tag for such kind of code because it mixes /\ up

nice release, +rep
Reply

#4
can itsMods make a cod 4 section ?
Reply

#5
(06-13-2012, 19:15)Bloodfocus Wrote: can itsMods make a cod 4 section ?

perhaps yes but i have no idea if its worth it
Reply

#6
What should we post in there? I guess it will be dead section :S
[Image: r212360a129ce9b84444093b6cd2699013a1fbn155.png]
Reply

#7
@d0h! trust me , it will be cool
Reply

#8
back to mw2 ?
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#9
what this do:

if(c==random)
{
fakeType = crateType;
break;
}
c++;
}
if(!isDefined(game["strings"][fakeType + "_hint"]))
fakeType = "ammo";

?
Reply

#10
Code:
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";
This takes a random airdrop type (chopper, ac130, etc.) and at the end it checks if a localized string for that type exists, if not it takes ammo (but that should never happen).
[Image: azuw.jpg]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Request] Airdrop Heaven mod The_Reaper_1 0 3,417 09-10-2013, 14:13
Last Post: The_Reaper_1
  Help WTF? FX trap [HARD] Tony. 11 8,709 02-22-2013, 19:32
Last Post: DidUknowiPwn
Video Preview Trap with FX [Z00MBY] Alex 19 14,223 01-27-2013, 15:49
Last Post: abidullah
  [Release] New trap and juggernaut carepackege Puffiamo 11 10,182 10-26-2012, 23:43
Last Post: islamsaab
Thumbs Up Preview Trap for Zombies in game [Z00MBY] Alex 1 3,493 09-21-2012, 19:13
Last Post: House
  Preview Plugin "A trap for the Zombie" [Z00MBY] Alex 10 9,111 09-15-2012, 18:51
Last Post: Yamato

Forum Jump:


Users browsing this thread:
1 Guest(s)

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