Sma
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <diablo_nowe.inc>
#include <fakemeta>
#include <engine>
#include <fun>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new bool:bKlasa[33]
new sprite_blast,
sprite_white;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
diablo_register_class("Test", 100, "<br>Gdy wyciagne noz i nacisnie przycisk R polozy na ziemi podpalajacy totem", FLAG_ALL)
}
public diablo_class_enabled(id){
bKlasa[id] = true;
}
public diablo_class_disabled(id){
bKlasa[id] = false;
}
stock Spawn_Ent(const szNazwaKlasy[])
{
new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, szNazwaKlasy))
set_pev(ent, pev_origin, {0.0, 0.0, 0.0})
dllfunc(DLLFunc_Spawn, ent)
return ent
}
public item_zamroz(id)
{
new origin[3]
pev(id,pev_origin,origin)
new ent = Spawn_Ent("info_target")
set_pev(ent,pev_classname,"Effect_Zamroz_Totem")
set_pev(ent,pev_owner,id)
set_pev(ent,pev_solid,SOLID_TRIGGER)
set_pev(ent,pev_origin,origin)
set_pev(ent,pev_ltime, halflife_time() + 15 + 0.1)
engfunc(EngFunc_SetModel, ent, "addons/amxmodx/diablo/totem_heal.mdl")
set_rendering ( ent, kRenderFxGlowShell, 0,100,255, kRenderFxNone, 255 )
engfunc(EngFunc_DropToFloor,ent)
set_pev(ent,pev_nextthink, halflife_time() + 0.1)
return PLUGIN_CONTINUE
}
public Effect_Zamroz_Totem_Think(ent)
{
new id = pev(ent,pev_owner)
new totem_dist = 300
//We have emitted beam. Apply effect (this is delayed)
if (pev(ent,pev_euser2) == 1)
{
new Float:forigin[3], origin[3]
pev(ent,pev_origin,forigin)
FVecIVec(forigin,origin)
//Find people near and damage them
new entlist[513]
new numfound = find_sphere_class(0,"player",totem_dist+0.0,entlist,512,forigin)
for (new i=0; i < numfound; i++)
{
new pid = entlist[i]
if (get_user_team(pid) == get_user_team(id))
continue
if (is_user_alive(pid)){
set_user_maxspeed(pid, 1.0)
set_task(15.0, "off_zamroz", pid)
}
}
set_pev(ent,pev_euser2,0)
set_pev(ent,pev_nextthink, halflife_time() + 1.5)
return PLUGIN_CONTINUE
}
//Entity should be destroyed because livetime is over
if (pev(ent,pev_ltime) < halflife_time() || !is_user_alive(id))
{
remove_entity(ent)
return PLUGIN_CONTINUE
}
//If this object is almost dead, apply some render to make it fade out
if (pev(ent,pev_ltime)-2.0 < halflife_time())
set_rendering ( ent, kRenderFxNone, 255,255,255, kRenderTransAlpha, 100 )
new Float:forigin[3], origin[3]
pev(ent,pev_origin,forigin)
FVecIVec(forigin,origin)
//Find people near and give them health
message_begin( MSG_BROADCAST, SVC_TEMPENTITY, origin );
write_byte( TE_BEAMCYLINDER );
write_coord( origin[0] );
write_coord( origin[1] );
write_coord( origin[2] );
write_coord( origin[0] );
write_coord( origin[1] + totem_dist );
write_coord( origin[2] + totem_dist );
write_short( sprite_white );
write_byte( 0 ); // startframe
write_byte( 0 ); // framerate
write_byte( 10 ); // life
write_byte( 10 ); // width
write_byte( 255 ); // noise
write_byte( 0 ); // r, g, b
write_byte( 100 ); // r, g, b
write_byte( 255 ); // r, g, b
write_byte( 128 ); // brightness
write_byte( 5 ); // speed
message_end();
set_pev(ent,pev_euser2,1)
set_pev(ent,pev_nextthink, halflife_time() + 0.5)
return PLUGIN_CONTINUE
}
public off_zamroz1(pid){
set_user_maxspeed(pid, 270.0)
}