Raised This Month: $ Target: $400
 0% 

Ent Thinking


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 01-07-2008 , 05:16   Ent Thinking
Reply With Quote #1

I'm trying to elminate the need for set_tasks in my mod and read
http://forums.alliedmods.net/showthread.php?t=43049

And now I ended up with this in my mod.

PHP Code:
plugin_init()
{
//...
new iEnt fm_create_entity("info_target")
    if (
iEnt)
    {
        
set_pev(iEntpev_classname"zswarm_lights")
        
fm_DispatchSpawn(iEnt)
        
set_pev(iEntpev_nextthink2.0)
        
register_forward(FM_Think"lightning_effects")
    }
}


public 
lightning_effects(iEnt
{
    if(!
get_pcvar_num(zomb_switch))
        return 
set_pev(iEntpev_nextthink10.0)

    if (
get_pcvar_num(zomb_lightning) == 0)
    {    
        
engfunc(EngFunc_LightStyle0"m")
        
remove_task(12175)
        
set_pev(iEntpev_nextthink10.0)
    }
    else if (
get_pcvar_num(zomb_lightning) == 1)
    {
        
engfunc(EngFunc_LightStyle0"a")
        
set_task(random_float(10.0,17.0),"thunder_clap",12175)
    }
    else if (
get_pcvar_num(zomb_lightning) == 2)
    {    
        
engfunc(EngFunc_LightStyle0"b")
        
remove_task(12175)
        
set_pev(iEntpev_nextthink10.0)
    }
    
    return 
FMRES_IGNORED
}

public 
thunder_clap() 
{
    if(!
get_pcvar_num(zomb_switch))
        return
    
    
engfunc(EngFunc_LightStyle0"p")
    
client_cmd(0,"speak %s"ZOMBIE_THUNDER)
    
    
//set_task(1.25, "lightning_effects", 12175)

Compiles with no errors and works ingame.
But the problem is that it changes the lights too fast and spams the wave file and just overloads the server.
__________________
It's a mystery.
Mini_Midget is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode