Тиммейты разминирывают мины

Сообщения
702
Реакции
54
Ошибка
тиммейты наступают на мины и взрывают их (урон вроде не получают, но всё же)
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5235
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (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.318-dev
Build date: 21:07:26 Oct 30 2018
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/932001b
Версия 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] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC3 ini ANY ANY
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.0.133 ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 4] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5235 ini Start ANY
[ 5] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 6] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 7] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 8] SafeNameAndChat RUN - SafeNameAndChat.so v1.1 ini ANY ANY
[ 9] MySQL RUN - mysql_amxx_i386.so v1.9.0.5235 pl4 ANY ANY
[10] ReAPI RUN - reapi_amxx_i386.so v5.6.0.160-dev pl4 ANY Never
[11] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl4 ANY Never
[12] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5235 pl4 ANY ANY
[13] CSX RUN - csx_amxx_i386.so v1.8.3-Re pl4 ANY ANY
[14] Engine RUN - engine_amxx_i386.so v1.9.0.5235 pl4 ANY ANY
[15] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5235 pl4 ANY ANY
15 plugins, 15 running
Список плагинов
amxx plugins
Currently loaded plugins:
name version author file status
[ 1] Lite Bans 2.2 neygomon lite_bans_off.a running
[ 2] Admin Loader 3.5 neygomon admin_loader.am running
[ 3] ScreenMaker 1.1 neygomon screen_maker.am running
[ 4] [ReAPI] AdminFreeLook 1.0 ReHLDS Team adminfreelook.a running
[ 5] Advanced Gag 1.9.0 neygomon amx_gag.amxx running
[ 6] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 7] Admin Commands 1.9.0.5229 AMXX Dev Team admincmd.amxx running
[ 8] Commands Menu 1.9.0.5229 AMXX Dev Team cmdmenu.amxx running
[ 9] Maps Menu 1.4.1 neugomon mapsmenu.amxx running
[ 10] Players Menu 1.7 neugomon players_menu.am running
[ 11] Menus Front-End 1.4 neugomon menufront_end.a running
[ 12] Admin Chat 1.9.0.5229 AMXX Dev Team adminchat.amxx running
[ 13] Admin Votes 1.9.0.5229 AMXX Dev Team adminvote.amxx running
[ 14] Advanced MapChooser 1.4 neygomon map_chooser.amx running
[ 15] CSX Easy Stats 1.9 neugomon csx_easy_stats. running
[ 16] Stats Configuration 1.9.0.5229 AMXX Dev Team statscfg.amxx running
[ 17] Advert Messages 1.2.2 neygomon adverts.amxx running
[ 18] Ping Kicker 1.0 DUKKHAZ0R ping_control.am running
[ 19] Afk Control 0.5.1 neygomon afk_control.amx running
[ 20] Lite Recoder 1.0.1 neygomon amx_demorec.amx running
[ 21] Auto Balancing 1.2 MakapoH. auto_balancing. debug
[ 22] Multiple Game Names 1.0 mforce gamename_change running
[ 23] unknown unknown unknown rc_logs.amxx running
[ 24] [ReAPI] Reset Score 0.1 pUzzlik re_reset_score. running
[ 25] Killer ScreenFade 0.0.5 Vaqtincha reapi_killer_sc running
[ 26] Lite Translit 2.8 neygomon lite_translit.a running
[ 27] Bad Nickname 0.0.1 Jumper valve-ms-boost. running
[ 28] Battle Mod: Levels 1.1-dev MakapoH. battle_mod_leve debug
[ 29] Battle Mod: Classes 1.6-dev MakapoH. battle_mod_clas debug
[ 30] Class: War Hero 0.5-dev MakapoH. class_war_hero. debug
[ 31] Class: Crazy 1.1-dev MakapoH. class_crazy.amx debug
[ 32] Class: Doctor 0.6-dev MakapoH. class_doctor.am debug
[ 33] Class: Engineer 1.1-dev MakapoH. class_engineer. debug
[ 34] Class: Kamikaze 0.7-dev MakapoH. class_kamikaze. debug
[ 35] Class: Ninja 0.5-dev MakapoH. class_ninja.amx debug
[ 36] Class: Alchemist 0.9-dev MakapoH. class_alchemist debug
[ 37] Class: Demoman 1.0-dev MakapoH. class_demoman.a debug
[ 38] Battle Mod 0.3-dev MakapoH. battle_mod.amxx debug
[ 39] Battle Menu 2.0 ThePhoenix battle_help.amx debug
[ 40] Skills 1.0 fl0wer skills.amxx debug
[ 41] Shop 1.1 fl0wer shop.amxx debug
[ 42] [ReAPI] Kill Rewards 0.0.3 Vaqtincha reapi_kill_rewa debug
[ 43] say /help 1.0 ThePhoenix say_help.amxx running
[ 44] Class: Titan 0.8-dev MakapoH. class_titan.amx debug
44 plugins, 44 running
Автор плагина
не суть
Версия плагина
не суть
Исходный код
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);

register_touch("mine", "player", "Touch_Mine");

RegisterHookChain(RG_CBasePlayer_PreThink, "CBasePlayer_PreThink_Pre", 0);
RegisterHookChain(RG_CSGameRules_RestartRound, "CSGameRules_RestartRound_Pre", 0);

forward_put_mine_id = CreateMultiForward("put_mine", ET_IGNORE, FP_CELL, FP_CELL);
forward_explode_mine_id = CreateMultiForward("explode_mine", ET_CONTINUE, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT);
}

public client_putinserver(id)
mine_num[id] = 0;

public CSGameRules_RestartRound_Pre()
{
arrayset(mine_num, 0, sizeof(mine_num));

new ent = -1;
while((ent = rg_find_ent_by_class(ent, "mine")))
set_entvar(ent, var_flags, get_entvar(ent, var_flags) | FL_KILLME);
}

public CBasePlayer_PreThink_Pre(const id)
{
if(!is_user_alive(id))
return HC_CONTINUE;

if(bm_get_player_class(id) != class_id)
return HC_CONTINUE;

if(get_entvar(id, var_button) & IN_USE)
UseAbility(id);

return HC_CONTINUE;
}

public bool:UseAbility(id)
{
if(mine_num[id] >= MAX_MINES)
return false;

static Float:game_time, Float:mine_time[MAX_CLIENTS + 1];
game_time = get_gametime();

if(mine_time[id] > game_time)
return false;

new Float:origin[3];
get_entvar(id, var_origin, origin);

new ent = rg_create_entity("info_target");

set_entvar(ent, var_classname, "mine");
set_entvar(ent, var_owner, id);
set_entvar(ent, var_origin, origin);
set_entvar(ent, var_solid, SOLID_BBOX);

entity_set_model(ent, MODEL_NAME);
entity_set_size(ent, Float:{ -16.0, -16.0, 0.0 }, Float:{ 16.0, 16.0, 2.0 }); //tyt bulo offnyto

drop_to_floor(ent);

set_entvar(ent, var_renderfx, kRenderFxNone);
set_entvar(ent, var_rendercolor, { 0.0, 0.0, 0.0 });
set_entvar(ent, var_rendermode, kRenderTransAlpha);
set_entvar(ent, var_renderamt, float(255 / 100 * MINE_VISIBLE));

mine_num[id]++;
mine_time[id] = game_time + MINE_COOLDOWN;

new ret;
ExecuteForward(forward_put_mine_id, ret, ent, id);

return true;
}

public Touch_Mine(ent)
{
new attacker = get_entvar(ent, var_owner);

if(!is_user_connected(attacker))
{
set_entvar(ent, var_flags, get_entvar(ent, var_flags) | FL_KILLME);
return PLUGIN_CONTINUE;
}

new Float:origin[3];
get_entvar(ent, var_origin, origin);

new TeamName:attacker_team = get_member(attacker, m_iTeam);

message_begin_f(MSG_BROADCAST, SVC_TEMPENTITY, origin);
write_byte(TE_EXPLOSION);
write_coord_f(origin[0]);
write_coord_f(origin[1]);
write_coord_f(origin[2]);
write_short(sprite_id);
write_byte(32);
write_byte(20);
write_byte(0);
message_end();

new victim = -1;
while((victim = find_ent_in_sphere(victim, origin, MINE_RADIUS)))
{
if(!is_user_alive(victim))
continue;

if(attacker_team == get_member(victim, m_iTeam))
continue;

new ret;
ExecuteForward(forward_explode_mine_id, ret, ent, attacker, victim, MINE_DAMAGE);

if(!ret)
{
rg_multidmg_clear();
rg_multidmg_add(ent, victim, MINE_DAMAGE, DMG_GRENADE);
rg_multidmg_apply(ent, attacker);
}
}

set_entvar(ent, var_flags, get_entvar(ent, var_flags) | FL_KILLME);

return PLUGIN_CONTINUE;
}
Я либо не замечал, либо такого раньше не видел, но теперь вижу, как свои чуваки пробегают по моим минам и они взрываются :с
Что нужно изменить, чтобы свои не взрывали ничего, а их просто игнорило, как и меня собственно. (только враги могли подорвать)
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
1,701
Реакции
1,512
Помог
26 раз(а)
А зачем искать в сфере по всем энтити, если можно просто цикл по игрокам?
А зачем удалять энтити и прибавлять бит удаления, а не просто удалить её?

По теме:
В аргументах тача нет второй энтити, её нужно проверять на команду, а не в цикле.
 

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

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