Повторно не спавнится энтити

Сообщения
9
Реакции
5
Ошибка
Нет
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5271 (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: Jun 24 2020 13:53:30
Built from: https://github.com/alliedmodders/amxmodx/commit/5eea3e5
Build ID: 5271:5eea3e5
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.8.0.739-dev
Build date: 09:46:24 Apr 21 2021 (2566)
Build from: https://github.com/dreamstalker/rehlds/commit/6a916d7
ReGamedll
ReGameDLL version: 5.20.0.505-dev
Build date: 11:06:14 Apr 17 2021
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/e86284b
Версия 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] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5271 ini Start ANY
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.0.92c ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 4] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 5] Revoice RUN - revoice_mm_i386.so v0.1.0.34 ini Start Never
[ 6] Placeholders disabler RUN - plfix_mm_i386.so v0.0.3 ini Start Never
[ 7] Ultimate Unprecacher RUN - unprecacher_i386.so vBeta 2.5.3 ini Chlvl Chlvl
[ 8] MySQL RUN - mysql_amxx_i386.so v1.9.0.5271 pl1 ANY ANY
[ 9] SQLite RUN - sqlite_amxx_i386.so v1.9.0.5271 pl1 ANY ANY
[10] Fun RUN - fun_amxx_i386.so v1.9.0.5271 pl1 ANY ANY
[11] Engine RUN - engine_amxx_i386.so v1.9.0.5271 pl1 ANY ANY
[12] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5271 pl1 ANY ANY
[13] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5271 pl1 ANY ANY
[14] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5271 pl1 ANY ANY
[15] CSX RUN - csx_amxx_i386.so v1.9.0.5271 pl1 ANY ANY
[16] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5271 pl1 ANY ANY
[17] ReAPI RUN - reapi_amxx_i386.so v5.19.0.211-dev pl1 ANY Never
17 plugins, 17 running
Список плагинов
[  1] Admin Loader            3.5         neygomon          admin_loader.am  running
[ 2] FreshBans 1.4.2b kanagava fresh_bans.amxx running
[ 3] [Reapi] Game name 1.0 HaP[KOOZ] reapi_gamename. running
[ 4] Slots Reservation 1.9.0.5271 AMXX Dev Team adminslots.amxx running
[ 5] Multi-Lingual System 1.9.0.5271 AMXX Dev Team multilingual.am running
[ 6] Commands Menu 1.9.0.5271 AMXX Dev Team cmdmenu.amxx running
[ 7] Maps Menu 1.9.0.5271 AMXX Dev Team mapsmenu.amxx running
[ 8] Admin Chat 1.9.0.5271 AMXX Dev Team adminchat.amxx running
[ 9] Scrolling Message 1.9.0.5271 AMXX Dev Team scrollmsg.amxx running
[ 10] Info. Messages 1.9.0.5271 AMXX Dev Team imessage.amxx running
[ 11] Admin Votes 1.9.0.5271 AMXX Dev Team adminvote.amxx running
[ 12] NextMap 1.9.0.5271 AMXX Dev Team nextmap.amxx running
[ 13] Nextmap Chooser 1.9.0.5271 AMXX Dev Team mapchooser.amxx running
[ 14] TimeLeft 1.9.0.5271 AMXX Dev Team timeleft.amxx running
[ 15] [JBE]Core 2.5a Sanlerus & HaP[K jbe_core_2.amxx running
[ 16] [JBE] Question 1.0 g3cKpunTop jbe_simon_quest running
[ 17] [JBE] Truth or lie 1.0 g3cKpunTop jbe_true_or_lie running
[ 18] Translate 2.2 OverGame jbe_translate.a running
[ 19] [JBE] Advert Manager 1.0 AlexandrFiner jbe_advertmanag running
[ 20] [JBE] HOOK 1.0 arttty7 jbe_hook.amxx running
[ 21] [JBE] Stats 1.5 OverGame & HaP[K jbe_stats.amxx running
[ 22] [UNIVERVAL] Spawn 1.0 CyberSlavik JB_SpawnMenu.am debug
[ 23] Color Bubble Grab 1.0 HOBOSTI & KOTOKU color_bubble.am running
[ 24] [JBE] Boss Menu 1.0 HaP[KOOZ] jbe_smotrmenu.a running
[ 25] [JBE]Spleaf & Block 1.3 thezolotoi & HaP jbe_block.amxx running
[ 26] [JBE] Quest 1.0 OverGame & HaP[K jbe_quest.amxx running
[ 27] [JBE] Ak47 Knife 3.0 ToJI9IHGaa|HaP[K jbe_weapon_ak47 running
[ 28] [JBE] Extra: Anaconda 1.0 Crock / HaP[KOOZ jbe_weapon_anac running
[ 29] [JBE] M82 1.0 Crock jbe_weapon_m82. running
[ 30] [JBE_DM] Birth Day 1.1 Freedo.m jbe_dm_birthday running
[ 31] [JBE] Game Galaxy 1.5 HaP[KOOZ] jbe_dm_galaxy.a running
[ 32] [JBE_DM] Ghosts 1.3 Freedo.m jbe_dm_ghosts.a running
[ 33] [JBE_DM] Hide And Seek 1.3 Freedo.m jbe_dm_hideands running
[ 34] [JBE_DM] Ringolevio 1.1 Freedo.m jbe_dm_ringolev running
[ 35] [JBE_DM] Sparta 1.1 Freedo.m jbe_dm_sparta.a running
[ 36] [JBE] Game Zombie 1.0 HaP[KOOZ] jbe_dm_zm.amxx running
[ 37] Players Menu 1.9.0.5271 AMXX Dev Team plmenu.amxx running
37 plugins, 37 running
Автор плагина
CyberSlavik & thezolotoi
Версия плагина
0.8
Исходный код
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <xs>
#include <engine>

#pragma semicolon 1
#pragma compress 1

native jbe_get_chief_id();
native jbe_get_user_team(pPlayer);

new g_iCreeperID;
new const g_szCreeperModel[] = "models/jb_engine/creeper.mdl";
new const g_szCreeperClassName[] = "ent_creeper";
new const g_szCreeperExplosionSprite[] = "sprites/jb_oasis/flame.spr";
new g_iCreeperSpeed = 261;
new bool:g_bCreeperGame;
new bool:g_bFindEntityBlock;
new g_pSpriteExplosion;
new bool:g_bRadiusDamage = true;
new bool:g_bDrop = false;

new NumSpeedCreeper;
new const szSpeedCreeper[][] =
{
"Стандартная",
"Быстрая",
"Очень быстрая"
};

public plugin_precache()
{
engfunc(EngFunc_PrecacheModel, g_szCreeperModel);
g_pSpriteExplosion = engfunc(EngFunc_PrecacheModel, g_szCreeperExplosionSprite);
}

public plugin_init()
{
register_plugin("[JBE] Creeper", "0.8", "CyberSlavik && thezolotoi");
register_menucmd(register_menuid("Show_CreeperCreate"), MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4 | MENU_KEY_0, "Handle_CreeperCreate");

register_forward(FM_PlayerPreThink, "FakeMeta_PlayerThink_Pre", false);
register_forward(FM_AddToFullPack, "FakeMeta_PlayerAddToFullPack_Post", true);
register_forward(FM_Touch, "FakeMeta_PlayerCreeperTouch_Post", true);

register_clcmd("creperok", "Show_CreeperCreate");
//register_clcmd("messagemode num_creeper_speed", "ClCmd_NumCreeperSpeed");
register_event("HLTV", "EVENT__NewRound", "a", "1=0", "2=0");

register_touch("worldspawn", "ent_creeper", "touch_wall");
register_touch("func_brush", "ent_creeper", "touch_wall");
register_touch("func_breakable", "ent_creeper", "touch_wall");
}

public EVENT__NewRound()
{
g_bCreeperGame = false;
engfunc(EngFunc_RemoveEntity, g_iCreeperID);
g_iCreeperID = 0;
g_bFindEntityBlock = false;
g_bDrop = false;
}

public Show_CreeperCreate(id)
{
if(~get_user_flags(id) & ADMIN_RCON) return PLUGIN_HANDLED;
new szMenu[MAX_MENU_LENGTH], iKeys = MENU_KEY_1 | MENU_KEY_0,
iLen = formatex(szMenu, charsmax(szMenu), "\wКрипер^n^n");

iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[1] \w%s крипера^n", g_iCreeperID == 0 ? "Создать" : "Убрать");
if(g_iCreeperID != 0)
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[2] \w%s игру^n^n", g_bCreeperGame ? "Закончить" : "Начать");
iKeys |= MENU_KEY_2;
}
else iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[2] \d%s игру^n^n", g_bCreeperGame ? "Закончить" : "Начать");
if(!g_bCreeperGame)
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\dНастройки^n\r[3] \wСкорость: \y%s^n", szSpeedCreeper[NumSpeedCreeper]);
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[4] \wУрон от взрыва по радиусу: %s^n", g_bRadiusDamage ? "\yВкл" : "\rВыкл");
iKeys |= MENU_KEY_3 | MENU_KEY_4;
}
else
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\dНастройки^n[#] Скорость: \y%d^n", szSpeedCreeper[NumSpeedCreeper]);
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d[#] Урон от взрыва по радиусу: %s^n", g_bRadiusDamage ? "\yВкл" : "\rВыкл");
}
formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\r[0] \wВыход");
return show_menu(id, iKeys, szMenu, -1, "Show_CreeperCreate");
}

public Handle_CreeperCreate(id, iKey)
{
switch(iKey)
{
case 0:
{
if(g_iCreeperID == 0)
{
new iSeeOrigin[3];
new Float:fSeeOrigin[3];
get_user_origin(id, iSeeOrigin, Origin_AimEndEyes);
IVecFVec(iSeeOrigin, fSeeOrigin);
jbe_create_creeper_world(fSeeOrigin);
}
else
{
g_bCreeperGame = false;
engfunc(EngFunc_RemoveEntity, g_iCreeperID);
g_iCreeperID = 0;
g_bFindEntityBlock = false;
}
}
case 1:
{
if(g_iCreeperID != 0)
{
g_bCreeperGame = !g_bCreeperGame;
if(!g_bCreeperGame)
{
engfunc(EngFunc_RemoveEntity, g_iCreeperID);
g_iCreeperID = 0;
g_bFindEntityBlock = false;
}
}
}
case 2:
{
switch(++NumSpeedCreeper)
{
case 0: g_iCreeperSpeed = 260;
case 1: g_iCreeperSpeed = 320;
case 2: g_iCreeperSpeed = 400;
default: NumSpeedCreeper = 0;
}
}
case 3: g_bRadiusDamage = !g_bRadiusDamage;
case 9: return PLUGIN_HANDLED;
}
return Show_CreeperCreate(id);
}

jbe_create_creeper_world(Float:vecOrigin[3])
{
new iEntity = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
if(!pev_valid(iEntity))
return;

set_pev(iEntity, pev_classname, g_szCreeperClassName);
set_pev(iEntity, pev_movetype, MOVETYPE_FLY);
set_pev(iEntity, pev_solid, SOLID_BBOX);

engfunc(EngFunc_SetModel, iEntity, g_szCreeperModel);
engfunc(EngFunc_SetSize, iEntity, Float:{-10.0, -10.0, 0.0}, Float:{10.0, 10.0, 100.0});
engfunc(EngFunc_SetOrigin, iEntity, vecOrigin);

g_iCreeperID = iEntity;
}

public FakeMeta_PlayerThink_Pre()
{
if(!g_bCreeperGame)
return FMRES_IGNORED;

if(!pev_valid(g_iCreeperID))
return FMRES_IGNORED;

new Float:fOriginCreeper[3];
new iVictim = FM_NULLENT;
new iPlayers[ MAX_PLAYERS ], iNum = 0;
pev(g_iCreeperID, pev_origin, fOriginCreeper);

while((iVictim = engfunc(EngFunc_FindEntityInSphere, iVictim, fOriginCreeper, 1200.0)))
{
if(g_bFindEntityBlock)
break;

if(!is_user_alive(iVictim))
continue;

if(jbe_get_user_team(iVictim) != 1)
continue;

if(0 < iVictim <= MaxClients)
iPlayers[ iNum++ ] = iVictim;
}
if(iNum > 0)
{
iVictim = iPlayers[ random( iNum ) ];
g_bFindEntityBlock = true;
}

if(g_bFindEntityBlock)
{
new Float:fOriginPlayer[3];
new Float:fDistance;
new Float:fAngles[3];
new Float:fVelocity[3];
new Float:fCoordinateX;
new Float:fCoordinateZ;
new Float:fRadian;
new Float:fSpeed;

pev(iVictim, pev_origin, fOriginPlayer);

fDistance = get_distance_f(fOriginCreeper, fOriginPlayer);

pev(g_iCreeperID, pev_angles, fAngles);

fCoordinateX = fOriginPlayer[0] - fOriginCreeper[0];
fCoordinateZ = fOriginPlayer[1] - fOriginCreeper[1];

fRadian = floatatan(fCoordinateZ / fCoordinateX, radian);

fAngles[1] = fRadian * (180 / M_PI);

if(fOriginPlayer[0] < fOriginCreeper[0]) fAngles[1] = fAngles[1] - 180.0;
else fAngles[1] = fRadian * (180 / M_PI);

fSpeed = fDistance / float(g_iCreeperSpeed);

fVelocity[0] = (fOriginPlayer[0] - fOriginCreeper[0]) / fSpeed;
fVelocity[1] = (fOriginPlayer[1] - fOriginCreeper[1]) / fSpeed;
fVelocity[2] = (fOriginPlayer[2] - fOriginCreeper[2]) / fSpeed;

set_pev(g_iCreeperID, pev_angles, fAngles);
set_pev(g_iCreeperID, pev_velocity, fVelocity);
set_pev(g_iCreeperID, pev_framerate, 3.0);
set_pev(g_iCreeperID, pev_nextthink, get_gametime() + 0.01);
}
else
{
g_bCreeperGame = false;
engfunc(EngFunc_RemoveEntity, g_iCreeperID);
g_iCreeperID = 0;
g_bFindEntityBlock = false;
client_print(jbe_get_chief_id(), print_center, "Крипер не может найти жертву");
Show_CreeperCreate(jbe_get_chief_id());
}
return FMRES_IGNORED;
}

public FakeMeta_PlayerAddToFullPack_Post()
{
if(g_bDrop)
return FMRES_IGNORED;

if(!pev_valid(g_iCreeperID))
return FMRES_IGNORED;

if(!g_bCreeperGame)
return FMRES_IGNORED;

if(pev(g_iCreeperID, pev_flags) & FL_ONGROUND)
return FMRES_IGNORED;

engfunc(EngFunc_DropToFloor, g_iCreeperID);

return FMRES_IGNORED;
}

public FakeMeta_PlayerCreeperTouch_Post(iEntity, pPlayer)
{
if(!g_bCreeperGame)
return FMRES_IGNORED;

if(!pev_valid(iEntity))
return FMRES_IGNORED;

if(!is_user_alive(pPlayer))
return FMRES_IGNORED;

if(jbe_get_user_team(pPlayer) != 1)
return FMRES_IGNORED;

new szEntityTouchClassName[MAX_PLAYERS];
pev(iEntity, pev_classname, szEntityTouchClassName, charsmax(szEntityTouchClassName));
if(equal(szEntityTouchClassName, g_szCreeperClassName))
{
new Float:fOriginCreeper[3];
pev(g_bCreeperGame, pev_origin, fOriginCreeper);
fOriginCreeper[2] += 25.0;

message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
{
write_byte(TE_EXPLOSION);
engfunc(EngFunc_WriteCoord, fOriginCreeper[0]);
engfunc(EngFunc_WriteCoord, fOriginCreeper[1]);
engfunc(EngFunc_WriteCoord, fOriginCreeper[2]);
write_short(g_pSpriteExplosion);
write_byte(22);
write_byte(14);
write_byte(TE_EXPLFLAG_NONE);
}
message_end();

/* -> Декали гари на земле после взрыва. Не работают, так как нет соприкосновения с землёй <- */
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
{
write_byte(TE_WORLDDECAL);
engfunc(EngFunc_WriteCoord, fOriginCreeper[0]);
engfunc(EngFunc_WriteCoord, fOriginCreeper[1]);
engfunc(EngFunc_WriteCoord, fOriginCreeper[2] - 20.0);
write_byte(random_num(46, 48));
}
message_end();
/* -> Решил не удалять, пусть будут <- */

ExecuteHamB(Ham_Killed, pPlayer, pPlayer, 2);
new iVictimS = FM_NULLENT;
while((iVictimS = engfunc(EngFunc_FindEntityInSphere, iVictimS, fOriginCreeper, 64.0)))
{
if(g_bRadiusDamage)
break;

if(!is_user_alive(iVictimS))
continue;

if(jbe_get_user_team(iVictimS) != 1)
continue;

ExecuteHamB(Ham_TakeDamage, iVictimS, iVictimS, iVictimS, 25.0, DMG_BLAST);
}

g_bCreeperGame = false;
engfunc(EngFunc_RemoveEntity, iEntity);
g_iCreeperID = 0;
g_bFindEntityBlock = false;
}
return FMRES_IGNORED;
}

public touch_wall(entity, client)
{
new Float:delay, Float:gametime; gametime = get_gametime();

if(delay < gametime)
{
delay = gametime + 3.0;
new Float:client_origin[3], Float:client_angle[3];
pev(client, pev_origin, client_origin);
client_origin[2] -= 36.0;
pev(client, pev_v_angle, client_angle);


new Float:futur_origin[3];
origin_infront(client_angle, client_origin, 17.0, futur_origin);

new trace_handle = create_tr2();
engfunc(EngFunc_TraceLine, client_origin, futur_origin, DONT_IGNORE_MONSTERS, client, trace_handle);
get_tr2(trace_handle, TR_vecEndPos, futur_origin);

if(get_distance_f(client_origin, futur_origin) <= 17.0)
{
engfunc(EngFunc_MakeVectors, client_angle);
new Float:forward_vector[3];
get_global_vector(GL_v_forward, forward_vector);

client_angle[0] = forward_vector[0] * 200.0;
client_angle[1] = forward_vector[1] * 200.0;
client_angle[2] = 220.0;

set_pev(client, pev_velocity, client_angle);
g_bDrop = true;
set_task(0.2,"task_on");
}
}
}

public task_on()
{
g_bDrop = false;
}

origin_infront(Float:vAngles[3], Float:vecOrigin[3], Float:flDistance, Float:vecOutput[3])
{
static Float:vecAngles[3];
xs_vec_copy(vAngles, vecAngles);
engfunc(EngFunc_MakeVectors, vecAngles);
global_get(glb_v_forward, vecAngles);
xs_vec_mul_scalar(vecAngles, flDistance, vecAngles);
xs_vec_add(vecOrigin, vecAngles, vecOutput);
}
Плагин спавнит крипера по прицелу, проблема в том что крипер после убийства своей цели, его больше не заспавнишь. Так же некорректно ищет ближайшую цель, а именно выделяет человека, который заспавнил.
 

Вложения

Сообщения
3,023
Реакции
1,731
Помог
79 раз(а)
[ 3] [Reapi] Game name 1.0 HaP[KOOZ] reapi_gamename. running
[ 25] [JBE]Spleaf & Block 1.3 thezolotoi & HaP jbe_block.amxx running
[ 24] [JBE] Boss Menu 1.0 HaP[KOOZ] jbe_smotrmenu.a running
[ 28] [JBE] Extra: Anaconda 1.0 Crock / HaP[KOOZ jbe_weapon_anac running
[ 31] [JBE] Game Galaxy 1.5 HaP[KOOZ] jbe_dm_galaxy.a running
[ 36] [JBE] Game Zombie 1.0 HaP[KOOZ] jbe_dm_zm.amxx running
Ты автор многих своих плагинов, неужели ты не можешь разобраться ?
 

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

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