Advertisement
MegastoRM

Untitled

Jun 4th, 2013
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4. #include <engine>
  5. #include <hamsandwich>
  6.  
  7. new sprite;
  8. new ilosc_blyskawic[33],poprzednia_blyskawica[33];
  9. new const gszSound[] = "ambience/thunder_clap.wav";
  10.  
  11. new bool:ima_electric[33]
  12.  
  13. public plugin_init() {
  14. register_plugin("", "1.0", "piterka");
  15.  
  16.  
  17. register_event("ResetHUD", "ResetHUD", "abe");
  18. }
  19.  
  20. public plugin_precache()
  21. {
  22. sprite = precache_model("sprites/lgtning.spr");
  23. precache_sound(gszSound);
  24. }
  25.  
  26. public iskoristiperk(id) {
  27.  
  28. if(!is_user_alive(id)) return PLUGIN_HANDLED;
  29.  
  30. if(!ilosc_blyskawic[id]) {
  31. return PLUGIN_HANDLED;
  32. }
  33. new ofiara, body;
  34. get_user_aiming(id, ofiara, body);
  35.  
  36. if(is_user_alive(ofiara)){
  37. if(get_user_team(ofiara) == get_user_team(id)) {
  38. return PLUGIN_HANDLED;
  39. }
  40.  
  41. if(poprzednia_blyskawica[id]+5.0>get_gametime()) {
  42. client_print(id,print_chat,"Blyskawicy mozesz uzyc raz na 5 sek.");
  43. return PLUGIN_HANDLED;
  44. }
  45. poprzednia_blyskawica[id] = floatround(get_gametime());
  46. ilosc_blyskawic[id]--;
  47.  
  48. puscBlyskawice(id, ofiara, 50.0, 0.5);
  49. }
  50. return PLUGIN_HANDLED;
  51. }
  52.  
  53. stock Create_TE_BEAMENTS(startEntity, endEntity, iSprite, startFrame, frameRate, life, width, noise, red, green, blue, alpha, speed) {
  54. message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
  55. write_byte( TE_BEAMENTS )
  56. write_short( startEntity ) // start entity
  57. write_short( endEntity ) // end entity
  58. write_short( iSprite ) // model
  59. write_byte( startFrame ) // starting frame
  60. write_byte( frameRate ) // frame rate
  61. write_byte( life ) // life
  62. write_byte( width ) // line width
  63. write_byte( noise ) // noise amplitude
  64. write_byte( red ) // red
  65. write_byte( green ) // green
  66. write_byte( blue ) // blue
  67. write_byte( alpha ) // brightness
  68. write_byte( speed ) // scroll speed
  69. message_end()
  70. }
  71. puscBlyskawice(id, ofiara, Float:fObrazenia = 55.0, Float:fCzas = 1.0){
  72. //Obrazenia
  73. new ent = create_entity("info_target");
  74. entity_set_string(ent, EV_SZ_classname, "blyskawica");
  75. ExecuteHamB(Ham_TakeDamage, ofiara, ent, id, fObrazenia, DMG_SHOCK)
  76.  
  77. remove_entity(ent);
  78.  
  79. //Piorun
  80. Create_TE_BEAMENTS(id, ofiara, sprite, 0, 10, floatround(fCzas*10), 150, 5, 200, 200, 200, 200, 10);
  81.  
  82. //Dzwiek
  83. emit_sound(id, CHAN_WEAPON, gszSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
  84. emit_sound(ofiara, CHAN_WEAPON, gszSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
  85. }
  86.  
  87.  
  88. public ResetHUD(id) {
  89. if(ima_electric[id]) {
  90. ilosc_blyskawic[id] = 3;
  91. }
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement