Guest User

Untitled

a guest
Apr 2nd, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.91 KB | None | 0 0
  1. #include common_scripts\utility;
  2. #include maps\_utility;
  3. #include maps\_zombiemode_utility;
  4.  
  5. init()
  6. {
  7. // DO NOT DELETE / EDIT ANY OF THIS!
  8. trigs = getentarray("flaming_ammo_trigger","targetname");
  9. level.disallowed_flaming_guns = [];
  10. addGun("m2_flamethrower_zombie");
  11. addGun("tesla_gun");
  12. addGun("panzerschrek_zombie");
  13. addGun("colt_dirty_harry");
  14. addGun("zombie_colt_upgraded", "up");
  15.  
  16. // This is the cost of the ammo. You can change this.
  17. price = 1500;
  18.  
  19. // Add guns here that can't get flaming ammo. Do NOT delete the ones above this, it can cause problems or just be fail.
  20. // 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,
  21. // 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
  22. // 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
  23. // different gun name.
  24. addGun("ray_gun"); // Ray gun is added for you :)
  25.  
  26. for(i=0;i<trigs.size;i++)
  27. {
  28. trigs[i] thread main(price);
  29. }
  30. }
  31. addGun(gun, do_upgraded_vers)
  32. {
  33. if(do_upgraded_vers == undefined || do_upgraded_vers == "both")
  34. {
  35. level.disallowed_flaming_guns[level.disallowed_flaming_guns.size] = gun;
  36. level.disallowed_flaming_guns[level.disallowed_flaming_guns.size] = gun + "_upgraded";
  37. }
  38. else if(do_upgraded_vers == "non")
  39. level.disallowed_flaming_guns[level.disallowed_flaming_guns.size] = gun;
  40. else if(do_upgraded_vers == "up")
  41. level.disallowed_flaming_guns[level.disallowed_flaming_guns.size] = gun + "_upgraded";
  42. }
  43. main(cost)
  44. {
  45. while(1)
  46. {
  47. self sethintstring("Press &&1 to buy flaming ammo [Cost: "+cost+"]");
  48. self waittill("trigger", who);
  49. if( who.score < cost )
  50. {
  51. play_sound_at_pos( "no_purchase", who.origin );
  52. continue;
  53. }
  54. currentGun = who getCurrentWeapon();
  55. for(i=0;i<level.disallowed_flaming_guns.size;i++)
  56. if(currentGun == level.disallowed_flaming_guns[i])
  57. {
  58. if(level.disallowed_flaming_guns[i] == "m2_flamethrower_zombie" || level.disallowed_flaming_guns[i] == "m2_flamethrower_zombie_upgraded")
  59. thread scrolling_hud( "This is a flamethrower, idiot." );
  60. else
  61. thread scrolling_hud( "This gun can not have flaming ammo." );
  62.  
  63. play_sound_at_pos( "no_purchase", who.origin );
  64. self thread main(cost);
  65. return;
  66. }
  67. if(who currentGunFlaming(currentGun))
  68. {
  69. thread scrolling_hud( "This gun already has flaming ammo." );
  70.  
  71. play_sound_at_pos( "no_purchase", who.origin );
  72. continue;
  73. }
  74. else
  75. who setFlaming(currentGun);
  76.  
  77. self sethintstring("Thanks for buying flaming ammo!");
  78. play_sound_at_pos( "purchase", who.origin );
  79. who maps\_zombiemode_score::minus_to_player_score( cost );
  80. wait 1.5;
  81. }
  82. }
  83. setFlaming(gun)
  84. {
  85. if(!isDefined(self.flamingGuns))
  86. self.flamingGuns = [];
  87.  
  88. primaryWeapons = self GetWeaponsListPrimaries();
  89.  
  90. for(i=0;i<primaryWeapons.size;i++)
  91. {
  92. if(primaryWeapons[i] == gun)
  93. self.flamingGuns[self.flamingGuns.size] = primaryWeapons[i];
  94. }
  95. }
  96. currentGunFlaming(gun)
  97. {
  98. for(i=0;i<self.flamingGuns.size;i++)
  99. {
  100. if(self.flamingGuns[i] == gun)
  101. return true;
  102. }
  103. return false;
  104. }
  105. scrolling_hud( text )
  106. {
  107. self endon ("disconnect");
  108.  
  109. hudelem = maps\_hud_util::createFontString( "objective", 2 );
  110. hudelem maps\_hud_util::setPoint( "TOP", undefined, 0, level.zombie_vars["zombie_timer_offset"] - (level.zombie_vars["zombie_timer_offset_interval"] * 2));
  111. hudelem.sort = 0.5;
  112. hudelem.alpha = 0;
  113. hudelem fadeovertime(0.5);
  114. hudelem.alpha = 1;
  115. hudelem.label = text;
  116. hudelem thread scrolling_hud_move();
  117. }
  118. scrolling_hud_move()
  119. {
  120. wait 0.5;
  121. move_fade_time = 1.5;
  122.  
  123. self FadeOverTime( move_fade_time );
  124. self MoveOverTime( move_fade_time );
  125. self.y = 270;
  126. self.alpha = 0;
  127. wait move_fade_time;
  128. self destroy();
  129. }
Advertisement
Add Comment
Please, Sign In to add comment