• Регистрация на форуме отключена.
    Она будет открываться первого числа каждого месяца на 24 часа.

    Если необходимо - пишите админу группы Dev-CS в Telegram-чате.

Создаются невидимые стены на картах

Сообщения
16
Реакции
4
Ошибка
Автоматически создаются невидимые стены на картах
ОС
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
Билд
ReHLDS version: 3.7.0.697-dev
Build date: 20:42:34 Jul 24 2020 (2295)
Build from: https://github.com/dreamstalker/rehlds/commit/98db467
ReGamedll
ReGameDLL version: 5.18.0.474-dev
Build date: 11:07:34 Jul 16 2020
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/efb06a7
Версия 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.5263      ini  Start ANY
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.0.92c ini Start Never
[ 3] Ultimate Unprecacher RUN - unprecacher_i386.so vBeta 2.5.3 ini Chlvl Chlvl
[ 4] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 5] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC5 ini ANY ANY
[ 6] SQLite RUN - sqlite_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
[ 7] Fun RUN - fun_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
[ 8] Engine RUN - engine_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
[ 9] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
[10] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5271 pl1 ANY ANY
[11] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
[12] CSX RUN - csx_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
[13] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
[14] ReAPI RUN - reapi_amxx_i386.so v5.16.0.198-dev pl1 ANY Never
[15] gRIP RUN - grip_amxx_i386.so v0.1.5 Beta pl1 ANY
Список плагинов
[  1] Polymorph: Mod Manager  1.1.2       Fysiks            dsp_polymorph.a  debug
[ 2] Polymorph: RockTheVote 1.0 Fysiks dsp_poly_rtv_ne running
[ 3] Game Namer Version 1. NeuroToxin dsp_gamename.am running
[ 4] [KZ] Anti Cheat 1.0 deniS & Fame dsp_anticheat_k running
[ 5] FreshBans 1.4.3b kanagava dsp_fresh_bans. running
[ 6] Chats Additions Core 1.0.0-beta Sergey Shorokhov dsp_ca_core.amx running
[ 7] [CA] Gag 1.0.0-beta Sergey Shorokhov dsp_ca_gag.amxx running
[ 8] [CA] Mute menu 1.0.0-beta Sergey Shorokhov dsp_ca_mute.amx running
[ 9] Proxy Check GRIP 2.0-grip juice/voed dsp_proxy_check running
[ 10] Admin Base 1.9.0.5271 AMXX Dev Team dsp_admin.amxx running
[ 11] Admin Menu 1.0 AndrewZ dsp_admin_menu. running
[ 12] Admin Votes 1.9.0.5271 AMXX Dev Team dsp_adminvote.a running
[ 13] Admin Commands 1.9.0.5271 AMXX Dev Team dsp_admincmd.am running
[ 14] Slots Reservation 1.9.0.5271 AMXX Dev Team dsp_adminslots. running
[ 15] Admin Chat 1.9.0.5271 AMXX Dev Team dsp_adminchat.a running
[ 16] Commands Menu 1.9.0.5271 AMXX Dev Team dsp_cmdmenu.amx running
[ 17] Teleport Menu 1.9.0.5271 AMXX Dev Team dsp_telemenu.am running
[ 18] Players Menu 1.9.0.5271 AMXX Dev Team dsp_plmenu_fix. running
[ 19] TimeLeft 1.9.0.5271 AMXX Dev Team dsp_timeleft.am running
[ 20] NextMap 1.9.0.5271 AMXX Dev Team dsp_nextmap.amx running
[ 21] Multi-Lingual System 1.9.0.5271 AMXX Dev Team dsp_multilingua running
[ 22] DeadStrike Menu 1.0 AndrewZ dsp_lang_menu.a running
[ 23] Ultimate Revive 1.0.7 twisterniq dsp_revive.amxx running
[ 24] Lighting Menu 0.1.1 Nordic Warrior dsp_sky_change. running
[ 25] Unlimited Choose Team 1.0 fl0wer dsp_unlimited_t running
[ 26] unknown unknown unknown dsp_loading_sou running
[ 27] Center Msg Fix 0.4 mx?! dsp_center_msg_ running
[ 28] Paint Marker 2.0.0 twisterniq dsp_paint_marke running
[ 29] Paint Marker: Default 1.0.1 twisterniq dsp_paint_marke running
[ 30] PF-Editor 0.0.8 wellasgood dsp_plugins_edi running
[ 31] Surf Fix 1.9 Lopol2010 dsp_surf_fix.am running
[ 32] Voteban CSR 0.8.7beta Leo_[BH] dsp_voteban.amx running
[ 33] Motd 1 TheNega dsp_motd_site.a running
[ 34] Client Autoexec on Con 1.0 Torch dsp_client_cfg. running
[ 35] DSP Cam 1.0 Dean Snow dsp_camera.amxx running
[ 36] Auto recording demo 3.0 IzI | Bonaqua (R dsp_demo.amxx running
[ 37] DSP Bank 1.0 Dean Snow dsp_bank.amxx running
[ 38] Registration System 2016 v1.1 Dean Snow dsp_registratio running
[ 39] CSO Costumes 3.6 Smilex_Gamer dsp_costumes_al running
[ 40] [CS] Player Models API 1.2 WiLS dsp_cs_player_m running
[ 41] CS Misc. Stats 1.9.0.5271 AMXX Dev Team dsp_miscstats.a running
[ 42] Autoresponder/Advertis 0.5 MaximusBrood dsp_ad_manager. running
[ 43] [ReAPI] Custom Models 1.6.1 neugomon dsp_player_mode running
[ 44] OciXCrom's Rank System 3.8 OciXCrom dsp_ranksystem. running
[ 45] Knife Models 3.0 OciXCrom dsp_knife_skins running
[ 46] Chat Manager 4.4 OciXCrom dsp_crx_chatman running
[ 47] CM: Toggle Chat 4.1 OciXCrom dsp_crx_chatman running
[ 48] Classic Server Menu 2.0 Dean Snow dsp_menu_classi running
[ 49] Classic Other Menu 2.0 Dean Snow dsp_menu_cl_oth running
[ 50] ProKreedz Ultimativ v2.4 vato loco [GE-S] dsp_prokreedz.a running
[ 51] ProKreedz Grab v2.4 vato loco [GE-S] dsp_PK_Grab_v2. running
[ 52] ProKreedz Hook v2.4 vato loco [GE-S] dsp_PK_Hook_v2. running
[ 53] ProKreedz Jetpack v2.4 vato loco [GE-S] dsp_PK_Jetpack_ running
[ 54] Spawns Fixer 1.3.3.7. fl0wer dsp_spawns_fixe running
[ 55] KZ Menu 2.0 Dean Snow dsp_KZMenu.amxx running
[ 56] Invis 1.0 DarkGL dsp_KZInvis.amx running
[ 57] JumpStats 2.42 BorJomi dsp_uq_jumpstat running
[ 58] Tops_JumpStats 2.42 BorJomi dsp_uq_jumpstat running
[ 59] MultiPlayer Bhop 1.1.2 ConnorMcLeod dsp_mpbhop.amxx running
[ 60] [Amx] Show TimeLeft 21.11.2017 vk.com/CSPlugin dsp_showtimelef running
[ 61] Restarter 1.0 Dean Snow dsp_mod_restart running
[ 62] Module DisActivator 1.0 Dean Snow dsp_module_disa running
[ 63] Walls Creator 1.1 ь dsp_walls_creat running
Автор плагина
https://dev-cs.ru/members/64/ (d3m37r4)
Версия плагина
1.1
Исходный код
/*
Plugin is based on WalkGuard (https://forums.alliedmods.net/showthread.php?t=55245).
Thanks a mogel (https://forums.alliedmods.net/member.php?u=24745) for base (WalkGuard v1.3.2).
*/

#include <amxmodx>
#include <engine>

#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif

#if !defined client_disconnected
#define client_disconnected client_disconnect
#endif

new const PLUGIN_NAME[] = "Walls Creator";
new const PLUGIN_VERSION[] = "1.1";
new const PLUGIN_AUTHOR[] = "ь";

const ACCESS_FLAG = ADMIN_LEVEL_A; // Флаг доступа к меню создания/редактирования/удаления заграждения

const MAX_WALLS = 64; // Максимальное кол-во заграждений на карте
const TASK_ID_SHOW_WALLS = 1024;

#if !defined NULLENT
const NULLENT = -1;
#endif

new const FOLDER_NAME[] = "walls_data"; // Папка в которой хранятся файлы с настройками для карт
new const FILE_FORMAT[] = "dat"; // Формат файлов

new const ENT_CLASSNAME[] = "wall_ent";
new const ENT_SET_MODEL[] = "models/gib_skull.mdl"; // valve/models/gib_skull.mdl
new const SPRITE_BEAM[] = "sprites/laserbeam.spr"; // valve/sprites/laserbeam.spr

enum {X, Y, Z};
enum _:TYPE {WALL_DEFAULT, ACTIVE_WALL, RED_WALL, YELLOW_WALL};
enum _:COLOR {R, G, B};

new const g_Coord[3][] = {"X", "Y", "Z"};
new const g_Color[TYPE][COLOR] = {
{255, 255, 255},
{0, 0, 255},
{255, 0, 0},
{255, 255, 0}
};

new Float:g_vecDefMins[3] = {-32.0, -32.0, -32.0};
new Float:g_vecDefMaxs[3] = {32.0, 32.0, 32.0};

new Float:g_WallPos[MAX_WALLS + 1][3];
new Float:g_WallMins[MAX_WALLS + 1][3];
new Float:g_WallMaxs[MAX_WALLS + 1][3];

new g_iEditorID = 0;
new g_iDirection = 0;
new g_iSetupUnits = 10;

new g_iWallsCount, g_iWallsMax, g_iWall_ID;
new g_iWallIndex[MAX_WALLS + 1];
new g_BeamSprite;
new g_MapName[32];

public plugin_precache()
{
precache_model(ENT_SET_MODEL);
g_BeamSprite = precache_model(SPRITE_BEAM);
}

public plugin_cfg()
{
new szFileDir[128];

get_localinfo("amxx_configsdir", szFileDir, charsmax(szFileDir));
get_mapname(g_MapName, charsmax(g_MapName));

formatex(szFileDir, charsmax(szFileDir), "%s/%s/%s.%s", szFileDir,FOLDER_NAME, g_MapName, FILE_FORMAT);

switch(file_exists(szFileDir))
{
case 0:
{
server_print("[%s] Warning: there is no file with location of barriers for map ^"%s^"!", PLUGIN_NAME, g_MapName);
return;
}
case 1:
{
new iFile = fopen(szFileDir, "rt");

if(iFile)
{
new szBuffer[128], szArgIndex[4];
new szArgPosX[8], szArgPosY[8], szArgPosZ[8];
new szArgMinsX[6], szArgMinsY[6], szArgMinsZ[6];
new szArgMaxsX[6], szArgMaxsY[6], szArgMaxsZ[6];

while(!feof(iFile))
{
fgets(iFile, szBuffer, charsmax(szBuffer));
trim(szBuffer);

if(!(szBuffer[0]) || szBuffer[0] == ';' || szBuffer[0] == '#')
continue;

parse(szBuffer, szArgIndex, charsmax(szArgIndex),
szArgPosX, charsmax(szArgPosX), szArgPosY, charsmax(szArgPosY), szArgPosZ, charsmax(szArgPosZ),
szArgMinsX, charsmax(szArgMinsX), szArgMinsY, charsmax(szArgMinsY), szArgMinsZ, charsmax(szArgMinsZ),
szArgMaxsX, charsmax(szArgMaxsX), szArgMaxsY, charsmax(szArgMaxsY), szArgMaxsZ, charsmax(szArgMaxsZ)
);

UTIL_Vec_Set(g_WallPos[g_iWallsCount], str_to_float(szArgPosX), str_to_float(szArgPosY), str_to_float(szArgPosZ));
UTIL_Vec_Set(g_WallMins[g_iWallsCount], str_to_float(szArgMinsX), str_to_float(szArgMinsY), str_to_float(szArgMinsZ));
UTIL_Vec_Set(g_WallMaxs[g_iWallsCount], str_to_float(szArgMaxsX), str_to_float(szArgMaxsY), str_to_float(szArgMaxsZ));

g_iWallIndex[g_iWallsCount] = CreateNewWall(g_WallPos[g_iWallsCount], g_WallMins[g_iWallsCount], g_WallMaxs[g_iWallsCount]);
g_iWallsCount++;
}

fclose(iFile);
}
}
}

FindAllWalls();
HideAllWalls();

if(!g_iWallsCount)
{
server_print("[%s] Warning: file ^"%s^" is empty!", PLUGIN_NAME, szFileDir);
} else {
g_iWall_ID = g_iWallsMax;

server_print("[%s] Success: %d barrier%s were uploaded to ^"%s^" map.", PLUGIN_NAME, g_iWallsMax, (g_iWallsMax > 1) ? "s" : "", g_MapName);
}
}

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);

register_clcmd("wallscreator", "PreOpen_WallsCreatorMenu", ACCESS_FLAG);

register_menucmd(register_menuid("WallsCreator Menu"), 1023, "WallsCreator_MenuHandler");
register_menucmd(register_menuid("WallsCreator EditMenu"), 1023, "WallsCreator_EditMenuHandler");
register_menucmd(register_menuid("WallsCreator KillMenu"), 1023, "WallsCreator_KillMenuHandler");

register_dictionary("walls_creator.txt");
}

public client_disconnected(iIndex)
{
if(iIndex == g_iEditorID)
{
HideAllWalls();
g_iEditorID = 0;
}
}

public plugin_end()
SaveAllWalls(0)

public task_ShowWallBox(iEnt)
{
iEnt -= TASK_ID_SHOW_WALLS;

if(!is_valid_ent(iEnt) || !g_iEditorID)
return;

new Float:vPos[3];

entity_get_vector(iEnt, EV_VEC_origin, vPos);

if(!is_in_viewcone(g_iEditorID, vPos) && iEnt != g_iWallIndex[g_iWall_ID])
return;

new Float:vEditorPos[3], Float:vReturn[3];

entity_get_vector(g_iEditorID, EV_VEC_origin, vEditorPos);
trace_line(NULLENT, vEditorPos, vPos, vReturn);

if(iEnt == g_iWallIndex[g_iWall_ID])
UTIL_VisualizeVector(vEditorPos[0], vEditorPos[1], vEditorPos[2] - 16.0, vPos[0], vPos[1], vPos[2], g_Color[RED_WALL]);

new Float:dh = vector_distance(vEditorPos, vPos) - vector_distance(vEditorPos, vReturn)

if(floatabs(dh) > 128.0 && iEnt != g_iWallIndex[g_iWall_ID])
return;

new iColor[3], Float:vMins[3], Float:vMaxs[3];

entity_get_vector(iEnt, EV_VEC_mins, vMins);
entity_get_vector(iEnt, EV_VEC_maxs, vMaxs);

UTIL_Vec_Add(vMins, vPos, vMins);
UTIL_Vec_Add(vMaxs, vPos, vMaxs);

iColor[R] = (g_iWallIndex[g_iWall_ID] == iEnt) ? g_Color[ACTIVE_WALL][R] : g_Color[WALL_DEFAULT][R];
iColor[G] = (g_iWallIndex[g_iWall_ID] == iEnt) ? g_Color[ACTIVE_WALL][G] : g_Color[WALL_DEFAULT][G];
iColor[B] = (g_iWallIndex[g_iWall_ID] == iEnt) ? g_Color[ACTIVE_WALL][B] : g_Color[WALL_DEFAULT][B];

UTIL_CreateBox(vMins, vMaxs, iColor);

if(iEnt != g_iWallIndex[g_iWall_ID])
return;

switch(g_iDirection)
{
case X: // X-координата
{
UTIL_VisualizeVector(vMaxs[0], vMaxs[1], vMaxs[2], vMaxs[0], vMins[1], vMins[2], g_Color[YELLOW_WALL]);
UTIL_VisualizeVector(vMaxs[0], vMaxs[1], vMins[2], vMaxs[0], vMins[1], vMaxs[2], g_Color[YELLOW_WALL]);
UTIL_VisualizeVector(vMins[0], vMaxs[1], vMaxs[2], vMins[0], vMins[1], vMins[2], g_Color[RED_WALL]);
UTIL_VisualizeVector(vMins[0], vMaxs[1], vMins[2], vMins[0], vMins[1], vMaxs[2], g_Color[RED_WALL]);
}
case Y: // Y-координата
{
UTIL_VisualizeVector(vMins[0], vMaxs[1], vMins[2], vMaxs[0], vMaxs[1], vMaxs[2], g_Color[YELLOW_WALL]);
UTIL_VisualizeVector(vMaxs[0], vMaxs[1], vMins[2], vMins[0], vMaxs[1], vMaxs[2], g_Color[YELLOW_WALL]);
UTIL_VisualizeVector(vMins[0], vMins[1], vMins[2], vMaxs[0], vMins[1], vMaxs[2], g_Color[RED_WALL]);
UTIL_VisualizeVector(vMaxs[0], vMins[1], vMins[2], vMins[0], vMins[1], vMaxs[2], g_Color[RED_WALL]);
}
case Z: // Z-координата
{
UTIL_VisualizeVector(vMaxs[0], vMaxs[1], vMaxs[2], vMins[0], vMins[1], vMaxs[2], g_Color[YELLOW_WALL]);
UTIL_VisualizeVector(vMaxs[0], vMins[1], vMaxs[2], vMins[0], vMaxs[1], vMaxs[2], g_Color[YELLOW_WALL]);
UTIL_VisualizeVector(vMaxs[0], vMaxs[1], vMins[2], vMins[0], vMins[1], vMins[2], g_Color[RED_WALL]);
UTIL_VisualizeVector(vMaxs[0], vMins[1], vMins[2], vMins[0], vMaxs[1], vMins[2], g_Color[RED_WALL]);
}
}
}

public PreOpen_WallsCreatorMenu(iIndex, iFlags)
{
if(~get_user_flags(iIndex) & iFlags)
{
console_print(iIndex, "%L", iIndex, "WC_NO_ACCESS");
return PLUGIN_HANDLED;
}

g_iEditorID = iIndex;

FindAllWalls();
ShowAllWalls();
WallsCreator_BuildMenu(iIndex);

return PLUGIN_HANDLED;
}

public WallsCreator_BuildMenu(iIndex)
{
new szMenu[512], iLen;

new iKeys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_9|MENU_KEY_0;

iLen = formatex(szMenu, charsmax(szMenu), "\w[\rWallsCreator Menu\w] %L^n^n", iIndex, "WC_MAIN_MENU");

iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w%L: \r%d^n", iIndex, "WC_TOTAL_BARRIERS", g_iWallsMax);
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w%L: \r%d^n^n", iIndex, "WC_BARRIER_SELECTED", g_iWall_ID);

iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%s %L^n", (g_iWall_ID < g_iWallsMax) ? "\r1. \w" : "\d1. ", iIndex, "WC_NEXT_BARRIER");
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%s %L^n^n", (g_iWall_ID > 1) ? "\r2. \w" : "\d2. ", iIndex, "WC_PREVIOUS_BARRIER");
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%s %L^n^n", (g_iWallsMax < MAX_WALLS) ? "\r3. \w" : "\d3. ", iIndex, "WC_CREATE_BARRIER");
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%s %L^n", is_valid_ent(g_iWallIndex[g_iWall_ID]) ? "\r4. \w" : "\d4. ", iIndex, "WC_EDIT_BARRIER");
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%s %L^n^n", is_valid_ent(g_iWallIndex[g_iWall_ID]) ? "\r5. \w" : "\d5. ", iIndex, "WC_DELETE_BARRIER");

iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r9. \w%L^n", iIndex, "WC_SAVE_SETTINGS");
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r0. \w%L", iIndex, "WC_EXIT_MENU");

show_menu(iIndex, iKeys, szMenu, -1, "WallsCreator Menu");
}

public WallsCreator_MenuHandler(iIndex, iKey)
{
switch(iKey)
{
case 0:
{
g_iWall_ID = (g_iWall_ID < g_iWallsMax) ? ++g_iWall_ID : g_iWall_ID;
WallsCreator_BuildMenu(iIndex);
}
case 1:
{
g_iWall_ID = (g_iWall_ID > 1) ? --g_iWall_ID : g_iWall_ID;
WallsCreator_BuildMenu(iIndex);
}
case 2:
{
if(g_iWallsMax < MAX_WALLS)
{
new Float:vPos[3];

entity_get_vector(iIndex, EV_VEC_origin, vPos);

g_iWallIndex[g_iWallsCount] = CreateNewWall(vPos, g_vecDefMins, g_vecDefMaxs);
g_iWall_ID = g_iWallsCount;

ShowAllWalls();
WallsCreator_BuildEditMenu(iIndex);
}
}
case 3:
{
if(is_valid_ent(g_iWallIndex[g_iWall_ID]))
{
WallsCreator_BuildEditMenu(iIndex);
} else {
WallsCreator_BuildMenu(iIndex);
}
}
case 4: WallsCreator_BuildKillMenu(iIndex);
case 8:
{
SaveAllWalls(iIndex);
WallsCreator_BuildMenu(iIndex);
client_print_color(iIndex, 0, "%L", iIndex, "WC_NEED_CHANGEMAP");
}
case 9: HideAllWalls();
}
}

public WallsCreator_BuildKillMenu(iIndex)
{
new szMenu[512], iLen;

new iKeys = MENU_KEY_0|MENU_KEY_1;

iLen = formatex(szMenu, charsmax(szMenu), "\w[\rWallsCreator Menu\w] %L^n^n", iIndex, "WC_DELETING_BARRIER");

iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r1. \w%L^n", iIndex, "WC_CONFIRM_DELETING");
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r0. \w%L", iIndex, "WC_CANCEL_DELETE");

show_menu(iIndex, iKeys, szMenu, -1, "WallsCreator KillMenu");
}

public WallsCreator_KillMenuHandler(iIndex, iKey)
{
switch(iKey)
{
case 0:
{
remove_entity(g_iWallIndex[g_iWall_ID]);
FindAllWalls();

g_iWall_ID = g_iWallsMax;
WallsCreator_BuildMenu(iIndex);

client_print_color(iIndex, 0, "%L", iIndex, "WC_SUCCESSFULLY_REMOVED");
}
case 9:
{
WallsCreator_BuildMenu(iIndex);
client_print_color(iIndex, 0, "%L", iIndex, "WC_NEED_SAVE_SETTINGS");
}
}
}

public WallsCreator_BuildEditMenu(iIndex)
{
new szMenu[512], iLen;

new iKeys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6;

iLen = formatex(szMenu, charsmax(szMenu), "\w[\rWallsCreator Menu\w] %L^n^n", iIndex, "WC_EDITING");

iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r1. \w%L: [\r%s\w]^n", iIndex, "WC_EDIT_AXIS", g_Coord[g_iDirection]);
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r2. \w%L: [\r%d Unit%s\w]^n^n", iIndex, "WC_EDIT_STEP", g_iSetupUnits, (g_iSetupUnits == 1) ? "": "s");

iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r3. \y%L %L^n", iIndex, "WC_ZOOM", iIndex, g_iDirection == 1 ? "WC_LEFT" : ((1 < g_iDirection) ? "WC_FROM_ABOVE" : "WC_FRONT"));
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r4. \y%L %L^n^n", iIndex, "WC_REDUCE", iIndex, g_iDirection == 1 ? "WC_LEFT" : ((1 < g_iDirection) ? "WC_FROM_ABOVE" : "WC_FRONT"));

iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r5. \r%L %L^n", iIndex, "WC_ZOOM", iIndex, g_iDirection == 1 ? "WC_RIGHT" : ((1 < g_iDirection) ? "WC_FROM_BELOW" : "WC_POSTERIORLY"));
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r6. \r%L %L^n^n", iIndex, "WC_REDUCE", iIndex, g_iDirection == 1 ? "WC_RIGHT" : ((1 < g_iDirection) ? "WC_FROM_BELOW" : "WC_POSTERIORLY"));

iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r0. \w%L", iIndex, "WC_RETURN_MAIN_MENU");

show_menu(iIndex, iKeys, szMenu, -1, "WallsCreator EditMenu");
}

public WallsCreator_EditMenuHandler(iIndex, iKey)
{
new Float:vPos[3], Float:vMins[3], Float:vMaxs[3];

entity_get_vector(g_iWallIndex[g_iWall_ID], EV_VEC_origin, vPos);
entity_get_vector(g_iWallIndex[g_iWall_ID], EV_VEC_mins, vMins);
entity_get_vector(g_iWallIndex[g_iWall_ID], EV_VEC_maxs, vMaxs);

switch(iKey)
{
case 0:
{
g_iDirection = (g_iDirection < 2) ? ++g_iDirection : 0;
WallsCreator_BuildEditMenu(iIndex);
}
case 1:
{
g_iSetupUnits = (g_iSetupUnits < 100) ? g_iSetupUnits * 10 : 1;
WallsCreator_BuildEditMenu(iIndex);
}
case 2:
{
vMins[g_iDirection] -= float(g_iSetupUnits) / 2.0;
vMaxs[g_iDirection] += float(g_iSetupUnits) / 2.0;
vPos[g_iDirection] += float(g_iSetupUnits) / 2.0;

entity_set_vector(g_iWallIndex[g_iWall_ID], EV_VEC_origin, vPos);
entity_set_size(g_iWallIndex[g_iWall_ID], vMins, vMaxs);

WallsCreator_BuildEditMenu(iIndex);
}
case 3:
{
if((floatabs(vMins[g_iDirection]) + vMaxs[g_iDirection]) >= g_iSetupUnits)
{
vMins[g_iDirection] += float(g_iSetupUnits) / 2.0;
vMaxs[g_iDirection] -= float(g_iSetupUnits) / 2.0;
vPos[g_iDirection] -= float(g_iSetupUnits) / 2.0;
}

entity_set_vector(g_iWallIndex[g_iWall_ID], EV_VEC_origin, vPos);
entity_set_size(g_iWallIndex[g_iWall_ID], vMins, vMaxs);

WallsCreator_BuildEditMenu(iIndex);
}
case 4:
{
vMins[g_iDirection] -= float(g_iSetupUnits) / 2.0;
vMaxs[g_iDirection] += float(g_iSetupUnits) / 2.0;
vPos[g_iDirection] -= float(g_iSetupUnits) / 2.0;

entity_set_vector(g_iWallIndex[g_iWall_ID], EV_VEC_origin, vPos);
entity_set_size(g_iWallIndex[g_iWall_ID], vMins, vMaxs);

WallsCreator_BuildEditMenu(iIndex);
}
case 5:
{
if((floatabs(vMins[g_iDirection]) + vMaxs[g_iDirection]) >= g_iSetupUnits)
{
vMins[g_iDirection] += float(g_iSetupUnits) / 2.0;
vMaxs[g_iDirection] -= float(g_iSetupUnits) / 2.0;
vPos[g_iDirection] += float(g_iSetupUnits) / 2.0;
}

entity_set_vector(g_iWallIndex[g_iWall_ID], EV_VEC_origin, vPos);
entity_set_size(g_iWallIndex[g_iWall_ID], vMins, vMaxs);

WallsCreator_BuildEditMenu(iIndex);
}
case 9:
{
WallsCreator_BuildMenu(iIndex);
client_print_color(iIndex, 0, "%L", iIndex, "WC_NEED_SAVE_SETTINGS");
}
}
}

