Knife_duel

Сообщения
460
Реакции
68
Помог
7 раз(а)
Ошибка
L 05/26/2020 - 20:13:48: [ReAPI] get_member: invalid or uninitialized entity
L 05/26/2020 - 20:13:48: [AMXX] Displaying debug trace (plugin "knife_duel.amxx", version "1.2")
L 05/26/2020 - 20:13:48: [AMXX] Run time error 10: native error (native "get_member")
L 05/26/2020 - 20:13:48: [AMXX] [0] knife_duel.sma::CBasePlayer_PreThink_Post (line 114)
ОС
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.696-dev
Build date: 18:46:47 May 18 2020 (2228)
Build from: https://github.com/dreamstalker/rehlds/commit/987ee51
ReGamedll
ReGameDLL version: 5.16.0.461-dev
Build date: 12:59:43 May 18 2020
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/c6875e5
Версия 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.92c ini Start Never
[ 3] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC5 ini ANY ANY
[ 4] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5263 ini Start ANY
[ 5] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 6] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 7] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 8] SQLite RUN - sqlite_amxx_i386.so v1.9.0.5263 pl4 ANY ANY
[ 9] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl4 ANY Never
[10] ReAPI RUN - reapi_amxx_i386.so v5.13.0.194-dev pl4 ANY Never
[11] Engine RUN - engine_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[12] hackdetector RUN - hackdetector_amxx_i386.so v0.15.328.lite pl4 ANY ANY
[13] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5263 pl4 ANY ANY
[14] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5263 pl4 ANY ANY
[15] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5263 pl4 ANY ANY
[16] SxGeo RUN - sxgeo_amxx_i386.so v2.2 pl4 ANY Never
16 plugins, 16 running
Список плагинов
name                    version     author            file             status   
[ 1] CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sql.am debug
[ 2] FreshBans 1.4.2b kanagava fresh_bans_142_ running
[ 3] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 4] ScreenMaker 1.1 neygomon screen_maker.am running
[ 5] RC BaseChanger freesrv custom rc_basechanger. stopped
[ 6] ReChecker Logging freesrv custom rc_logging.amxx running
[ 7] Lite Admin ESP 1.1 neygomon, AcE admin_esp_ace.a running
[ 8] Admin Base 1.9.0.5263 AMXX Dev Team admin.amxx running
[ 9] High Ping Kicker 1.6 UFPS.Team hpk.amxx running
[ 10] AFK Control ReNew 1.2(a) neygomon afk_control.amx running
[ 11] [ReAPI] AWPoff 1.4.3 PAffAEJIkA :3 awp_off.amxx running
[ 12] AES: StatsX 0.5+1 serfreeman1337 aes_statsx_cstr running
[ 13] Stats Configuration 1.9.0.5263 AMXX Dev Team statscfg.amxx running
[ 14] Advanced Gag 1.9.0 neygomon amx_gag.amxx running
[ 15] Maps Menu 1.9.0.5263 AMXX Dev Team mapsmenu.amxx running
[ 16] Server Menu 1.5.0 F@nt0M server_menu.amx running
[ 17] Advanced Kill Assists 1.3b Xelson next21_kill_ass running
[ 18] Parachute Lite [ReAPI] 14.0 Leo_[BH] parachute_leo_1 running
[ 19] DemoRecoder 1.1 neygomon amx_demorec.amx running
[ 20] Rock to Ban 1.02 Safety1st rock2ban.amxx running
[ 21] Players Menu 1.7 neugomon players_menu.am running
[ 22] [ReAPI] Kills Counter 0.3 serfreeman1337 kills_counter.a running
[ 23] SF Warn Menu 0.1.4g serfreeman1337 sf_admin_warns. running
[ 24] AES: StatsX Info Rank 0.1 serfreeman1337 aes_statsx_rank running
[ 25] GameName Changer 1.0 neugomon gamename_change running
[ 26] [ReAPI] Damager 1.1 phe re_damager.amxx running
[ 27] lite screen fade 1.0 AcE re_lite_screen_ running
[ 28] [ReAPI] VIP System 1.3.1 pUzzlik re_vip_system_g running
[ 29] AntiFlood Change Name 28.11.2018 sergrib AntiFlood_Chang running
[ 30] [ReAPI] Random Weapons 2.4.9 neugomon/h1k3 Random_Weapons_ running
[ 31] [ReAPI] Best player of 1.1.2 F@nt0M best_player_of_ running
[ 32] SF Bets 0.1.5 serfreeman1337 sf_bets.amxx running
[ 33] Radio Hudmsg Block 1.0 AcE radio_hudmsg_bl running
[ 34] Lite C4 Timer 1.0.0 neygomon lite_c4timer.am running
[ 35] Advanced MapChooser 1.4 neygomon map_chooser.amx running
[ 36] [ReAPI] No Team Flash 0.0.2 Vaqtincha no_team_flash.a running
[ 37] Items Restrict 1.0 s1lent items_restrict. running
[ 38] Say Rs, Me, Hp 1.0 AcE rs_me_hp.amxx debug
[ 39] Mode 2x2 2.5re s1lent mode.amxx running
[ 40] Knife Duel with Telepo 1.2 neygomon knife_duel.amxx debug
[ 41] Models Replacement 0.0.2 ConnorMcLeod | V models_replacem running
[ 42] Ultimate KillStreak Ad 0.7 SAMURAI ut_killstreak_a running
[ 43] SpecList 1.2a FatalisDK speclist.amxx running
[ 44] Steam Models 0.1b+mod.l Freedo.m steam_models.am running
[ 45] Adverts 1.0 pUzzlik adverts_message running
[ 46] [SxGeo] Connect Info 1.0p s1lent sxgeo_connect_i running
[ 47] Admin Loger 1.0 HARDCORE admin_loger.amx running
[ 48] Lite Translit 2.8 neygomon lite_translit_c running
[ 49] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 50] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 51] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am running
[ 52] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
52 plugins, 51 running
Автор плагина
neygomon
Версия плагина
1.2
Исходный код
// *************************************************************************************
// Плагин загружен с www.neugomon.ru
// Автор: neugomon [ https://neugomon.ru/members/1/ ]
// Официальная тема поддержки: https://neugomon.ru/threads/3291/
// При копировании материала ссылка на сайт www.neugomon.ru ОБЯЗАТЕЛЬНА!
// *************************************************************************************

#include <amxmodx>
#include <reapi>

// #define TEST // Для теста команда в чат /duel. работать будет при любом кол-ве игроков :D Доступ с флагом ADMIN_RCON
#define HITWALL 3 // Сколько раз надо по стене ударить, чтобы вызвать дуель
#define VOTETODUEL 10 // Через сколько секунд считать, что противник зассал
#define HEALTHONDUEL 35 // Сколько HP ставить игрокам на время дуели. 0 - будет столько, сколько осталось за время раунда.
#define SETAIMONOPP // Разворачивать игроков друг к другу лицом :D
#define ANNOUNCE // Показывать сообщение, когда остаются игрока 1 х 1

enum _:TEAMS
{
TT,
CT
}

new HookChain:HookChain_CBasePlayer_PreThink,
HookChain:HookChain_SV_StartSound;

new Float:g_fKnifePos[TEAMS][3];
new g_iInsider, g_iOpponent;

new Float:g_fHitWall[33];
new g_iHitWall[33];

const TASK_VOTE_DUEL = 100;
#if AMXX_VERSION_NUM < 183
#include <colorchat>
#define client_disconnected client_disconnect
#endif
#if !defined REAPI_VERSION || REAPI_VERSION < 5091
#error Oh, no... Needed ReAPI >= 5.0.91
#endif

public plugin_init()
{
register_plugin("Knife Duel with Teleport", "1.2", "neygomon"); // thanks Mistrick for code by Search Spawns

HookChain_SV_StartSound = RegisterHookChain(RH_SV_StartSound, "SV_StartSound_Post", true);
DisableHookChain((HookChain_CBasePlayer_PreThink = RegisterHookChain(RG_CBasePlayer_PreThink, "CBasePlayer_PreThink_Post", true)));
RegisterHookChain(RG_CBasePlayer_Killed, "CBasePlayer_Killed_Post", true);
RegisterHookChain(RG_CSGameRules_CheckMapConditions, "CheckMapConditions_Post", true);
FindSpawnsForDuel();

register_menucmd(register_menuid("VoteToDuel"), MENU_KEY_1|MENU_KEY_2, "VoteHandler");
#if defined TEST
register_clcmd("say /duel", "test");
#endif
}
#if defined TEST
public test(id)
{
if(is_user_alive(id) && get_user_flags(id) & ADMIN_RCON)
{
new ent, ent2;
IsValidPlayersNum(ent, ent2);

g_iOpponent = TeamName:get_member(id, m_iTeam) == TEAM_TERRORIST ? ent2 : ent;
g_iInsider = id;

DisableHookChain(HookChain_SV_StartSound);
GoToDuel();
}
return 1;
}
#endif
public client_disconnected(id)
{
if(id == g_iInsider || id == g_iOpponent)
DuelDidNotTake();
}

public CheckMapConditions_Post()
{
if(g_iInsider)
DuelDidNotTake();
}

public SV_StartSound_Post(const recipients, const entity, const channel, const sample[], const volume, Float:attenuation, const fFlags, const pitch)
{
// if(strcmp(sample, "weapons/knife_hitwall1.wav") == 0)
if(sample[0] == 'w' && sample[7] == '/' && sample[8] == 'k' && sample[13] == '_' && sample[17] == 'w') // вангую говно в error логах
{
new Float:fGameTime = get_gametime();
if(fGameTime - g_fHitWall[entity] > 1.0)
g_iHitWall[entity] = 0;
else
{
new ent1, ent2;
if(g_iHitWall[entity] == HITWALL - 1 && IsValidPlayersNum(ent1, ent2) && !g_iOpponent)
{
VoteToTheDuel(entity, TeamName:get_member(entity, m_iTeam) == TEAM_TERRORIST ? ent2 : ent1);
DisableHookChain(HookChain_SV_StartSound);
}
}
g_iHitWall[entity]++;
g_fHitWall[entity] = fGameTime;
}
}

public CBasePlayer_PreThink_Post(id)
{
if(g_iInsider == id || g_iOpponent == id)
{
if(is_user_alive(id))
{
if(get_member(get_member(id, m_pActiveItem), m_iId) != WEAPON_KNIFE)
engclient_cmd(id, "weapon_knife");
}
}
}

public CBasePlayer_Killed_Post(const victim, const killer)
{
if(g_iInsider)
{
if(task_exists(TASK_VOTE_DUEL))
DuelDidNotTake();
else if(g_iOpponent)
{
if(victim == g_iInsider || victim == g_iOpponent)
DuelDidNotTake();
}
return;
}
#if defined ANNOUNCE
new ent1, ent2;
if(IsValidPlayersNum(ent1, ent2))
{
client_print_color(
ent1,
print_team_default,
"^1[^4Knife Duel^1] ^4Вы остались^3 1 x 1^4! Хотите knife дуель? Чиркните ^3%d раза ^4по стене.",
HITWALL
);
client_print_color(
ent2,
print_team_default,
"^1[^4Knife Duel^1] ^4Вы остались^3 1 x 1^4! Хотите knife дуель? Чиркните ^3%d раза ^4по стене.",
HITWALL
);
}
#endif
}

VoteToTheDuel(id, opponent)
{
new nameId[32], nameOpp[32], sMenu[200];
get_user_name(id, nameId, charsmax(nameId));
get_user_name(opponent, nameOpp, charsmax(nameOpp));

formatex(
sMenu, charsmax(sMenu),
"\r%s\y, Вас вызвал на дуэль \r%s^n\wВы согласны?^n^n\r1. \wДа. Сделаю фарш.^n\r2. \wНет. Я очкую",
nameOpp, nameId
);

show_menu(opponent, MENU_KEY_1|MENU_KEY_2, sMenu, VOTETODUEL, "VoteToDuel");
set_task(float(VOTETODUEL), "DuelDidNotTake", TASK_VOTE_DUEL);

g_iInsider = id;
return PLUGIN_HANDLED;
}

public VoteHandler(id, key)
{
switch(key)
{
case 0:
{
g_iOpponent = id;
remove_task(TASK_VOTE_DUEL);
GoToDuel();
}
case 1:
{
new name[32];
get_user_name(id, name, charsmax(name));
client_print_color(
g_iInsider,
print_team_default,
"^1[^4Knife Duel^1] ^4Игрок ^3%s ^4ссыканул и отказался от дуэли :\",
name
);
DuelDidNotTake();
}
}
return PLUGIN_HANDLED;
}

