HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #define DEFAULT_KILL_MONEY 200 // Alap kill pénz
  2.  
  3. #include <amxmodx>
  4. #include <reapi>
  5.  
  6. #define IsPlayer(%1) (1 <= %1 <= g_iMaxPlayers)
  7.  
  8. new g_iMaxPlayers, g_iRoundKills[MAX_CLIENTS + 1], HookChain:g_hAddAccount
  9.  
  10.  
  11. public plugin_init()
  12. {
  13. register_plugin("Többszörös Pénz", "0.0.2", "Vaqtincha")
  14.  
  15. RegisterHookChain(RG_CSGameRules_RestartRound, "CSGameRules_RestartRound", .post = true)
  16. RegisterHookChain(RG_CSGameRules_PlayerKilled, "CSGameRules_PlayerKilled", .post = false)
  17. DisableHookChain(g_hAddAccount = RegisterHookChain(RG_CBasePlayer_AddAccount, "CBasePlayer_AddAccount", .post = false))
  18.  
  19. g_iMaxPlayers = get_maxplayers()
  20. }
  21.  
  22. public client_putinserver(pPlayer) {
  23. g_iRoundKills[pPlayer] = 0
  24. }
  25.  
  26. public CSGameRules_RestartRound() {
  27. arrayset(g_iRoundKills, 0, sizeof(g_iRoundKills))
  28. }
  29.  
  30. public CSGameRules_PlayerKilled(const pVictim, const pevKiller, const pevInflictor)
  31. {
  32. if(IsPlayer(pevKiller) && pVictim != pevKiller)
  33. {
  34. g_iRoundKills[pevKiller]++
  35. EnableHookChain(g_hAddAccount)
  36. }
  37.  
  38. g_iRoundKills[pVictim] = 0
  39. }
  40.  
  41. public CBasePlayer_AddAccount(const pPlayer, const iAmount, const RewardType:type, bool:bTrackChange)
  42. {
  43. DisableHookChain(g_hAddAccount)
  44.  
  45. if(type == RT_ENEMY_KILLED && g_iRoundKills[pPlayer] > 0) {
  46. server_print("Jutalom %i", (DEFAULT_KILL_MONEY * g_iRoundKills[pPlayer]))
  47. SetHookChainArg(2, ATYPE_INTEGER, (DEFAULT_KILL_MONEY * g_iRoundKills[pPlayer]))
  48. }
  49. }
  50.  
  51.  
  52.