CreateNewWall(Float:vPos[3], Float:vMins[3], Float:vMaxs[3])
{
new iEnt = create_entity("info_target");

entity_set_string(iEnt, EV_SZ_classname, ENT_CLASSNAME);
entity_set_model(iEnt, ENT_SET_MODEL);
entity_set_origin(iEnt, vPos);
entity_set_int(iEnt, EV_INT_movetype, MOVETYPE_PUSH);

if(g_iEditorID)
{
entity_set_int(iEnt, EV_INT_solid, SOLID_NOT);
} else {
entity_set_int(iEnt, EV_INT_solid, SOLID_BBOX);
}

entity_set_size(iEnt, vMins, vMaxs);
set_entity_visibility(iEnt, 0);

return iEnt;
}

FindAllWalls()
{
new iEnt = NULLENT;
g_iWallsCount = 0;

while((iEnt = find_ent_by_class(iEnt, ENT_CLASSNAME)))
g_iWallIndex[++g_iWallsCount] = iEnt;

g_iWallsMax = g_iWallsCount;
g_iWallsCount += 1;
}

HideAllWalls()
{
g_iEditorID = 0;

for(new i; i < g_iWallsCount; i++)
{
if(is_valid_ent(g_iWallIndex[i]))
{
entity_set_int(g_iWallIndex[i], EV_INT_solid, SOLID_BBOX);
remove_task(TASK_ID_SHOW_WALLS + g_iWallIndex[i]);
}
}
}

ShowAllWalls()
{
FindAllWalls();

for(new i; i < g_iWallsCount; i++)
{
if(is_valid_ent(g_iWallIndex[i]))
{
if(task_exists(TASK_ID_SHOW_WALLS + g_iWallIndex[i]))
remove_task(TASK_ID_SHOW_WALLS + g_iWallIndex[i]);

entity_set_int(g_iWallIndex[i], EV_INT_solid, SOLID_NOT);
set_task(0.2, "task_ShowWallBox", TASK_ID_SHOW_WALLS + g_iWallIndex[i], _, _, "b");
}
}
}

SaveAllWalls(iIndex)
{
new szFileDir[128], szBuffer[128];

get_localinfo("amxx_configsdir", szFileDir, charsmax(szFileDir));

formatex(szFileDir, charsmax(szFileDir), "%s/%s/", szFileDir,FOLDER_NAME);

if(!dir_exists(szFileDir))
mkdir(szFileDir);

formatex(szFileDir, charsmax(szFileDir), "%s/%s.%s", szFileDir, g_MapName, FILE_FORMAT);

if(file_exists(szFileDir))
delete_file(szFileDir);

FindAllWalls();

formatex(szBuffer, charsmax(szBuffer), "#^n\
# File was created for %s^n\
#^n\
# <Wall Index> <Position X Y Z> <Mins X Y Z> <Maxs X Y Z>^n\
#^n", g_MapName
);
write_file(szFileDir, szBuffer);

for(new i; ++i < g_iWallsCount;)
{
new Float:vPos[3], Float:vMins[3], Float:vMaxs[3]

entity_get_vector(g_iWallIndex[i], EV_VEC_origin, vPos);
entity_get_vector(g_iWallIndex[i], EV_VEC_mins, vMins);
entity_get_vector(g_iWallIndex[i], EV_VEC_maxs, vMaxs);

formatex(szBuffer, charsmax(szBuffer), "%d %.1f %.1f %.1f %.0f %.0f %.0f %.0f %.0f %.0f",
i, vPos[0], vPos[1], vPos[2], vMins[0], vMins[1], vMins[2], vMaxs[0], vMaxs[1], vMaxs[2]
);

write_file(szFileDir, szBuffer);
}

if(iIndex > 0)
{
client_print_color(iIndex, 0, "%L ^"^4%s/%s.%s^1^".", iIndex, "WC_PRESERVATION_OF_BARRIERS", FOLDER_NAME, g_MapName, FILE_FORMAT);
} else if(iIndex == 0) {
server_print("[%s] Map Change: All created barriers are stored in file ^"%s/%s.%s^".", PLUGIN_NAME, FOLDER_NAME, g_MapName, FILE_FORMAT);
}
}

