Проверенный
Участник
- Сообщения
- 2,288
- Реакции
- 1,739
- Помог
- 31 раз(а)
Основная информация
Проблема: Некорректный подсчет урона ассиста
Ошибка:
Amx Mod X: ReAMXX
Билд:
ReGamedll:
Список модулей:
Список плагинов:
Список метамодулей:
Исходник:
Комментарий:
Дают ассиста, даже при нанесении 11хп урона.
Проблема: Некорректный подсчет урона ассиста
Ошибка:
Дополнительная информацияДают ассиста за нанесение меньшего урона, чем убийца
Amx Mod X: ReAMXX
Билд:
Код:
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.3.0.605-dev
Build date: 22:55:56 Nov 8 2017 (1306)
Build from: https://github.com/dreamstalker/rehlds/commit/dab2663
ReGamedll:
Код:
ReGameDLL version: 5.3.0.269-dev
Build date: 22:20:07 Nov 12 2017
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/411761c
Список модулей:
PHP:
Currently loaded modules:
name version author status
[ 1] MySQL 1.8.3-Re AMX Mod X Dev Team running
[ 2] dummy_csx 1.0 AGHL.RU Dev Team running
[ 3] ReAimDetector 0.2.0 ReHLDS Team running
[ 4] FakeMeta 1.8.3-Re AMX Mod X Dev Team running
[ 5] Ham Sandwich 1.8.3-Re AMX Mod X Dev Team running
[ 6] ReAPI 5.2.0.139- Asmodai & s1lent running
[ 7] Engine 1.8.3-Re AMX Mod X Dev Team running
[ 8] CStrike 1.8.3-Re AMX Mod X Dev Team running
[ 9] nVault 1.8.3-Re AMX Mod X Dev Team running
[10] Sockets 1.8.3-Re HLSW Dev Team running
[11] Sockets2 1.8.1.3746 HLSW Dev Team running
11 modules, 11 correct
Список плагинов:
HTML:
[ReAPI] KiLL Assist poka_4to_b PRoSToTeM@ Kill_assist_rea running
Список метамодулей:
PHP:
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] Reunion RUN - reunion_mm_i386.so v0.1.75 ini Start Never
[ 2] WHBlocker RUN - whblocker_mm_i386.so v1.5.692 ini Chlvl ANY
[ 3] AMX Mod X RUN - amxmodx_mm_i386.so v1.8.3-Re ini Start ANY
[ 4] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC3 ini ANY ANY
[ 5] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 6] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 7] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 8] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 9] MySQL RUN - mysql_amxx_i386.so v1.8.3-Re pl3 ANY ANY
[10] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.0 pl3 ANY Never
[11] FakeMeta RUN - fakemeta_amxx_i386.so v1.8.3-Re pl3 ANY ANY
[12] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.8.3-Re pl3 ANY ANY
[13] ReAPI RUN - reapi_amxx_i386.so v5.2.0.139-dev pl3 ANY Never
[14] Engine RUN - engine_amxx_i386.so v1.8.3-Re pl3 ANY ANY
[15] CStrike RUN - cstrike_amxx_i386.so v1.8.3-Re pl3 ANY ANY
15 plugins, 15 running
Исходник:
Код:
#include <amxmodx>
#include <reapi>
#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif
#define MONEY 300 // Выдавать $$
#define FRAG // +1 фраг
//#define SUPPORT_CSSTATS_MYSQL // Защитать фраг в статистику плагина от скальпеля
#define SUPPORT_AES_EXP // Выдавать опыт
#if !defined MAX_PLAYERS
const MAX_PLAYERS = 32;
#endif
#if !defined MAX_NAME_SIZE
const MAX_NAME_SIZE = 32;
#endif
#if defined SUPPORT_CSSTATS_MYSQL
native csstats_set_user_value(index, ident, value);
native csstats_get_user_value(index, ident);
#endif
#if defined SUPPORT_AES_EXP
native aes_add_player_exp(id,exp,override = 0);
#endif
// who's whom
new Float:g_playerDamage[MAX_PLAYERS + 1][MAX_PLAYERS + 1];
new HookChain:g_deathNoticePostHook;
public plugin_init() {
register_plugin("[ReAPI] KiLL Assist", "poka_4to_beta", "PRoSToTeM@"); // edited by neugomon
// if(!is_regamedll() || !is_rehlds())
// set_fail_state("Needs CS ReGameDLL and ReHLDS");
RegisterHookChain(RG_CBasePlayer_Spawn, "OnPlayerSpawn_Post", true);
RegisterHookChain(RG_CBasePlayer_TakeDamage, "OnPlayerTakeDamage_Post", true);
RegisterHookChain(RG_CSGameRules_DeathNotice, "OnDeathNotice", false);
DisableHookChain((g_deathNoticePostHook = RegisterHookChain(RG_CSGameRules_DeathNotice, "OnDeathNotice_Post", true)));
}
public client_connect(playerEntIndex)
arrayset(_:g_playerDamage[playerEntIndex], 0, sizeof(g_playerDamage[]));
public OnPlayerSpawn_Post(playerEntIndex)
for(new i = 1; i <= MAX_PLAYERS; i++)
g_playerDamage[playerEntIndex] = 0.0;
public OnPlayerTakeDamage_Post(playerEntIndex, inflictorEntIndex, attackerEntIndex, Float:damage, damageType)
{
if(
attackerEntIndex != playerEntIndex &&
is_user_connected(attackerEntIndex) &&
rg_is_player_can_takedamage(attackerEntIndex, playerEntIndex)
) g_playerDamage[attackerEntIndex][playerEntIndex] += damage;
}
public OnDeathNotice(victimEntIndex, killerEntIndex, inflictorEntIndex)
{
if(
killerEntIndex != victimEntIndex &&
is_user_connected(killerEntIndex) &&
rg_is_player_can_takedamage(killerEntIndex, victimEntIndex)
)
{
new bestAttackerEntIndex = 0;
for (new i = 1, Float:maxDamage; i <= MAX_PLAYERS; i++) {
if (g_playerDamage[victimEntIndex] > maxDamage) {
maxDamage = g_playerDamage[victimEntIndex];
bestAttackerEntIndex = i;
}
}
// Assistant must have more damage than killer
if(
bestAttackerEntIndex != killerEntIndex &&
is_user_connected(bestAttackerEntIndex) &&
rg_is_player_can_takedamage(bestAttackerEntIndex, victimEntIndex) &&
get_member(bestAttackerEntIndex, m_iTeam) != TEAM_SPECTATOR
)
{
new name1[MAX_NAME_SIZE], name2[MAX_NAME_SIZE], name3[MAX_NAME_SIZE], name[MAX_NAME_SIZE];
get_entvar(killerEntIndex, var_netname, name1, charsmax(name1));
get_entvar(bestAttackerEntIndex, var_netname, name2, charsmax(name2));
get_entvar(victimEntIndex, var_netname, name3, charsmax(name3));
#if defined MONEY
rg_add_account(bestAttackerEntIndex, MONEY);
#endif
#if defined FRAG
set_entvar(bestAttackerEntIndex, var_frags, Float:get_entvar(bestAttackerEntIndex, var_frags) + 1.0);
#endif
#if defined SUPPORT_CSSTATS_MYSQL
csstats_set_user_value(bestAttackerEntIndex, 0, csstats_get_user_value(bestAttackerEntIndex, 0) + 1);
#endif
#if defined SUPPORT_AES_EXP
aes_add_player_exp(bestAttackerEntIndex, 1);
#endif
// TODO: cut nicknames if big length (> 14) and add ...
// TODO: UTF-8 cut correctly
if(strlen(name1) + strlen(name2) > 28) {
formatex(name, charsmax(name), "%.14s + %.14s", name1, name2);
} else {
formatex(name, charsmax(name), "%s + %s", name1, name2);
}
client_print_color(bestAttackerEntIndex, 0, "^1* Вы помогли ^3%s ^1убить ^3%s ^1.Ваш бонус -^4 1 фраг ^1+^4 1 опыт ^1+ ^4%d$", name1, name3, MONEY);
message_begin(MSG_ALL, SVC_UPDATEUSERINFO);
write_byte(killerEntIndex - 1);
write_long(get_user_userid(killerEntIndex));
write_char('\');
write_char('n');
write_char('a');
write_char('m');
write_char('e');
write_char('\');
write_string(name);
for(new i = 0; i < 16; i++)
write_byte(0);
message_end();
EnableHookChain(g_deathNoticePostHook);
}
}
}
public OnDeathNotice_Post(victimEntIndex, killerEntIndex, inflictorEntIndex)
{
rh_update_user_info(killerEntIndex);
DisableHookChain(g_deathNoticePostHook);
}
Комментарий:
Дают ассиста, даже при нанесении 11хп урона.
Вложения
-
4.5 KB Просмотры: 605