проблемка с KillsRarity

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
165
Реакции
-8
Ошибка
L 05/18/2020 - 19:41:01: [ReAPI] get_member: invalid or uninitialized entity
L 05/18/2020 - 19:41:01: [AMXX] Displaying debug trace (plugin "KillsRarity.amxx", version "0.0.1")
L 05/18/2020 - 19:41:01: [AMXX] Run time error 10: native error (native "get_member")
L 05/18/2020 - 19:41:01: [AMXX] [0] KillsRarity.sma::_Get_RareKill (line 56)
L 05/18/2020 - 19:41:01: [AMXX] [1] KillsRarity.sma::CBasePlayer_Killed (line 41)
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5263 (http://www.amxmodx.org)
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.7.0.695-dev
Build date: 15:54:29 Apr 6 2020 (2186)
Build from: https://github.com/dreamstalker/rehlds/commit/7513e71
ReGamedll
ReGameDL version: 5.16.0.460-dev
Build date: 10:11:49 May 2 2020
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/4f72525
Версия 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] AMX Mod X RUN- amxmodx_mm_i386.so v1.9.0.5263ini Start ANY
[ 2] Reunion RUN- reunion_mm_i386.so v0.1.0.92c ini Start Never
[ 3] ReSemiclip RUN- resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 4] WHBlocker RUN- whblocker_mm_i386.sov1.5.697ini Chlvl ANY
[ 5] VoiceTranscoder RUN- VoiceTranscoder.so v2017RC5ini ANYANY
[ 6] Ham Sandwich RUN- hamsandwich_amxx_i386.so v1.9.0.5263pl1 ANYANY
[ 7] FakeMetaRUN- fakemeta_amxx_i386.so v1.9.0.5263pl1 ANYANY
[ 8] CStrike RUN- cstrike_amxx_i386.sov1.9.0.5263pl1 ANYANY
[ 9] CSX RUN- csx_amxx_i386.so v1.9.0.5263pl1 ANYANY
[10] ReAPIRUN- reapi_amxx_i386.so v5.13.0.194-dev pl1 ANYNever
[11] Engine RUN- engine_amxx_i386.so v1.9.0.5263pl1 ANYANY
[12] Fun RUN- fun_amxx_i386.so v1.9.0.5263pl1 ANYANY
Список плагинов
[ 1] UCP Server 8.5Endi ucp.amxxrunning
[ 2] Admin Base 1.8.1.3746 AMXX Dev Team admin.amxx running
[ 3] Admin Commands 1.9.0.5263 AMXX Dev Team admincmd.amxx running
[ 4] Slots Reservation 1.9.0.5263 AMXX Dev Team adminslots.amxx running
[ 5] AMXMODMENU STRIKE TEA SCHOCKKTOLOGY.DE menufront.amxxrunning
[ 6] amx_kickmenu reasons a 0.3a BetaFlash kickmenu_reason running
[ 7] Players Menu1.9.0.5263 AMXX Dev Team plmenu.amxxrunning
[ 8] Maps Menu1.9.0.5263 AMXX Dev Team mapsmenu.amxx running
[ 9] Map Manager 2.5.61Mistrick mapmanager.amxx running
[ 10] Admin Chat 1.9.0.5263 AMXX Dev Team adminchat.amxxrunning
[ 11] Anti Flood 1.9.0.5263 AMXX Dev Team antiflood.amxxrunning
[ 12] Admin Votes 1.9.0.5263 AMXX Dev Team adminvote.amxxrunning
[ 13] Stats Configuration 1.9.0.5263 AMXX Dev Team statscfg.amxx running
[ 14] StatsX (MastaMan Editi 1.9.0.5263 AMXX Dev Team &statsx_shell.am debug
[ 15] Restrict Weapons 1.9.0.5263 AMXX Dev Team restmenu.amxx running
[ 16] High Ping Kicker (Stea 0.16.2OLO/shadow ping_kicker.amx running
[ 17] AFK Kicker 1.0b Cheesy Peteza afk_kicker.amxx running
[ 18] UCP Menu 2.1STEVE ucp_menu.amxx running
[ 19] [ReAPI] AdminFreeLook1.0ReHLDS Team adminfreelook.a running
[ 20] Admin Prefixes 4.1m0skVi4a ;] AdminPrefixes.a running
[ 21] True dmg stats 1.0by4udilo TopTrueDmg.amxx running
[ 22] Killer Bonus0.1def4u1t Round_Kill_Bonu running
[ 23] Advanced Gag1.4.3[VTCneygomon amx_gag.amxx running
[ 25] C4 Timer 0.1Lightman bombtimer.amxxrunning
[ 26] Descriptive 'Fire in t 0.1VENdescriptive_fir running
[ 27] Nice Killer 1.6Got Milk? / HoHo nice_killer.amx running
[ 28] IDEA VIP by Ba/lePa & 3.2.6 Ba/lePa | Remake IDEAL_VIP.amxxrunning
[ 29] Reset Score 0.2SCHOCKKTOLOGY.DE Resetscore.amxx running
[ 30] Night VIPs Private Racoonnight_vips.amxx running
[ 31] AD Manager 1.0Nesquik ad_manager.amxx running
[ 32] Parachute Lite [ReAPI] 11.0 Leo_[BH] parachute.amxxrunning
[ 33] Admin, Vip and Lady mo 0.3b Freedo.m +mod.Le Strike_Skins.am running
[ 34] Weapon Kill 1.2Slove. & AcEKnife_Sound.amx running
[ 35] xREDIRECT1.0.3.3 x0Rxredirect.amxxrunning
[ 36] Advanced Kill Assists1.3a Xelsonkill_assist.amx running
[ 37] Anti reconnect 3.0JohnJ antireconnect.a running
[ 38] Kills Rarity0.0.1 wopox1337KillsRarity.amx debug
[ 39] [ReAPI] No Team Flash0.0.3 Vaqtinchano_team_flash.a running
Автор плагина
wopox1337
Версия плагина
0.0.1
Исходный код
#include <amxmodx>
#include <reapi>
#include <fakemeta>
#include <xs>

#define IsSuicide(%1,%2) bool:(%1 == %2)
#define IsPlayer(%1) bool:(%1 && %1 <= MAX_PLAYERS)

new bool:g_bDamaged[MAX_PLAYERS + 1][MAX_PLAYERS + 1];

enum _:KillRarity_s (<<=1)
{
kill_NoScope = 1,
kill_AirShot,
kill_OneShot,
kill_Penetrated,
kill_HeadShot
}

public plugin_init()
{
register_plugin("Kills Rarity", "0.0.1", "wopox1337");
RegisterHookChain(RG_CBasePlayer_TakeDamage, "CBasePlayer_TakeDamage", .post = true);
RegisterHookChain(RG_CBasePlayer_Killed, "CBasePlayer_Killed", .post = true);
RegisterHookChain(RG_CSGameRules_RestartRound, "CSGameRules_RestartRound", .post = true);
}

public CBasePlayer_TakeDamage(id, iInflictor, iAttacker, Float:fDamage, bitsDamageType)
{
if(id == iAttacker || !is_user_connected(iAttacker) || !rg_is_player_can_takedamage(id, iAttacker))
return;

g_bDamaged[iAttacker][id] = true;
}

public CBasePlayer_Killed(id, iKiller, iGib)
{
if(IsSuicide(id, iKiller) || !IsPlayer(iKiller))
return;

_AnnounceToPlayers(iKiller, _Get_RareKill(id, iKiller));
}

public CSGameRules_RestartRound()
{
for(new id = 1; id <= MaxClients; id++)
arrayset(g_bDamaged[id], 0, sizeof g_bDamaged[]);
}

_Get_RareKill(id, iKiller)
{
const DEFAULT_FOV = 90;
#define __GetItem_ID(%1) get_member(get_member(%1, m_pActiveItem), m_iId)

new bitKillRarity;
new bitsActiveItem = 1 << __GetItem_ID(iKiller);

if(get_member(id, m_bHeadshotKilled)) // Headshot kill
{
bitKillRarity |= kill_HeadShot;
}

if(bitsActiveItem & (1 << CSW_HEGRENADE | 1 << CSW_KNIFE)) // HEGrenade or Knife kill
{
return bitKillRarity;
}

if(bitsActiveItem & (1 << CSW_AWP | 1 << CSW_SCOUT | 1 << CSW_G3SG1 | 1 << CSW_SG550)) // Sniper Kill
{
if(get_member(iKiller, m_iClientFOV) == DEFAULT_FOV) // NoScope
{
bitKillRarity |= kill_NoScope;
}
}

static Float:fvecVelocity[3];
get_entvar(iKiller, var_velocity, fvecVelocity);
if(fvecVelocity[2] != 0.0 && (fvecVelocity[2] < -1.0 || fvecVelocity[2] > 1.0)) // JumpShot or AirShot kill (same as !FL_ONGROUND?)
{
bitKillRarity |= kill_AirShot;
}

if(!(bitsActiveItem & (1 << CSW_AWP))
&& !g_bDamaged[iKiller][id]
) // OneShot kill
{
bitKillRarity |= kill_OneShot;
}

if(bIsPenetrated(id, iKiller)) // Wallbang kill
{
bitKillRarity |= kill_Penetrated;
}

return bitKillRarity;
}

_AnnounceToPlayers(iKiller, bitKillRarity)
{
if(!bitKillRarity)
{
return;
}

new szRareKillBuffer[64];

if(bitKillRarity & kill_NoScope) strcat(szRareKillBuffer, "NoScope ", 16);
if(bitKillRarity & kill_AirShot) strcat(szRareKillBuffer, "AirShot ", 16);
if(bitKillRarity & kill_OneShot) strcat(szRareKillBuffer, "OneShot ", 16);
if(bitKillRarity & kill_Penetrated) strcat(szRareKillBuffer, "Wallbang ", 16);
if(bitKillRarity & kill_HeadShot) strcat(szRareKillBuffer, "Headshot ", 16); // Don't need it!?

trim(szRareKillBuffer);

client_print_color(0, print_team_red, "^4*^3 %n^4 совершил необычное убийство! : ^3%s", iKiller, szRareKillBuffer);
}

stock bool:bIsPenetrated(id, iKiller)
{
static hTrace;
if(!hTrace)
hTrace = create_tr2();

static Float:vfOrigin_Killer[3], Float:vfViewOfs[3];
get_entvar(iKiller, var_origin, vfOrigin_Killer);
get_entvar(iKiller, var_view_ofs, vfViewOfs);
xs_vec_add(vfOrigin_Killer, vfViewOfs, vfOrigin_Killer);

static Float:vfOrigin[3];
get_entvar(id, var_origin, vfOrigin);
get_entvar(id, var_view_ofs, vfViewOfs);
xs_vec_add(vfOrigin, vfViewOfs, vfOrigin);

engfunc(EngFunc_TraceLine, vfOrigin_Killer, vfOrigin, IGNORE_MONSTERS | IGNORE_GLASS, 0, hTrace);

static Float:fFraction;
get_tr2(hTrace, TR_flFraction, fFraction);

return bool:(fFraction != 1.0);
}
помогите исправить ошибку
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
1,701
Реакции
1,512
Помог
26 раз(а)
38 строка
if(IsSuicide(id, iKiller) || !IsPlayer(iKiller))
=>
if(IsSuicide(id, iKiller) || !is_user_connected(iKiller))
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу