Перейти к содержимому
View in the app

A better way to browse. Learn more.

Zloplay community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Опубликовано:

Hello guys,

 

I have made a new mod for MW2, it's the airdrop trap from MW3. The mod adds the airdrop trap to the possible contents of a care package.

 

Here is a video of it:

 

The 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);
   }
} 

 

Just paste the code in a custom gsc and load it. Alternatively you can add it to _airdrop.gsc.

 

Thanks to Rendflex for testing and helping.

Featured Replies

Опубликовано:

Not sure if you did or not, as I'm not looking directly at the original source code, but if any of this coding material is taken from NoFate's explosive decoy script, then I would ask that you give credit. Otherwise, if this is completely your own work though, very nicely done :)

Опубликовано:
  • Автор
Not sure if you did or not, as I'm not looking directly at the original source code, but if any of this coding material is taken from NoFate's explosive decoy script, then I would ask that you give credit. Otherwise, if this is completely your own work though, very nicely done :)

No, it's completely my own work. I only took some code from _airdrop.gsc and checked how they did it in mw3.

Опубликовано:
would it be possible to make the airdrop look like this for the team who called it in?

black like in mw3 yk?

A57DC91527A9CD69933764EF0BFDC811B0AAD64C

Well team's crates use different textures (green if it's on your team, red if on the others) so I'd say it's possible by changing the textures, and I'd assume it'd be in one of the iw_xx.iwd files. Not sure who'd go through the trouble though, unless it really means that much. :P

Опубликовано:

Well team's crates use different textures (green if it's on your team, red if on the others) so I'd say it's possible by changing the textures, and I'd assume it'd be in one of the iw_xx.iwd files. Not sure who'd go through the trouble though, unless it really means that much. :P

i'm asking because idk if this crate is actually loadable, the screenshot is from yamato and is probably archived by memoryhacking.

Опубликовано:

Well team's crates use different textures (green if it's on your team, red if on the others) so I'd say it's possible by changing the textures, and I'd assume it'd be in one of the iw_xx.iwd files. Not sure who'd go through the trouble though, unless it really means that much. :P

i'm asking because idk if this crate is actually loadable, the screenshot is from yamato and is probably archived by memoryhacking.

I don't think one would memory hack to do that, really. I may be very wrong, but I'm just assuming that the textures for it are like camos, and easily replaceable with other textures (such as that black one).

Like I said though, I may be wrong, I'm not 100% sure about this.

Опубликовано:
would it be possible to make the airdrop look like this for the team who called it in?

black like in mw3 yk?

10190_screenshots_2011-04-13_00001.jpg

 

Tried it with Zxz. It didn't work out as expected. First of all, the model only exists on some maps, such as terminal. The second problem is that the collision is weird, so the care package may land slightly beneath the ground.

Опубликовано:
Tried it with Zxz. It didn't work out as expected. First of all, the model only exists on some maps, such as terminal. The second problem is that the collision is weird, so the care package may land slightly beneath the ground.

Physics collisions are based on the xmodel?

Опубликовано:
Tried it with Zxz. It didn't work out as expected. First of all, the model only exists on some maps, such as terminal. The second problem is that the collision is weird, so the care package may land slightly beneath the ground.

Physics collisions are based on the xmodel?

Or the xmodel is a slightly different size so when using the same collision it appears to go through the ground?

Опубликовано:
Tried it with Zxz. It didn't work out as expected. First of all, the model only exists on some maps, such as terminal. The second problem is that the collision is weird, so the care package may land slightly beneath the ground.

Physics collisions are based on the xmodel?

Or the xmodel is a slightly different size so when using the same collision it appears to go through the ground?

 

it's most likely this.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу

Важная информация

Используя этот сайт, вы соглашаетесь Условия использования.

Account

Navigation

Поиск

Поиск

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.