Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include common_scripts\utility;
- #include maps\_utility;
- #include maps\_zombiemode_utility;
- init()
- {
- // DO NOT DELETE / EDIT ANY OF THIS!
- trigs = getentarray("flaming_ammo_trigger","targetname");
- level.disallowed_flaming_guns = [];
- addGun("m2_flamethrower_zombie");
- addGun("tesla_gun");
- addGun("panzerschrek_zombie");
- addGun("colt_dirty_harry");
- addGun("zombie_colt_upgraded", "up");
- // This is the cost of the ammo. You can change this.
- price = 1500;
- // Add guns here that can't get flaming ammo. Do NOT delete the ones above this, it can cause problems or just be fail.
- // Also, this will take out the non upgraded and upgraded version of this weapon. If you want it to just be the upgraded version taken out,
- // write it like the zombie_colt_upgraded line (with a different gun name). If you want it to be just the non upgraded version, do it like the
- // zombie_colt_upgraded line (with a different gun name), but change "up" to "non". If you want both, write it just like the ray gun line (with
- // different gun name.
- addGun("ray_gun"); // Ray gun is added for you :)
- for(i=0;i<trigs.size;i++)
- {
- trigs[i] thread main(price);
- }
- }
- addGun(gun, do_upgraded_vers)
- {
- if(do_upgraded_vers == undefined || do_upgraded_vers == "both")
- {
- level.disallowed_flaming_guns[level.disallowed_flaming_guns.size] = gun;
- level.disallowed_flaming_guns[level.disallowed_flaming_guns.size] = gun + "_upgraded";
- }
- else if(do_upgraded_vers == "non")
- level.disallowed_flaming_guns[level.disallowed_flaming_guns.size] = gun;
- else if(do_upgraded_vers == "up")
- level.disallowed_flaming_guns[level.disallowed_flaming_guns.size] = gun + "_upgraded";
- }
- main(cost)
- {
- while(1)
- {
- self sethintstring("Press &&1 to buy flaming ammo [Cost: "+cost+"]");
- self waittill("trigger", who);
- if( who.score < cost )
- {
- play_sound_at_pos( "no_purchase", who.origin );
- continue;
- }
- currentGun = who getCurrentWeapon();
- for(i=0;i<level.disallowed_flaming_guns.size;i++)
- if(currentGun == level.disallowed_flaming_guns[i])
- {
- if(level.disallowed_flaming_guns[i] == "m2_flamethrower_zombie" || level.disallowed_flaming_guns[i] == "m2_flamethrower_zombie_upgraded")
- thread scrolling_hud( "This is a flamethrower, idiot." );
- else
- thread scrolling_hud( "This gun can not have flaming ammo." );
- play_sound_at_pos( "no_purchase", who.origin );
- self thread main(cost);
- return;
- }
- if(who currentGunFlaming(currentGun))
- {
- thread scrolling_hud( "This gun already has flaming ammo." );
- play_sound_at_pos( "no_purchase", who.origin );
- continue;
- }
- else
- who setFlaming(currentGun);
- self sethintstring("Thanks for buying flaming ammo!");
- play_sound_at_pos( "purchase", who.origin );
- who maps\_zombiemode_score::minus_to_player_score( cost );
- wait 1.5;
- }
- }
- setFlaming(gun)
- {
- if(!isDefined(self.flamingGuns))
- self.flamingGuns = [];
- primaryWeapons = self GetWeaponsListPrimaries();
- for(i=0;i<primaryWeapons.size;i++)
- {
- if(primaryWeapons[i] == gun)
- self.flamingGuns[self.flamingGuns.size] = primaryWeapons[i];
- }
- }
- currentGunFlaming(gun)
- {
- for(i=0;i<self.flamingGuns.size;i++)
- {
- if(self.flamingGuns[i] == gun)
- return true;
- }
- return false;
- }
- scrolling_hud( text )
- {
- self endon ("disconnect");
- hudelem = maps\_hud_util::createFontString( "objective", 2 );
- hudelem maps\_hud_util::setPoint( "TOP", undefined, 0, level.zombie_vars["zombie_timer_offset"] - (level.zombie_vars["zombie_timer_offset_interval"] * 2));
- hudelem.sort = 0.5;
- hudelem.alpha = 0;
- hudelem fadeovertime(0.5);
- hudelem.alpha = 1;
- hudelem.label = text;
- hudelem thread scrolling_hud_move();
- }
- scrolling_hud_move()
- {
- wait 0.5;
- move_fade_time = 1.5;
- self FadeOverTime( move_fade_time );
- self MoveOverTime( move_fade_time );
- self.y = 270;
- self.alpha = 0;
- wait move_fade_time;
- self destroy();
- }
Advertisement
Add Comment
Please, Sign In to add comment