public DuelDidNotTake()
{
DisableHookChain(HookChain_CBasePlayer_PreThink);
EnableHookChain(HookChain_SV_StartSound);
remove_task(TASK_VOTE_DUEL);

g_iInsider = 0;
g_iOpponent = 0;
}

// Idea by Mistrick
// Thanks ^_^
FindSpawnsForDuel()
{
new ent = rg_find_ent_by_class(-1, "info_player_start");
get_entvar(ent, var_origin, g_fKnifePos[TT]);

new ent2 = ent, bool:bFindPlace;
new Float:distance = 1000.0;

while(distance > 100.0 && !bFindPlace)
{
while((ent2 = rg_find_ent_by_class(ent2, "info_player_start")))
{
get_entvar(ent2, var_origin, g_fKnifePos[CT]);
if(get_distance_f(g_fKnifePos[TT], g_fKnifePos[CT]) > distance)
{
bFindPlace = true;
break;
}
}
distance -= 100.0;
ent2 = ent;
}
if(!bFindPlace)
set_fail_state("spawns for duel not found :( govnomap...");
}

GoToDuel()
{
if(is_user_alive(g_iInsider) && is_user_alive(g_iOpponent))
{
set_entvar(g_iInsider, var_origin, g_fKnifePos[0]);
set_entvar(g_iOpponent, var_origin, g_fKnifePos[1]);
#if defined SETAIMONOPP
entity_set_aim(g_iInsider, g_iOpponent);
entity_set_aim(g_iOpponent, g_iInsider);
#endif
#if HEALTHONDUEL > 0
set_entvar(g_iInsider, var_health, float(HEALTHONDUEL));
set_entvar(g_iOpponent, var_health, float(HEALTHONDUEL));
#endif
EnableHookChain(HookChain_CBasePlayer_PreThink);

set_hudmessage(.red = 0, .green = 255, .blue = 0, .x = -1.0, .y = 0.15, .holdtime = 5.0);
show_hudmessage(0, "Дуэль началась! Приятного зрелища :)");
}
}

stock IsValidPlayersNum(&idT = 0, &idCT = 0)
{
new pl[32], tt, ct;
get_players(pl, tt, "ae", "TERRORIST");
idT = pl[0];
get_players(pl, ct, "ae", "CT");
idCT = pl[0];
return (tt == 1 && ct == 1);
}

stock entity_set_aim(id, ent)
{
new Float:vOrigin[3], Float:vEntOrigin[3];
get_entvar(id, var_origin, vOrigin);
get_entvar(ent, var_origin, vEntOrigin);

vOrigin[0] -= vEntOrigin[0];
vOrigin[1] -= vEntOrigin[1];
vOrigin[2] -= vEntOrigin[2];

new Float:vNewAngles[3], Float:vAimVector[3], Float:v_length;
v_length = vector_length(vOrigin);

vAimVector[0] = vOrigin[0] / v_length;
vAimVector[1] = vOrigin[1] / v_length;
vAimVector[2] = vOrigin[2] / v_length;

vector_to_angle(vAimVector, vNewAngles);

vNewAngles[0] *= -1;
vNewAngles[1] += 180;

set_entvar(id, var_angles, vNewAngles);
set_entvar(id, var_fixangle, 1);
}
Привет форумчане помогите решить ошибку. Заранее спасибо.
 
В этой теме было размещено решение! Перейти к решению.

hajimura

Е777КХ05
Сообщения
290
Реакции
228
Помог
6 раз(а)
HARDCORE, а Вы точно используете эту скомпилированную версию исходника? Попробуйте скомпилировать исходник и перезалейте плагин. Просто, судя по ошибке, в коде напрашивается проверка на коннект игрока, но она уже там стоит
 
Последнее редактирование:
Сообщения
460
Реакции
68
Помог
7 раз(а)
shadow, здравствуйте. Да точно, и был компилен на предидущей версии реапи. Но конечно я зделаю так как вы указали. Если будут ошибки отпишу.
Прошу администрацыю пока не закрывать тему.
 

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

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