Расстановка спавнов

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
67
Реакции
18
Ошибка
Ошибки, как таковой нет.
Я просто не понимаю, по каким параметрам заполнять конфиг
ОС
Linux
Amx Mod X
AMX Mod X 1.10.0.5461
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.13.0.788-dev
Build date: 07:36:33 Jul 12 2023 (3378)
Build from: https://github.com/dreamstalker/rehlds/commit/f955b07
ReGamedll
ReGameDLL version: 5.26.0.668-dev
Build date: 19:02:48 Dec 31 2023
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/d3c0ec8
Версия Metamod
Metamod-r v1.3.0.149, API (5:13)
Metamod-r build: 11:31:17 Apr 23 2024
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/603a257
Список метамодулей
[ 1] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC5 ini ANY ANY
[ 2] AMX Mod X RUN - amxmodx_mm_i386.so v1.10.0.5461 ini Start ANY
[ 3] Reunion RUN - reunion_mm_i386.so v0.1.92d ini Start Never
[ 4] Revoice RUN - revoice_mm_i386.so v0.1.0.34 ini Start Never
[ 5] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.10.0.5461 pl2 ANY ANY
[ 6] CSX RUN - csx_amxx_i386.so v1.10.0.5461 pl2 ANY ANY
[ 7] FakeMeta RUN - fakemeta_amxx_i386.so v1.10.0.5461 pl2 ANY ANY
[ 8] Engine RUN - engine_amxx_i386.so v1.10.0.5461 pl2 ANY ANY
[ 9] ReAPI RUN - reapi_amxx_i386.so v5.24.0.300-dev pl2 ANY Never
Список плагинов
[ 1] 0 Admin Base 1.10.0.546 AMXX Dev Team admin.amxx running
[ 2] 1 Admin Commands 1.10.0.546 AMXX Dev Team admincmd.am running
[ 3] 2 Admin Help 1.10.0.546 AMXX Dev Team adminhelp.a running
[ 4] 3 Slots Reservation 1.10.0.546 AMXX Dev Team adminslots. running
[ 5] 4 Multi-Lingual System 1.10.0.546 AMXX Dev Team multilingua running
[ 6] 5 Menus Front-End 1.10.0.546 AMXX Dev Team menufront.a running
[ 7] 6 Commands Menu 1.10.0.546 AMXX Dev Team cmdmenu.amx running
[ 8] 7 Players Menu 1.10.0.546 AMXX Dev Team plmenu.amxx running
[ 9] 8 Maps Menu 1.10.0.546 AMXX Dev Team mapsmenu.am running
[ 10] 9 Plugin Menu 1.10.0.546 AMXX Dev Team pluginmenu. running
[ 11] 10 Admin Chat 1.10.0.546 AMXX Dev Team adminchat.a running
[ 12] 11 Anti Flood 1.10.0.546 AMXX Dev Team antiflood.a running
[ 13] 12 Scrolling Message 1.10.0.546 AMXX Dev Team scrollmsg.a running
[ 14] 13 Info. Messages 1.10.0.546 AMXX Dev Team imessage.am running
[ 15] 14 Admin Votes 1.10.0.546 AMXX Dev Team adminvote.a running
[ 16] 15 NextMap 1.10.0.546 AMXX Dev Team nextmap.amx running
[ 17] 16 Nextmap Chooser 1.10.0.546 AMXX Dev Team mapchooser. running
[ 18] 17 TimeLeft 1.10.0.546 AMXX Dev Team timeleft.am running
[ 19] 18 Pause Plugins 1.10.0.546 AMXX Dev Team pausecfg.am running
[ 20] 19 Stats Configuration 1.10.0.546 AMXX Dev Team statscfg.am running
[ 21] 20 StatsX 1.10.0.546 AMXX Dev Team statsx.amxx running
[ 22] 21 Getpos Plugin 1.0 raffe unknown getpos.amxx running
[ 23] 22 Multi-Lingual System 1.9.0.5281 AMXX Dev Team unknown zmb_langueg running
[ 24] 23 [ZMB] Core 1.9.0.5281 81x08 unknown zmb_core.am debug
[ 25] 24 [ZMB] Score Hud 0.0.1 81x08 unknown zmb_score_h debug
[ 26] 25 [ZMB] Other 0.0.1 DalgaPups unknown zmb_other.a debug
[ 27] 26 [ZMB] SpawnSystems 1.0 DalgaPups unknown zmb_spawnsy debug
[ 28] 27 anti block 0.2 cheap_suit unknown zmb_antiblo debug
[ 29] 28 Impact Explode He Gren 1.0.0 DalgaPups unknown zmb_impact_ debug
[ 30] 29 [ReAPI] Healthnade 0.0.2 F@nt0M unknown zmb_impact_ debug
Автор плагина
DalgaPups
Версия плагина
1.0
Исходный код
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <reapi>
#include <zmb>


#define MAX_SPAWNS 128
#define _random(%1) random_num(0, %1 - 1)
#define TASK_ID_ANTIBLOCK 4658756857

#define PLUGIN_NAME "[ZMB] SpawnSystems"
#define PLUGIN_VERS "1.0"
#define PLUGIN_AUTH "DalgaPups"

new Float:g_spawns[MAX_SPAWNS+1][9], g_spawncount;
new bool: g_bInfectionBegan;
new bool:plrSolid[MAX_CLIENTS + 1];
new bool:plrRestore[MAX_CLIENTS + 1];
new Float:g_Origin[MAX_CLIENTS + 1][3];
new iForward[3];

new const Float:size[][3] = {
{0.0, 0.0, 1.0}, {0.0, 0.0, -1.0}, {0.0, 1.0, 0.0}, {0.0, -1.0, 0.0}, {1.0, 0.0, 0.0}, {-1.0, 0.0, 0.0}, {-1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, -1.0, 1.0}, {1.0, 1.0, -1.0}, {-1.0, -1.0, 1.0}, {1.0, -1.0, -1.0}, {-1.0, 1.0, -1.0}, {-1.0, -1.0, -1.0},
{0.0, 0.0, 2.0}, {0.0, 0.0, -2.0}, {0.0, 2.0, 0.0}, {0.0, -2.0, 0.0}, {2.0, 0.0, 0.0}, {-2.0, 0.0, 0.0}, {-2.0, 2.0, 2.0}, {2.0, 2.0, 2.0}, {2.0, -2.0, 2.0}, {2.0, 2.0, -2.0}, {-2.0, -2.0, 2.0}, {2.0, -2.0, -2.0}, {-2.0, 2.0, -2.0}, {-2.0, -2.0, -2.0},
{0.0, 0.0, 3.0}, {0.0, 0.0, -3.0}, {0.0, 3.0, 0.0}, {0.0, -3.0, 0.0}, {3.0, 0.0, 0.0}, {-3.0, 0.0, 0.0}, {-3.0, 3.0, 3.0}, {3.0, 3.0, 3.0}, {3.0, -3.0, 3.0}, {3.0, 3.0, -3.0}, {-3.0, -3.0, 3.0}, {3.0, -3.0, -3.0}, {-3.0, 3.0, -3.0}, {-3.0, -3.0, -3.0},
{0.0, 0.0, 4.0}, {0.0, 0.0, -4.0}, {0.0, 4.0, 0.0}, {0.0, -4.0, 0.0}, {4.0, 0.0, 0.0}, {-4.0, 0.0, 0.0}, {-4.0, 4.0, 4.0}, {4.0, 4.0, 4.0}, {4.0, -4.0, 4.0}, {4.0, 4.0, -4.0}, {-4.0, -4.0, 4.0}, {4.0, -4.0, -4.0}, {-4.0, 4.0, -4.0}, {-4.0, -4.0, -4.0},
{0.0, 0.0, 5.0}, {0.0, 0.0, -5.0}, {0.0, 5.0, 0.0}, {0.0, -5.0, 0.0}, {5.0, 0.0, 0.0}, {-5.0, 0.0, 0.0}, {-5.0, 5.0, 5.0}, {5.0, 5.0, 5.0}, {5.0, -5.0, 5.0}, {5.0, 5.0, -5.0}, {-5.0, -5.0, 5.0}, {5.0, -5.0, -5.0}, {-5.0, 5.0, -5.0}, {-5.0, -5.0, -5.0}
};




public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERS, PLUGIN_AUTH);

register_logevent("LogEventHook_RoundEnd", 2, "1=Round_End");
register_event("HLTV", "EventHook_HLTV", "a", "1=0", "2=0");
register_logevent("LogEventHook_RestartGame", 2, "1=Game_Commencing", "1&Restart_Round_");

RegisterHookChain(RG_CBasePlayer_Spawn, "HC_CBasePlayer_Spawn_Post", true);

new mapname[32];
get_mapname(mapname, charsmax(mapname));
register_spawnpoints(mapname);
}

public EventHook_HLTV()
{
if(get_cvar_num("zmb_antiblock") == 1)
return;

if(get_cvar_num("zmb_randomspawn") != 1)
return;

if(!task_exists(TASK_ID_ANTIBLOCK))
{
set_task(5.0, "DisableAntiblock", TASK_ID_ANTIBLOCK);

iForward[0] = register_forward(FM_PlayerPreThink, "preThink");
iForward[1] = register_forward(FM_PlayerPostThink, "postThink");
iForward[2] = register_forward(FM_AddToFullPack, "addToFullPack", 1);
}

}

public DisableAntiblock()
{
unregister_forward(FM_PlayerPreThink, iForward[0]);
unregister_forward(FM_PlayerPostThink, iForward[1]);
unregister_forward(FM_AddToFullPack, iForward[2]);
remove_task(TASK_ID_ANTIBLOCK);
}
public LogEventHook_RestartGame() {
LogEventHook_RoundEnd();
}
public LogEventHook_RoundEnd()
{
if(get_cvar_num("zmb_antiblock") == 1)
return;

if(get_cvar_num("zmb_randomspawn") != 1)
return;

g_bInfectionBegan = false;

if(task_exists(TASK_ID_ANTIBLOCK))
DisableAntiblock();

}
public HC_CBasePlayer_Spawn_Post(iIndex)
{
if(is_user_alive(iIndex))
{
if(!g_bInfectionBegan)
{
if(get_cvar_num("zmb_randomspawn") == 1 && g_spawncount > 0)
zmb_randomspawn(iIndex);
}

}

}
public bio_fw_core_infect_pre(iIndex, iAttacker, iType)
{
if(get_cvar_num("zmb_randomspawn") == 2 && g_spawncount > 0 && iType == 0)
zmb_randomspawn(iIndex);

g_bInfectionBegan = true;
}
public register_spawnpoints(const mapname[])
{
new configdir[32];
get_configsdir(configdir, 31);

new csdmfile[64], line[64], data[10][6];
formatex(csdmfile, 63, "%s/csdm/%s.spawns.cfg", configdir, mapname);

if(file_exists(csdmfile))
{
new file;
file = fopen(csdmfile, "rt");

while(file && !feof(file))
{
fgets(file, line, 63);
if(!line[0] || str_count(line,' ') < 2)
continue;

parse(line, data[0], 5, data[1], 5, data[2], 5, data[3], 5, data[4], 5, data[5], 5, data[6], 5, data[7], 5, data[8], 5, data[9], 5);

g_spawns[g_spawncount][0] = floatstr(data[0]), g_spawns[g_spawncount][1] = floatstr(data[1]);
g_spawns[g_spawncount][2] = floatstr(data[2]), g_spawns[g_spawncount][3] = floatstr(data[3]);
g_spawns[g_spawncount][4] = floatstr(data[4]), g_spawns[g_spawncount][5] = floatstr(data[5]);
g_spawns[g_spawncount][6] = floatstr(data[7]), g_spawns[g_spawncount][7] = floatstr(data[8]);
g_spawns[g_spawncount][8] = floatstr(data[9]);

if(++g_spawncount >= MAX_SPAWNS)
break;
}
if(file)
fclose(file);
}
}


