Raised This Month: $222 Target: $400
 55% 

Solved Thunder Events


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rrduna
Member
Join Date: Nov 2010
Location: Brazil
Old 04-26-2020 , 08:32   Thunder Events
Reply With Quote #1

Hello,
I have this thunder events plugin but something about it is causing my server to have a lot of instability.
can someone say what can cause or what can be wrong?


Code

PHP Code:

// define a task id
#define TASKID1 1324687358

// array de sons aleatórios 
new thunder_sounds[][] = {
    
"thunder_events/thunder1",
    
"thunder_events/thunder2",
    
"thunder_events/thunder3",
    
"thunder_events/thunder4",
    
"thunder_events/thunder5"
}

public 
plugin_init() { // registro do plugin
    
register_plugin(PLUGIN,VERSION,AUTHOR)
    
set_taskrandom_float30.0,  60.0 ), "thunderclap")
    return 
PLUGIN_CONTINUE;
}

public 
client_putinserver(id){
    if(
is_user_bot(id)) 
    return;
    
    if(!
task_exists(TASKID1)){
        
restore_lightstyle();
    }
}

public 
thunderclap() { 
    
client_cmd(0,"spk %s",thunder_sounds[random(sizeof thunder_sounds)]);
    
set_taskrandom_float(30.0,  60.0), "thunderclap")
    
    
engfunc(EngFunc_LightStyle0"z")
    
    if(
task_exists(TASKID1)){
        
remove_task(TASKID1
    }
    
set_task(0.2"restore_lightstyle"TASKID1)
    return 
FMRES_HANDLED
}

public 
restore_lightstyle() {
    
engfunc(EngFunc_LightStyle0"m")


Last edited by rrduna; 04-26-2020 at 19:44. Reason: Solved
rrduna is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-26-2020 , 08:35   Re: Thunder Events
Reply With Quote #2

instability? What exact is the problem you're experiencing?
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
rrduna
Member
Join Date: Nov 2010
Location: Brazil
Old 04-26-2020 , 08:47   Re: Thunder Events
Reply With Quote #3

when the light event occurs, a failure occurs, but the light is still displayed. To make sure it was this plug-in, I commented on the lines that cause the light to be processed and left only the sounds, and in the tests the crash did not exist.
rrduna is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-26-2020 , 13:46   Re: Thunder Events
Reply With Quote #4

Quote:
Originally Posted by rrduna View Post
when the light event occurs, a failure occurs, but the light is still displayed. To make sure it was this plug-in, I commented on the lines that cause the light to be processed and left only the sounds, and in the tests the crash did not exist.
failure...?
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Reply


Thread Tools
Display Modes

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 19:35.


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