SHARE
TWEET

COD Class : Fearless Mind

MasamuneDate May 16th, 2020 (edited) 1,097 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <amxmodx>
  2. #include <engine>
  3. #include <fakemeta>
  4. #include <fun>
  5. #include <cstrike>
  6. #include <amxmisc>
  7. #include <codmod>   // Fungsi register class ada di library ini
  8. #include <colorchat>    // Color chat ada di library ini
  9. #include <hamsandwich> // Segala fungsi "Ham" ada disini
  10.  
  11. new const nazwa[]   = "Fearless Mind"// Nama class
  12. new const opis[]    = "Heal you 15% of damage dealt, additional 20% dmg"; // Deskripsi
  13. new const bronie    = 1<<CSW_AK47 | 1<<CSW_FIVESEVEN | 1<<CSW_M4A1 ; // Senjata class
  14. new const zdrowie   = 20; // Darah
  15. new const kondycja  = 10; // Speed
  16. new const inteligencja  = 0; // Int
  17. new const wytrzymalosc  = 30; // Str
  18.  
  19. new bool: ma_klase [33]; // Validator atau Flag class
  20. new player_b_vampire[33] = 0; // Variabel berapa banyak lifesteal
  21.  
  22. public plugin_init() {
  23.     register_plugin(nazwa, "1.0", "MasamuneDate"); // Register plugin
  24.     cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc); // Fungsi register class
  25.     register_event("Damage", "Damage", "b", "2!0")
  26. }
  27.  
  28. public cod_class_enabled(id){ // Class enable, denga ID adalah id player kita
  29.     ma_klase[id] = true; // Class enable = True
  30.     ColorChat(id, GREEN, "Created by MasamuneDate", nazwa); // Kasih message di chat
  31.     player_b_vampire[id] = 20;   // Lifesteal amount
  32. }
  33.  
  34. public cod_class_disabled(id){
  35.     player_b_vampire[id] = 0; // No lifesteal, atau di disable
  36.     ma_klase[id] = false; // Class false
  37. }  
  38.  
  39. public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
  40. {
  41.     if(!is_user_connected(idattacker)) // Kalo user ga konek, ignore fungsi ham ini
  42.         return HAM_IGNORED;
  43.    
  44.     if(!ma_klase[idattacker])
  45.         cod_inflict_damage(idattacker, this, damage*0.2, 0.0, idinflictor, damagebits); // Damage *0.2, artinya dia kasi extra 20% dmg
  46.        
  47.     return HAM_IGNORED;
  48. }
  49.  
  50. public Damage(id){
  51.     if (is_user_connected(id)){ // Kalo user konek
  52.         new damage = read_data(2)
  53.         new weapon
  54.         new bodypart
  55.         new attacker_id = get_user_attacker(id,weapon,bodypart)
  56.         if (is_user_connected(attacker_id) && attacker_id != id)
  57.         add_vampire_bonus(id,damage,attacker_id)
  58.     }
  59. }
  60.  
  61. public add_vampire_bonus(id,damage,attacker_id){ // Heal lifesteal
  62.    
  63.     if (player_b_vampire[attacker_id] > 0){
  64.         new maxhealth = 100+cod_get_user_health(attacker_id,1,1,1)
  65.         if (get_user_health(attacker_id)+player_b_vampire[attacker_id] <= maxhealth){
  66.            
  67.             set_user_health(attacker_id,get_user_health(attacker_id)+player_b_vampire[attacker_id])
  68.         }
  69.         else{
  70.             set_user_health(attacker_id,maxhealth)
  71.         }
  72.     }
  73. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top