05-23-2011, 19:19
Hello
This is a easy code, is not very usefull, is only usefull for people who want to make this in a zombie mod,
And add this in Init()
This is a easy code, is not very usefull, is only usefull for people who want to make this in a zombie mod,
Code:
StreakBox(pos, angle)
{
box = spawn("script_model", pos);
box setModel("com_plasticcase_beige_big");
box.angles = angle;
box Solid();
box CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
level.trigger = spawn( "trigger_radius", pos, 0, 50, 50 );
level.trigger.angles = angle;
level.trigger thread StreakBoxGive(pos, angle,box);
wait 0.01;
}
StreakBoxGive(pos,angle,box)
{
self endon("disconnect");
while(1)
{
self waittill( "trigger", player );
if(Distance(pos, Player.origin) <= 50){
Player setLowerMessage("activate", "Hold ^3[{+activate}]^7 for a Random Killstreak" );}
if(Distance(pos, Player.origin) >50){
Player ClearLowerMessage("activate", 1);}
if(Distance(pos, Player.origin) <= 75 && player useButtonPressed())
{
player ClearLowerMessage("activate", 1);
player playsound( "vending_machine_button_press" );
box thread Effects(box);
player thread Bar();
wait 4.5;
player playsound( "vending_machine_soda_drop" );
player maps\mp\killstreaks\_killstreaks::giveKillstreak( level.streaks[RandomInt( level.streaks.size )], true );
wait 1;
}
wait .25;
}
}
Effects(box)
{
flare = loadfx("misc/flare_ambient_green");
fx1 = SpawnFx(flare, box.origin);
TriggerFX(fx1);
fx2 = SpawnFx(flare, box.origin+(0,0,5));
TriggerFX(fx2);
wait 5;
fx1 delete();
fx2 delete();
}
Bar()
{
duration = 4.0;
bar = createPrimaryProgressBar( 25 );
barText = createPrimaryProgressBarText( 25 );
barText setText( "^2Getting Streak" );
bar updateBar( 0, 1 / duration );
bar.color = (1, 0, 0);
for(i=0;i<4;i++)
{
self playSound( "ui_mp_nukebomb_timer" );
wait 1;
}
wait 3.5;
bar destroyElem();
barText destroyElem();
}
And add this in Init()
Code:
level.streaks = [];
level.streaks[0] = "uav";
level.streaks[1] = "counter_uav";
level.streaks[2] = "helicopter";
level.streaks[3] = "ac130";
level.streaks[4] = "nuke";
level.streaks[5] = "emp";
level.streaks[6] = "predator_missile";
level.streaks[7] = "helicopter_minigun";
level.streaks[8] = "precision_airstrike";
level.streaks[9] = "sentry";
level.streaks[10] = "helicopter_flares";
level.streaks[11] = "stealth_airstrike";
level.streaks[12] = "harrier_airstrike";