hlmod.hu
https://hlmod.hu/

ReAPI - Multiplication Kill Money
https://hlmod.hu/viewtopic.php?f=134&t=27967
Oldal: 1 / 1

Szerző:  theglorious [ 2017.07.18. 17:51 ]
Hozzászólás témája:  ReAPI - Multiplication Kill Money

ReAPI - Multiplication Kill Money
Leírás:
  • A plugin megszorozza az alap ölés pénzt a játékos öléseivel, új körnél nullázódik.
Példa:
  • 1 ölésnél 200 dollárt kapunk
  • 2 ölésnél a 200 (alap) dollár 2 szeresét, tehát 400-at
  • 4 ölésnél a 200 (alap) dollár 4 szeresét, tehát 800-at
Beállítás:
  1. #define DEFAULT_KILL_MONEY 200 // Alap kill pénz
Verzió:
  • v0.0.2
Követelmények:
  • ReHLDS
  • ReGameDLL
  • ReAPI
Kompatibilis:
  • Amx Mod X 1.8.2
  • (Re) Amx Mod X 1.8.3-dev
Eredeti link:
Készítő:
  • Vaqtincha
Plugin:
  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("Multiplication Kill Money", "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. }

Oldal: 1 / 1 Minden időpont UTC+01:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/