Raised This Month: $32 Target: $400
 8% 

Solved Current light


Post New Thread Reply   
 
Thread Tools Display Modes
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 09-23-2017 , 09:44   Re: Current light
Reply With Quote #11

Quote:
L 09/23/2017 - 14:40:15: [AMXX] [0] thunder.sma::thundershow (line 81)
L 09/23/2017 - 14:40:16: [AMXX] Displaying debug trace (plugin "thunder.amxx")
L 09/23/2017 - 14:40:16: [AMXX] Run time error 4: index out of bounds
L 09/23/2017 - 14:40:16: [AMXX] [0] thunder.sma::thundershow (line 81)
L 09/23/2017 - 14:40:16: [AMXX] Displaying debug trace (plugin "thunder.amxx")
L 09/23/2017 - 14:40:16: [AMXX] Run time error 4: index out of bounds
L 09/23/2017 - 14:40:16: [AMXX] [0] thunder.sma::thundershow (line 81)
L 09/23/2017 - 14:40:16: [AMXX] Displaying debug trace (plugin "thunder.amxx")
L 09/23/2017 - 14:40:16: [AMXX] Run time error 4: index out of bounds
L 09/23/2017 - 14:40:16: [AMXX] [0] thunder.sma::thundershow (line 81)
L 09/23/2017 - 14:40:16: [AMXX] Displaying debug trace (plugin "thunder.amxx")
L 09/23/2017 - 14:40:16: [AMXX] Run time error 4: index out of bounds
L 09/23/2017 - 14:40:16: [AMXX] [0] thunder.sma::thundershow (line 81)
L 09/23/2017 - 14:40:16: [AMXX] Displaying debug trace (plugin "thunder.amxx")
L 09/23/2017 - 14:40:16: [AMXX] Run time error 4: index out of bounds
L 09/23/2017 - 14:40:16: [AMXX] [0] thunder.sma::thundershow (line 81)
L 09/23/2017 - 14:40:16: [AMXX] Displaying debug trace (plugin "thunder.amxx")
L 09/23/2017 - 14:40:16: [AMXX] Run time error 4: index out of bounds
L 09/23/2017 - 14:40:16: [AMXX] [0] thunder.sma::thundershow (line 81)
PHP Code:
        case 1: {
            
            
engfunc(EngFunc_LightStyle0lights_thunder2[g_lights_reach]) // (line 81)
            //client_print(0, print_chat,"light2 == %s ", lights_thunder2[g_lights_reach])
        

I think it should be in this particular line because it shows the last value when i debug it !
PHP Code:
    if (g_lights_reach >= thunderchance()) {
        
copy(g_lightcharsmax(g_light), lights_thunder1[g_lights_reach]);// its true like this ?
    
copy(g_lightcharsmax(g_light), lights_thunder2[g_lights_reach]);//  its true like this ?

        
remove_task(THUNDER)
        
thunder_check()

    } 
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 09-23-2017 , 13:25   Re: Current light
Reply With Quote #12

Quote:
Originally Posted by abdobiskra View Post
PHP Code:
        case 1: {
            
            
engfunc(EngFunc_LightStyle0lights_thunder2[g_lights_reach]) // (line 81)
            //client_print(0, print_chat,"light2 == %s ", lights_thunder2[g_lights_reach])
        

Add debug after plugin name, and also that's your code?!?! I don't know why there is error... Use set_lights from engine.
KiLLeR. is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 09-29-2017 , 07:27   Re: Current light
Reply With Quote #13

I am trying to make another function
Now work but sometimes the lightning is repeated several times
debug:
Quote:
time tunder = -1
time tunder = -2
time tunder = -3
time tunder = -4
time tunder = -5
time tunder = -6
PHP Code:
public thunder_checkdd()
{
    static 
g_ThunderTime 2
    
    
if(g_ThunderTime)
    {
    
        
set_task(1.0"thunder_checkdd"123456)
        
        
emit_sound(0,CHAN_AUTO,g_ambience_thunder[random_num(0sizeof g_ambience_thunder-1)],1.0,ATTN_NORM,0,PITCH_NORM)
        
set_lights(random_num(01) < "ijklmnonmlkjihgfedcbc" "klmlkjihgfedcbabbcdedcbc")
        
        
//client_print(0, print_chat, "time tunder = %i", g_ThunderTime)
            
        
    
}else if(g_ThunderTime <= 0)
    {
        
remove_task(123456)
        
set_lights("")
        
set_task(10.0"thunder_checkdd")
        return 
PLUGIN_CONTINUE
    
}
    
g_ThunderTime--
    return 
PLUGIN_CONTINUE

Where can it be wrong ?
__________________

Last edited by abdobiskra; 09-29-2017 at 14:55.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 09-30-2017 , 12:51   Re: Current light
Reply With Quote #14

Quote:
Originally Posted by abdobiskra View Post
I am trying to make another function
Now work but sometimes the lightning is repeated several times
debug:

PHP Code:
public thunder_checkdd()
{
    static 
g_ThunderTime 2
    
    
if(g_ThunderTime)
    {
    
        
set_task(1.0"thunder_checkdd"123456)
        
        
emit_sound(0,CHAN_AUTO,g_ambience_thunder[random_num(0sizeof g_ambience_thunder-1)],1.0,ATTN_NORM,0,PITCH_NORM)
        
set_lights(random_num(01) < "ijklmnonmlkjihgfedcbc" "klmlkjihgfedcbabbcdedcbc")
        
        
//client_print(0, print_chat, "time tunder = %i", g_ThunderTime)
            
        
    
}else if(g_ThunderTime <= 0)
    {
        
remove_task(123456)
        
set_lights("")
        
set_task(10.0"thunder_checkdd")
        return 
PLUGIN_CONTINUE
    
}
    
g_ThunderTime--
    return 
PLUGIN_CONTINUE

Where can it be wrong ?
You have to put only one letter in set_lights. And also use "#OFF" instead of empty string.
What do you mean by several times?! This "if(g_ThunderTime)" means: execute code always when g_ThunderTime different than zero including negative numbers. So I guess you have to do something like if(g_ThunderTime > 0).

Last edited by KiLLeR.; 09-30-2017 at 12:58.
KiLLeR. is offline
Reply



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 20:37.


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