Raised This Month: $ Target: $400
 0% 

set_task problems (I think)


  
 
 
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-01-2007 , 23:00   set_task problems (I think)
Reply With Quote #1

I'm not sure if my set_tasks are the problem but I can't figure out what the actual problem is. When the server starts up, the cvar is defaultly set to 1 and when I change it to 0. It works but when I want to set it back to 1 again. Nothing works apparently.
PHP Code:
new zomb_lightning

public plugin_init() {
    
zomb_lightning register_cvar("zs_lightning","1")

    
set_task(1.0,"lightning_effects")
}

public 
lightning_effects() {
    if(
get_pcvar_num(zomb_lightning))
    {    
        
set_lights("a")
        
set_task(random_float(10.0,17.0),"thunder_clap",12175)
    }
    else if (!
get_pcvar_num(zomb_lightning))
    {
        
set_lights("b")
        
remove_task(12175)
    }
    return 
PLUGIN_HANDLED
}
    
public 
thunder_clap()
{
    
set_lights("s")
    
client_cmd(0,"speak ambience/thunder_clap.wav")
    
    
set_task(1.0,"lightning_effects",12175)

__________________
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 22:25.


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