Sorinel

VIP

Aug 5th, 2020
1,399
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include < amxmodx >
  2. #include < cstrike >
  3. #include < fakemeta >
  4. #include < hamsandwich >
  5.  
  6. #define   PLUGIN    "VIP PENTRU CATALIN"
  7. #define   VERSION   "0.1.0"
  8. #define   AUTHOR    "Sorinel"
  9.  
  10. #define   VIP_FLAG  ADMIN_LEVEL_H
  11.  
  12. #define   HS_HP           14  
  13. #define   KILL_HP         7
  14. #define   FRAG_HP_LIMIT   100
  15.  
  16. #define   HEALTH 50
  17. #define   ARMOR  50
  18.  
  19. new const vip_model_t[]  =  "vip_model_t"
  20. new const vip_model_ct[]  =  "vip_model_ct"
  21.  
  22. public plugin_init( ) {
  23.  
  24.        register_plugin( PLUGIN, VERSION, AUTHOR)
  25.        register_event("DeathMsg", "death_msg", "a", "1>0")
  26.        RegisterHam( Ham_Spawn, "player", "PlayerSpawn", 1 )
  27. }
  28.  
  29. public plugin_precache() {
  30.  
  31.     new ModelOrSoundPath[128]
  32.  
  33.     formatex(  ModelOrSoundPath,  sizeof  (  ModelOrSoundPath  )  -1, "models/player/%s/%s.mdl",  vip_model_t,  vip_model_t)
  34.     //engfunc( EngFunc_PrecacheModel, ModelOrSoundPath)
  35.  
  36.         formatex(  ModelOrSoundPath,  sizeof  (  ModelOrSoundPath  )  -1, "models/player/%s/%s.mdl",  vip_model_ct,  vip_model_ct)
  37.     //engfunc( EngFunc_PrecacheModel, ModelOrSoundPath)
  38. }
  39.  
  40. public PlayerSpawn( id ) {
  41.  
  42.        if( is_user_alive( id )  && get_user_flags( id ) & VIP_FLAG ) {
  43.  
  44.        fm_set_user_health( id, get_user_health( id ) + HEALTH )
  45.        fm_set_user_armor( id, get_user_armor( id ) + ARMOR )       
  46.        
  47.              switch( cs_get_user_team( id ) )
  48.              { 
  49.                case  CS_TEAM_T:  cs_set_user_model(  id,  vip_model_t)
  50.                case  CS_TEAM_CT: cs_set_user_model(  id,  vip_model_ct)    
  51.              }
  52.        }
  53. }
  54.  
  55. bonus_health(id, health)
  56. {
  57.     if( is_user_bot(id) )
  58.           return PLUGIN_HANDLED
  59.    
  60.     static limit
  61.     limit = FRAG_HP_LIMIT
  62.    
  63.     if( is_user_alive( id ) && get_user_flags( id ) & VIP_FLAG )
  64.     {
  65.         limit = FRAG_HP_LIMIT
  66.     }
  67.        
  68.     fm_set_user_health(id, clamp((get_user_health(id) + health), 1, limit))
  69.     return PLUGIN_HANDLED
  70. }
  71.  
  72. public death_msg()
  73. {
  74.     new killer = read_data(1)
  75.     new victim = read_data(2)
  76.         new headshot = read_data(3)
  77.  
  78.     if(killer == victim || !is_user_connected(victim) || !is_user_alive(killer))
  79.                      return PLUGIN_HANDLED
  80.  
  81.         if (headshot)
  82.         {
  83.                 bonus_health(killer, HS_HP)
  84.                
  85.                 if(is_user_alive(killer) && get_user_flags(killer) & VIP_FLAG)
  86.                 {
  87.                       fm_set_user_health(killer, get_user_health(killer) + HS_HP )
  88.                 }
  89.         }
  90.         else
  91.         {
  92.                 bonus_health(killer, KILL_HP)
  93.                
  94.                 if(is_user_alive(killer) && get_user_flags(killer) & VIP_FLAG)
  95.                 {
  96.                       fm_set_user_health(killer, get_user_health(killer) + KILL_HP )
  97.                 }
  98.         }
  99.         return PLUGIN_CONTINUE
  100. }
  101.  
  102. /* Stock-uri */
  103.  
  104. stock fm_set_user_health(id, health)
  105. {
  106.     (health > 0) ? set_pev(id, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, id)
  107.  
  108.     return 1
  109. }
  110.  
  111. stock fm_set_user_armor(index, armor) {
  112.     set_pev(index, pev_armorvalue, float(armor))
  113.  
  114.     return 1
  115. }
  116.  
  117.  
RAW Paste Data