Margo
Пользователь
- Регистрация
- 9 Июн 2017
- Сообщения
- 30
- Симпатии
- 0
- Пол
- Женский
Ребят вот такой плагин нашла , но с ним падает сервер .
Что может вызывать падение ?
Что может вызывать падение ?
/*****************************************************/
#define GIVE_HP 30
#define MAX_HP 100
/*****************************************************/
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define fm_find_ent_in_sphere(%1,%2,%3) engfunc(EngFunc_FindEntityInSphere, %1, %2, %3)
new const g_sound_explosion[] = "weapons/sg_explode.wav"
new const g_classname_grenade[] = "grenade"
new HpExpSpr, CircleSpr
public plugin_precache()
{
HpExpSpr = precache_model("sprites/blueflare2.spr");
CircleSpr = precache_model("sprites/shockwave.spr");
}
public plugin_init()
{
register_plugin("health granade", "0.1", "Vaqtincha")
register_forward(FM_EmitSound, "forward_emitsound")
}
public changemode(id)
{
if (!is_user_alive(id) || !(user_has_weapon(id, CSW_SMOKEGRENADE)))
{
return
}
}
public forward_emitsound(ent, channel, const sound[])
{
if (!pev_valid(ent) || !equal(sound, g_sound_explosion) || !is_grenade(ent))
return FMRES_IGNORED;
static id, Floatrigin[3]
id = pev(ent, pev_owner);
if (!is_user_alive(id))
return FMRES_IGNORED;
pev(ent, pev_origin, origin)
engfunc(EngFunc_EmitSound, ent, CHAN_WEAPON, sg_explode, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
create_health_eff(origin)
create_blast_circle(ent, 10, 255, 40)
new tre
while((tre = fm_find_ent_in_sphere(tre,origin,200.0)) != 0)
{
if(is_user_alive(tre) && get_user_team(tre) == get_user_team(id))
{
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, tre)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(90)
write_byte(255)
write_byte(0)
write_byte(45)
message_end()
set_rendering(tre, kRenderFxGlowShell, 0,255,50, kRenderNormal,20)
set_task(1.5, "UnEffect", tre)
fm_set_user_health(tre, min(get_user_health(tre) + GIVE_HP, MAX_HP))
}
}
return FMRES_SUPERCEDE
}
public UnEffect(tre)
{
if(is_user_alive(tre))
{
set_rendering(tre, kRenderFxNone, 0, 0, 0, kRenderNormal, 0)
}
}
bool:is_grenade(ent) {
if (!pev_valid(ent))
return false
static classname[sizeof g_classname_grenade + 1]
pev(ent, pev_classname, classname, sizeof g_classname_grenade)
if (equal(classname, g_classname_grenade))
return true
return false
}
stock bool:is_hull_vacant(const Floatrigin[3], hull) {
new tr = 0
engfunc(EngFunc_TraceHull, origin, origin, 0, hull, 0, tr)
if (!get_tr2(tr, TR_StartSolid) && !get_tr2(tr, TR_AllSolid) && get_tr2(tr, TR_InOpen))
return true
return false
}
stock create_health_eff(const Floatrigin[3])
{
message_begin(MSG_ALL,SVC_TEMPENTITY,{0,0,0})
write_byte(TE_SPRITETRAIL)
write_coord(floatround(origin[0]))
write_coord(floatround(origin[1]))
write_coord(floatround(origin[2])+20)
write_coord(floatround(origin[0]))
write_coord(floatround(origin[1]))
write_coord(floatround(origin[2])+80)
write_short(HpExpSpr)
write_byte(20)
write_byte(20)
write_byte(4)
write_byte(20)
write_byte(10)
message_end()
}
stock create_blast_circle(ent, R, G, B)
{
static Float: fOrigin[3], iOrigin[3];
pev(ent, pev_origin, fOrigin);
FVecIVec( fOrigin, iOrigin );
message_begin( MSG_BROADCAST, SVC_TEMPENTITY, iOrigin );
write_byte( TE_BEAMCYLINDER );
write_coord( iOrigin[ 0 ] );
write_coord( iOrigin[ 1 ] );
write_coord( iOrigin[ 2 ]);
write_coord( iOrigin[ 0 ] );
write_coord( iOrigin[ 1 ] );
write_coord( iOrigin[ 2 ] + 250) ; // radius
write_short( CircleSpr );
write_byte( 0 ); // start framerate
write_byte( 1 ); // framerate
write_byte( 5 ); // life
write_byte( 30 ); // width
write_byte( 1 ); // amplitude
write_byte(R);
write_byte(G);
write_byte(B);
write_byte( 255 ); // brightness
write_byte( 5 ); // speed
message_end();
engfunc(EngFunc_RemoveEntity, ent)
}
stock fm_set_user_health(index, health)
{
health > 0 ? set_pev(index, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, index)
return 1
}
stock set_rendering(index, fx=kRenderFxNone, r=255, g=255, b=255, render=kRenderNormal, amount=16)
{
set_pev(index, pev_renderfx, fx)
new Float:RenderColor[3]
RenderColor[0] = float(r)
RenderColor[1] = float(g)
RenderColor[2] = float(b)
set_pev(index, pev_rendercolor, RenderColor)
set_pev(index, pev_rendermode, render)
set_pev(index, pev_renderamt, float(amount))
return 1
}
#define GIVE_HP 30
#define MAX_HP 100
/*****************************************************/
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define fm_find_ent_in_sphere(%1,%2,%3) engfunc(EngFunc_FindEntityInSphere, %1, %2, %3)
new const g_sound_explosion[] = "weapons/sg_explode.wav"
new const g_classname_grenade[] = "grenade"
new HpExpSpr, CircleSpr
public plugin_precache()
{
HpExpSpr = precache_model("sprites/blueflare2.spr");
CircleSpr = precache_model("sprites/shockwave.spr");
}
public plugin_init()
{
register_plugin("health granade", "0.1", "Vaqtincha")
register_forward(FM_EmitSound, "forward_emitsound")
}
public changemode(id)
{
if (!is_user_alive(id) || !(user_has_weapon(id, CSW_SMOKEGRENADE)))
{
return
}
}
public forward_emitsound(ent, channel, const sound[])
{
if (!pev_valid(ent) || !equal(sound, g_sound_explosion) || !is_grenade(ent))
return FMRES_IGNORED;
static id, Floatrigin[3]
id = pev(ent, pev_owner);
if (!is_user_alive(id))
return FMRES_IGNORED;
pev(ent, pev_origin, origin)
engfunc(EngFunc_EmitSound, ent, CHAN_WEAPON, sg_explode, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
create_health_eff(origin)
create_blast_circle(ent, 10, 255, 40)
new tre
while((tre = fm_find_ent_in_sphere(tre,origin,200.0)) != 0)
{
if(is_user_alive(tre) && get_user_team(tre) == get_user_team(id))
{
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, tre)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(90)
write_byte(255)
write_byte(0)
write_byte(45)
message_end()
set_rendering(tre, kRenderFxGlowShell, 0,255,50, kRenderNormal,20)
set_task(1.5, "UnEffect", tre)
fm_set_user_health(tre, min(get_user_health(tre) + GIVE_HP, MAX_HP))
}
}
return FMRES_SUPERCEDE
}
public UnEffect(tre)
{
if(is_user_alive(tre))
{
set_rendering(tre, kRenderFxNone, 0, 0, 0, kRenderNormal, 0)
}
}
bool:is_grenade(ent) {
if (!pev_valid(ent))
return false
static classname[sizeof g_classname_grenade + 1]
pev(ent, pev_classname, classname, sizeof g_classname_grenade)
if (equal(classname, g_classname_grenade))
return true
return false
}
stock bool:is_hull_vacant(const Floatrigin[3], hull) {
new tr = 0
engfunc(EngFunc_TraceHull, origin, origin, 0, hull, 0, tr)
if (!get_tr2(tr, TR_StartSolid) && !get_tr2(tr, TR_AllSolid) && get_tr2(tr, TR_InOpen))
return true
return false
}
stock create_health_eff(const Floatrigin[3])
{
message_begin(MSG_ALL,SVC_TEMPENTITY,{0,0,0})
write_byte(TE_SPRITETRAIL)
write_coord(floatround(origin[0]))
write_coord(floatround(origin[1]))
write_coord(floatround(origin[2])+20)
write_coord(floatround(origin[0]))
write_coord(floatround(origin[1]))
write_coord(floatround(origin[2])+80)
write_short(HpExpSpr)
write_byte(20)
write_byte(20)
write_byte(4)
write_byte(20)
write_byte(10)
message_end()
}
stock create_blast_circle(ent, R, G, B)
{
static Float: fOrigin[3], iOrigin[3];
pev(ent, pev_origin, fOrigin);
FVecIVec( fOrigin, iOrigin );
message_begin( MSG_BROADCAST, SVC_TEMPENTITY, iOrigin );
write_byte( TE_BEAMCYLINDER );
write_coord( iOrigin[ 0 ] );
write_coord( iOrigin[ 1 ] );
write_coord( iOrigin[ 2 ]);
write_coord( iOrigin[ 0 ] );
write_coord( iOrigin[ 1 ] );
write_coord( iOrigin[ 2 ] + 250) ; // radius
write_short( CircleSpr );
write_byte( 0 ); // start framerate
write_byte( 1 ); // framerate
write_byte( 5 ); // life
write_byte( 30 ); // width
write_byte( 1 ); // amplitude
write_byte(R);
write_byte(G);
write_byte(B);
write_byte( 255 ); // brightness
write_byte( 5 ); // speed
message_end();
engfunc(EngFunc_RemoveEntity, ent)
}
stock fm_set_user_health(index, health)
{
health > 0 ? set_pev(index, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, index)
return 1
}
stock set_rendering(index, fx=kRenderFxNone, r=255, g=255, b=255, render=kRenderNormal, amount=16)
{
set_pev(index, pev_renderfx, fx)
new Float:RenderColor[3]
RenderColor[0] = float(r)
RenderColor[1] = float(g)
RenderColor[2] = float(b)
set_pev(index, pev_rendercolor, RenderColor)
set_pev(index, pev_rendermode, render)
set_pev(index, pev_renderamt, float(amount))
return 1
}