stock UTIL_CreateBox(const Float:vecMins[], const Float:vecMaxs[], Color[3])
{
UTIL_VisualizeVector(vecMaxs[0], vecMaxs[1], vecMaxs[2], vecMins[0], vecMaxs[1], vecMaxs[2], Color);
UTIL_VisualizeVector(vecMaxs[0], vecMaxs[1], vecMaxs[2], vecMaxs[0], vecMins[1], vecMaxs[2], Color);
UTIL_VisualizeVector(vecMaxs[0], vecMaxs[1], vecMaxs[2], vecMaxs[0], vecMaxs[1], vecMins[2], Color);
UTIL_VisualizeVector(vecMins[0], vecMins[1], vecMins[2], vecMaxs[0], vecMins[1], vecMins[2], Color);
UTIL_VisualizeVector(vecMins[0], vecMins[1], vecMins[2], vecMins[0], vecMaxs[1], vecMins[2], Color);
UTIL_VisualizeVector(vecMins[0], vecMins[1], vecMins[2], vecMins[0], vecMins[1], vecMaxs[2], Color);
UTIL_VisualizeVector(vecMins[0], vecMaxs[1], vecMaxs[2], vecMins[0], vecMaxs[1], vecMins[2], Color);
UTIL_VisualizeVector(vecMins[0], vecMaxs[1], vecMins[2], vecMaxs[0], vecMaxs[1], vecMins[2], Color);
UTIL_VisualizeVector(vecMaxs[0], vecMaxs[1], vecMins[2], vecMaxs[0], vecMins[1], vecMins[2], Color);
UTIL_VisualizeVector(vecMaxs[0], vecMins[1], vecMins[2], vecMaxs[0], vecMins[1], vecMaxs[2], Color);
UTIL_VisualizeVector(vecMaxs[0], vecMins[1], vecMaxs[2], vecMins[0], vecMins[1], vecMaxs[2], Color);
UTIL_VisualizeVector(vecMins[0], vecMins[1], vecMaxs[2], vecMins[0], vecMaxs[1], vecMaxs[2], Color);
}

/* Thanks wopox1337 for stock (https://dev-cs.ru/threads/222/#post-8937) */
stock UTIL_VisualizeVector(Float:vStartX, Float:vStartY, Float:vStartZ, Float:vEndX, Float:vEndY, Float:vEndZ, iColor[3])
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_BEAMPOINTS);
write_coord(floatround(vStartX));
write_coord(floatround(vStartY));
write_coord(floatround(vStartZ));
write_coord(floatround(vEndX));
write_coord(floatround(vEndY));
write_coord(floatround(vEndZ));
write_short(g_BeamSprite);
write_byte(1); // Стартовый кадр
write_byte(1); // Скорость анимации
write_byte(2); // Время существования/life in 0.1's
write_byte(6); // Толщина луча
write_byte(0); // Искажение
write_byte(iColor[0]); // Цвет красный
write_byte(iColor[1]); // Цвет зеленый
write_byte(iColor[2]); // Цвет синий
write_byte(200); // Яркость
write_byte(0); // Скорость
message_end();
}

stock UTIL_Vec_Add(const Float:Vec1[], const Float:Vec2[], Float:Out[])
{
Out[0] = Vec1[0] + Vec2[0];
Out[1] = Vec1[1] + Vec2[1];
Out[2] = Vec1[2] + Vec2[2];
}

stock UTIL_Vec_Set(Float:Vec[], Float:x, Float:y, Float:z)
{
Vec[0] = x;
Vec[1] = y;
Vec[2] = z;
}
Дело в том, что когда включаю один раз плагин Walls Creator, то на некоторых мапах появляются невидимые стены и блоки, при том, что плагин отключен. Все становится нормальным только когда перезагружаешь сервер.

Возможные влияния:
плагин mpbhop, так как тоже оказывает влияние на объекты на карте;
плагин spawnsfixer, тоже оказывает влияние на объекты.
20210320130350_1.jpg
 

Download all Attachments

Сообщения
16
Реакции
4
Дело было в создающемся энтити trigger_camera плагином камеры третьего лица. Каким-то образом у нее ставится функция Freeze Player:

Возможно эта строка ставила эту функцию:
new iEnt = -1;
dllfunc(DLLFunc_Think, iEnt)
 

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

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