Post: [RELEASE] Cod4 Care Package Chopper
10-29-2011, 10:33 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); i will update this when ive got time to a nicer code Happy

this script was one of my 1st cod4 mods so its not very good.
but it still works 100% so here you go

To use it just throw a grenade and the chopper will drop the package where the grenade explodes.

add this to init :
    precacheModel( "com_plasticcase_beige_big" );


thread this :
    self thread CarePackage();


    CarePackage()
{
self.c["Box"] delete();
self.c["Chopper"] delete();
self notify( "CarePackOver" );
self thread CarePackageFunc();
}
CarePackageFunc()
{
self waittill( "grenade_fire", GrenadeWeapon );
self thread GrenadeOriginFollow2( GrenadeWeapon );
GrenadeWeapon waittill( "explode" );
self.LockMenu = false;
self.c["Chopper"] = spawnHelicopter(self, (3637, 10373, 750), self.angles, "cobra_mp", "vehicle_cobra_helicopter_fly");
self.c["Chopper"] playLoopSound( "mp_cobra_helicopter" );
self.c["Box"] = spawn( "script_model", (0,32,20) );

self.c["Box"] setmodel("com_plasticcase_beige_big");
self.c["Box"] LinkTo( self.c["Chopper"], "tag_ground" , (0,32,20) , (0,0,0) );
self.c["Chopper"].currentstate = "ok";
self.c["Chopper"].laststate = "ok";
self.c["Chopper"] setdamagestage( 3 );
self.c["Chopper"] setspeed(1000, 25, 10);
self.c["Chopper"] setvehgoalpos( self.Grenade + (-30, 40, 750), 1);
wait 13.5;
self.c["Box"] Unlink();
fall = bullettrace(self.c["Box"].origin, self.c["Box"].origin + (0, 0, -10000), false, self);
time = CareSpeed(500, self.c["Box"].origin, fall["position"]);
self.c["Box"] moveto(fall["position"], time);
wait time;

self.c["Box"] thread DeleteBoxOvertime(self);
self.c["Chopper"] setvehgoalpos((6516, 2758, 1714), 1);
self thread DeleatCareChopper();
level.Point = NewHudElem();
level.Point.x = self.c["Box"].origin[0];
level.Point.y = self.c["Box"].origin[1];
level.Point.z = self.c["Box"].origin[2]+15;
level.Point setShader("waypoint_bombsquad",14,14);
level.Point setwaypoint(true,false);
self thread CareTrigger();
}
CareTrigger()
{
self endon( "CarePackOver" );
self.CareGot = false;
self.killSreaks = [];
self.killSreaks[0] = "airstrike_mp";
self.killSreaks[1] = "helicopter_mp";
self.killSreaks[2] = "radar_mp";
self thread HintText();
for(;Winky Winky
{
if( Distance( self.origin, ( self.c["Box"].origin ) ) < 35 )
{
self.Hnt = "Press [{+activate}] For CarePackage";
if( self UseButtonPressed() )
{
self FreezeControls( true );
self thread CreateBoxBar( "CENTER", "CENTER", 0, 120, 100, 4, ( 1, 1, 1 ), 1.5 );
wait 1.5;
self.PickedKillSteak = RandomInt(self.killSreaks.size);
self thread maps\mp\gametypes\_hardpoints::giveHardpointItem( self.killSreaks[self.PickedKillSteak], 0 );
self iPrintlnBold( "^1" + self.killSreaks[self.PickedKillSteak], " " );
self.c["Box"] Delete();
self.Progress["Bar"] DestroyElem();
level.Point destroy();
self.CareGot = true;
self.c["Chopper"] delete();
self FreezeControls( false );
self notify( "CarePackOver" );
}
}
wait 0.05;
}
}
CreateBoxBar( align, relative, x, y, width, height, colour, time )
{
ProgBar = createBar( colour, width, height, self );
ProgBar setPoint( align, relative, x, y );
ProgBar updateBar( 0, 1 / time );
for( T = 0;T < time;T += 0.05 )
wait .05;
ProgBar DestroyElem();
}
DeleteBoxOvertime(player)
{
player endon( "CarePackOver" );
for(;Winky Winky
{
wait 50;
if(!self.CareGot){
self Delete();
player.Progress["Bar"] DestroyElem();
level.Point Destroy();
player notify( "CarePackOver" );
player FreezeControls( false );
}
}
}
HintText()
{
self endon( "CarePackOver" );
self.Txt = self createFontString( "objective", 1.4 );
self.Txt setPoint( "CENTER", "CENTER" );
self.hnt = "";
for(;Winky Winky
{
self.Txt setText("" + self.hnt);
self.hnt = "";
wait 0.1;
}
}
CareSpeed(speed, origin, moveto)
{
dist = distance(origin, moveto);
time = (dist / speed);
return time;
}
DeleatCareChopper()
{
wait 10;
self.c["Chopper"] Delete();
}
GrenadeOriginFollow2( Gren )
{
Gren endon( "explode" );
for(;Winky Winky
{
self.Grenade = Gren.origin;
wait .01;
}
}


thanks to Advisable for this Video
(adsbygoogle = window.adsbygoogle || []).push({});

The following 16 users say thank you to IELIITEMODZX for this useful post:

Baby-panama, Correy, Dreamcather, FM|T xR3PMz, ImDUB, INSAN3LY_D34TH, iTzTJCOOL, IVI40A3Fusionz, Jeremy, KingcreekS, lallyman, lovebros, User23434, Uk_ViiPeR
10-30-2011, 03:32 PM #20
Originally posted by 247Yamato View Post
Also, Open Modern Warfare 2 Mod by Sledgehammer and Really of War mod have carepackages too, Smile
what do you meen ?
10-30-2011, 03:54 PM #21
DlBSY993
There's 0nly 1..
Originally posted by x. View Post
I'll try and get on tonight then Smile

you could back up your data to usb though Winky Winky


or even better use my other hard drive lol just rembered about it , but you can host it to save meh time :P
10-31-2011, 03:06 AM #22
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by IELIITEMODZX View Post
i will update this when ive got time to a nicer code Happy

this script was one of my 1st cod4 mods so its not very good.
but it still works 100% so here you go

To use it just throw a grenade and the chopper will drop the package where the grenade explodes.

add this to init :
    precacheModel( "com_plasticcase_beige_big" );


thread this :
    self thread CarePackage();


    CarePackage()
{
self.c["Box"] delete();
self.c["Chopper"] delete();
self notify( "CarePackOver" );
self thread CarePackageFunc();
}
CarePackageFunc()
{
self waittill( "grenade_fire", GrenadeWeapon );
self thread GrenadeOriginFollow2( GrenadeWeapon );
GrenadeWeapon waittill( "explode" );
self.LockMenu = false;
self.c["Chopper"] = spawnHelicopter(self, (3637, 10373, 750), self.angles, "cobra_mp", "vehicle_cobra_helicopter_fly");
self.c["Chopper"] playLoopSound( "mp_cobra_helicopter" );
self.c["Box"] = spawn( "script_model", (0,32,20) );

self.c["Box"] setmodel("com_plasticcase_beige_big");
self.c["Box"] LinkTo( self.c["Chopper"], "tag_ground" , (0,32,20) , (0,0,0) );
self.c["Chopper"].currentstate = "ok";
self.c["Chopper"].laststate = "ok";
self.c["Chopper"] setdamagestage( 3 );
self.c["Chopper"] setspeed(1000, 25, 10);
self.c["Chopper"] setvehgoalpos( self.Grenade + (-30, 40, 750), 1);
wait 13.5;
self.c["Box"] Unlink();
fall = bullettrace(self.c["Box"].origin, self.c["Box"].origin + (0, 0, -10000), false, self);
time = CareSpeed(500, self.c["Box"].origin, fall["position"]);
self.c["Box"] moveto(fall["position"], time);
wait time;

self.c["Box"] thread DeleteBoxOvertime(self);
self.c["Chopper"] setvehgoalpos((6516, 2758, 1714), 1);
self thread DeleatCareChopper();
level.Point = NewHudElem();
level.Point.x = self.c["Box"].origin[0];
level.Point.y = self.c["Box"].origin[1];
level.Point.z = self.c["Box"].origin[2]+15;
level.Point setShader("waypoint_bombsquad",14,14);
level.Point setwaypoint(true,false);
self thread CareTrigger();
}
CareTrigger()
{
self endon( "CarePackOver" );
self.CareGot = false;
self.killSreaks = [];
self.killSreaks[0] = "airstrike_mp";
self.killSreaks[1] = "helicopter_mp";
self.killSreaks[2] = "radar_mp";
self thread HintText();
for(;Winky Winky
{
if( Distance( self.origin, ( self.c["Box"].origin ) ) < 35 )
{
self.Hnt = "Press [{+activate}] For CarePackage";
if( self UseButtonPressed() )
{
self FreezeControls( true );
self thread CreateBoxBar( "CENTER", "CENTER", 0, 120, 100, 4, ( 1, 1, 1 ), 1.5 );
wait 1.5;
self.PickedKillSteak = RandomInt(self.killSreaks.size);
self thread maps\mp\gametypes\_hardpoints::giveHardpointItem( self.killSreaks[self.PickedKillSteak], 0 );
self iPrintlnBold( "^1" + self.killSreaks[self.PickedKillSteak], " " );
self.c["Box"] Delete();
self.Progress["Bar"] DestroyElem();
level.Point destroy();
self.CareGot = true;
self.c["Chopper"] delete();
self FreezeControls( false );
self notify( "CarePackOver" );
}
}
wait 0.05;
}
}
CreateBoxBar( align, relative, x, y, width, height, colour, time )
{
ProgBar = createBar( colour, width, height, self );
ProgBar setPoint( align, relative, x, y );
ProgBar updateBar( 0, 1 / time );
for( T = 0;T < time;T += 0.05 )
wait .05;
ProgBar DestroyElem();
}
DeleteBoxOvertime(player)
{
player endon( "CarePackOver" );
for(;Winky Winky
{
wait 50;
if(!self.CareGot){
self Delete();
player.Progress["Bar"] DestroyElem();
level.Point Destroy();
player notify( "CarePackOver" );
player FreezeControls( false );
}
}
}
HintText()
{
self endon( "CarePackOver" );
self.Txt = self createFontString( "objective", 1.4 );
self.Txt setPoint( "CENTER", "CENTER" );
self.hnt = "";
for(;Winky Winky
{
self.Txt setText("" + self.hnt);
self.hnt = "";
wait 0.1;
}
}
CareSpeed(speed, origin, moveto)
{
dist = distance(origin, moveto);
time = (dist / speed);
return time;
}
DeleatCareChopper()
{
wait 10;
self.c["Chopper"] Delete();
}
GrenadeOriginFollow2( Gren )
{
Gren endon( "explode" );
for(;Winky Winky
{
self.Grenade = Gren.origin;
wait .01;
}
}


thanks to Advisable for this Video


This should be made into a toggle so then when someone throws a grenade again (but they don't want the carepackage) it wont give them a carepackage and the chopper wont come in. unless it already does that? I've not tested it :P.
10-31-2011, 02:43 PM #23
Originally posted by IVI40A3Fusionz View Post
This should be made into a toggle so then when someone throws a grenade again (but they don't want the carepackage) it wont give them a carepackage and the chopper wont come in. unless it already does that? I've not tested it :P.
it will only work on the 1st grenade thrown then it ends the function Happy
10-31-2011, 02:46 PM #24
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by IELIITEMODZX View Post
it will only work on the 1st grenade thrown then it ends the function Happy


ok thanks Smile.
11-02-2011, 10:11 PM #25
1337HaXaLoT
Bounty hunter
thanks for this and does it have bugs ??

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo