Post: [SCRIPT] Scavenger Packs
05-21-2012, 09:47 PM #1
Default Avatar
Gizmo
Guest
(adsbygoogle = window.adsbygoogle || []).push({}); Modified from Mikeeeyy's CoD5 scavenger script Smile

Drops a scavenger pack which can be picked up to replenish ammo, it could probably be used on player deaths for gamemodes :p .
If you can find a more suitable model please let me know :p .

    
DropScavengerPack()
{
self iprintln("Ammo pack spawned!");
self.Ammo = spawn( "script_model", self.origin + ( 0, 0, 0 ) );
self.Ammo1 = spawn( "script_model", self.origin + ( 6, 0, 0 ) );
self.Ammo SetModel( "mil_tntbomb_mp" );
self.Ammo1 SetModel( "mil_tntbomb_mp" );
self thread DeleteAfter30();
wait 5;
self thread getAmmo();
}
getAmmo()
{
self endon("30");
self.Trig = spawn( "trigger_radius", self.Ammo.origin, 1, 20, 10 );
self.Trig waittill( "trigger", i );
self playsound("oldschool_pickup");
i SetWeaponAmmoStock( i GetCurrentWeapon(), i GetWeaponAmmoStock( i GetCurrentWeapon() ) + 30 );
self.Ammo Delete();
self.Ammo1 Delete();
}
DeleteAfter30()
{
for( i = 30;i >= 0;i-- )
{
if( !IsDefined( self.Ammo ) )
{
break;
}
wait 1;
}
self notify("30");
self.Ammo1 Delete();
self.Ammo Delete();
}



Last edited by Gizmo ; 05-21-2012 at 10:37 PM.

The following 4 users say thank you to Gizmo for this useful post:

Correy, Ghost1990, Harry, KingcreekS
05-21-2012, 11:47 PM #2
Correy
I'm the Original
Originally posted by gizzi View Post
..


you could also builder from this, this will most probably won't work and will have a whole bunch of errors.. but im just implementing how it could be done to give you and idea of a drop of, with the perk.

    
MonitorDrop()
{
if( self.hasScavanger )
{
self waittill( "death" );
self.Ammo = spawn( "script_model", self.origin + ( 0, 0, 0 ) );
self thread destroyOn( self.Ammo, 30 );
for(;Winky Winky
{
if( distance( self.origin, self.Trig < 20 ))
{
self SetWeaponAmmoStock( self GetCurrentWeapon(), self GetWeaponAmmoStock( self GetCurrentWeapon() ) + 30 );
break;
}
wait .3;
}
self playsound("oldschool_pickup");
}
}
destroyOn( ent, int )
{
for( i=0; i<int; i++ )
{
ent destroy();
}
}


something like that Drack

The following user thanked Correy for this useful post:

05-22-2012, 07:31 AM #3
Karoolus
I'm the W@W Menu Guy !
add somewhere in init()

    level.scavenger = [];
level.scavtrig = [];


    MonitorDrop()
{
for(;Winky Winky
{
self waittill( "death" );
if( self.hasScavanger )
{
self AddScavenger();
}
}
}

AddScavenger()
{
number = 0;
for(i = 0; i <= level.scavenger.size; i++)
{
if(IsDefined(level.scavenger[i]))
{
continue;
}
else
{
number = i;
}
}
level.scavenger[number] = spawn( "script_model", self.origin + ( 0, 0, 0 ) );
level.scavenger[number] SetModel( "mil_tntbomb_mp" );
level.scavtrig[number] = spawn( "trigger_radius", self.origin, 1, 20, 10 );
scav_active[number] = true;
self WaitTime(number);
while(scav_active[number])
{
level.scavtrig waittill( "trigger", player );
player playsound("oldschool_pickup");
player SetWeaponAmmoStock( player GetCurrentWeapon(), player GetWeaponAmmoStock( player GetCurrentWeapon() ) + 30 );
scav_active[number] = false;
}
level.scavenger[number] Delete();
level.scavtrig[number] = Delete();
level.scavenger[number] = Undefined;
}

WaitTime(number)
{
wait 30;
scav_active[number] = false;
}


:fyea:

---------- Post added at 09:31 AM ---------- Previous post was at 09:26 AM ----------

could probably be improved, but i think it should work :p

first 2 scripts would work for only 1 scavenger pack, but if you implement this in an online game, it would totally screw things up, cause all the packs would react to the same triggers..
this way, every dropped pack has its own trigger etc, once it is finished that specific pack will disappear, while the others still remain active Smile
(at least, that's how i see it :p )

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

Correy,
05-22-2012, 07:32 AM #4
247Yamato
< ^ > < ^ >
You should play damagefeedback Happy
05-22-2012, 07:38 AM #5
Karoolus
I'm the W@W Menu Guy !
Originally posted by 247Yamato View Post
You should play damagefeedback Happy


come again ?
05-22-2012, 07:42 AM #6
247Yamato
< ^ > < ^ >
Originally posted by Karoolus View Post
come again ?


It also needs a blue small bag
05-22-2012, 07:47 AM #7
Karoolus
I'm the W@W Menu Guy !
Originally posted by 247Yamato View Post
It also needs a blue small bag


oh i know..
i didn't make this, only edited it a bit stare
05-22-2012, 07:50 AM #8
247Yamato
< ^ > < ^ >
Originally posted by Karoolus View Post
oh i know..
i didn't make this, only edited it a bit stare


I was saying to Gizzi Drack

The following user thanked 247Yamato for this useful post:

Karoolus
05-22-2012, 02:36 PM #9
Originally posted by Karoolus View Post
add somewhere in init()

    level.scavenger = [];
level.scavtrig = [];


    MonitorDrop()
{
for(;Winky Winky
{
self waittill( "death" );
if( self.hasScavanger )
{
self AddScavenger();
}
}
}

AddScavenger()
{
number = 0;
for(i = 0; i <= level.scavenger.size; i++)
{
if(IsDefined(level.scavenger[i]))
{
continue;
}
else
{
number = i;
}
}
level.scavenger[number] = spawn( "script_model", self.origin + ( 0, 0, 0 ) );
level.scavenger[number] SetModel( "mil_tntbomb_mp" );
level.scavtrig[number] = spawn( "trigger_radius", self.origin, 1, 20, 10 );
scav_active[number] = true;
self WaitTime(number);
while(scav_active[number])
{
level.scavtrig waittill( "trigger", player );
player playsound("oldschool_pickup");
player SetWeaponAmmoStock( player GetCurrentWeapon(), player GetWeaponAmmoStock( player GetCurrentWeapon() ) + 30 );
scav_active[number] = false;
}
level.scavenger[number] Delete();
level.scavtrig[number] = Delete();
level.scavenger[number] = Undefined;
}

WaitTime(number)
{
wait 30;
scav_active[number] = false;
}


:fyea:

---------- Post added at 09:31 AM ---------- Previous post was at 09:26 AM ----------

could probably be improved, but i think it should work :p

first 2 scripts would work for only 1 scavenger pack, but if you implement this in an online game, it would totally screw things up, cause all the packs would react to the same triggers..
this way, every dropped pack has its own trigger etc, once it is finished that specific pack will disappear, while the others still remain active Smile
(at least, that's how i see it :p )

If he had left it how it was instead of putting self on everything it would of worked fine lol.
05-22-2012, 05:23 PM #10
Default Avatar
Gizmo
Guest
Originally posted by 247Yamato View Post
You should play damagefeedback Happy


I'll add it to Karoo's version :megusta:


Originally posted by nZxMikeeeyx View Post
If he had left it how it was instead of putting self on everything it would of worked fine lol.


I tried that (how yours originally was), the trigger radius's remained despite the models being destroyed (That might have been something I did though, lol ) :fa: .

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo