Advertisement
Prawy

Untitled

Apr 1st, 2022
58
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None
  1. Gascan_Check()
  2. {
  3. self endon("disconnect");
  4. self endon("death");
  5.  
  6. while(1)
  7. {
  8. w = self getCurrentWeapon();
  9. if(w == "gascan_mp" && self.pers["team"] == "allies" && !isDefined(self.gascanyet))
  10. {
  11. if(self.didntnotify)
  12. {
  13. self iprintlnBold("^2Press ^1MELEE^2 and ^1ATTACK ^2to use Gascan!");
  14. self.didntnotify = false;
  15. }
  16. //self setClientCvar( "ui_helptext", "^2Press ^1MELEE^2 and ^1ATTACK ^2to use Gascan!" );
  17. if( self meleeButtonPressed() && self attackButtonPressed() && !self.gascanyet)
  18. self thread gascan(self.origin);
  19. }
  20. else
  21. {
  22. w = undefined;
  23. self.didntnotify = true;
  24. }
  25.  
  26. wait 0.1;
  27. }
  28. }
  29.  
  30.  
  31. gascan(origin)
  32. {
  33. self endon("level gascan end");
  34. self endon("disconnect");
  35. self endon("death");
  36.  
  37. self.gascanyet = true;
  38. self thread gascan_hit(origin);
  39. self.thefire = spawn( "script_model", origin);
  40. self.thefire playloopsound("medfire");
  41. for(i=0; i<40; i++)
  42. {
  43. playFx(level.fx_flame, self.origin);
  44. wait 0.5;
  45. if(i == 39)
  46. {
  47. self notify("level gascan end");
  48. self.thefire stoploopsound();
  49.  
  50. //self.gascanyet = false;
  51. }
  52. }
  53. }
  54. gascan_hit(origin)
  55. {
  56. self endon("level gascan end");
  57. self endon("disconnect");
  58. self endon("death");
  59.  
  60. while(1)
  61. {
  62. players = getentarray("player", "classname");
  63. for( i = 0; i < players.size; i++ )
  64. {
  65. player = players[i];
  66. if( player.sessionstate == "playing" && player.pers["team"] == "axis" )
  67. {
  68. if( distance(player.origin, origin) < 100 && !player.gascanned)
  69. {
  70. player thread hitme(self);
  71. }
  72. }
  73. wait 0.3;
  74. }
  75. wait 0.2;
  76. }
  77.  
  78. }
  79.  
  80. hitme(person)
  81. {
  82.  
  83. person endon("level gascan end");
  84. self endon("disconnect");
  85. self endon("death");
  86. person endon("disconnect");
  87. person endon("death");
  88.  
  89. //self thread gascanned(self.origin, person);
  90. self playloopsound("bigfire");
  91. for(i=0; i<30; i++)
  92. {
  93. self.gascanned = true;
  94. playFx(level.fx_flame, self.origin);
  95. // iprintlnbold ("work");
  96. self thread [[level.callbackPlayerDamage]](person, person, (30 + randomInt(10)), 0, "MOD_MORTAR_SPLASH", "gascan_mp", self.origin, vectornormalize(self.origin - origin), "none", 0);
  97. wait 0.5;
  98. }
  99.  
  100.  
  101.  
  102. self stoploopsound();
  103. }
  104.  
  105. gascanned(origin, person)
  106. {
  107. self endon("level gascan end");
  108. self endon("disconnect");
  109. self endon("death");
  110.  
  111. for( i = 0; i < players.size; i++ )
  112. {
  113. player = players[i];
  114. if( player.sessionstate == "playing" && player.pers["team"] == "axis" )
  115. {
  116. if( distance(player.origin, self.origin) < 100 && !player.gascanned)
  117. {
  118. player thread hitme(person);
  119. }
  120. }
  121. wait 0.3;
  122. }
  123. wait 0.2;
  124. }
Advertisement
RAW Paste Data Copied
Advertisement