Advertisement
MasamuneDate

Cod Class

Mar 28th, 2018
626
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.62 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <codmod>
  4.  
  5. #define PLUGIN "Child Of Light"
  6. #define VERSION "1.0"
  7. #define AUTHOR "MasamuneDate"
  8.  
  9. new bool:ma_klase[33];
  10.  
  11. new const nazwa[] = "Child Of Light";
  12. new const opis[] = "1/10 chance to blinding the enemy";
  13. new const bronie = 1<<CSW_P90| 1<<CSW_USP ;
  14. new const zdrowie = 30;
  15. new const kondycja = 0;
  16. new const inteligencja = 0;
  17. new const wytrzymalosc = 15;
  18.  
  19. new g_msg_screenfade;
  20.  
  21. public plugin_init()
  22. {
  23.     register_plugin(PLUGIN, VERSION, AUTHOR);
  24.     register_event("Damage", "Damage", "b", "2!=0");
  25.     cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
  26.     g_msg_screenfade = get_user_msgid("ScreenFade");
  27. }
  28.  
  29. public cod_class_enabled(id)
  30. {
  31.     ma_klase[id] = true;
  32. }
  33.  
  34. public cod_class_disabled(id)
  35. {
  36.     ma_klase[id] = false;
  37. }
  38.  
  39. public Damage(id)
  40. {
  41.     new attacker = get_user_attacker(id);
  42.     if(!is_user_alive(attacker) || !is_user_connected(attacker) || id == attacker)
  43.        
  44.     return PLUGIN_CONTINUE;
  45.    
  46.     if(ma_klase[attacker] && random(8) == 1)
  47.         Display_Fade(id,1<<14,1<<14 ,1<<16,255,155,50,230);
  48.  
  49.     return PLUGIN_CONTINUE;
  50. }
  51.  
  52. stock Display_Fade(id,duration,holdtime,fadetype,red,green,blue,alpha)
  53. {
  54.     message_begin( MSG_ONE, g_msg_screenfade,{0,0,0},id );
  55.     write_short( duration );    // Duration of fadeout
  56.     write_short( holdtime );    // Hold time of color
  57.     write_short( fadetype );    // Fade type
  58.     write_byte ( red );        // Red
  59.     write_byte ( green );        // Green
  60.     write_byte ( blue );        // Blue
  61.     write_byte ( alpha );    // Alpha
  62.     message_end();
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement