Advertisement
Guest User

amxx forward

a guest
Nov 9th, 2017
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.51 KB | None | 0 0
  1. /* вырезано из плагина serfreeman1337 :)
  2. вырезал Ge3eR для проброса форварда в ReHLDS
  3. */
  4.  
  5. #include <amxmodx>
  6. #include <fakemeta>
  7.  
  8. new FW_Death, dummy_ret;
  9.  
  10. public plugin_init()
  11. {
  12.     register_plugin("Death Forward", "0.1", "Ge3eR");
  13.     register_event("Damage","EventHook_Damage","b","2!0")
  14. }
  15.  
  16. #if AMXX_VERSION_NUM < 183
  17. new MaxClients;
  18.     public plugin_cfg()
  19. #else
  20.     public OnAutoConfigsBuffered()
  21. #endif
  22. {
  23.     #if AMXX_VERSION_NUM < 183
  24.     MaxClients = get_maxplayers()
  25.         // форсируем выполнение exec addons/amxmodx/configs/amxx.cfg
  26.         server_exec()
  27.     #endif
  28.  
  29.     FW_Death =  CreateMultiForward("client_death",ET_IGNORE,FP_CELL,FP_CELL,FP_CELL,FP_CELL,FP_CELL)
  30. }
  31.  
  32. //
  33. // Регистрация попадания
  34. //
  35. public EventHook_Damage(player)
  36. {
  37.     static dmg_inflictor;dmg_inflictor = pev(player,pev_dmg_inflictor)
  38.    
  39.     if(pev_valid(dmg_inflictor) != 2)
  40.     {
  41.         return PLUGIN_CONTINUE
  42.     }
  43.    
  44.     if(!(0 < dmg_inflictor <= MaxClients))
  45.     {
  46.         // урон с гранаты на данным момент не учитывается
  47.        
  48.         return PLUGIN_CONTINUE
  49.     }
  50.    
  51.     static weapon_id,last_hit,attacker
  52.     attacker = get_user_attacker(player,weapon_id,last_hit)
  53.  
  54.     if(!is_user_alive(player))
  55.     {
  56.         if(is_user_connected(attacker))
  57.         {
  58.             ExecuteForward(FW_Death,dummy_ret,attacker,player,weapon_id,last_hit,is_tk(attacker,player))
  59.         }
  60.     }
  61.    
  62.     return PLUGIN_CONTINUE
  63. }
  64.  
  65. is_tk(killer,victim)
  66. {
  67.     if(killer == victim)
  68.         return true
  69.    
  70.     return false
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement