Плагин refill_weapon_on_kill выдает ошибку.

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
18
Реакции
0
Ошибка
L 01/19/2019 - 22:53:46: [ReAPI] rg_get_iteminfo: invalid entity index -1 [arg_index]
L 01/19/2019 - 22:53:46: [AMXX] Displaying debug trace (plugin "refill_weapon_on_kill.amxx", version "0.2")
L 01/19/2019 - 22:53:46: [AMXX] Run time error 10: native error (native "rg_get_iteminfo")
L 01/19/2019 - 22:53:46: [AMXX] [0] refill_weapon_on_kill.sma::ReloadWeapons (line 65)
L 01/19/2019 - 22:53:46: [AMXX] [1] refill_weapon_on_kill.sma::CSGameRules_DeathNotice (line 53)
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5235 (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: Dec 18 2018 01:20:00
Билд
Protocol version 48
Exe version 1.0.1.4 (cstrike)
ReHLDS version: 3.4.0.668-dev
Build date: 09:47:42 Sep 29 2018 (1631)
Build from: https://github.com/dreamstalker/rehlds/commit/89be216
ReGamedll
ReGameDLL version: 5.7.0.322-dev
Build date: 11:41:14 Jan 13 2019
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/7398bb7
Версия 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
Список метамодулей
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] SafeNameAndChat RUN - SafeNameAndChat.so v1.1 ini ANY ANY
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.0.92 ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 4] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 5] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 6] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC3 ini ANY ANY
[ 7] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5235 ini Start ANY
[ 8] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 9] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[10] ReAPI RUN - reapi_amxx_i386.so v5.7.0.162-dev pl7 ANY Never
[11] ReCSDM RUN - csdm_amxx_i386.so v3.6 pl7 ANY ANY
[12] MySQL RUN - mysql_amxx_i386.so v1.9.0.5235 pl7 ANY ANY
[13] Engine RUN - engine_amxx_i386.so v1.9.0.5235 pl7 ANY ANY
[14] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5235 pl7 ANY ANY
[15] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl7 ANY Never
[16] hackdetector RUN - hackdetector_amxx_i386.so v0.15.328.lite pl7 ANY ANY
[17] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5235 pl7 ANY ANY
[18] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5235 pl7 ANY ANY
[19] CSX RUN - csx_amxx_i386.so v1.9.0.5235 pl7 ANY ANY
[20] Fun RUN - fun_amxx_i386.so v1.9.0.5235 pl7 ANY ANY
20 plugins, 20 running
Список плагинов
amxx plugins
Currently loaded plugins:
name version author file status
[ 1] fb_forwards 0.1.4 Kanagava & Realu fb_forwards.amx running
[ 2] admin_loader 0.4 kanagava admin_loader.am running
[ 3] FreshBans 1.4.0b kanagava fresh_bans.amxx running
[ 4] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 5] Aliases checker 1.0.3 kanagava alias_detector. running
[ 6] Info. Messages 1.8.3-Re AMXX Dev Team imessage.amxx running
[ 7] Admin Chat 1.9.0.5235 AMXX Dev Team adminchat.amxx running
[ 8] Admin Commands 1.9.0.5235 AMXX Dev Team admincmd.amxx running
[ 9] Admin Votes 1.9.0.5235 AMXX Dev Team adminvote.amxx running
[ 10] Anti Flood 1.9.0.5235 AMXX Dev Team antiflood.amxx running
[ 11] Commands Menu 1.9.0.5235 AMXX Dev Team cmdmenu.amxx running
[ 12] Maps Menu 1.9.0.5235 AMXX Dev Team mapsmenu.amxx running
[ 13] Menus Front-End 1.9.0.5235 AMXX Dev Team menufront.amxx running
[ 14] Players Menu 1.9.0.5235 AMXX Dev Team plmenu.amxx running
[ 15] Scrolling Message 1.8.3-Re AMXX Dev Team scrollmsg.amxx running
[ 16] Stats Configuration 1.9.0.5235 AMXX Dev Team statscfg.amxx running
[ 17] StatsX 1.9.0.5235 AMXX Dev Team statsx.amxx running
[ 18] unknown unknown unknown chatmanager_add bad load
[ 19] FIX Game Player Equip 0.1 unnamed fix_game_player paused
[ 20] ResetScore 1.0 Leo_[BH] resetscore_reap running
[ 21] Respawn 0.1 unnamed respawn.amxx running
[ 22] [ReAMX] Parachute RBS 17.12.12 KRoT@L/JTP10181 parachute_rbs.a running
[ 23] RE Vampire 1.0.7 MakapoH, AcE, RE re_vampire.amxx running
[ 24] Refill Weapon On Kill 0.2 Vaqtincha refill_weapon_o debug
[ 25] AFK Control ReNew 1.2(a) neygomon afk_control.amx running
[ 26] ReCSDM Main 3.6 ReCSDM Team csdm_main.amxx running
[ 27] ReCSDM Equip 3.6 ReCSDM Team csdm_equip.amxx running
[ 28] ReCSDM Spawns 3.6 ReCSDM Team csdm_spawn_pres running
[ 29] ReCSDM Misc 3.6 ReCSDM Team csdm_misc.amxx running
[ 30] ReCSDM Stripper 3.6 KWo csdm_stripper.a running
[ 31] ReCSDM Protection 3.6 BAILOPAN csdm_protection running
[ 32] ReCSDM FFA 3.6 ReCSDM Team csdm_ffa.amxx running
[ 33] Map Manager: Core 3.0.2 Mistrick map_manager_cor running
[ 34] Map Manager: Scheduler 0.1.1 Mistrick map_manager_sch running
[ 35] Map Manager: Rtv 0.0.4 Mistrick map_manager_rtv running
[ 36] Map Manager: Nominatio 0.1.0 Mistrick map_manager_nom running
[ 37] Map Manager: BlockList 0.0.3 Mistrick map_manager_blo running
[ 38] Map Manager: Online so 0.0.2 Mistrick map_manager_onl running
[ 39] Map Manager: Effects 0.0.8 Mistrick map_manager_eff running
[ 40] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
( 18) Load fails: Plugin uses an unknown function (name "cm_set_player_message") - check your modules.ini.
40 plugins, 38 running
Автор плагина
Vaqtincha
Версия плагина
0.2
Исходный код
// Copyright 2019 Vaqtincha

/**■■■■■■■■■■■■■■■■■■■■■■■■■■■■ CONFIG START ■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/

// Рас/Комментировать чтобы вкл/выкл нужный функционал.

#define HEADSHOT_KILL_REFILL_ALL // Перезаряжать все оружие при убийстве хедшотом.
#define GRENADE_KILL_REFILL_ALL // Перезаряжать все оружие при убийстве гранатой.

#define ONLY_ACTIVE_WEAPON // Перезаряжать только активного оружие которого совершено убийство.
#define ONLY_REFILL_CLIP // Перезаряжать только магазин (или магазин+запасы.)

/**■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ CONFIG END ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/

#define PL_VERSION "0.2"

#include <amxmodx>
#include <reapi>

public plugin_init()
{
register_plugin("Refill Weapon On Kill", PL_VERSION, "Vaqtincha")
RegisterHookChain(RG_CSGameRules_DeathNotice, "CSGameRules_DeathNotice", .post = true)
}

public CSGameRules_DeathNotice(const pPlayer, const pKiller, pevInflictor)
{
if (pPlayer == pKiller || !is_user_alive(pKiller))
return HC_CONTINUE

if (pKiller == pevInflictor)
{
#if defined HEADSHOT_KILL_REFILL_ALL
if (get_member(pPlayer, m_bHeadshotKilled))
{
ReloadWeapons(pKiller, pevInflictor)
return HC_CONTINUE
}
#endif
#if defined ONLY_ACTIVE_WEAPON
pevInflictor = get_member(pKiller, m_pActiveItem)

if (!is_nullent(pevInflictor))
ReloadWeapons(pKiller, pevInflictor)
#else
ReloadWeapons(pKiller)
#endif
return HC_CONTINUE
}
#if defined GRENADE_KILL_REFILL_ALL
else if (FClassnameIs(pevInflictor, "grenade"))
{
ReloadWeapons(pKiller)
}
#endif
return HC_CONTINUE
}


ReloadWeapons(const pPlayer, const pWeapon = NULLENT)
{
if (pWeapon == NULLENT)
{
#if defined ONLY_REFILL_CLIP
set_member(pWeapon, m_Weapon_iClip, rg_get_iteminfo(pWeapon, ItemInfo_iMaxClip))
#else
rg_instant_reload_weapons(pPlayer)
#endif
}
else
{
#if defined ONLY_REFILL_CLIP
for (new InventorySlotType:i = PRIMARY_WEAPON_SLOT, pItem; i <= PISTOL_SLOT; i++)
{
pItem = get_member(pPlayer, m_rgpPlayerItems, i)

while (!is_nullent(pItem))
{
set_member(pItem, m_Weapon_iClip, rg_get_iteminfo(pItem, ItemInfo_iMaxClip))

pItem = get_member(pItem, m_pNext)
}
}
#else
rg_instant_reload_weapons(pPlayer, pWeapon)
#endif
}
}
В консоле сервера постоянно пишет ошибку работы плагина:
L 01/19/2019 - 22:53:46: [ReAPI] rg_get_iteminfo: invalid entity index -1 [arg_index]
L 01/19/2019 - 22:53:46: [AMXX] Displaying debug trace (plugin "refill_weapon_on_kill.amxx", version "0.2")
L 01/19/2019 - 22:53:46: [AMXX] Run time error 10: native error (native "rg_get_iteminfo")
L 01/19/2019 - 22:53:46: [AMXX] [0] refill_weapon_on_kill.sma::ReloadWeapons (line 65)
L 01/19/2019 - 22:53:46: [AMXX] [1] refill_weapon_on_kill.sma::CSGameRules_DeathNotice (line 53)

Компилировал последним компилятором, локально. Не пойму в чем проблема.
Но плагин все равно работает, только на сервере постоянно эту ошибку выдает.
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
2,491
Реакции
2,790
Помог
61 раз(а)
Код:
// Copyright 2019 Vaqtincha

/**■■■■■■■■■■■■■■■■■■■■■■■■■■■■ CONFIG START ■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/

// Рас/Комментировать чтобы вкл/выкл нужный функционал.

#define HEADSHOT_KILL_REFILL_ALL // Перезаряжать все оружие при убийстве хедшотом.
#define GRENADE_KILL_REFILL_ALL // Перезаряжать все оружие при убийстве гранатой.

#define ONLY_ACTIVE_WEAPON // Перезаряжать только активного оружие которого совершено убийство.
#define ONLY_REFILL_CLIP // Перезаряжать только магазин (или магазин+запасы.)

/**■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ CONFIG END ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/

#define PL_VERSION     "0.2"

#include <amxmodx>
#include <reapi>

public plugin_init()
{
    register_plugin("Refill Weapon On Kill", PL_VERSION, "Vaqtincha")
    RegisterHookChain(RG_CSGameRules_DeathNotice, "CSGameRules_DeathNotice", .post = true)
}

public CSGameRules_DeathNotice(const pPlayer, const pKiller, pevInflictor)
{
    if (pPlayer == pKiller || !is_user_alive(pKiller))
        return HC_CONTINUE

    if (pKiller == pevInflictor)
    {
#if defined HEADSHOT_KILL_REFILL_ALL
        if (get_member(pPlayer, m_bHeadshotKilled))
        {
            ReloadWeapons(pKiller, pevInflictor)
            return HC_CONTINUE
        }
#endif
#if defined ONLY_ACTIVE_WEAPON
        pevInflictor = get_member(pKiller, m_pActiveItem)

        if (!is_nullent(pevInflictor))
            ReloadWeapons(pKiller, pevInflictor)
#else
        ReloadWeapons(pKiller)
#endif
        return HC_CONTINUE
    }
#if defined GRENADE_KILL_REFILL_ALL
    else if (FClassnameIs(pevInflictor, "grenade"))
    {
        ReloadWeapons(pKiller)
    }
#endif
    return HC_CONTINUE
}


ReloadWeapons(const pPlayer, const pWeapon = NULLENT)
{
    if (pWeapon == NULLENT)
    {
#if defined ONLY_REFILL_CLIP
        for (new InventorySlotType:i = PRIMARY_WEAPON_SLOT, pItem; i <= PISTOL_SLOT; i++)
        {
            pItem = get_member(pPlayer, m_rgpPlayerItems, i)

            while (!is_nullent(pItem))
            {
                set_member(pItem, m_Weapon_iClip, rg_get_iteminfo(pItem, ItemInfo_iMaxClip))
        
                pItem = get_member(pItem, m_pNext)
            }
        }
#else
        rg_instant_reload_weapons(pPlayer)
#endif
    }
    else
    {
#if defined ONLY_REFILL_CLIP
        set_member(pWeapon, m_Weapon_iClip, rg_get_iteminfo(pWeapon, ItemInfo_iMaxClip))
#else       
        rg_instant_reload_weapons(pPlayer, pWeapon)
#endif
    }
}
 
Сообщения
18
Реакции
0
Спасибо! Еще подскажите пожалуйста, в консоле сервера постоянно высвечивается надпись:
MasterRequestRestart
Your server needs to be restarted in order to receive the latest update.

Хотя все последнее установлено. Как решить подскажите пожалуйста.
 
Статус
В этой теме нельзя размещать новые ответы.

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

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