Участник
Пользователь
- Сообщения
- 271
- Реакции
- 43
- Помог
- 5 раз(а)
- Ошибка
-
score reset on next round
- ОС
- Linux
- Amx Mod X
-
AMX Mod X 1.10.0.5384 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Oct 21 2019 02:50:07
Built from: https://github.com/alliedmodders/amxmodx/commit/5120dea
Build ID: 5384:5120dea
Core mode: JIT+ASM32
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.7.0.693-dev
Build date: 18:20:58 Jan 28 2020 (2117)
Build from: https://github.com/dreamstalker/rehlds/commit/c4cecf5
- ReGamedll
-
ReGameDLL version: 5.13.0.447-dev+m
Build date: 18:11:04 Jan 15 2020
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/2eba3b1
- Версия Metamod
-
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
- Список метамодулей
-
[ 1] Reunion RUN - reunion_mm_i386.so v0.1.0.135 ini Start Never
[ 2] AMX Mod X RUN - amxmodx_mm_i386.so v1.10.0.5384 ini Start ANY
[ 3] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 4] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 5] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 6] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 7] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 8] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC4 ini ANY ANY
[ 9] Ultimate Unprecacher RUN - unprecacher_i386.so vBeta 2.5.3 ini Chlvl Chlvl
[10] ReAPI RUN - reapi_amxx_i386.so v5.12.0.192-dev pl2 ANY Never
[11] MySQL RUN - mysql_amxx_i386.so v1.10.0.5384 pl2 ANY ANY
[12] FakeMeta RUN - fakemeta_amxx_i386.so v1.10.0.5384 pl2 ANY ANY
[13] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.10.0.5384 pl2 ANY ANY
[14] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl2 ANY Never
[15] CStrike RUN - cstrike_amxx_i386.so v1.10.0.5384 pl2 ANY ANY
[16] CSX RUN - csx_amxx_i386.so v1.10.0.5384 pl2 ANY ANY
[17] Engine RUN - engine_amxx_i386.so v1.10.0.5384 pl2 ANY ANY
[18] Fun RUN - fun_amxx_i386.so v1.10.0.5384 pl2 ANY ANY
- Список плагинов
-
Currently loaded plugins:
name version author file status
[ 1] Admin Loader 3.5 neygomon admin_loader_3_ running
[ 2] FreshBans 1.4.3b kanagava fresh_bans_143_ running
[ 3] Ban Sound: Fresh Bans 1.1 Leo_[BH] fb_ban_sound_fi running
[ 4] DopBan 3.0.3b kanagava dop_ban303_.amx running
[ 5] fb_forwards 0.3 kanagava + Spiel fb_fowards.amxx debug
[ 6] Fake Ping 1.1 MeRcyLeZZ/gyxoBk FakePing.amxx running
[ 7] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 8] Ultimate Chats Control 5.2(c) neygomon ucc2.amxx running
[ 9] Advert Messages 1.22 neygomon adverts.amxx running
[ 10] Anti DD Scroll Test Test Anti_Scroll.amx running
[ 11] Admin Commands 1.10.0.525 AMXX Dev Team admincmd.amxx running
[ 12] Multi-Lingual System 1.10.0.525 AMXX Dev Team multilingual.am running
[ 13] Menus Front-End 1.9.0.5232 AMXX Dev Team menufrontv2_cli running
[ 14] Commands Menu 1.10.0.525 AMXX Dev Team cmdmenu.amxx running
[ 15] Players Menu 1.10.0.525 AMXX Dev Team plmenu.amxx running
[ 16] Maps Menu 1.10.0.525 AMXX Dev Team mapsmenu.amxx running
[ 17] Admin Chat 1.10.0.525 AMXX Dev Team adminchat.amxx running
[ 18] Anti Flood 1.10.0.525 AMXX Dev Team antiflood.amxx running
[ 19] Admin Votes 1.10.0.525 AMXX Dev Team adminvote.amxx running
[ 20] Stats Configuration 1.10.0.525 AMXX Dev Team statscfg.amxx running
[ 21] HLstatsX CE Ingame Plu 1.6.19 (HL psychonic hlstatsx_comman running
[ 22] Supply Crates 2.0 TBagT supply_box.amxx running
[ 23] TutorText 0.0.1 ConnorMcLeod cztutors.amxx running
[ 24] Global Offensive 4.82 Psychical rcsgo_rest_murz debug
[ 25] Items Restrict 1.0 s1lent items_restrict. running
[ 26] [ReAPI] resetscore 1.0 Phantom resetscore.amxx running
[ 27] Bullet Damage 0.0.1 ConnorMcLeod bullet_damage.a running
[ 28] Demo Recorder 2.4.1 F@nt0M demo_recorder.a running
[ 29] [ReAPI] No Team Flash 0.0.3 Vaqtincha no_team_flash.a running
[ 30] unknown unknown unknown sub_models_2.am running
[ 31] C4 Timer on roundtime 0.3.3a neygomon c4timer.amxx running
[ 32] [ReAPI] Block 'Fire in 0.0.1 sergrib reapi_block_FIT running
[ 33] [ReAPI] Parachute 1.1 ReHLDS Team parasiutas.amxx running
[ 34] AFK Control ReNew 1.2(a) neygomon afk_control.amx running
[ 35] Advanced Kill Assists 1.0 Xelson next21_kill_ass debug
[ 36] Christmas hat 0.3 AMXX.Shop christmas_hat_r running
[ 37] unknown unknown unknown csteam_bonus_a2 debug
[ 38] Lite Admin ESP 1.1 neygomon, AcE admin_esp.amxx running
[ 39] World Model Group 1.1 w0w world_model_gro running
[ 40] [ReAPI] Anti overflow 3.1 mazdan & Inline, antir.amxx running
[ 41] Map Manager: Core 3.0.4 Mistrick map_manager_cor running
[ 42] Map Manager: Scheduler 0.1.3 Mistrick map_manager_sch running
[ 43] Map Manager: Rtv 0.1.0 Mistrick map_manager_rtv running
[ 44] Map Manager: BlockList 0.0.3 Mistrick map_manager_blo running
[ 45] Map Manager: Effects 0.0.9 Mistrick map_manager_eff running
[ 46] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 47] [ReVIP] System Core 2.5 full pUzzlik re_vip_core.amx running
[ 48] [ReVIP] Menu 2.5 full pUzzlik re_vipmenu_fix3 running
[ 49] [ReVIP] Add HP 2.3 free pUzzlik re_vip_hp_add.a running
49 plugins, 49 running
- Автор плагина
- Xelson
- Версия плагина
- 1.0
- Исходный код
-
#include <amxmodx>
#include <reapi>
#define FRAGS_FOR_ASSIST /* Объявите, чтобы игроку, оказавшему помощь в убийстве, зачислялся фраг. */
#define MONEY_FOR_ASSIST 100 /* Сколько денег платить игроку, совершившему помощь в убийстве. Оплата произойдет только если указано значение больше нуля. */
#define DAMAGE_FOR_ASSIST 30.0
#define ASSIST_ALGORITHM ADVANCED /* Алгоритм для определения помощников в убийтве. По-умолчанию используется ADVANCED.
CSSTATSX — эквивалентный CSstatsX алгоритм учёта помощи по убийствам с использованием соответствующего квара. Алгоритм выбирает такого игрока, который
нанес больше всего ущерба жертве и не менее допустимого значения, определяемое кваром csstats_sql_assisthp из CSstatsX либо параметром DAMAGE_FOR_ASSIST.
Если CSstatsX не установлен, то для просчётов используется значение DAMAGE_FOR_ASSIST.
ADVANCED — улучшенная и более справедливая формула, которая выбирает из ряда других ассистентов такого, кто больше всего нанес урона
жертве и чей процент урона от общего ущерба от всех составляет не менее DAMAGE_FOR_ASSIST процентов. Этот алгоритм не синхронизируется
с CSstatsX, что может повлечь к неучёту их в статистике. */
#define NAMES_LENGTH 28
#define is_user_valid(%0) (0 < %0 && %0 < g_iMaxPlayers)
#if AMXX_VERSION_NUM < 183
#define client_disconnected client_disconnect
#endif
#if REAPI_VERSION < 52121
#error This plugin supports ReAPI >=5.2.0.121
#endif
//#define DEBUG
enum
{
CSSTATSX,
ADVANCED
}
enum _:PLAYER_DATA
{
CONNECTED,
DAMAGE_ON[33],
Float:DAMAGE_ON_TIME[33],
NAME[32]
}
new g_ePlayerData[33][PLAYER_DATA], g_iMaxPlayers, g_iMsgScoreInfo
new HookChain:g_pSV_WriteFullClientUpdate, HookChain:g_pCBasePlayer_Killed_Post, g_szDeathString[32], g_iAssistKiller
#if ASSIST_ALGORITHM == CSSTATSX
new g_pCvarAssistHp
#endif
public plugin_init()
{
register_plugin("Advanced Kill Assists", "1.0", "Xelson")
RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_Spawn_Post", true)
RegisterHookChain(RG_CBasePlayer_Killed, "CBasePlayer_Killed_Pre", false)
RegisterHookChain(RG_CBasePlayer_TakeDamage, "CBasePlayer_TakeDamage_Pre", false)
DisableHookChain((g_pCBasePlayer_Killed_Post = RegisterHookChain(RG_CBasePlayer_Killed, "CBasePlayer_Killed_Post", true)))
DisableHookChain((g_pSV_WriteFullClientUpdate = RegisterHookChain(RH_SV_WriteFullClientUpdate, "SV_WriteFullClientUpdate", false)))
register_message(get_user_msgid("DeathMsg"), "Message_DeathMsg")
#if defined DEBUG
register_clcmd("assist", "ClCmd_Assist")
#endif
#if ASSIST_ALGORITHM == CSSTATSX
g_pCvarAssistHp = get_cvar_pointer("csstats_sql_assisthp")
#endif
g_iMsgScoreInfo = get_user_msgid("ScoreInfo")
g_iMaxPlayers = get_maxplayers() + 1
}
public client_infochanged(id)
{
get_user_info(id, "name", g_ePlayerData[id][NAME], charsmax(g_ePlayerData[][NAME]))
}
public client_putinserver(id)
{
g_ePlayerData[id][CONNECTED] = true
}
public client_disconnected(id)
{
g_ePlayerData[id][CONNECTED] = false
arrayset(g_ePlayerData[id][DAMAGE_ON], 0, sizeof g_ePlayerData[][DAMAGE_ON])
}
public CBasePlayer_Spawn_Post(id)
{
arrayset(g_ePlayerData[id][DAMAGE_ON], 0, sizeof g_ePlayerData[][DAMAGE_ON])
}
public CBasePlayer_TakeDamage_Pre(iVictim, iWeapon, iAttacker, Float:fDamage)
{
if(is_user_valid(iAttacker) && iVictim != iAttacker && rg_is_player_can_takedamage(iVictim, iAttacker))
{
#if ASSIST_ALGORITHM == ADVANCED
new Float:fHealth; get_entvar(iVictim, var_health, fHealth)
if(fDamage > fHealth) fDamage = fHealth
#endif
g_ePlayerData[iAttacker][DAMAGE_ON][iVictim] += floatround(fDamage)
g_ePlayerData[iAttacker][DAMAGE_ON_TIME][iVictim] = get_gametime()
}
}
public CBasePlayer_Killed_Pre(iVictim, iKiller)
{
new iAssistant, iMaxDamage
#if ASSIST_ALGORITHM == ADVANCED
new iTotalDamage
for(new id = 1; id < g_iMaxPlayers; id++)
{
if(g_ePlayerData[id][CONNECTED])
{
if(id != iKiller && g_ePlayerData[id][DAMAGE_ON][iVictim] > 0)
{
if(g_ePlayerData[id][DAMAGE_ON][iVictim] > iMaxDamage)
{
iAssistant = id
iMaxDamage = g_ePlayerData[id][DAMAGE_ON][iVictim]
}
else if(g_ePlayerData[id][DAMAGE_ON][iVictim] == iMaxDamage)
iAssistant = g_ePlayerData[id][DAMAGE_ON_TIME][iVictim] > g_ePlayerData[iAssistant][DAMAGE_ON_TIME][iVictim] ? id : iAssistant
}
iTotalDamage += g_ePlayerData[id][DAMAGE_ON][iVictim]
}
}
if((float(iMaxDamage) / float(iTotalDamage)) * 100.0 < DAMAGE_FOR_ASSIST) iAssistant = 0
#elseif ASSIST_ALGORITHM == CSSTATSX
new iNeedDamage = g_pCvarAssistHp ? get_pcvar_num(g_pCvarAssistHp) : floatround(DAMAGE_FOR_ASSIST)
for(new id = 1; id < g_iMaxPlayers; id++)
{
if(g_ePlayerData[id][CONNECTED] && id != iKiller && g_ePlayerData[id][DAMAGE_ON][iVictim] > iMaxDamage)
{
if(g_ePlayerData[id][DAMAGE_ON][iVictim] > iNeedDamage)
{
iAssistant = id
iMaxDamage = g_ePlayerData[id][DAMAGE_ON][iVictim]
}
else if(g_ePlayerData[id][DAMAGE_ON][iVictim] == iNeedDamage)
iAssistant = g_ePlayerData[id][DAMAGE_ON_TIME][iVictim] > g_ePlayerData[iAssistant][DAMAGE_ON_TIME][iVictim] ? id : iAssistant
}
}
#endif
if(!iAssistant || iKiller == iVictim) return HC_CONTINUE
new szName[2][32], iLen[2], iExcess
copy(szName[1], charsmax(szName[]), g_ePlayerData[iAssistant][NAME])
iLen[1] = strlen(szName[1])
EnableHookChain(g_pSV_WriteFullClientUpdate)
if(!is_user_valid(iKiller) && g_ePlayerData[iAssistant][CONNECTED])
{
static const szWorldName[] = "world"
iExcess = iLen[1] - NAMES_LENGTH - (sizeof szWorldName)
if(iExcess > 0) strclip(szName[1], iExcess)
formatex(g_szDeathString, charsmax(g_szDeathString), "%s + %s", szWorldName, szName[1])
g_iAssistKiller = iAssistant
rh_update_user_info(iAssistant)
}
else
{
g_ePlayerData[iKiller][DAMAGE_ON][iVictim] = 0
copy(szName[0], charsmax(szName[]), g_ePlayerData[iKiller][NAME])
iLen[0] = strlen(szName[0])
new iLenSum = (iLen[0] + iLen[1])
iExcess = iLenSum - NAMES_LENGTH
if(iExcess > 0)
{
new iLongest = iLen[0] > iLen[1] ? 0 : 1
new iShortest = iLongest == 1 ? 0 : 1
if(float(iExcess) / float(iLen[iLongest]) > 0.60)
{
new iNewLongest = floatround(float(iLen[iLongest]) / float(iLenSum) * float(iExcess))
strclip(szName[iLongest], iNewLongest)
strclip(szName[iShortest], iExcess - iNewLongest)
}
else strclip(szName[iLongest], iExcess)
}
formatex(g_szDeathString, charsmax(g_szDeathString), "%s + %s", szName[0], szName[1])
g_iAssistKiller = iKiller
rh_update_user_info(g_iAssistKiller)
}
if(g_ePlayerData[iAssistant][CONNECTED])
{
g_ePlayerData[iAssistant][DAMAGE_ON][iVictim] = 0
#if MONEY_FOR_ASSIST > 0
rg_add_account(iAssistant, MONEY_FOR_ASSIST)
#endif
#if defined FRAGS_FOR_ASSIST
set_entvar(iAssistant, var_frags, get_entvar(iAssistant, var_frags) + 1)
message_begin(MSG_ALL, g_iMsgScoreInfo)
write_byte(iAssistant)
write_short(get_entvar(iAssistant, var_frags))
write_short(get_member(iAssistant, m_iDeaths))
write_short(0)
write_short(get_member(iAssistant, m_iTeam))
message_end()
#endif
}
EnableHookChain(g_pCBasePlayer_Killed_Post)
return HC_CONTINUE
}
public SV_WriteFullClientUpdate(id, pBuffer)
{
if(id == g_iAssistKiller)
set_key_value(pBuffer, "name", g_szDeathString)
}
public Message_DeathMsg()
{
new iWorld = get_msg_arg_int(1)
if(iWorld == 0 && g_iAssistKiller)
set_msg_arg_int(1, ARG_BYTE, g_iAssistKiller)
}
public CBasePlayer_Killed_Post(iVictim, iKiller)
{
DisableHookChain(g_pCBasePlayer_Killed_Post)
new iAssistKiller = g_iAssistKiller; g_iAssistKiller = 0
rh_update_user_info(iAssistKiller)
}
strclip(szString[], iClip, szEnding[] = "..")
{
new iLen = strlen(szString) - 1 - strlen(szEnding) - iClip
format(szString[iLen], iLen, szEnding)
}
#if defined DEBUG
#include <hamsandwich>
public ClCmd_Assist()
{
new id[3], szArg[64]
for(new i; i < 3; i++)
{
read_argv(i + 1, szArg, charsmax(szArg))
id[i] = str_to_num(szArg)
}
g_ePlayerData[id[1]][DAMAGE_ON][id[2]] = 100
ExecuteHamB(Ham_Killed, id[2], id[0], 0)
ExecuteHamB(Ham_CS_RoundRespawn, id[2])
}
#endif
why on next round frag for assist is removed from score
В этой теме было размещено решение! Перейти к решению.