Пользователь
- Сообщения
- 6
- Реакции
- 0
- Ошибка
-
L 03/31/2024 - 08:37:55: [ENGINE] Invalid entity 110
L 03/31/2024 - 08:37:55: [AMXX] Displaying debug trace (plugin "Fleydonson_lasermine.amxx", version "1.1")
L 03/31/2024 - 08:37:55: [AMXX] Run time error 10: native error (native "entity_get_string")
L 03/31/2024 - 08:37:55: [AMXX] [0] Fleydonson_lasermine.sma::TripMine_Damage (line 933)
Segmentation fault
- ОС
- Windows
- Amx Mod X
-
amxmodx_1.9.0
- Билд
-
Версия билда: ReHLDS
- ReGamedll
-
RegameDLL версии: 5.26.0.668
- Версия Metamod
-
metamod_re.1.3xx
- Список метамодулей
-
[ 1] Reunion RUN - reunion.so v0.1.0.137 ini Start Never
[ 2] AMX Mod X RUN - amxmodx.so v1.9.0.5294 ini Start ANY
[ 3] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5294 pl2 ANY
[ 4] CSX RUN - csx_amxx_i386.so v1.9.0.5294 pl2 ANY
[ 5] ReAPI RUN - reapi_amxx_i386.so v5.24.0.300-dev pl2 ANY Never
[ 6] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5294 pl2 ANY
[ 7] MySQL RUN - mysql_amxx_i386.so v1.9.0.5294 pl2 ANY
[ 8] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5294 pl2 ANY
[ 9] Engine RUN - engine_amxx_i386.so v1.9.0.5294 pl2 ANY
[10] Fun RUN - fun_amxx_i386.so v1.9.0.5294 pl2 ANY ANY
- Список плагинов
-
[ 1] Admin Loader 3.5 neygomon admin_loader.amxx
[ 2] FreshBans 1.4.8b kanagava fresh_bans.amxx
[ 3] Admin Chat 1.9.0.5294 AMXX Dev Team adminchat.amxx
[ 4] Admin Commands 1.9.0.5294 AMXX Dev Team admincmd.amxx
[ 5] Anti Flood 1.9.0.5294 AMXX Dev Team antiflood.amxx
[ 6] Commands Menu 1.9.0.5294 AMXX Dev Team cmdmenu.amxx
[ 7] Info. Messages 1.9.0.5294 AMXX Dev Team imessage.amxx
[ 8] Menus Front-End 1.9.0.5294 AMXX Dev Team menufront.amxx
[ 9] Maps Menu 1.9.0.5294 AMXX Dev Team mapsmenu.amxx
[ 10] NextMap 1.9.0.5294 AMXX Dev Team nextmap.amxx
[ 11] Nextmap Chooser 1.9.0.5294 AMXX Dev Team mapchooser.amxx
[ 12] Players Menu 1.9.0.5294 AMXX Dev Team plmenu.amxx
[ 13] Plugin Menu 1.9.0.5294 AMXX Dev Team pluginmenu.amxx
[ 14] Restrict Weapons 1.9.0.5294 AMXX Dev Team restmenu.amxx
[ 15] TimeLeft 1.9.0.5294 AMXX Dev Team timeleft.amxx
[ 16] Scrolling Message 1.9.0.5294 AMXX Dev Team scrollmsg.amxx
[ 17] Admin Votes 1.9.0.5294 AMXX Dev Team adminvote.amxx
[ 18] CS Misc. Stats 1.9.0.5294 AMXX Dev Team miscstats.amxx
[ 19] CS Stats Logging 1.9.0.5294 AMXX Dev Team stats_logging..amxx
[ 20] Stats Configuration 1.9.0.5294 AMXX Dev Team statscfg.amxx
[ 21] Advanced Experience Sy 0.5 Vega serfreeman1337 advanced_experi.amxx
[ 22] CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sql.amxx
[ 23] Spray Block 0.4 neugomon spray_block.amxx
[ 24] Block Radio Commands 1.0 d3m37r4 block_radio_com.amxx
- Автор плагина
- unknown
- Версия плагина
- unknown
- Исходный код
-
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include < cstrike >
#include <engine>
#include <hamsandwich>
#include <xs>
#include <colorchat>
#define Mine_Model "models/Fleydonson/laserfence.mdl"
#define Mine_Sprite_Laser_CT "sprites/Fleydonson/lasermine_ct.spr"
#define Mine_Sprite_Laser_T "sprites/Fleydonson/lasermine_t.spr"
#define Mine_Sprite_Explo "sprites/zerogxplode.spr"
#define Mine_Sprite_Explo_Extra "sprites/nhth1.spr"
#define Mine_Sound_Placed "Fleydonson/mine_deploy.wav"
#define Mine_Sound_Loading "Fleydonson/mine_charge.wav"
#define Mine_Sound_Activate "Fleydonson/mine_activate.wav"
#define Mine_Sound_Hit "Fleydonson/beamstart9.wav"
new keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0
new g_iBeam_T, g_iBeam_CT
new bool:g_bSettingMine[33]
new g_iMine[33], g_iCountMines[33]
new g_rotating[33]
new g_iCvar[10]
new Float:g_fTime[33], Float:g_fTime2[33]
new g_iSPR_Explo, g_iSPR_Explo2, g_iSPR_Smoke
new g_IDEniti[33]
public plugin_precache()
{
precache_model(Mine_Model)
g_iBeam_CT=precache_model(Mine_Sprite_Laser_CT)
g_iBeam_T=precache_model(Mine_Sprite_Laser_T)
g_iSPR_Explo=precache_model(Mine_Sprite_Explo)
g_iSPR_Explo2=precache_model(Mine_Sprite_Explo_Extra)
g_iSPR_Smoke=precache_model("sprites/black_smoke4.spr")
precache_sound(Mine_Sound_Placed)
precache_sound(Mine_Sound_Loading)
precache_sound(Mine_Sound_Activate)
precache_sound(Mine_Sound_Hit)
}
public plugin_init()
{
register_clcmd("+setfence","clcmd_setlaser_plus")
register_clcmd("-setfence","clcmd_setlaser_minus")
//register_dictionary("laserfence.txt")
RegisterHam(Ham_TakeDamage, "func_breakable", "Laser_TakeDamage")
RegisterHam(Ham_Killed, "player", "ham_killed_post", 1)
register_touch("Laser_Fence", "player", "touch_player")
register_menu("Menu_1", keys, "func_menu")
register_forward(FM_PlayerPreThink, "fm_playerprethink")
register_forward(FM_CmdStart,"fm_cmdstart")
register_think("Laser_Fence", "think_laser_mine")
g_iCvar[0]=register_cvar("lf_damage","1000")
g_iCvar[1]=register_cvar("lf_health","1000")
g_iCvar[2]=register_cvar("lf_reward", "1000")
g_iCvar[3]=register_cvar("lf_explo_effect","1")
g_iCvar[4]=register_cvar("lf_glow","0")
g_iCvar[5]=register_cvar("lf_cost", "2500")
g_iCvar[6]=register_cvar("lf_cost_repair", "1000")
g_iCvar[7]=register_cvar("lf_cost_turn", "200")
g_iCvar[8]=register_cvar("lf_cost_up", "1500")
}
public plugin_natives() register_native("delete_lf", "delete_lf", 1)
public touch_player(ent, id)
{
g_IDEniti[id] = ent
if( pev ( ent, pev_euser4 ) == 1)
{
Server_Menu(id)
}
}
public Server_Menu(id)
{
new name[32]
get_user_name(id, name, 31)
//new status_obgreid[33]
static menu[650], iLen
iLen = 0
iLen = formatex(menu[iLen], charsmax(menu) - iLen, "\r[CSDM \wМеню Лазерного Забора^nПрокачать до [2]-го уровня цена \y[%d $]^n^n", get_pcvar_num(g_iCvar[8]));
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r[1] \wДа^n")
keys |= MENU_KEY_1
}
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r[2] \wНет^n^n")
keys |= MENU_KEY_2
}
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r[0] \wВыход")
keys |= MENU_KEY_0
show_menu(id, keys, menu, -1, "Menu_1");
return PLUGIN_HANDLED
}
public func_menu(id, key)
{
switch(key)
{
case 0:
{
if(cs_get_user_money( id ) >= get_pcvar_num(g_iCvar[8]))
{
cs_set_user_money( id, cs_get_user_money( id ) - get_pcvar_num(g_iCvar[8]) )
set_pev( g_IDEniti[id], pev_euser4, 2 ); // уровень
set_anim( g_IDEniti[id], 0)
engfunc(EngFunc_SetSize, g_IDEniti[id], Float:{ -8.0, -8.0, -4.0 }, Float:{ 8.0, 8.0, 84.0 })
}
else
{
ColorChat(id,BLUE,"^4[CSDM]^1 У вас недостаточно денег! Для прокачки ^4[Лазерного Забора] ^1требуется:^3 1500 $", get_pcvar_num(g_iCvar[8]))
}
}
case 1:
{
}
}
}
public plugin_cfg()
{
new file[128]; get_localinfo("amxx_configsdir",file,63)
format(file, 127, "%s/laserfence.cfg", file)
if(file_exists(file)) server_cmd("exec %s", file), server_exec()
}
public clcmd_setlaser_plus(id)
{
if(!is_user_alive(id)) return PLUGIN_HANDLED
new target, body
get_user_aiming(id, target, body, 64)
static ClassName[32]
pev(target, pev_classname, ClassName, charsmax(ClassName))
if (equal(ClassName, "Laser_Fence"))
{
if(fm_cs_get_user_team(id)!=pev(target, pev_iuser1))
return PLUGIN_HANDLED
g_rotating[id]=1
g_iMine[id]=target
if(get_pcvar_num(g_iCvar[4]))
{
switch(pev(target, pev_iuser1))
{
case 1: fm_set_rendering(target,kRenderFxGlowShell,200,10,10,kRenderTransAdd,150)
case 2: fm_set_rendering(target,kRenderFxGlowShell,10,10,200,kRenderTransAdd,150)
}
} else{
fm_set_rendering(target, kRenderFxNone, 255, 255, 255, kRenderTransAdd, 200)
}
return PLUGIN_HANDLED
}
if(g_iCountMines[id])
{
ColorChat(id,BLUE,"^4[CSDM]^1 Вы поставили максимальное количество^4 [Лазерных Заборов] ^1Всего доступно: ^3[1] на карте")
return PLUGIN_HANDLED
}
if(cs_get_user_money( id ) < get_pcvar_num(g_iCvar[5]))
{
ColorChat(id,BLUE,"^4[CSDM]^1 У вас недостаточно денег! Для покупки ^4[Лазерного Забора] ^1требуется:^3 2500 $", get_pcvar_num(g_iCvar[5]))
return PLUGIN_HANDLED
}
create(id)
g_bSettingMine[id]=true
message_begin(MSG_ONE, 108, _, id)
write_byte(1)
write_byte(0)
message_end()
set_task(1.05, "Task_Spawn_Mine", id+777)
return PLUGIN_HANDLED
}
public Task_Spawn_Mine(taskid)
{
new id=taskid-777
cs_set_user_money( id, cs_get_user_money( id ) - get_pcvar_num(g_iCvar[5]) )
new i_Ent=g_iMine[id]
if(get_pcvar_num(g_iCvar[4]))
{
switch(pev(i_Ent, pev_iuser1))
{
case 1: fm_set_rendering(i_Ent,kRenderFxGlowShell,200,50,50,kRenderNormal,5)
case 2: fm_set_rendering(i_Ent,kRenderFxGlowShell,50,50,200,kRenderNormal,5)
}
} else{
fm_set_rendering(i_Ent)
}
emit_sound(i_Ent, CHAN_VOICE, Mine_Sound_Placed, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
emit_sound(i_Ent, CHAN_BODY , Mine_Sound_Loading, 0.2, ATTN_NORM, 0, PITCH_NORM)
g_bSettingMine[id]=false
g_iCountMines[id]++
set_pev(i_Ent, pev_nextthink, get_gametime()+1.0)
}
public clcmd_setlaser_minus(id)
{
if(g_rotating[id]){
g_rotating[id]=0
new i_Ent=g_iMine[id]
if(get_pcvar_num(g_iCvar[4]))
{
switch(pev(i_Ent, pev_iuser1))
{
case 1: fm_set_rendering(i_Ent,kRenderFxGlowShell,200,50,50,kRenderNormal,5)
case 2: fm_set_rendering(i_Ent,kRenderFxGlowShell,50,50,200,kRenderNormal,5)
}
} else{
fm_set_rendering(i_Ent)
}
return PLUGIN_HANDLED
}
if(!g_bSettingMine[id]) return PLUGIN_HANDLED
g_bSettingMine[id]=false
remove_task(id+777)
new i_Ent=g_iMine[id]
engfunc(EngFunc_RemoveEntity, i_Ent)
message_begin(MSG_ONE, 108, _, id)
write_byte(0)
write_byte(0)
message_end()
return PLUGIN_HANDLED
}
public client_putinserver(id)
{
set_task(1.0, "Task_Informer", id+666)
}
public Task_Informer(taskid)
{
new id=taskid-666
set_task(1.0, "Task_Informer", taskid)
if(!is_user_alive(id))return
new target, body
get_user_aiming(id, target, body, 128)
static ClassName[32]
pev(target, pev_classname, ClassName, charsmax(ClassName))
if (equal(ClassName, "Laser_Fence"))
{
if(fm_cs_get_user_team(id)!=pev(target, pev_iuser1)) return
new Float:Health
pev(target, pev_health, Health)
new Name[32]
get_user_name(pev(target, pev_iuser2),Name,31)
set_hudmessage(200, 50, 50, -1.0, 0.60, 0, 0.0, 1.0, 0.01, 0.01)
show_hudmessage(id, "Лазерный Забор^nВладелец: %s^n Убийств: %d^n Уровень: %d^n Здоровье: %d ", Name, pev(target, pev_iuser3),pev ( target, pev_euser4 ), floatround(Health), get_pcvar_num(g_iCvar[1]))
}
}
public ham_killed_post(id)
{
if(g_iCountMines[id]>0)
{
Cycle_delete_mines(id)
}
}
public client_disconnect(id)
{
if(g_iCountMines[id]>0)
{
Cycle_delete_mines(id)
}
}
public delete_lf(id)
{
if(g_iCountMines[id]>0)
{
Cycle_delete_mines(id)
}
}
public fm_cmdstart(id, uc_handle, seed) {
if(!is_user_alive(id)) return
if(g_fTime[id]>get_gametime()) return
new buttons = get_uc(uc_handle,UC_Buttons)
if(buttons & IN_USE)
{
new target, body
get_user_aiming(id, target, body, 128)
static ClassName[32]
pev(target, pev_classname, ClassName, charsmax(ClassName))
if (equal(ClassName, "Laser_Fence"))
{
if(fm_cs_get_user_team(id)!=pev(target, pev_iuser1)) return
g_fTime[id]=get_gametime()+0.2
new Float:Health
pev(target, pev_health, Health)
new Float:Max=get_pcvar_float(g_iCvar[1])
if(Health>=Max)return
//new iTime
//new Float:iHpTime=Health/500.0
//iTime= 4 - floatround(iHpTime)
g_fTime2[id]=get_gametime()+0.3
if(Health+25.0>Max)
{
Health=Max
if(pev(target, pev_iuser2)==id) fChatColor(id, "!g[CSDM] !yВнимание! Вы полностью отремонтировали !gЛазерный Забор!")
else
{
fChatColor(id, "!g[CSDM] !yВнимание! Вы полностью отремонтировали !gЛазерный Забор!")
fChatColor(pev(target, pev_iuser2), "!g[CSDM] !yВнимание! Ваш !gЛазерный Забор !yбыл отремонтирован! ")
}
}
else Health+=25.0
set_pev(target, pev_health, Health)
}
}
}
public fm_playerprethink(id)
{
if(g_rotating[id])
{
new i_Ent=g_iMine[id]
new Float:flOrigin[3], Float:flOrigin2[3]
pev(id, pev_origin, flOrigin)
pev(i_Ent, pev_origin, flOrigin2)
new Float:flDistance = get_distance_f (flOrigin, flOrigin2)
if(flDistance>65.0){
g_rotating[id]=0
if(get_pcvar_num(g_iCvar[4]))
{
switch(pev(i_Ent, pev_iuser1))
{
case 1: fm_set_rendering(i_Ent,kRenderFxGlowShell,200,50,50,kRenderNormal,5)
case 2: fm_set_rendering(i_Ent,kRenderFxGlowShell,50,50,200,kRenderNormal,5)
}
} else{
fm_set_rendering(i_Ent)
}
return
}
new Float:angles[3]
pev(i_Ent,pev_angles,angles)
angles[1]+=0.25
if( pev ( i_Ent, pev_euser4 ) == 1)
{
set_anim(i_Ent, 1)
}
if( pev ( i_Ent, pev_euser4 ) == 2)
{
set_anim(i_Ent, 6)
}
set_pev(i_Ent,pev_angles,angles)
}
if(!g_bSettingMine[id]) return
new i_Ent=g_iMine[id]
new Float:vOrigin[3];
new Float:vNewOrigin[3],Float:vNormal[3],Float:vTraceDirection[3], Float:vTraceEnd[3]
pev(id, pev_origin, vOrigin)
velocity_by_aim(id, 50, vTraceDirection)
xs_vec_add(vTraceDirection, vOrigin, vTraceEnd)
engfunc(EngFunc_TraceLine, vOrigin, vTraceEnd, DONT_IGNORE_MONSTERS, id, 0)
get_tr2(0, TR_vecEndPos, vTraceEnd)
new Float:TrAc[3]
TrAc[0]=vTraceEnd[0]
TrAc[1]=vTraceEnd[1]
TrAc[2]=-1000.0
engfunc(EngFunc_TraceLine, vTraceEnd, TrAc, DONT_IGNORE_MONSTERS, id, 0)
new Float:fFraction
get_tr2(0, TR_flFraction, fFraction)
if(fFraction < 1.0)
{
get_tr2(0, TR_vecEndPos, vTraceEnd);
get_tr2(0, TR_vecPlaneNormal, vNormal);
} else {
clcmd_setlaser_minus(id)
return
}
if(pev(i_Ent, pev_waterlevel)==2 || (pev(i_Ent, pev_flags)&FL_INWATER)){
clcmd_setlaser_minus(id)
return
}
xs_vec_add(vTraceEnd, vNormal, vNewOrigin)
engfunc(EngFunc_SetOrigin, i_Ent, vNewOrigin)
new Float:angles[3]
pev(id,pev_angles,angles)
angles[0]=90.0
set_pev(i_Ent,pev_angles,angles)
}
public create(id)
{
new g_Entity_Mine
g_Entity_Mine = engfunc(EngFunc_AllocString, "func_breakable")
new i_Ent = engfunc(EngFunc_CreateNamedEntity,g_Entity_Mine)
if(!i_Ent) return
g_iMine[id]=i_Ent
set_pev(i_Ent, pev_classname, "Laser_Fence")
engfunc(EngFunc_SetModel, i_Ent, Mine_Model)
set_pev(i_Ent, pev_solid, SOLID_NOT)
set_pev(i_Ent, pev_movetype, MOVETYPE_FLY)
set_pev( i_Ent, pev_euser4, 1 ); // уровень
engfunc(EngFunc_SetSize, i_Ent, Float:{ -8.0, -8.0, -4.0 }, Float:{ 8.0, 8.0, 35.0 })
fm_set_rendering(i_Ent, kRenderFxNone, 255, 255, 255, kRenderTransAdd, 200)
set_pev(i_Ent, pev_takedamage, DAMAGE_NO)
set_pev(i_Ent, pev_iuser1, fm_cs_get_user_team(id))
set_pev(i_Ent, pev_health, get_pcvar_float(g_iCvar[1]))
set_pev(i_Ent, pev_iuser2, id)
set_anim(i_Ent, 1)
set_pdata_int(i_Ent, 36, 6, 4)
}
stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
{
static Float:color[3]
color[0] = float(r)
color[1] = float(g)
color[2] = float(b)
set_pev(entity, pev_renderfx, fx)
set_pev(entity, pev_rendercolor, color)
set_pev(entity, pev_rendermode, render)
set_pev(entity, pev_renderamt, float(amount))
}
public think_laser_mine(i_Ent)
{
if(!pev_valid(i_Ent)) return
static Float:vOrigin[3]
pev(i_Ent, pev_origin, vOrigin)
if(pev(i_Ent, pev_takedamage)== DAMAGE_NO)
{
new victim = -1, g_counts = 0
while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, vOrigin, 12.0)) != 0)
{
if(!is_user_connected(victim)||!is_user_alive(victim))continue
g_counts++
}
if(g_counts)
{
set_pev(i_Ent, pev_nextthink, get_gametime()+0.3)
return
}
emit_sound(i_Ent, CHAN_VOICE, Mine_Sound_Activate, 0.5, ATTN_NORM, 1, 75);
set_pev(i_Ent, pev_solid, SOLID_BBOX)
set_pev(i_Ent, pev_takedamage, DAMAGE_YES)
set_pev(i_Ent, pev_nextthink, get_gametime()+0.1)
return
}
new Float:HP
pev(i_Ent, pev_health, HP)
if(HP<=200.0 && pev ( i_Ent, pev_euser4 ) == 2){
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_SMOKE)
engfunc(EngFunc_WriteCoord, vOrigin[0]+random_float(-8.0, 8.0))
engfunc(EngFunc_WriteCoord, vOrigin[1]+random_float(-8.0, 8.0))
engfunc(EngFunc_WriteCoord, vOrigin[2]+random_float(70.0, 80.0))
write_short(g_iSPR_Smoke)
write_byte(random_num(3,7))
write_byte(30)
message_end()
}
new Float:vTracedBeamEnd[3]
pev(i_Ent,pev_angles,vTracedBeamEnd)
new Float:vForward[3], Float:vRight[3], Float:vUp[3]
angle_vector(vTracedBeamEnd,ANGLEVECTOR_FORWARD,vForward)
angle_vector(vTracedBeamEnd,ANGLEVECTOR_RIGHT,vRight)
angle_vector(vTracedBeamEnd,ANGLEVECTOR_UP,vUp)
vTracedBeamEnd[0]=vOrigin[0]+vForward[0]*500.0+vRight[0]+vUp[0]*(-64000.0)
vTracedBeamEnd[1]=vOrigin[1]+vForward[1]*500.0+vRight[1]+vUp[1]*(-64000.0)
vTracedBeamEnd[2]=vOrigin[2]+vForward[2]*500.0+vRight[2]+vUp[2]*(-64000.0)
if( pev ( i_Ent, pev_euser4 ) == 2)
{
set_anim(i_Ent, 6)
}
if( pev ( i_Ent, pev_euser4 ) == 1)
{
set_anim(i_Ent, 1)
}
if( pev ( i_Ent, pev_euser4 ) == 1)
{
vOrigin[2]+=10.3
vTracedBeamEnd[2]-=11.0
laserFunc(i_Ent, vOrigin, vTracedBeamEnd)
vOrigin[2]+=10.0
vTracedBeamEnd[2]+=10.0
laserFunc(i_Ent, vOrigin, vTracedBeamEnd)
vOrigin[2]+=10.0
vTracedBeamEnd[2]+=10.0
laserFunc(i_Ent, vOrigin, vTracedBeamEnd)
vOrigin[2]+=10.0
vTracedBeamEnd[2]+=10.0
laserFunc(i_Ent, vOrigin, vTracedBeamEnd)
vOrigin[2]+=10.0
vTracedBeamEnd[2]+=10.0
laserFunc(i_Ent, vOrigin, vTracedBeamEnd)
}
if( pev ( i_Ent, pev_euser4 ) == 2)
{
vOrigin[2]+=14.3
vTracedBeamEnd[2]-=15.0
laserFunc(i_Ent, vOrigin, vTracedBeamEnd)
vOrigin[2]+=18.0
vTracedBeamEnd[2]+=18.0
laserFunc(i_Ent, vOrigin, vTracedBeamEnd)
vOrigin[2]+=18.0
vTracedBeamEnd[2]+=18.0
laserFunc(i_Ent, vOrigin, vTracedBeamEnd)
vOrigin[2]+=18.0
vTracedBeamEnd[2]+=18.0
laserFunc(i_Ent, vOrigin, vTracedBeamEnd)
vOrigin[2]+=18.0
vTracedBeamEnd[2]+=18.0
laserFunc(i_Ent, vOrigin, vTracedBeamEnd)
}
set_pev(i_Ent, pev_nextthink, get_gametime()+0.1)
}
public laserFunc(i_Ent, const Float:vOrigin[3], const Float:vTracedBeamEnd[3])
{
new ptr = create_tr2()
engfunc(EngFunc_TraceLine, vOrigin, vTracedBeamEnd, DONT_IGNORE_MONSTERS , i_Ent, ptr)
static Float:vTracedBeamEnd1[3]
get_tr2(ptr, TR_vecEndPos, vTracedBeamEnd1)
static iHit, Float:fFraction;
get_tr2(ptr, TR_flFraction, fFraction);
iHit = get_tr2(ptr, TR_pHit);
if(fFraction < 1.0)
{
if(pev_valid(iHit)&&is_user_alive(iHit)&&fm_cs_get_user_team(iHit)!=pev(i_Ent, pev_iuser1))
{
emit_sound(iHit, CHAN_WEAPON, Mine_Sound_Hit, 1.0, ATTN_NORM, 0, PITCH_NORM)
new Float:Health
pev(iHit, pev_health, Health)
if(Health>get_pcvar_float(g_iCvar[0])) {
ExecuteHamB(Ham_TakeDamage, iHit, i_Ent, pev(i_Ent, pev_iuser2), get_pcvar_float(g_iCvar[0]), DMG_BLAST)
}else {
ExecuteHamB(Ham_TakeDamage, iHit, i_Ent, pev(i_Ent, pev_iuser2), get_pcvar_float(g_iCvar[0]), DMG_BULLET)
set_pev(i_Ent, pev_iuser3, pev(i_Ent, pev_iuser3)+1)
}
}
}
DrawLaser(i_Ent, vOrigin, vTracedBeamEnd1)
}
DrawLaser(i_Ent, const Float:v_Origin[3], const Float:v_EndOrigin[3])
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_BEAMPOINTS)
engfunc(EngFunc_WriteCoord,v_Origin[0])
engfunc(EngFunc_WriteCoord,v_Origin[1])
engfunc(EngFunc_WriteCoord,v_Origin[2])
engfunc(EngFunc_WriteCoord,v_EndOrigin[0])
engfunc(EngFunc_WriteCoord,v_EndOrigin[1])
engfunc(EngFunc_WriteCoord,v_EndOrigin[2])
switch(pev(i_Ent, pev_iuser1))
{
case 1: write_short(g_iBeam_T)
case 2: write_short(g_iBeam_CT)
}
write_byte(0);
write_byte(0);
write_byte(1)
if( pev ( i_Ent, pev_euser4 ) == 1)
{
write_byte(10)
}
else
if( pev ( i_Ent, pev_euser4 ) == 2)
{
write_byte(15)
}
write_byte(0)
write_byte(255)
write_byte(255)
write_byte(255)
write_byte(255)
write_byte(255)
message_end()
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_SPARKS)
engfunc(EngFunc_WriteCoord,v_EndOrigin[0])
engfunc(EngFunc_WriteCoord,v_EndOrigin[1])
engfunc(EngFunc_WriteCoord,v_EndOrigin[2])
message_end()
}
stock fm_cs_get_user_team(id)
{
if (pev_valid(id) != 2) return 0
return get_pdata_int(id, 114, 5)
}
stock Cycle_delete_mines(i_Owner)
{
new iEnt = 33
while((iEnt = engfunc(EngFunc_FindEntityByString, iEnt, "classname", "Laser_Fence")))
{
if(pev(iEnt, pev_iuser2) != i_Owner) continue
engfunc(EngFunc_RemoveEntity, iEnt)
}
g_iCountMines[i_Owner]=0
}
public Laser_TakeDamage(victim, inflictor, attacker, Float:damage, bit_Damage)
{
if(!pev_valid(victim)) return HAM_IGNORED
static ClassName[32]
pev(victim, pev_classname, ClassName, charsmax(ClassName))
if (equal(ClassName, "Laser_Fence"))
{
if(!is_user_connected(attacker)||(fm_cs_get_user_team(attacker)==pev(victim, pev_iuser1)&&attacker!=pev(victim, pev_iuser2)))
return HAM_SUPERCEDE
if(get_user_weapon(attacker)==CSW_KNIFE)
return HAM_SUPERCEDE
new Float:g_Health
pev(victim, pev_health, g_Health)
if (g_Health <= damage)
{
fChatColor(pev(victim, pev_iuser2), "!g[CSDM] !yВнимание! Ваш !gЛазерный Забор !yбыл разрушен!")
g_iCountMines[pev(victim, pev_iuser2)]--
CreateExplosion(victim)
engfunc(EngFunc_RemoveEntity, victim)
return HAM_SUPERCEDE
}
}
return HAM_IGNORED
}
CreateExplosion(iCurrent)
{
new Float:vOrigin[3]
pev(iCurrent,pev_origin,vOrigin)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(99)
write_short(iCurrent)
message_end()
if(get_pcvar_num(g_iCvar[3])==2){
message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_SPRITETRAIL) // Throws a shower of sprites or models
engfunc(EngFunc_WriteCoord, vOrigin[ 0 ]) // start pos
engfunc(EngFunc_WriteCoord, vOrigin[ 1 ])
engfunc(EngFunc_WriteCoord, vOrigin[ 2 ])
engfunc(EngFunc_WriteCoord, vOrigin[ 0 ]) // velocity
engfunc(EngFunc_WriteCoord, vOrigin[ 1 ])
engfunc(EngFunc_WriteCoord, vOrigin[ 2 ]+6.0)
write_short(g_iSPR_Explo2) // spr
write_byte(random_num(20,30)) // (count)
write_byte(10) // (life in 0.1's)
write_byte(1) // byte (scale in 0.1's)
write_byte(30) // (velocity along vector in 10's)
write_byte(20) // (randomness of velocity in 10's)
message_end()
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, vOrigin, 0)
write_byte(TE_EXPLOSION)
engfunc(EngFunc_WriteCoord,vOrigin[0])
engfunc(EngFunc_WriteCoord,vOrigin[1])
engfunc(EngFunc_WriteCoord,vOrigin[2])
write_short(g_iSPR_Explo)
write_byte(30)
write_byte(15)
write_byte(0)
message_end()
} else if(get_pcvar_num(g_iCvar[3])==1){
message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_SPRITETRAIL) // Throws a shower of sprites or models
engfunc(EngFunc_WriteCoord, vOrigin[ 0 ]) // start pos
engfunc(EngFunc_WriteCoord, vOrigin[ 1 ])
engfunc(EngFunc_WriteCoord, vOrigin[ 2 ])
engfunc(EngFunc_WriteCoord, vOrigin[ 0 ]) // velocity
engfunc(EngFunc_WriteCoord, vOrigin[ 1 ])
engfunc(EngFunc_WriteCoord, vOrigin[ 2 ]+6.0)
write_short(g_iSPR_Explo2) // spr
write_byte(random_num(20,30)) // (count)
write_byte(10) // (life in 0.1's)
write_byte(1) // byte (scale in 0.1's)
write_byte(30) // (velocity along vector in 10's)
write_byte(20) // (randomness of velocity in 10's)
message_end()
} else {
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, vOrigin, 0)
write_byte(TE_EXPLOSION)
engfunc(EngFunc_WriteCoord,vOrigin[0])
engfunc(EngFunc_WriteCoord,vOrigin[1])
engfunc(EngFunc_WriteCoord,vOrigin[2])
write_short(g_iSPR_Explo)
write_byte(30)
write_byte(15)
write_byte(0)
message_end()
}
}
stock fChatColor(const idUser, const input[], any:...)
{
new count = 1, arrPlayers[32];
new szMsgText[256];
vformat(szMsgText, charsmax(szMsgText), input, 3);
replace_all(szMsgText, charsmax(szMsgText), "!g", "^4");
replace_all(szMsgText, charsmax(szMsgText), "!y", "^1");
replace_all(szMsgText, charsmax(szMsgText), "!t", "^3");
if (idUser)
arrPlayers[0] = idUser;
else
get_players(arrPlayers, count, "ch");
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(arrPlayers[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, arrPlayers[i]);
write_byte(arrPlayers[i]);
write_string(szMsgText);
message_end();
}
}
}
}
stock set_anim(ent, sequence)
{
set_pev(ent, pev_sequence, sequence)
set_pev(ent, pev_animtime, halflife_time())
set_pev(ent, pev_framerate, 1.0)
}
Когда ставишь забор все ок, но стоит его разрушить игроку или самому игроку который поставил его - падает сервер
Вложения
-
22.4 KB Просмотры: 56