HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1.  
  2. #include <amxmodx>
  3.  
  4. #include <amxmisc>
  5.  
  6. #include <cstrike>
  7.  
  8. #include <codmod>
  9.  
  10. #include <engine>
  11.  
  12. #include <hamsandwich>
  13.  
  14.  
  15.  
  16. new sprite;
  17.  
  18. new ilosc_blyskawic[33],poprzednia_blyskawica[33];
  19.  
  20. new const gszSound[] = "ambience/thunder_clap.wav";
  21.  
  22.  
  23.  
  24. new const nazwa[] = "Zeusz";
  25.  
  26. new const opis[] = "LEIRA'S: Kapsz 3db villa'mot. ( Felhaszna'la's: E bet'u'vel! )";
  27.  
  28. new const bronie = 1<<CSW_M4A1 | 1<<CSW_M249; // Milyen fegyver legyen a kasztba
  29.  
  30. new const zdrowie = 40; // Élet
  31.  
  32. new const kondycja = 40; //Sebesség
  33.  
  34. new const inteligencja = 20; //Inteligencia
  35.  
  36. new const wytrzymalosc = 20; //Sebezhetetlenség (Halhatatlanság)
  37.  
  38.  
  39.  
  40. new ma_klase[33]
  41.  
  42.  
  43.  
  44. public plugin_init() {
  45.  
  46. register_plugin(nazwa, "1.0", "piterka");
  47.  
  48. cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
  49.  
  50.  
  51.  
  52.  
  53.  
  54. register_event("ResetHUD", "ResetHUD", "abe");
  55.  
  56. }
  57.  
  58.  
  59.  
  60. public plugin_precache()
  61.  
  62. {
  63.  
  64. sprite = precache_model("sprites/lgtning.spr");
  65.  
  66. precache_sound(gszSound);
  67.  
  68. }
  69.  
  70.  
  71.  
  72. public cod_class_enabled(id)
  73.  
  74. {
  75.  
  76. ilosc_blyskawic[id] = 3;
  77.  
  78. ma_klase[id] = 1;
  79.  
  80.  
  81.  
  82. return COD_CONTINUE;
  83.  
  84. }
  85.  
  86.  
  87.  
  88. public cod_class_disabled(id)
  89.  
  90. {
  91.  
  92. ma_klase[id] = 0;
  93.  
  94. ilosc_blyskawic[id] = 0;
  95.  
  96. }
  97.  
  98.  
  99.  
  100. public cod_class_skill_used(id) {
  101.  
  102.  
  103.  
  104. if(!is_user_alive(id)) return PLUGIN_HANDLED;
  105.  
  106.  
  107.  
  108. if(!ilosc_blyskawic[id]) {
  109.  
  110. return PLUGIN_HANDLED;
  111.  
  112. }
  113.  
  114. new ofiara, body;
  115.  
  116. get_user_aiming(id, ofiara, body);
  117.  
  118.  
  119.  
  120. if(is_user_alive(ofiara)){
  121.  
  122. if(get_user_team(ofiara) == get_user_team(id)) {
  123.  
  124. return PLUGIN_HANDLED;
  125.  
  126. }
  127.  
  128.  
  129.  
  130. if(poprzednia_blyskawica[id]+5.0>get_gametime()) {
  131.  
  132. client_print(id,print_chat,"Csak 5ma'sodpercenke'nt tudsz l'o'ni villa'mot.");
  133.  
  134. return PLUGIN_HANDLED;
  135.  
  136. }
  137.  
  138. poprzednia_blyskawica[id] = floatround(get_gametime());
  139.  
  140. ilosc_blyskawic[id]--;
  141.  
  142.  
  143.  
  144. puscBlyskawice(id, ofiara, 50.0, 0.5);
  145.  
  146. }
  147.  
  148. return PLUGIN_HANDLED;
  149.  
  150. }
  151.  
  152.  
  153.  
  154. stock Create_TE_BEAMENTS(startEntity, endEntity, iSprite, startFrame, frameRate, life, width, noise, red, green, blue, alpha, speed) {
  155.  
  156. message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
  157.  
  158. write_byte( TE_BEAMENTS )
  159.  
  160. write_short( startEntity ) // start entity
  161.  
  162. write_short( endEntity ) // end entity
  163.  
  164. write_short( iSprite ) // model
  165.  
  166. write_byte( startFrame ) // starting frame
  167.  
  168. write_byte( frameRate ) // frame rate
  169.  
  170. write_byte( life ) // life
  171.  
  172. write_byte( width ) // line width
  173.  
  174. write_byte( noise ) // noise amplitude
  175.  
  176. write_byte( red ) // red
  177.  
  178. write_byte( green ) // green
  179.  
  180. write_byte( blue ) // blue
  181.  
  182. write_byte( alpha ) // brightness
  183.  
  184. write_byte( speed ) // scroll speed
  185.  
  186. message_end()
  187.  
  188. }
  189.  
  190. puscBlyskawice(id, ofiara, Float:fObrazenia = 55.0, Float:fCzas = 1.0){
  191.  
  192. //Obrazenia
  193.  
  194. new ent = create_entity("info_target");
  195.  
  196. entity_set_string(ent, EV_SZ_classname, "blyskawica");
  197.  
  198. cod_inflict_damage(id, ofiara, fObrazenia, 1.0, ent, DMG_SHOCK);
  199.  
  200.  
  201.  
  202. remove_entity(ent);
  203.  
  204.  
  205.  
  206. //Piorun
  207.  
  208. Create_TE_BEAMENTS(id, ofiara, sprite, 0, 10, floatround(fCzas*10), 150, 5, 200, 200, 200, 200, 10);
  209.  
  210.  
  211.  
  212. //Dzwiek
  213.  
  214. emit_sound(id, CHAN_WEAPON, gszSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
  215.  
  216. emit_sound(ofiara, CHAN_WEAPON, gszSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
  217.  
  218. }
  219.  
  220.  
  221.  
  222.  
  223.  
  224. public ResetHUD(id) {
  225.  
  226. if(ma_klase[id] == 1) {
  227.  
  228. ilosc_blyskawic[id] = 3;
  229.  
  230. }
  231.  
  232. }
  233.