Error Sheild CSDM

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
38
Реакции
-1
Помог
1 раз(а)
Ошибка
L 10/30/2019 - 13:32:46: [HAMSANDWICH] Entity out of range (-1)
L 10/30/2019 - 13:32:46: [AMXX] Displaying debug trace (plugin "shit.amxx", version "1.0")
L 10/30/2019 - 13:32:46: [AMXX] Run time error 10: native error (native "ExecuteHamB")
L 10/30/2019 - 13:32:46: [AMXX] [0] shit.sma::destroy_shield_by_owner (line 470)
L 10/30/2019 - 13:32:46: [AMXX] [1] shit.sma::client_disconnected (line 476)
L 10/30/2019 - 13:35:45: [HAMSANDWICH] Entity out of range (-1)
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5249 (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 19 2019 13:31:53
Built from: https://github.com/alliedmodders/amxmodx/commit/6cecb34
Build ID: 5249:6cecb34
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.7.0.692-dev
Build date: 18:58:01 Sep 21 2019 (1988)
Build from: https://github.com/dreamstalker/rehlds/commit/e7232be
ReGamedll
ReGameDLL version: 5.11.0.420-dev+m
Build date: 12:57:16 Oct 9 2019
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/4996564
Версия 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
Список метамодулей
description           stat pend  file                        vers             src  load  unload
[ 1] Reunion RUN - reunion_mm_i386.so v0.1.0.92 ini Start Never
[ 2] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 3] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 4] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 5] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC3 ini ANY ANY
[ 6] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5249 ini Start ANY
[ 7] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 8] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 9] Ultimate Unprecacher RUN - unprecacher_i386.so vBeta 2.5 ini Chlvl Chlvl
[10] MySQL RUN - mysql_amxx_i386.so v1.9.0.5249 pl6 ANY ANY
[11] Fun RUN - fun_amxx_i386.so v1.9.0.5249 pl6 ANY ANY
[12] Engine RUN - engine_amxx_i386.so v1.9.0.5249 pl6 ANY ANY
[13] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5249 pl6 ANY ANY
[14] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5249 pl6 ANY ANY
[15] CSX RUN - csx_amxx_i386.so v1.9.0.5249 pl6 ANY ANY
[16] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5249 pl6 ANY ANY
[17] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl6 ANY Never
[18] ReAPI RUN - reapi_amxx_i386.so v5.10.0.188-dev pl6 ANY Never
[19] CSSB RUN - cssb_amxx_i386.so v5.0.0 pl6 ANY ANY
[20] ReCSDM RUN - csdm_amxx_i386.so v3.6 pl6 ANY ANY
20 плагинов, 20 работают
Список плагинов
name                    version     author            file             status   
[ 1] GameCMS_API 5.2.5 zhorzh78 gamecms_api_5.2 running
[ 2] WebHS 0.1 kanagava fb_web_online.a running
[ 3] FreshBans 1.3.8b kanagava fresh_bans_138_ running
[ 4] Aliases checker 0.8.2 kanagava alias_detector0 running
[ 5] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 6] Admin Commands 1.9.0.5249 AMXX Dev Team admincmd.amxx running
[ 7] Slots Reservation 1.9.0.5249 AMXX Dev Team adminslots.amxx running
[ 8] Menus Front-End 1.5 neugomon menufront.amxx running
[ 9] Commands Menu 1.9.0.5249 AMXX Dev Team cmdmenu.amxx running
[ 10] GameCMS_GagManager 2.2.3 zhorzh78 gamecms_gagmana running
[ 11] New Kick Menu 1.4.2 Radius newkickmenu.amx running
[ 12] Players Menu 1.7 neugomon players_menu.am running
[ 13] Maps Menu 1.4.1 neugomon mapsmenu.amxx running
[ 14] Admin Chat 1.9.0.5249 AMXX Dev Team adminchat.amxx running
[ 15] Admin Votes 1.9.0.5249 AMXX Dev Team adminvote.amxx running
[ 16] [183] NextMap 18.09.25 SKAJIbnEJIb & AM nextmap.amxx running
[ 17] [183] MapChooser RBS 18.10.05 SKAJIbnEJIb & UF mapchooser_rbs. running
[ 18] [183] TimeLeft 18.09.25 SKAJIbnEJIb & AM timeleft.amxx running
[ 19] CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sql.am running
[ 20] AES: StatsX 0.5+1 serfreeman1337 aes_stats.amxx running
[ 21] Stats Configuration 1.9.0.5249 AMXX Dev Team statscfg.amxx running
[ 22] Walls Creator 1.1 d3m37r4 walls_creator.a running
[ 23] Level System by CSStat 1.5.9 Radius level_system.am running
[ 24] Auto Team Balance Adva 1.5.1 Radius team_balans.amx running
[ 25] Main Marvel Menu 1.0 Author menu.amxx running
[ 26] Main Marvel Menu 1.0 Author menu_n.amxx running
[ 27] SF MultiJump 0.2 serfreeman1337 2_jump.amxx running
[ 28] ShowMans 0.1 Author snowmanup.amxx running
[ 29] Hats shop 1.1 R-2 ShopHatsH.amxx running
[ 30] ShopGuns 1.0 Author shop_guns.amxx running
[ 31] Golden Deagle 1.1 AlejandroSk / di wc3_goldendgl.a running
[ 32] Golden m4 1.0 AlejandroSk wc3_Goldenm4.am running
[ 33] Golden Ak 47 1.0 AlejandroSk wc3_goldenak.am running
[ 34] Golden Awp 1.1 Davidoff wc3_extra_golde running
[ 35] AK LONG 1.0 Author wc3_ak47_long.a running
[ 36] Extra: HK416 1.0 Crock / =) (Popr wc3_hk416.amxx running
[ 37] Bajie Minigun 1.0 Author wc3_minigun.amx running
[ 38] ShopGuns 0.1 Author cso_shop.amxx running
[ 39] Cyber Skull-2 1.0 Author skull2.amxx running
[ 40] unknown unknown unknown blaster_extra.a running
[ 41] Cyber AkPaladin 1.0 Author buff_ak.amxx running
[ 42] Cyber M4Dark 1.0 Author buff_m4.amxx running
[ 43] Cyber Newcomen Expert 1.0 Author cso_ne.amxx running
[ 44] Desperado 2.0 Authoor desperado.amxx running
[ 45] Cyber Ethereal 1.0 Author ethereal.amxx running
[ 46] Cyber LionPistol 1.0 Author lion_pistol.amx running
[ 47] Cyber M249Phoenix 1.0 Author m249_phoenix_zp running
[ 48] Cyber RailCannon 1.0 Author normal_railcann running
[ 49] PlasmaGun 1.0 Sokrat PlasmaGun.amxx running
[ 50] Cyber tornado 1.0 Author tornado.amxx running
[ 51] Star Chaser AR 1.0 Author starchaserar.am running
[ 52] unknown unknown unknown scar.amxx running
[ 53] CSSB Dispenser 15.10.2018 SMaster cssbDispenser.a running
[ 54] CSSB Tesla Coil 15.10.2018 SMaster cssbTeslaCoil.a running
[ 55] CSSB Goliath Sentry Gu 23.03.2019 SMaster cssbSentryGuns. running
[ 56] SF TripMine 0.3.4 serfreeman1337 lasermine.amxx debug
[ 57] Laser MInes 1.0 Author h_laser.amxx debug
[ 58] unknown unknown unknown laserfence.amxx running
[ 59] Grenade: Molotov 1.1 xUnicorn grenade_molotov running
[ 60] Tesla Nades 1.3a OT grenade_tesla.a running
[ 61] PumpkinGrenade 4.0 Console grenade_pumpkin running
[ 62] Teleport Smoke Grenade 0.2 \ grenade_telepor running
[ 63] Ultimited Ammo 2.0 Author ultimited_clip. running
[ 64] ADMIN22 1.0 222 fith.amxx running
[ 65] Adverts 1.0 pUzzlik adverts_message running
[ 66] HUD HP-AP 1.0 Error hp_ap.amxx running
[ 67] Damager 1.0 Prayer damager_guns.am running
[ 68] Hook 1.0 Hook hook.amxx running
[ 69] [ReAPI] Custom Models 1.6.1 neugomon models.amxx running
[ 70] Custom Knife Model 0.1 Safety1st custom_knife.am running
[ 71] Remove Dropped Weapons Alpha WPMG PRoSToTeM@ remove.amxx running
[ 72] Custom Radio Commands 0.6 KaLoSZyFeR custom_radio.am running
[ 73] Admin ESP 0.2 Kost & miRror admin_esp_mini. running
[ 74] ZM Buy Bhop 1.0 Author bhop_admin.amxx running
[ 75] VIP Informer 1.0 fl0wer vip.amxx running
[ 76] [183] Afk Time 17.10.30 Sanlerus afk_time.amxx running
[ 77] Parachute for ALL [ReA 3.0 Leo_[BH] parachute.amxx running
[ 78] New_MoneyBonus & Sokra 1.0 NewGame_PL bonus.amxx running
[ 79] Damager 1.0 Prayer damager.amxx running
[ 80] Demo Recorder 2.4.0 F@nt0M demo_recorder.a running
[ 81] Money Limiter 1.0 fl0wer money_limiter.a running
[ 82] Vampire 1.0c Shalfey vampire.amxx running
[ 83] Donate money 0.1 Sanlerus \ di.al transfer_money. running
[ 84] resetscore(ReAPI) 1.0 Phantom resetscore.amxx running
[ 85] Knife Steal Money 0.1 mx?! knife_reward.am running
[ 86] Translate 2.1 OverGame Translate.amxx running
[ 87] Show Motd 0.1 Author vipka.amxx running
[ 88] Advert Messages 1.4.9 Radius (based on advert_messages running
[ 89] ReCSDM Main 3.6 ReCSDM Team csdm_main.amxx running
[ 90] ReCSDM Equip 3.6 ReCSDM Team csdm_equip.amxx running
[ 91] ReCSDM Spawns 3.6 ReCSDM Team csdm_spawn_pres running
[ 92] ReCSDM Misc 3.6 ReCSDM Team csdm_misc.amxx running
[ 93] ReCSDM Stripper 3.6 KWo csdm_stripper.a running
[ 94] ReCSDM Protection 3.6 BAILOPAN csdm_protection running
94 плагинов, 94 работают
Автор плагина
Author
Версия плагина
1.0
Исходный код
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <xs>

#define is_valid_player(%1) ( 1 <= %1 <= g_iMaxPlayers )
#define is_valid_team(%1) ( 0 < %1 < 3 )

// Ресурсы
new const szModels[][] =
{
"models/CSDM/Shield/Block.mdl"
}

new const szSounds[][] =
{
"debris/bustmetal1.wav",
"debris/bustmetal2.wav",
"debris/metal1.wav",
"debris/metal3.wav",
"CSDM/Shield/turridle.wav",
"CSDM/Shield/turrset.wav",
"CSDM/Shield/turrspot.wav",
"CSDM/Shield/building.wav",
"CSDM/Shield/fire.wav",
"weapons/rocket1.wav"
}

new const SHIELD_EXPLODE[] = "sprites/CSDM/Shield/csdm_explode.spr"
// Ресурсы

#define DDM_SHIELD_NAME "ddm_bshield"
#define DDM_SHIELD_TYPE "info_target"

#define is_entity_on_ground(%1) ( pev ( %1, pev_flags ) & FL_ONGROUND )
#define cs_give_user_money(%0,%1) cs_set_user_money(%0,cs_get_user_money(%0)+%1)

#define PLACE_RANGE 45.0


#define NAGRADA 500 // Награда за разрушение
#define REWARD 1000 // Возврат денег, при разрушении своего щита

new const max_player_shield = 1; // Сколько может ставить игрок щитов
new const shield_cost = 2000; // Цена создания щита
new const Float:shield_health = 2000.0; // HP щита

new p_shield_count[33],g_iMaxPlayers,g_SprExp;


public plugin_init()
{
register_plugin("Build Sheild", "1.0", "Author")

RegisterHam(Ham_TakeDamage, DDM_SHIELD_TYPE, "fw_TakeDamage")
RegisterHam(Ham_Killed, DDM_SHIELD_TYPE, "fw_Killed");
RegisterHam(Ham_TakeDamage, "player", "p_fw_TakeDamage")

register_forward (FM_TraceLine, "fw_TraceLine_Post", 1)

g_iMaxPlayers = get_global_int(GL_maxClients)
}

public plugin_precache()
{
for(new i=0;i<sizeof(szModels);i++)
precache_model(szModels[i])

for(new i=0;i<sizeof(szSounds);i++)
precache_sound(szSounds[i])

g_SprExp = precache_model(SHIELD_EXPLODE)
}

public p_fw_TakeDamage( ent, idinflictor, idattacker, Float:damage, damagebits )
{
if(!pev_valid(ent)) return HAM_IGNORED

if(!is_user_connected(ent) || !is_user_connected(idinflictor) || ent == idinflictor)
return HAM_IGNORED

new Float:fOriginAttacker[3],Float:fOriginTarget[3],Float:fOriginHit[3]
pev(ent,pev_origin,fOriginTarget)
pev(idinflictor,pev_origin,fOriginAttacker)
new iHitEnt = fm_trace_line ( idinflictor, fOriginAttacker, fOriginTarget, fOriginHit )

new sClassname[24]
pev ( iHitEnt, pev_classname, sClassname, charsmax ( sClassname ) )

if (equal ( sClassname, DDM_SHIELD_NAME ))
return HAM_SUPERCEDE

return HAM_IGNORED
}

public fw_TakeDamage ( ent, idinflictor, idattacker, Float:damage, damagebits )
{
if ( !pev_valid ( ent ) )
return HAM_IGNORED

new sClassname[24]
pev ( ent, pev_classname, sClassname, charsmax ( sClassname ) )
if (equal ( sClassname, DDM_SHIELD_NAME ))
{
new iOwner = pev(ent,pev_iuser1)

if ( pev( ent,pev_team) == get_user_team ( idattacker ) && idattacker != iOwner && is_valid_player ( idattacker ) && is_user_connected ( idattacker ))
return HAM_SUPERCEDE

emit_sound( ent, CHAN_STATIC, szSounds[3], VOL_NORM, ATTN_NORM, 0, PITCH_NORM );

new Float:direction[3];
GetAimOrigin(idinflictor,direction)
message_begin_f(MSG_PVS,SVC_TEMPENTITY,direction,0)
write_byte(TE_SPARKS)
write_coord_f(direction[0])
write_coord_f(direction[1])
write_coord_f(direction[2])
message_end()
}
return HAM_IGNORED
}

public fw_Killed(ent, idattacker, corpse)
{
if(!pev_valid(ent)) return HAM_IGNORED

static szClassname[32];
pev(ent, pev_classname, szClassname, charsmax(szClassname));

if(equal(szClassname,DDM_SHIELD_NAME))
{
Delete_Sheild(ent, idattacker)
}
return HAM_IGNORED
}

public plugin_natives()
{
register_native("get_shit", "@native_give_shit", 1)
}


@native_give_shit( id )
{
shield_build ( id )
}


public shield_build ( id )
{
if ( !is_user_alive ( id ) )
{
ChatColor ( id, "^3[^4Инфо^3]^1 Мертвым нельзя ставить щит!" )
return PLUGIN_HANDLED
}

new iSentryCount = p_shield_count[id]

if ( iSentryCount >= max_player_shield)
{
ChatColor ( id, "^3[^4Инфо^3]^1 Нельзя установить более %d щитов!",max_player_shield)
return PLUGIN_HANDLED
}

if ( !is_entity_on_ground ( id ) )
{
ChatColor ( id, "^3[^4Инфо^3]^1 Встань на землю, чтобы установить щит!" )
return PLUGIN_HANDLED
}

if ( cs_get_user_money ( id ) < shield_cost)
{
ChatColor ( id, "^3[^4Инфо^3]^1 У вас недостаточно денег! Нужно ^4%d^3$", shield_cost)
return PLUGIN_HANDLED
}

new Float:fPlayerOrigin[3]
pev ( id, pev_origin, fPlayerOrigin )

new Float:fOrigin[3], Float:fAngle[3]
pev ( id, pev_angles, fAngle )
fOrigin = fPlayerOrigin

fOrigin[0] += floatcos ( fAngle[1], degrees ) * PLACE_RANGE
fOrigin[1] += floatsin ( fAngle[1], degrees ) * PLACE_RANGE
fOrigin[0] += floatcos ( fAngle[0], degrees) * PLACE_RANGE
fOrigin[1] += floatcos ( fAngle[1], degrees )
fOrigin[0] -= floatsin ( fAngle[1], degrees )
fOrigin[1] += floatcos ( fAngle[2], degrees )
fOrigin[1] -= floatsin ( fAngle[2], degrees ) * PLACE_RANGE
fOrigin[0] -= floatsin ( fAngle[0], degrees ) * PLACE_RANGE
fOrigin[0] -= PLACE_RANGE

if ( pev ( id, pev_flags ) & FL_DUCKING )
fOrigin[2] += 18.0, fPlayerOrigin[2] += 18.0

new tr = 0, Float:fFraction
engfunc ( EngFunc_TraceLine, fPlayerOrigin, fOrigin, 0, id, tr )
get_tr2 ( tr, TR_flFraction, fFraction )

if ( fFraction != 1.0 )
{
ChatColor ( id, "^3[^4Инфо^3]^1 Здесь не получается установить щит!" )
return PLUGIN_HANDLED
}

if(vector_distance(fPlayerOrigin, fOrigin) > 96.0)
{
ChatColor ( id, "^3[^4Инфо^3]^1 Здесь не получается установить щит!" )
return PLUGIN_HANDLED
}

if ( CreateBShield ( fOrigin, id ) )
{
cs_give_user_money ( id, -shield_cost)
p_shield_count[id] ++
return PLUGIN_HANDLED
}
ChatColor ( id, "^3[^4Инфо^3]^1 Здесь не получается установить щит!" )
return PLUGIN_HANDLED;
}


Delete_Sheild(ent, idattacker =-1)
{
new owner = pev(ent,pev_iuser1)
if(idattacker)
{
if(owner == idattacker)
{
ChatColor(owner, "^3[^4Инфо^3] ^1Вы разрушили собственный щит!")
cs_set_user_money ( owner, min ( cs_get_user_money ( owner ) + REWARD, 20000 ) )
}
else if(is_valid_player(idattacker) && is_user_connected(idattacker))
{
new szName[ 32 ]
get_user_name( idattacker, szName, charsmax( szName ) );
ChatColor ( owner, "^3[^4Инфо^3]^1 %s разрушил ваш щит!",szName)
ChatColor ( idattacker, "^3[^4Инфо^3]^1 Вы разрушили щит врага")
cs_set_user_money(idattacker, min(cs_get_user_money(idattacker) + NAGRADA, 20000))
}
UTIL_BreakModel(ent)
p_shield_count[owner] --
}
else if(idattacker == -1)
UTIL_BreakModel(ent)
}

public destroy_shield_by_owner(owner)
{
if(p_shield_count[owner] == 0)
return PLUGIN_HANDLED

new ent = FM_NULLENT;
while((ent = fm_find_ent_by_class(ent,DDM_SHIELD_NAME)))
{
if(pev(ent,pev_iuser1) != owner) continue
ExecuteHamB(Ham_Killed, ent, -1,16777216);
}
return PLUGIN_HANDLED
}

public client_disconnected(id)
{
destroy_shield_by_owner(id)
p_shield_count[id] = 0;
}

public fw_TraceLine_Post ( Float:start[3], Float:end[3], noMonsters, id )
{
if (!is_user_alive(id))
return PLUGIN_HANDLED

new const hitEnt = get_tr(TR_pHit)

if (!pev_valid(hitEnt))
return FMRES_IGNORED

new classname[32]
pev(hitEnt, pev_classname, classname, 31)

if(!equal(classname, DDM_SHIELD_NAME))
return FMRES_IGNORED

static health
health = pev(hitEnt, pev_health)
if (health <= 0)
return FMRES_IGNORED

static team
team = pev(hitEnt, pev_team)
if (team != get_user_team(id))return FMRES_IGNORED

static maxshp;
maxshp = pev(hitEnt,pev_max_health)
set_dhudmessage(team == 1 ? 150 : 0, 100, team == 2 ? 150 : 0, -1.0, 0.80, 0, 0.7, 0.0)

new OwnName[33]
get_user_name (pev(hitEnt,pev_iuser1), OwnName, sizeof(OwnName) )
show_dhudmessage(id, "Установил %s^nЗдоровье : %d/%d", OwnName, health, maxshp)
return FMRES_IGNORED
}

stock bool:CreateBShield ( Float:origin[3], creator)
{
if ( !CheckLocation ( origin ) )
return false

new ent = create_entity(DDM_SHIELD_TYPE) // func_wall
if (!ent)
return false

origin[2] -= distFromGround(origin, ent)

set_pev(ent,pev_takedamage,DAMAGE_YES)
set_pev(ent,pev_dmg,100.0)
set_pev(ent,pev_health,shield_health)
set_pev(ent,pev_max_health,shield_health)

set_pev(ent, pev_solid, SOLID_SLIDEBOX)//
set_pev(ent, pev_movetype, MOVETYPE_FLY) // head flies base falls
set_pev(ent, pev_team, get_user_team(creator))
fm_set_kvd(ent, "material", "6")

set_pev(ent, pev_classname, DDM_SHIELD_NAME)
engfunc(EngFunc_SetModel, ent, szModels[0])
set_pev ( ent, pev_iuser1, creator )

engfunc( EngFunc_SetSize, ent, Float:{ -10.0, -10.0, 0.0 }, Float:{ 10.0, 10.0, 55.0 } );
set_pev(ent,pev_origin, origin)
new Float:Angles[3]
pev(creator,pev_angles,Angles)
Angles[0] = 0.0
Angles[2] = 0.0
set_pev(ent,pev_angles,Angles)

//


emit_sound(creator, CHAN_AUTO, szSounds[7], 1.0, ATTN_NORM, 0, PITCH_NORM)
return true
}

stock Float:distFromGround(Float:start[3], pSkip)
{
static tr, Float:end[3]
tr = create_tr2()
end[0] = start[0]
end[1] = start[1]
end[2] = -8192.0
engfunc(EngFunc_TraceLine, start, end, IGNORE_MONSTERS, pSkip, tr)
get_tr2(tr, TR_vecEndPos, end)
free_tr2(tr)
return vector_distance(start, end)
}


stock bool:CheckLocation ( const Float:origin[3] )
{
if ( engfunc ( EngFunc_PointContents, origin ) != CONTENTS_EMPTY )
return false

new tr = create_tr2 ()

engfunc ( EngFunc_TraceHull, origin, origin, 0, HULL_HEAD/*HUMAN*/, 0, tr )
if ( !get_tr2 ( tr, TR_InOpen ) || get_tr2 ( tr, TR_StartSolid ) || get_tr2 ( tr, TR_AllSolid ) )
{
free_tr2 ( tr )
return false
}

#define SIZE 16.0

new Float:fTraceEnds[9][3], Float:fTraceHit[3], iHitEnt
fTraceEnds[0][0] = origin[0]
fTraceEnds[0][1] = origin[1]
fTraceEnds[0][2] = origin[2] - SIZE - SIZE
fTraceEnds[1][0] = origin[0] - SIZE
fTraceEnds[1][1] = origin[1] - SIZE
fTraceEnds[1][2] = origin[2] - SIZE - SIZE
fTraceEnds[2][0] = origin[0] + SIZE
fTraceEnds[2][1] = origin[1] - SIZE
fTraceEnds[2][2] = origin[2] - SIZE - SIZE
fTraceEnds[3][0] = origin[0] - SIZE
fTraceEnds[3][1] = origin[1] + SIZE
fTraceEnds[3][2] = origin[2] - SIZE - SIZE
fTraceEnds[4][0] = origin[0] + SIZE
fTraceEnds[4][1] = origin[1] + SIZE
fTraceEnds[4][2] = origin[2] - SIZE - SIZE
fTraceEnds[5][0] = origin[0] - SIZE
fTraceEnds[5][1] = origin[1] - SIZE
fTraceEnds[5][2] = origin[2] + SIZE + SIZE
fTraceEnds[6][0] = origin[0] + SIZE
fTraceEnds[6][1] = origin[1] - SIZE
fTraceEnds[6][2] = origin[2] + SIZE + SIZE
fTraceEnds[7][0] = origin[0] - SIZE
fTraceEnds[7][1] = origin[1] + SIZE
fTraceEnds[7][2] = origin[2] + SIZE + SIZE
fTraceEnds[8][0] = origin[0] + SIZE
fTraceEnds[8][1] = origin[1] + SIZE
fTraceEnds[8][2] = origin[2] + SIZE + SIZE

for (new i = 0, b = 0; i < 9; i++)
{
engfunc ( EngFunc_TraceLine, origin, fTraceEnds[i], 0, 0, tr )
iHitEnt = get_tr2 ( tr, TR_pHit )

if ( iHitEnt != -1 )
{
free_tr2 ( tr )
return false
}

get_tr2 ( tr, TR_vecEndPos, fTraceHit )

for ( b = 0; b < 3; b++ )
{
if ( fTraceEnds[i][b] != fTraceHit[b] )
{
free_tr2 ( tr )
return false
}
}
if ( i < 5 )
{
fTraceHit[0] = fTraceEnds[i][0]
fTraceHit[1] = fTraceEnds[i][1]
fTraceHit[2] = -8192.0

engfunc ( EngFunc_TraceLine, fTraceEnds[i], fTraceHit, 0, 0, tr )
//get_tr2 ( tr, TR_vecEndPos, fTraceHit )
iHitEnt = get_tr2 ( tr, TR_pHit )

if ( pev_valid ( iHitEnt ) )
{
new sClassname[16]
pev ( iHitEnt, pev_classname, sClassname, charsmax ( sClassname ) )
if ( equal ( sClassname, DDM_SHIELD_NAME ) || equal ( sClassname, "NiceDispenser" ) )
{
free_tr2 ( tr )
return false
}
}
}
}
free_tr2 ( tr )
return true
}

stock UTIL_BreakModel(target)
{
new Float:origin[3]
pev(target,pev_origin,origin)
message_begin(MSG_ALL,SVC_TEMPENTITY,{0,0,0},target)
write_byte(TE_SPRITETRAIL) //Спрайт захвата
engfunc( EngFunc_WriteCoord, origin[ 0 ] );
engfunc( EngFunc_WriteCoord, origin[ 1 ] );
engfunc( EngFunc_WriteCoord, origin[ 2 ]+20);
engfunc( EngFunc_WriteCoord, origin[ 0 ] );
engfunc( EngFunc_WriteCoord, origin[ 1 ] );
engfunc( EngFunc_WriteCoord, origin[ 2 ]+80);
write_short(g_SprExp)
write_byte(20)
write_byte(2)
write_byte(3)
write_byte(20)
write_byte(10)
message_end()
return true;
}

stock GetAimOrigin(plr, Float:vOrigin[3])
{
new Float:vStart[3], Float:vViewOfs[3], Float:vDest[3];

pev(plr, pev_origin, vStart);
pev(plr, pev_view_ofs, vViewOfs);

vStart[0] += vViewOfs[0];
vStart[1] += vViewOfs[1];
vStart[2] += vViewOfs[2];

pev(plr, pev_v_angle, vDest);
engfunc(EngFunc_MakeVectors, vDest);
global_get(glb_v_forward, vDest);

vDest[0] *= 9999.0;
vDest[1] *= 9999.0;
vDest[2] *= 9999.0;

vDest[0] += vStart[0];
vDest[1] += vStart[1];
vDest[2] += vStart[2];

engfunc(EngFunc_TraceLine, vStart, vDest, 0, plr, 0);
get_tr2(0, TR_vecEndPos, vOrigin);

return 1;
}

stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)

replace_all(msg, 190, "!g", "^4") // Green Color
replace_all(msg, 190, "!y", "^1") // Default Color
replace_all(msg, 190, "!team", "^3") // Team Color
replace_all(msg, 190, "!team2", "^0") // Team2 Color

if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (!is_user_connected(players[i]))continue
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
return PLUGIN_HANDLED
}
Щит не удаляется при выходе с сервера. Так же выдает ошибки в консоли.

Код:
L 10/30/2019 - 13:32:46: [HAMSANDWICH] Entity out of range (-1)
L 10/30/2019 - 13:32:46: [AMXX] Displaying debug trace (plugin "shit.amxx", version "1.0")
L 10/30/2019 - 13:32:46: [AMXX] Run time error 10: native error (native "ExecuteHamB")
L 10/30/2019 - 13:32:46: [AMXX]    [0] shit.sma::destroy_shield_by_owner (line 470)
L 10/30/2019 - 13:32:46: [AMXX]    [1] shit.sma::client_disconnected (line 476)
L 10/30/2019 - 13:35:45: [HAMSANDWICH] Entity out of range (-1)
 
В этой теме было размещено решение! Перейти к решению.
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.

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

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