View Single Post
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 03-22-2010 , 04:41   i will share it with you [Disco Effect]
Reply With Quote #1

hi,

i just wanted to share it with you.

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <amxmisc>
#include <engine>

#define write_coord_f(%0)  (engfunc(EngFunc_WriteCoord,%0))

new const Classname[] = "discocircus"
new Sprite,think_time

public plugin_init()
{
    
register_plugin"Disco Circus""1.3""One" )
    
think_time register_cvar("amx_thinktime","0.40")
    
register_clcmd"amx_circus_on""Make_it" )
    
register_clcmd"amx_circus_off""Remove_it" )
    
register_thinkClassname"Circus_think" )
}
public 
Make_it(const Spieler,const Stufe,const M_ID)
{
    if(!
cmd_access(Spieler,Stufe,M_ID,1))
    {
        return 
PLUGIN_HANDLED
    
}
    new 
Float:origin[3]
    new 
g_Entity
    
    pev
(Spieler,pev_origin,origin)
    
    if((
g_Entity=create_entity("info_target")))
    {
        
set_pev(g_Entity,pev_classname,Classname)
        
        
engfunc(EngFunc_SetSize,g_Entity,Float:{-311.0,-1.0,-1.0},Float:{311.0,1.0,1.0})
        
engfunc(EngFunc_SetOrigin,g_Entity,origin)
        
set_pev(g_Entity,pev_effects,EF_BRIGHTFIELD)
        
set_pev(g_Entity,pev_solid,SOLID_BBOX)
        
set_pev(g_Entity,pev_movetype,MOVETYPE_TOSS)
        
set_pev(g_Entity,pev_owner,Spieler)
        
set_pev(g_Entity,pev_nextthink,get_gametime()+get_pcvar_float(think_time))
    }
    return 
PLUGIN_HANDLED_MAIN
}
public 
Circus_think(const g_Entity)
{
    if(!
is_valid_ent(g_Entity))
    {
        return
    }
    static 
Float:origin[3]
    static 
Float:End[3]
    static 
Float:Position[3]
    
    
pev(g_Entity,pev_origin,origin)
    
    
End[0] = random_float(-5000.0,5000.0)
    
End[1] = random_float(-5000.0,5000.0)
    
End[2] = random_float(0.0,5000.0)
    
    
trace_line(g_Entity,origin,End,Position)
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    
write_byte(TE_BEAMDISK )
    
write_coord_f(origin[0])
    
write_coord_f(origin[1] )
    
write_coord_f(origin[2]+100.0)
    
write_coord_f(random_float(-5000.0,5000.0))
    
write_coord_f(random_float(-5000.0,5000.0))
    
write_coord_f(random_float(-5000.0,5000.0))
    
write_short(Sprite)
    
write_byte(0)
    
write_byte(0)
    
write_byte(1)
    
write_byte(5)
    
write_byte(50)
    
write_byte(random_num(1,255))
    
write_byte(random_num(1,255))
    
write_byte(random_num(1,255))
    
write_byte(200)
    
write_byte(30)
    
message_end()
    
    
set_pev(g_Entity,pev_nextthink,get_gametime()+get_pcvar_float(think_time))
}
public 
plugin_precache()
{
    
Sprite precache_model("sprites/laserbeam.spr")
}
public 
Remove_it(const Spieler,const Stufe,const M_ID)
{
    if(
cmd_access(Spieler,Stufe,M_ID,1))
    {
        
remove_entity_name(Classname)
        return 
PLUGIN_HANDLED_MAIN
    
}
    return 
PLUGIN_HANDLED

You can see this effect in this video = http://www.youtube.com/watch?v=O2DW6_SYhH0#t=0m30s

Credit @ Arkshine ! then i could'nt begin to code this shit without his code

( Dont start it more than 1 time/Mapchange ! else your server willbe crashed. maybe anyone can fix this?! )


Code:
amx_circus_on    //turns on
amx_circus_off     //turns off 
amx_thinktime 0.45    // dont change it lower than 0.25 !!
Attached Files
File Type: sma Get Plugin or Get Source (disco_circus.sma - 1470 views - 2.6 KB)
__________________

Last edited by One; 03-26-2010 at 19:01.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One