Участник
Пользователь
- Сообщения
- 57
- Реакции
- 5
- Ошибка
-
Неверная информация по урону.
- ОС
- Linux
- Amx Mod X
-
amxx version
AMX Mod X 1.10.0.5435 (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: Aug 7 2021 08:32:30
Built from: https://github.com/alliedmodders/amxmodx/commit/36d5aa9
Build ID: 5435:36d5aa9
Core mode: JIT+ASM32
- Билд
-
version
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.13.0.788-dev
Build date: 07:36:33 Jul 12 2023 (3378)
Build from: https://github.com/dreamstalker/rehlds/commit/f955b07
- ReGamedll
-
game version
ReGameDLL version: 5.26.0.668-dev
Build date: 19:02:48 Dec 31 2023
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/d3c0ec8
- Версия Metamod
-
meta version
Metamod-r v1.3.0.131, API (5:13)
Metamod-r build: 18:51:02 Jul 11 2022
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/adc9414
- Список метамодулей
-
meta list
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] AMX Mod X RUN - amxmodx.so v1.10.0.5435 ini Start ANY
[ 2] ReAuthCheck fail - reauthcheck.so v0.1.6 ini Start Never
[ 3] Reunion RUN - reunion.so v0.1.92d ini Start Never
[ 4] Revoice RUN - revoice.so v0.1.0.34 ini Start Never
[ 5] HitBox Fix RUN - hitbox_fix.so v1.1.2 ini Start ANY
[ 6] CStrike RUN - cstrike_amxx_i386.so v1.10.0.5435 pl1 ANY ANY
[ 7] CSX RUN - csx_amxx_i386.so v1.10.0.5435 pl1 ANY ANY
[ 8] ReAPI RUN - reapi_amxx_i386.so v5.24.0.300-dev pl1 ANY Never
[ 9] FakeMeta RUN - fakemeta_amxx_i386.so v1.10.0.5435 pl1 ANY ANY
[10] MySQL RUN - mysql_amxx_i386.so v1.10.0.5435 pl1 ANY ANY
10 plugins, 9 running
- Список плагинов
-
amxx list
Currently loaded plugins:
id name version author url file status
[ 1] 0 Admin Loader 3.5 neygomon unknown admin_loade running
[ 2] 1 FreshBans 1.4.8b kanagava unknown fresh_bans. running
[ 3] 2 Admin Chat 1.10.0.543 AMXX Dev Team adminchat.a running
[ 4] 3 Admin Commands 1.10.0.543 AMXX Dev Team admincmd.am running
[ 5] 4 Commands Menu 1.10.0.543 AMXX Dev Team cmdmenu.amx running
[ 6] 5 Menus Front-End 1.10.0.543 AMXX Dev Team menufront.a running
[ 7] 6 Maps Menu 1.10.0.543 AMXX Dev Team mapsmenu.am running
[ 8] 7 Players Menu 1.10.0.543 AMXX Dev Team plmenu.amxx running
[ 9] 8 Restrict Weapons 1.10.0.543 AMXX Dev Team restmenu.am running
[ 10] 9 GameInfo 1.2 b0t. unknown 1.amxx running
10 plugins, 10 running
- Автор плагина
- b0t.
- Версия плагина
- 1.2
- Исходный код
-
#include <amxmodx>
#include <reapi>
//new const g_szIP[] = "185.248.103.12:15555";
#define MAX_DMG_100 //Максимальный нанёсённый урон по одному противнику = 100.
#define SHOT_A_GRENADE //Засчитывать урон от гранаты за попадание.
#define MAXPLAYERS 11 //Максимальное количество слотов на сервере
enum any: DATA {
Demage,
Shot
};
new
e_InfoClient[DATA][MAXPLAYERS +1],
bool:b_Chat;
public plugin_init() {
register_plugin("GameInfo", "1.2", "b0t.");
RegisterHookChain(RG_CBasePlayer_TakeDamage, "RG_CBasePlayerTakeDamage_Post", 1);
RegisterHookChain(RG_RoundEnd,"RG_RoundEnd_Post", 1);
register_clcmd("say /damageinfo", "Info_Menu");
}
public RG_CBasePlayerTakeDamage_Post(const pVictim, const iInflictor, const pAttacer, const Float:fDamage, const iBitDamage) {
if(!is_user_connected(pAttacer) || fDamage <= 0.0 || !rg_is_player_can_takedamage(pVictim, pAttacer) || pVictim == pAttacer)
return HC_CONTINUE;
#if !defined SHOT_A_GRENADE
if(iBitDamage & DMG_GRENADE)
return HC_CONTINUE;
#endif
new iDemage = floatround(fDamage);
#if defined MAX_DMG_100
if(e_InfoClient[Demage][pAttacer] +iDemage > 100)
e_InfoClient[Demage][pAttacer] = 100;
else e_InfoClient[Demage][pAttacer] += iDemage;
#else
e_InfoClient[Demage][pAttacer] += iDemage;
#endif
++e_InfoClient[Shot][pAttacer];
return HC_CONTINUE;
}
public RG_RoundEnd_Post() {
for(new i = 1; i <= MAXPLAYERS; ++i) {
if(!is_user_connected(i))
continue;
UTIL_ShowRoundInfo(i);
}
arrayset(e_InfoClient[_:0][0], 0, sizeof(e_InfoClient) * sizeof(e_InfoClient[]));
}
public Info_Menu(const pId) {
new i_Menu = menu_create("\yИнформер меню", "Damager_Handler");
menu_additem(i_Menu, "Показывать информацию об уроне в консоли", "1");
menu_additem(i_Menu, "Показывать информацию об уроне в чате", "2");
menu_setprop(i_Menu, MPROP_EXITNAME, "Выход");
menu_display(pId, i_Menu);
}
public Damager_Handler(const pId, const iMenu, const iItem) {
menu_destroy(iMenu);
if(iItem != MENU_EXIT)
b_Chat = bool:iItem;
return PLUGIN_HANDLED;
}
stock UTIL_ShowRoundInfo(const id) {
for(new i = 1; i <= MAXPLAYERS; ++i) {
if(!is_user_connected(i) || i == id)
continue;
if(e_InfoClient[Demage][id] == 0 && e_InfoClient[Demage][i] == 0)
continue;
client_print(id, b_Chat ? print_chat : print_console,
"Вы* -> |%i с %i|, Противник -> |%i with %i|, У %n -> |%.0fHP|",
e_InfoClient[Demage][id], e_InfoClient[Shot][id],
e_InfoClient[Demage][i], e_InfoClient[Shot][i],
i, !is_user_alive(i) ? 0 : get_entvar(i, var_health)
);
}
}
суть проблемы:
плагин после убийства игрока, выдает неверную информацию скрин приложил. Garey, BlackSignature, b0t.
хотел у вас совета попросить, в чем проблема может быть? изначальный код до всех поправок:
что не делая с плагином, баг не пропадает.
плагин после убийства игрока, выдает неверную информацию скрин приложил.
24 Янв 2024
хотел у вас совета попросить, в чем проблема может быть?
24 Янв 2024
Код:
/**
История изменений:
1.0 (02.08.2021) by b0t.
- Первый релиз;
1.1 (03.08.2021) y b0t.
- fix багов с отображением;
1.2 (15.09.2021) by b0t.
- Привязка к IP;
*/
#include <amxmodx>
#include <reapi>
new const VERSION[] = "1.2";
new bool:b_Chat;
#define MAX_DMG_100 //Максимальный нанёсённый урон по одному противнику = 100.
#define SHOT_A_GRENADE //Засчитывать урон от гранаты за попадание.
enum _:GAME_DATA {
SHOT,
DAMAGE
};
new p_iGameData[33][33][GAME_DATA];
public plugin_init() {
register_plugin("GameInfo",VERSION,"b0t.");
RegisterHookChain(RG_CBasePlayer_TakeDamage,"RG_CBasePlayerTakeDamage_Post", .post = true);
RegisterHookChain(RG_RoundEnd,"RG_RoundEnd_Post", .post = true);
register_clcmd("say /damageinfo", "Info_Menu");
}
public RG_CBasePlayerTakeDamage_Post(const pVictim,const iInflictor,const pAttacer,const Float:fDamage,const iBitDamage) {
if(!is_user_connected(pVictim) || !is_user_connected(pAttacer))
return HC_CONTINUE;
#if defined MAX_DMG_100
if(p_iGameData[pAttacer][pVictim][DAMAGE]+floatround(fDamage) > 100)
p_iGameData[pAttacer][pVictim][DAMAGE] = 100;
else
p_iGameData[pAttacer][pVictim][DAMAGE] += floatround(fDamage);
#else
p_iGameData[pAttacer][pVictim][DAMAGE] += floatround(fDamage);
#endif
#if !defined SHOT_A_GRENADE
if(iBitDamage & DMG_GRENADE)
return HC_CONTINUE;
#endif
p_iGameData[pAttacer][pVictim][SHOT]++;
return HC_CONTINUE;
}
public RG_RoundEnd_Post() {
for(new iPlayer=1;iPlayer<=MaxClients;iPlayer++) {
if(!is_user_connected(iPlayer))
continue;
UTIL_ShowRoundInfo(iPlayer);
}
arrayset(p_iGameData[0][0],0,sizeof(p_iGameData) * sizeof(p_iGameData[]));
}
public Info_Menu(const pId) {
new i_Menu = menu_create("\yИнформер меню", "Damager_Handler");
menu_additem(i_Menu, "\wПоказывать информацию об уроне в консоли", "1", 0);
menu_additem(i_Menu, "\wПоказывать информацию об уроне в чате", "2", 0);
menu_setprop(i_Menu, MPROP_NEXTNAME, "Дальше");
menu_setprop(i_Menu, MPROP_BACKNAME, "Назад");
menu_setprop(i_Menu, MPROP_EXITNAME, "Закрыть");
menu_display(pId, i_Menu, 0);
}
public Damager_Handler(const pId, const iMenu, const iItem) {
if(iItem == MENU_EXIT) {
menu_destroy(iMenu);
return PLUGIN_HANDLED;
}
new s_Data[6], s_Name[64], i_Access, i_Callback;
menu_item_getinfo(iMenu, iItem, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback);
new iKey = str_to_num(s_Data);
switch(iKey) {
case 1: b_Chat = false;
case 2: b_Chat = true;
}
menu_destroy(iMenu);
return PLUGIN_HANDLED;
}
stock UTIL_ShowRoundInfo(const id) {
for(new iPlayer=1;iPlayer<=MaxClients;iPlayer++) {
if(!is_user_connected(iPlayer) || iPlayer == id)
continue;
if(p_iGameData[id][iPlayer][DAMAGE] == 0 && p_iGameData[iPlayer][id][DAMAGE] == 0)
continue;
if(b_Chat) {
client_print_color(id,print_team_default,
"(%i with %i) damage, (%i with %i) taken, %n (%iHP)",
p_iGameData[id][iPlayer][DAMAGE],p_iGameData[id][iPlayer][SHOT],
p_iGameData[iPlayer][id][DAMAGE],p_iGameData[iPlayer][id][SHOT],
iPlayer,!is_user_alive(iPlayer) ? 0 : floatround(Float:get_entvar(iPlayer,var_health))
);
}
else {
client_print(id,print_console,
"(%i with %i) damage, (%i with %i) taken, %n (%iHP)",
p_iGameData[id][iPlayer][DAMAGE],p_iGameData[id][iPlayer][SHOT],
p_iGameData[iPlayer][id][DAMAGE],p_iGameData[iPlayer][id][SHOT],
iPlayer,!is_user_alive(iPlayer) ? 0 : floatround(Float:get_entvar(iPlayer,var_health))
);
}
}
}
В этой теме было размещено решение! Перейти к решению.
Последнее редактирование: