HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <codmod>
  3. #include <fakemeta>
  4.  
  5. new const nev[] = "[ADMIN] XYZ";
  6. new const leiras[] = "ADMIN KASZT";
  7. new const fegyver = 1<<CSW_M4A1 | 1<<CSW_AK47 | 1<<CSW_AWP;
  8. new const elet = 0;
  9. new const speed = 0;
  10. new const inteligencia = 0;
  11. new const ugyesseg = 0;
  12.  
  13. new bool:admin_csoport[33];
  14. new bool:duppla_ugras[33];
  15.  
  16. new const MaxLoszer[31] = { -1, 13, -1, 10, 1, 7, 1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
  17. 10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 };
  18.  
  19. public plugin_init() {
  20. register_plugin(nev, "1.0", "QTM_Peyote");
  21.  
  22. cod_register_class(nev, leiras, fegyver, elet, speed, inteligencia, ugyesseg);
  23.  
  24. register_forward(FM_CmdStart, "CmdStart");
  25. register_event("DeathMsg", "DeathMsg", "ade");
  26. }
  27. public cod_class_enabled(id)
  28. {
  29. if(!(get_user_flags(id) & ADMIN_LEVEL_H))
  30. {
  31. client_print(id, print_chat, "[ADMIN] Ez a kaszt csak Adminoknak.")
  32. return COD_STOP;
  33. }
  34. admin_csoport[id] = true;
  35. return COD_CONTINUE;
  36. }
  37.  
  38. public cod_class_disabled(id)
  39. admin_csoport[id] = false;
  40.  
  41. public CmdStart(id, uc_handle)
  42. {
  43. if(!admin_csoport[id])
  44. return FMRES_IGNORED;
  45.  
  46. new button = get_uc(uc_handle, UC_Buttons);
  47. new oldbutton = pev(id, pev_oldbuttons);
  48. new flags = pev(id, pev_flags);
  49. if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && duppla_ugras[id])
  50. {
  51. duppla_ugras[id] = false;
  52. new Float:velocity[3];
  53. pev(id, pev_velocity, velocity);
  54. velocity[2] = random_float(265.0,285.0);
  55. set_pev(id, pev_velocity, velocity);
  56. }
  57. else if(flags & FL_ONGROUND)
  58. duppla_ugras[id] = true;
  59.  
  60. return FMRES_IGNORED;
  61. }
  62.  
  63. public DeathMsg()
  64. {
  65. new killer = read_data(1);
  66. new victim = read_data(2);
  67.  
  68. if(!is_user_connected(killer))
  69. return PLUGIN_CONTINUE;
  70.  
  71. if(admin_csoport[victim] && !admin_csoport[killer])
  72. cod_set_user_xp(killer, cod_get_user_xp(killer)+10);
  73.  
  74. if(admin_csoport[killer])
  75. {
  76. new cur_health = pev(killer, pev_health);
  77. new Float:max_health = 100.0+cod_get_user_health(killer);
  78. new Float:new_health = cur_health+20.0<max_health? cur_health+20.0: max_health;
  79. set_pev(killer, pev_health, new_health);
  80.  
  81. new weapon = get_user_weapon(killer);
  82. if(MaxLoszer[weapon] != -1)
  83. set_user_clip(killer, MaxLoszer[weapon]);
  84. }
  85.  
  86.  
  87. return PLUGIN_CONTINUE;
  88. }
  89.  
  90. stock set_user_clip(id, ammo)
  91. {
  92. new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _);
  93. get_weaponname(weapon, weaponname, 31);
  94. while ((weaponid = engfunc(EngFunc_FindEntityByString, weaponid, "classname", weaponname)) != 0)
  95. if (pev(weaponid, pev_owner) == id) {
  96. set_pdata_int(weaponid, 51, ammo, 4);
  97. return weaponid;
  98. }
  99. return 0;
  100. }
  101.  
  102.  
  103. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  104. *{\\ rtf1\\ ansi\\ ansicpg1250\\ deff0\\ deflang1038{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
  105. */
  106.