stock zmb_randomspawn(iIndex = 0)
{
new pId = 0;
if(iIndex)
{
static spawn_index;
spawn_index = _random(g_spawncount);

static Float:spawndata[3];
spawndata[0] = g_spawns[spawn_index][0];
spawndata[1] = g_spawns[spawn_index][1];
spawndata[2] = g_spawns[spawn_index][2];

if(!fm_is_hull_vacant(spawndata, HULL_HUMAN))
{
static i;
for(i = spawn_index + 1; i != spawn_index; i++)
{
if(i >= g_spawncount) i = 0;

spawndata[0] = g_spawns[i][0];
spawndata[1] = g_spawns[i][1];
spawndata[2] = g_spawns[i][2];

if(fm_is_hull_vacant(spawndata, HULL_HUMAN))
{
spawn_index = i;
break;
}
}
}

spawndata[0] = g_spawns[spawn_index][0];
spawndata[1] = g_spawns[spawn_index][1];
spawndata[2] = g_spawns[spawn_index][2];
set_entvar(iIndex, var_origin, spawndata);

spawndata[0] = g_spawns[spawn_index][3];
spawndata[1] = g_spawns[spawn_index][4];
spawndata[2] = g_spawns[spawn_index][5];
set_entvar(iIndex, var_angles, spawndata);

spawndata[0] = g_spawns[spawn_index][6];
spawndata[1] = g_spawns[spawn_index][7];
spawndata[2] = g_spawns[spawn_index][8];
set_entvar(iIndex, var_v_angle, spawndata);

set_entvar(iIndex, var_fixangle, 1);
}
else
{
new TeamName:iTeam ;

static players[32], num, i, id;
get_players(players, num, "a");

for(i = 0; i < num; i++)
{
id = players[i];
pId = id;

iTeam = get_member(id, m_iTeam);
if(iTeam != TEAM_TERRORIST && iTeam != TEAM_CT || get_entvar(id, var_iuser1))
continue;

static spawn_index;
spawn_index = _random(g_spawncount);

static Float:spawndata[3];
spawndata[0] = g_spawns[spawn_index][0];
spawndata[1] = g_spawns[spawn_index][1];
spawndata[2] = g_spawns[spawn_index][2];

if(!fm_is_hull_vacant(spawndata, HULL_HUMAN))
{
static i;
for(i = spawn_index + 1; i != spawn_index; i++)
{
if(i >= g_spawncount) i = 0;

spawndata[0] = g_spawns[i][0];
spawndata[1] = g_spawns[i][1];
spawndata[2] = g_spawns[i][2];

if(fm_is_hull_vacant(spawndata, HULL_HUMAN))
{
spawn_index = i;
break;
}
}
}

spawndata[0] = g_spawns[spawn_index][0];
spawndata[1] = g_spawns[spawn_index][1];
spawndata[2] = g_spawns[spawn_index][2];
set_entvar(id, var_origin, spawndata);

spawndata[0] = g_spawns[spawn_index][3];
spawndata[1] = g_spawns[spawn_index][4];
spawndata[2] = g_spawns[spawn_index][5];
set_entvar(id, var_angles, spawndata);

spawndata[0] = g_spawns[spawn_index][6];
spawndata[1] = g_spawns[spawn_index][7];
spawndata[2] = g_spawns[spawn_index][8];
set_entvar(id, var_v_angle, spawndata);

set_entvar(id, var_fixangle, 1);
}
}
if(is_user_stuck(pId))
{
UTIL_SayText(pId, "%L", pId, "ZMB_PLAYER_STUCK");
}
}


stock bool:fm_is_hull_vacant(const Float:origin[3], hull)
{
static tr;
tr = 0;

engfunc(EngFunc_TraceHull, origin, origin, 0, hull, 0, tr);
return (!get_tr2(tr, TR_StartSolid) && !get_tr2(tr, TR_AllSolid) && get_tr2(tr, TR_InOpen)) ? true : false;
}

stock bool:is_user_stuck(iIndex)
{
static Float:origin[3];
static Float:mins[3], hull;
static Float:vec[3];
static o;

if(is_user_human( iIndex ))
{
get_entvar(iIndex, var_origin, origin);
hull = get_entvar(iIndex, var_flags) & FL_DUCKING ? HULL_HEAD : HULL_HUMAN;


if (!is_hull_vacant(origin, hull,iIndex) && get_entvar(iIndex, var_movetype) != MOVETYPE_NOCLIP && !(get_entvar(iIndex,var_solid) & SOLID_NOT))
{
get_entvar(iIndex, var_mins, mins);
vec[2] = origin[2];
for (o=0; o < sizeof size; ++o)
{
vec[0] = origin[0] - mins[0] * size[o][0];
vec[1] = origin[1] - mins[1] * size[o][1];
vec[2] = origin[2] - mins[2] * size[o][2];
if (is_hull_vacant(vec, hull,iIndex))
{
engfunc(EngFunc_SetOrigin, iIndex, vec);
set_entvar(iIndex,var_velocity,{0.0,0.0,0.0});
o = sizeof size;
return true;
}
}
}
}
return false;
}
stock bool:is_hull_vacant(const Float:origin[3], hull,id) {
static tr;
engfunc(EngFunc_TraceHull, origin, origin, 0, hull, id, tr);
if (!get_tr2(tr, TR_StartSolid) || !get_tr2(tr, TR_AllSolid)) //get_tr2(tr, TR_InOpen))
return true;

return false;
}
stock str_count(str[], searchchar)
{
static maxlen;
maxlen = strlen(str);

static i, count;
count = 0;

for(i = 0; i <= maxlen; i++) if(str[i] == searchchar)
count++;

return count;
}

public addToFullPack(es, e, ent, host, hostflags, player, pSet)
{

if(player)
{
if(get_distance_f( g_Origin[ent], g_Origin[host] ) >= 50.0)
return FMRES_IGNORED;

if(plrSolid[host] && plrSolid[ent])
{
set_es(es, ES_Solid, SOLID_NOT)
//set_es(es, ES_RenderMode, kRenderTransAlpha)
//set_es(es, ES_RenderAmt, 30)
}
}
return FMRES_IGNORED;
}

public preThink(id)
{
//server_print("%d", bool:g_iCvar_AntiBlock);


static i, LastThink

if(LastThink > id)
{
FirstThink()
}
LastThink = id


if(!plrSolid[id]) return FMRES_IGNORED;

for(i = 1; i <= MaxClients; i++)
{
if(!plrSolid[i] || id == i) continue


set_entvar(i, var_solid, SOLID_NOT)
plrRestore[i] = true

}
return FMRES_IGNORED;
}

FirstThink()
{
for(new i = 1; i <= MaxClients; i++)
{
if(!zmb_is_user_alive(i))
{
plrSolid[i] = false
continue
}

plrSolid[i] = get_entvar(i, var_solid) == SOLID_SLIDEBOX ? true : false
get_entvar(i, var_origin, g_Origin[i]);
}
}

public postThink(id)
{

static i

for(i = 1; i <= MaxClients; i++)
{
if(plrRestore[i])
{
set_entvar(i, var_solid, SOLID_SLIDEBOX)
plrRestore[i] = false
}
}
return FMRES_IGNORED;
}
Всем доброго времени. Прошу помочь со следующим вопросом:
Увидев данный пост(отдельная благодарность Limbooc), решил поразбираться с составляющими мода, потихоньку ковыряю, что-то добавляю, что-то убираю.
И вот возник вопрос с работой взаимодействующего с глобальным модом плагина [ZMB] SpawnSystems.

Суть такая, что он для зм добавляет свои спавны, которые берёт из конфига карты.
Внешний вид единственного имеющегося файла de_dust2.spawns.cfg следующий:


Код:
712 -200 36 0 121 0 0 0 121 0
-936 1453 -76 0 163 0 0 0 163 0
-417 267 36 0 -2 0 0 0 -2 0
-458 1703 -92 0 -176 0 0 0 -176 0
-297 1440 4 0 73 0 0 0 73 0
...
Вопрос - первые три цифры это координаты х, у, z? А дальше... э-э-э?
 
В этой теме было размещено решение! Перейти к решению.
Последнее редактирование:
Сообщения
67
Реакции
18
Code_0xABC, это какие углы он измеряет?)
Создаёт чтоли зону спавна(типа прямоугольной 3D области)?
 
Сообщения
1,082
Реакции
58
Помог
11 раз(а)
Ты поменяй значение и поймешь
 
Сообщения
1,700
Реакции
1,512
Помог
26 раз(а)
R1ner, углы (x, y, z) куда будет смотреть игрок при спавне. По факту x - верх/низ, y - лево/право, z - не используется.
 
Сообщения
67
Реакции
18
fl0wer, Благодарю за подробный, а главное, понятный ответ!
 
Статус
В этой теме нельзя размещать новые ответы.

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

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