Advertisement
Guest User

Assasin

a guest
Aug 14th, 2012
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.55 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4. #include <codmod>
  5. #include <engine>
  6. #include <hamsandwich>
  7. #include <ColorChat>
  8.  
  9. new sprite;
  10. new ilosc_blyskawic[33],poprzednia_blyskawica[33];
  11. new const gszSound[] = "ambience/thunder_clap.wav";
  12.  
  13. new const nazwa[] = "Elektryk [SuperVIP]";
  14. new const opis[] = "Masz 3 blyskawice. ( Uzycie: klawisz E )";
  15. new const bronie = 1<<CSW_M4A1 | 1<<CSW_M249;
  16. new const zdrowie = 40;
  17. new const kondycja = 40;
  18. new const inteligencja = 20;
  19. new const wytrzymalosc = 20;
  20.  
  21. new ma_klase[33]
  22.  
  23. public plugin_init() {
  24. register_plugin(nazwa, "1.0", "piterka");
  25. cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
  26.  
  27.  
  28. register_event("ResetHUD", "ResetHUD", "abe");
  29. }
  30.  
  31. public plugin_precache()
  32. {
  33. sprite = precache_model("sprites/lgtning.spr");
  34. precache_sound(gszSound);
  35. }
  36.  
  37. public cod_class_enabled(id)
  38. {
  39. ilosc_blyskawic[id] = 3;
  40. ColorChat(id, RED, "^x04Klasa^x03 %s^x04 By^x01 Sajjuk", nazwa); //Gdy gracz nie ma flagi wyświetli mu komunikat
  41. if(!(get_user_flags(id) & ADMIN_LEVEL_G)) //FLAGA
  42. {
  43. ColorChat(id, RED, "^x03[%s]^x04 Jest^x03 klasa premium", nazwa) //Znowu info ze przykładowa klasa jest PREMIUM
  44. return COD_STOP;
  45. }
  46. ma_klase[id] = true;
  47. return COD_CONTINUE;
  48. }
  49.  
  50. public cod_class_disabled(id)
  51. {
  52. ma_klase[id] = 0;
  53. ilosc_blyskawic[id] = 0;
  54. }
  55.  
  56. public cod_class_skill_used(id) {
  57.  
  58. if(!is_user_alive(id)) return PLUGIN_HANDLED;
  59.  
  60. if(!ilosc_blyskawic[id]) {
  61. return PLUGIN_HANDLED;
  62. }
  63. new ofiara, body;
  64. get_user_aiming(id, ofiara, body);
  65.  
  66. if(is_user_alive(ofiara)){
  67. if(get_user_team(ofiara) == get_user_team(id)) {
  68. return PLUGIN_HANDLED;
  69. }
  70.  
  71. if(poprzednia_blyskawica[id]+5.0>get_gametime()) {
  72. client_print(id,print_chat,"Blyskawicy mozesz uzyc raz na 5 sek.");
  73. return PLUGIN_HANDLED;
  74. }
  75. poprzednia_blyskawica[id] = floatround(get_gametime());
  76. ilosc_blyskawic[id]--;
  77.  
  78. puscBlyskawice(id, ofiara, 50.0, 0.5);
  79. }
  80. return PLUGIN_HANDLED;
  81. }
  82.  
  83. stock Create_TE_BEAMENTS(startEntity, endEntity, iSprite, startFrame, frameRate, life, width, noise, red, green, blue, alpha, speed) {
  84. message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
  85. write_byte( TE_BEAMENTS )
  86. write_short( startEntity ) // start entity
  87. write_short( endEntity ) // end entity
  88. write_short( iSprite ) // model
  89. write_byte( startFrame ) // starting frame
  90. write_byte( frameRate ) // frame rate
  91. write_byte( life ) // life
  92. write_byte( width ) // line width
  93. write_byte( noise ) // noise amplitude
  94. write_byte( red ) // red
  95. write_byte( green ) // green
  96. write_byte( blue ) // blue
  97. write_byte( alpha ) // brightness
  98. write_byte( speed ) // scroll speed
  99. message_end()
  100. }
  101. puscBlyskawice(id, ofiara, Float:fObrazenia = 55.0, Float:fCzas = 1.0){
  102. //Obrazenia
  103. new ent = create_entity("info_target");
  104. entity_set_string(ent, EV_SZ_classname, "blyskawica");
  105. cod_inflict_damage(id, ofiara, fObrazenia, 1.0, ent, DMG_SHOCK);
  106.  
  107. remove_entity(ent);
  108.  
  109. //Piorun
  110. Create_TE_BEAMENTS(id, ofiara, sprite, 0, 10, floatround(fCzas*10), 150, 5, 200, 200, 200, 200, 10);
  111.  
  112. //Dzwiek
  113. emit_sound(id, CHAN_WEAPON, gszSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
  114. emit_sound(ofiara, CHAN_WEAPON, gszSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
  115. }
  116.  
  117.  
  118. public ResetHUD(id) {
  119. if(ma_klase[id] == 1) {
  120. ilosc_blyskawic[id] = 3;
  121. }
  122. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement