Advertisement
Guest User

Untitled

a guest
Sep 19th, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. custom_perk_1()
  2. {
  3. count = 0;
  4. self.count_exceeded = false;
  5. self.increase_count = false;
  6. self thread zombies_array(count);
  7. self thread increase_count(count);
  8. }
  9.  
  10. zombies_array()
  11. {
  12. while(1)
  13. {
  14. zombs = getaispeciesarray("axis");
  15. for(i=0;i<zombs.size;i++)
  16. {
  17. zombs[i] thread damage_detection();
  18. }
  19. wait 1;
  20. }
  21. }
  22.  
  23. damage_detection()
  24. {
  25.  
  26. players = getplayers();
  27. for(i=0;i<players.size;i++)
  28. {
  29. self waittill ("damage");
  30. if(players[i] IsMeleeing() && players[i].count_exceeded == false)
  31. {
  32. //iPrintLnBold("melee detected");
  33. players[i].increase_count = true;
  34. players[i] thread reset_timer();
  35. self thread maps\_zombiemode_spawner::zombie_head_gib();
  36. self DoDamage( self.health * 100, self.origin );
  37. }
  38. }
  39. }
  40.  
  41. increase_count(count)
  42. {
  43. while(1)
  44. {
  45. if(self.increase_count == true)
  46. {
  47. if ( count >= 4 )
  48. {
  49. //iPrintLnBold("count > 4");
  50. self.increase_count = false;
  51. self.count_exceeded = true;
  52. self notify ("begin_countdown");
  53. self thread reset_count(count);
  54. self waittill ("timer_up");
  55. //iPrintLnBold("reset");
  56. count = 0;
  57. self.count_exceeded = false;
  58. }
  59. else
  60. {
  61. //iPrintLnBold("count < 4");
  62. self.increase_count = false;
  63. count++;
  64. self maps\_zombiemode_score::player_add_points( "death", "MOD_MELEE", "head" );
  65. }
  66. }
  67. wait .5;
  68. }
  69. }
  70.  
  71. reset_timer()
  72. {
  73. level endon ("between_round_over");
  74. while(1)
  75. {
  76. self waittill ("begin_countdown");
  77. //iPrintLnBold("timer begin");
  78. wait 30;
  79. self notify ("timer_up");
  80. }
  81. }
  82.  
  83. reset_count()
  84. {
  85. level waittill ("between_round_over");
  86. self notify ("timer_up");
  87. }
  88.  
  89. hud_color(hud)
  90. {
  91. while(1)
  92. {
  93. if(self.count_exceeded == false)
  94. {
  95. hud.color = ( 1, 1, 0 );
  96. }
  97. else
  98. {
  99. hud.color = ( 1, 1, 1 );
  100. }
  101. wait .5;
  102. }
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement