Run time error 10: native error (native "cs_get_user_team")

Сообщения
73
Реакции
39
Помог
3 раз(а)
Ошибка
L 02/23/2020 - 03:16:52: Start of error session.
L 02/23/2020 - 03:16:52: Info (map "de_dust2_2x2") (file "addons/amxmodx/logs/error_20200223.log")
L 02/23/2020 - 03:16:52: [CSTRIKE] Invalid player 22 (not in-game)
L 02/23/2020 - 03:16:52: [AMXX] Displaying debug trace (plugin "girls.amxx", version "2.0")
L 02/23/2020 - 03:16:52: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 02/23/2020 - 03:16:52: [AMXX] [0] girls.sma::resetModel (line 20)
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5263 (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 27 2019 16:23:31
Built from: https://github.com/alliedmodders/amxmodx/commit/15a14a0
Build ID: 5263:15a14a0
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.14.0.454-dev+m
Build date: 17:39:55 Feb 19 2020
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/05cf0f7
Версия 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.92c       ini  Start Never
[ 2] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5263 ini Start ANY
[ 3] Revoice RUN - revoice_mm_i386.so v0.1.0.33 ini Start Never
[ 4] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 5] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 6] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 7] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 8] SafeNameAndChat RUN - SafeNameAndChat.so v1.1 ini ANY ANY
[ 9] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl2 ANY Never
[10] ReAPI RUN - reapi_amxx_i386.so v5.12.0.192-dev pl2 ANY Never
[11] CSX RUN - csx_amxx_i386.so v1.9.0.5263 pl2 ANY ANY
[12] MySQL RUN - mysql_amxx_i386.so v1.9.0.5263 pl2 ANY ANY
[13] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5263 pl2 ANY ANY
[14] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5263 pl2 ANY ANY
[15] Engine RUN - engine_amxx_i386.so v1.9.0.5263 pl2 ANY ANY
[16] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5263 pl2 ANY ANY
[17] Fun RUN - fun_amxx_i386.so v1.9.0.5263 pl2 ANY ANY
Список плагинов
[  1] Admin Loader            3.5         neygomon          admin_loader.am  running  
[ 2] CSStatsX SQL 0.7.4 serfreeman1337 csstatsx_sql.am running
[ 3] AES: StatsX 0.5.9 [REA serfreeman1337/s aes_statsx_cstr running
[ 4] [182] MapChooser RBS 18.10.05 SKAJIbnEJIb & UF mapchooser_rbs. running
[ 5] [182] TimeLeft 18.09.25 SKAJIbnEJIb & AM timeleft.amxx running
[ 6] [182] NextMap 18.09.25 SKAJIbnEJIb & AM nextmap.amxx running
[ 7] [ReAMX] VIP RBS 18.03.24 SKAJIbnEJIb vip_rbs.amxx running
[ 8] [ReAMX] Ultimate Weapo 17.08.28 SKAJIbnEJIb ultimate_weapon running
[ 9] [182] Ultimate Flags 18.12.16 SKAJIbnEJIb ultimate_flags. running
[ 10] [182] Damager RBS 19.08.30 SKAJIbnEJIb damager_rbs.amx running
[ 11] [182] Top Award RBS 17.10.30 SKAJIbnEJIb topaward_rbs.am running
[ 12] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 13] FreshBans 1.4.3b kanagava fresh_bans.amxx running
[ 14] [ReAPI] AdminFreeLook 1.0 ReHLDS Team adminfreelook.a running
[ 15] Lite Admin ESP 1.0 neygomon admin_esp.amxx running
[ 16] [183] Ultimate Gag 17.12.22BE SKAJIbnEJIb ultimate_gag.am running
[ 17] ScreenMaker 1.1 neygomon screen_maker.am running
[ 18] Chat Manager 1.1.2-16 Mistrick chatmanager.amx running
[ 19] Advert Messages 1.22 neygomon adverts.amxx running
[ 20] Admin Chat 1.9.0.5263 AMXX Dev Team adminchat.amxx running
[ 21] Admin Commands 1.9.0.5263 AMXX Dev Team admincmd.amxx running
[ 22] Anti Flood 1.9.0.5263 AMXX Dev Team antiflood.amxx running
[ 23] Commands Menu 1.9.0.5263 AMXX Dev Team cmdmenu.amxx running
[ 24] Admin Menu 1.1 sweden + Sherlok menufront.amxx debug
[ 25] Players Menu 1.9.0.5263 AMXX Dev Team plmenu.amxx running
[ 26] Plugin Menu 1.9.0.5263 AMXX Dev Team pluginmenu.amxx running
[ 27] Admin Votes 1.9.0.5263 AMXX Dev Team adminvote.amxx running
[ 28] CS Misc. Stats 1.9.0.5263 AMXX Dev Team miscstats.amxx debug
[ 29] Stats Configuration 1.9.0.5263 AMXX Dev Team statscfg.amxx running
[ 30] StatsX 1.9.0.5263 AMXX Dev Team statsx.amxx running
[ 31] Maps Menu 1.1.4 neugomon mapsmenu.amxx running
[ 32] Lady Admin 2.0 AhmetBro girls.amxx debug
[ 33] Ping Checker RC2 h1k3 ping_checker.am running
[ 34] AFK Control 1.4.1 [Rnd neygomon afk_control_2.a running
[ 35] [ReAPI] AWPoff 1.4.3 PAffAEJIkA :3 awp_off.amxx running
[ 36] Reset Score 0.0.2f wopox1337 ResetScore.amxx running
[ 37] Block Change Name 1.0 DJ_WEST block_change_na running
[ 38] Lite Recoder 1.0.1 neygomon amx_demorec.amx running
[ 39] Block grande info 1.0 neygomon BlockGrenadeInf running
[ 40] Lite Kill Assist 1.17 neygomon lite_kill_assis running
[ 41] [ReAPI] No Team Flash 0.0.3 Vaqtincha no_team_flash.a running
[ 42] AutoRestart 1.0 neygomon auto_rr.amxx running
[ 43] [ReAPI] Lite TeamBalan 2.3 neugomon lite_balancer.a running
[ 44] GameName 1.0 neugomon GameName.amxx running
[ 45] Mode 2x2 1.9 s1lent mode.amxx running
[ 46] Vip drop take block 1.5 bionext vip_drop_take_b running
[ 47] Items Restrict 1.1 s1lent items_restrict. running
[ 48] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 49] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 50] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am running
[ 51] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
[ 52] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste running
[ 53] AES: Bonus CSTRIKE 0.5.9.1 [R serfreeman1337/s aes_bonus_cstri running
Автор плагина
AhmetBro
Версия плагина
2.0
Исходный код
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init() {
register_plugin("Lady Admin", "2.0", "AhmetBro")
register_event("ResetHUD", "resetModel", "b")
return PLUGIN_CONTINUE
}

public plugin_precache() {
precache_model("models/player/red/red.mdl")
precache_model("models/player/blue/blue.mdl")

return PLUGIN_CONTINUE
}

public resetModel(id, level, cid) {
if (get_user_flags(id) & ADMIN_LEVEL_E) {
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T) {
cs_set_user_model(id, "red")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "blue")
}
else {
cs_reset_user_model(id)
}
}

return PLUGIN_CONTINUE
}
Раз в сутки, но в разное время, появляется такая ошибка в логах. Подскажите, как исправить?
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
1,701
Реакции
1,512
Помог
26 раз(а)
Поменять хук на спавн.
 
Сообщения
73
Реакции
39
Помог
3 раз(а)
fl0wer, а можно, пожалуйста, чуть более подробно, в какой строке и что на что поменять? А то я не сильно разбираюсь в скриптинге
 
Сообщения
1,701
Реакции
1,512
Помог
26 раз(а)
Sherlok_h, у себя в плагине замени с 1-33 строку на:
Код:
#pragma semicolon 1

#include <amxmodx>
#include <reapi>

new const RED[] = "red";
new const BLUE[] = "blue";

public plugin_init()
{
    register_plugin("BLady Admin", "1.0", "fl0wer");

    RegisterHookChain(RG_CBasePlayer_Spawn, "@CBasePlayer__Spawn_Post", true);
}

public plugin_precache()
{
    #define full_player_model_path(%0)            fmt("models/player/%s/%s.mdl", %0, %0)

    precache_model(full_player_model_path(RED));
    precache_model(full_player_model_path(BLUE));
}

@CBasePlayer__Spawn_Post(id)
{
    if (get_entvar(id, var_deadflag) != DEAD_NO)
        return;

    if (~get_user_flags(id) & ADMIN_LEVEL_E)
        return;

    switch (get_member(id, m_iTeam))
    {
        case TEAM_TERRORIST: rg_set_user_model(id, RED);
        case TEAM_CT: rg_set_user_model(id, BLUE);
    }
}
 
Сообщения
443
Реакции
319
Помог
13 раз(а)
Код:
#include <amxmodx>
#include <amxmisc>
#include <reapi>
public plugin_init(){
    RegisterHookChain(RG_CBasePlayer_SetClientUserInfoModel,"SetClientUserInfoModel");
    RegisterHookChain(RG_CBasePlayer_Spawn,"CBasePlayer_Spawn_Post",true);
}
new const formated[] = "models/player/%s/%s.mdl";
new const RED[] = "red";
new const BLUE[] = "blue";
public plugin_precache(){
    new szMdl[65];
    formatex(szMdl,charsmax(szMdl),formated,BLUE,BLUE);precache_model(szMdl);
    formatex(szMdl,charsmax(szMdl),formated,RED,RED);precache_model(szMdl);
}
public CBasePlayer_Spawn_Post(const iPlayer){
    if(!is_user_alive(iPlayer))return;
    static Flags;Flags = get_user_flags(iPlayer) & ADMIN_LEVEL_E;
    if(!Flags)return;
    switch(get_member(iPlayer,m_iTeam)) {
        case TEAM_TERRORIST: rg_set_user_model(iPlayer,RED);
        case TEAM_CT: rg_set_user_model(iPlayer,BLUE);
    }
}
public SetClientUserInfoModel(const pPlayer/* ,infobuffer[],szNewModel[] */){
    if(!is_user_alive(pPlayer))return HC_CONTINUE;
    static Flags;Flags = get_user_flags(pPlayer) & ADMIN_LEVEL_E;
    if(!Flags)return HC_CONTINUE;
    switch(get_member(pPlayer,m_iTeam)){
        case TEAM_TERRORIST: SetHookChainArg(3,ATYPE_STRING,RED);
        case TEAM_CT: SetHookChainArg(3,ATYPE_STRING,BLUE);
    }
    return HC_CONTINUE;
}
 
Последнее редактирование:
Сообщения
73
Реакции
39
Помог
3 раз(а)
fl0wer, Shel, спасибо за варианты. Попробовал от Флоувер - ошибки нет, думаю и во втором варианте от Шела тоже её не будет
 
Сообщения
443
Реакции
319
Помог
13 раз(а)
Во втором варианте меньше потребление памяти(refs instead dups). + недочет со сменой посредством смены model исправлен. Сам смотри.
 
Сообщения
1,701
Реакции
1,512
Помог
26 раз(а)
Во втором варианте меньше потребление памяти (refs instead dups)
Как же оно меньше, если у тебя на один хук больше? (code instead brain)

недочет со сменой посредством смены model исправлен. Сам смотри.
Я думаю оно тут исправлено:scratch_one-s_head:
https://github.com/s1lentq/ReGameDL...c2d2d8498f23aa/regamedll/dlls/player.cpp#L207
Если в другом месте поменяли модель, очевидно, что это и требовалось.
 

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

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