[僵尸插件] 敬请帮忙修改此插件适合4.3以前版本使用
请帮忙修改【人类力场】适合4.3以前版本使用,谢谢!#include <amxmodx>#include <zombieplague>
#include <fakemeta_util>
#include <fun>
new campoforze
new bool:campodefuerza = false
new stuck
new const Float:size[] = {
{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("Campo de fuerza", "1.0", "apotrike")
campoforze = zp_register_extra_item("Campo de Fuerza", 20, ZP_TEAM_HUMAN)
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}
public zp_extra_item_selected(player, itemid)
{
// Not alive
if (!is_user_alive(player))
return;
if (itemid == campoforze) {
new name
get_user_name(player, name, 31)
set_hudmessage(0, 255, 0, 0.05, 0.45, 1, 0.0, 5.0, 1.0, 1.0, -1)
show_hudmessage(0, "%s tiene un CAMPO DE FUERZA!!", name)
fm_set_rendering(player, kRenderFxGlowShell, 200, 200, 250, kRenderNormal, 300)
campodefuerza = true
efects(player)
campofuerza(player)
set_task(30.0, "timeout", player)
}
}
public campofuerza(id1)
{
// Not alive
if (!is_user_alive(id1))
return;
if(!campodefuerza)
return;
for (new id2; id2 <= 32; id2++)
{
if (zp_get_user_zombie(id2))
{
campofuntion(id1, id2)
}
}
set_task(0.1, "campofuerza", id1)
}
public campofuntion(id1, id2)
{
// Not alive
if (!is_user_alive(id1))
return;
if (!is_user_alive(id2))
return;
if(!campodefuerza)
return;
static Float:vOrigin, Float:vOrigin2
pev(id1, pev_origin, vOrigin)
pev(id2, pev_origin, vOrigin2)
if(vector_distance(vOrigin, vOrigin2) < 180)
{
set_task(0.5,"checkstuck",0,"",0,"b")
vOrigin2 -= 30.0
set_pev(id2, pev_origin, vOrigin2)
}
}
public efects(id)
{
// Not alive
if (!is_user_alive(id))
return;
if(!campodefuerza)
return;
// Get player origin
static Float:originF
pev(id, pev_origin, originF)
// Colored Aura
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_DLIGHT) // TE id
engfunc(EngFunc_WriteCoord, originF) // x
engfunc(EngFunc_WriteCoord, originF) // y
engfunc(EngFunc_WriteCoord, originF) // z
write_byte(30) // radius
write_byte(80) // r
write_byte(80) // g
write_byte(250) // b
write_byte(2) // life
write_byte(0) // decay rate
message_end()
set_task(0.1, "efects", id)
return;
}
public client_putinserver(id) {
campodefuerza = false
}
public client_disconnect(id) {
campodefuerza = false
}
public event_round_start()
{
for (new id; id <= 32; id++)
{
campodefuerza = false
}
}
public zp_user_infected_post(player, infector)
{
if (campodefuerza)
{
campodefuerza = false
}
return PLUGIN_CONTINUE
}
public timeout(id)
{
// Not alive
if (!is_user_alive(id))
return;
if(!campodefuerza)
return;
campodefuerza = false
fm_set_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 20)
}
public checkstuck() {
static players, pnum, player
get_players(players, pnum)
static Float:origin
static Float:mins, hull
static Float:vec
static o,i
for(i=0; i<pnum; i++){
player = players
if (is_user_connected(player) && is_user_alive(player)) {
pev(player, pev_origin, origin)
hull = pev(player, pev_flags) & FL_DUCKING ? HULL_HEAD : HULL_HUMAN
if (!is_hull_vacant(origin, hull,player) && !get_user_noclip(player) && !(pev(player,pev_solid) & SOLID_NOT)) {
++stuck
pev(player, pev_mins, mins)
vec = origin
for (o=0; o < sizeof size; ++o) {
vec = origin - mins * size
vec = origin - mins * size
vec = origin - mins * size
if (is_hull_vacant(vec, hull,player)) {
engfunc(EngFunc_SetOrigin, player, vec)
set_pev(player,pev_velocity,{0.0,0.0,0.0})
o = sizeof size
}
}
}
else
{
stuck = 0
}
}
}
}
stock bool:is_hull_vacant(const Float:origin, 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
} 力场弹么??不如用下防护罩。。和力场弹一个概念。。 这个不是力场弹,虽然我没用,似乎就是防护罩类似的东西吧?
防护罩有SMA共享吗?
页:
[1]