Raised This Month: $51 Target: $400
 12% 

[Problem]zp_adv_fog on swarm mod


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kakarot47
Senior Member
Join Date: May 2015
Location: Pakistan
Old 06-15-2016 , 18:31   [Problem]zp_adv_fog on swarm mod
Reply With Quote #1

Hey all,

i got zp_adv_fog for swarm mod.. so when i play swarm mod on map then fog starts but when round finish and starts new round then fog still acitvated.

I want this fog system only working on swarm mod and when round finished then fog will have to disable.

PHP Code:
#include <amxmodx>
#include <zombieplague>

// Variables
new cvar_fog_densitycvar_fog_color[3]

// Fog density offsets [Thnx to DA]
new const g_fog_density[] = { 00001111835811118125586696275990101605990,
            
101685910419559111181255911118360681161960 }

// The unique id of the fog task
new const TASK_FOG 5942

// Plugin init
public plugin_init()
{
    
// Plugin Registeration
    
register_plugin("[ZP] Advanced Fog System""1.0""Saad706")
    
    
// Register some cvars [Edit these]
    
cvar_fog_density =     register_cvar("zp_adv_fog_density""4")
    
cvar_fog_color[0] =     register_cvar("zp_adv_fog_color_R""250")
    
cvar_fog_color[1] =    register_cvar("zp_adv_fog_color_G""250")
    
cvar_fog_color[2] =     register_cvar("zp_adv_fog_color_B""250")
    
    
// Register round start event
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
    
// Register cvar for detecting servers with our plugin 
    
register_cvar("zp_adv_fog""1.0 By Saad706"FCVAR_SERVER|FCVAR_SPONLY)
    
set_cvar_string("zp_adv_fog""1.0 By Saad706")
}

// Round start

public zp_round_started()
{

    if ( 
zp_is_swarm_round())
    {
        
remove_task(TASK_FOG)
        
set_task(0.5"task_update_fog"TASK_FOG__"b")
    }
}

/*
public event_round_start()
{
    // Remove task and then set it again
    remove_task(TASK_FOG)
    set_task(0.5, "task_update_fog", TASK_FOG, _, _, "b")
}
*/

// Task: update fog message
public task_update_fog()
{
    
// Get the amount of density
    
static density
    density 
= (get_pcvar_num(cvar_fog_density))
    
    
// Finally, the fog message [Thnx to @bdul!]
    
message_begin(MSG_ALLget_user_msgid("Fog"), {0,0,0}, 0)
    
write_byte(get_pcvar_num(cvar_fog_color[0])) // Red
    
write_byte(get_pcvar_num(cvar_fog_color[1])) // Green
    
write_byte(get_pcvar_num(cvar_fog_color[2])) // Blue
    
write_byte(g_fog_density[density]) // SD
    
write_byte(g_fog_density[density+1]) // ED
    
write_byte(g_fog_density[density+2]) // D1
    
write_byte(g_fog_density[density+3]) // D2
    
message_end()

Thanks in Advance.
__________________



AssasinSniperNightmare ModArmageddon ModApolacyps Mod
Kakarot47 is offline
Send a message via Skype™ to Kakarot47
Senzor
Member
Join Date: Nov 2012
Location: Romania
Old 06-16-2016 , 04:14   Re: [Problem]zp_adv_fog on swarm mod
Reply With Quote #2

Try this
Code:
#include <amxmodx> 
#include <zombieplague> 

// Variables 
new cvar_fog_density, cvar_fog_color[3] 

// Fog density offsets [Thnx to DA] 
new const g_fog_density[] = { 0, 0, 0, 0, 111, 18, 3, 58, 111, 18, 125, 58, 66, 96, 27, 59, 90, 101, 60, 59, 90, 
            101, 68, 59, 10, 41, 95, 59, 111, 18, 125, 59, 111, 18, 3, 60, 68, 116, 19, 60 } 

// The unique id of the fog task 
new const TASK_FOG = 5942 

// Plugin init 
public plugin_init() 
{ 
    // Plugin Registeration 
    register_plugin("[ZP] Advanced Fog System", "1.0", "Saad706") 
     
    // Register some cvars [Edit these] 
    cvar_fog_density =     register_cvar("zp_adv_fog_density", "4") 
    cvar_fog_color[0] =     register_cvar("zp_adv_fog_color_R", "250") 
    cvar_fog_color[1] =    register_cvar("zp_adv_fog_color_G", "250") 
    cvar_fog_color[2] =     register_cvar("zp_adv_fog_color_B", "250") 
     
    // Register round start event 
    register_event("HLTV", "event_round_start", "a", "1=0", "2=0") 
     
    // Register cvar for detecting servers with our plugin  
    register_cvar("zp_adv_fog", "1.0 By Saad706", FCVAR_SERVER|FCVAR_SPONLY) 
    set_cvar_string("zp_adv_fog", "1.0 By Saad706") 
} 

// Round start 

public zp_round_started() 
{ 

    if(zp_is_swarm_round()) 
    { 
        remove_task(TASK_FOG) 
        set_task(0.5, "task_update_fog", TASK_FOG, _, _, "b") 
    } 
} 

/* 
public event_round_start() 
{ 
    // Remove task and then set it again 
    remove_task(TASK_FOG) 
//    set_task(0.5, "task_update_fog", TASK_FOG, _, _, "b") 
} 
*/ 

// Task: update fog message 
public task_update_fog() 
{ 
    // Get the amount of density 
    static density 
    density = (4 * get_pcvar_num(cvar_fog_density)) 
     
    // Finally, the fog message [Thnx to @bdul!] 
    message_begin(MSG_ALL, get_user_msgid("Fog"), {0,0,0}, 0) 
    write_byte(get_pcvar_num(cvar_fog_color[0])) // Red 
    write_byte(get_pcvar_num(cvar_fog_color[1])) // Green 
    write_byte(get_pcvar_num(cvar_fog_color[2])) // Blue 
    write_byte(g_fog_density[density]) // SD 
    write_byte(g_fog_density[density+1]) // ED 
    write_byte(g_fog_density[density+2]) // D1 
    write_byte(g_fog_density[density+3]) // D2 
    message_end() 
}
Senzor is offline
Kakarot47
Senior Member
Join Date: May 2015
Location: Pakistan
Old 06-16-2016 , 08:52   Re: [Problem]zp_adv_fog on swarm mod
Reply With Quote #3

PHP Code:
if ( zp_is_swarm_round()) 
and
PHP Code:
if (zp_is_swarm_round()) 
both are right

Read the post before reply

Quote:
Originally Posted by Kakarot47 View Post
Hey all,

i got zp_adv_fog for swarm mod.. so when i play swarm mod on map then fog starts but when round finish and starts new round then fog still acitvated.

I want this fog system only working on swarm mod and when round finished then fog will have to disable.
__________________



AssasinSniperNightmare ModArmageddon ModApolacyps Mod
Kakarot47 is offline
Send a message via Skype™ to Kakarot47
Senzor
Member
Join Date: Nov 2012
Location: Romania
Old 06-16-2016 , 11:50   Re: [Problem]zp_adv_fog on swarm mod
Reply With Quote #4

That's why i've put // in front of this line:
public event_round_start()
Code:
//    set_task(0.5, "task_update_fog", TASK_FOG, _, _, "b")
when the round start will remove the fog and not update it again
the only line available there now is this:
Code:
remove_task(TASK_FOG)

Last edited by Senzor; 06-16-2016 at 11:51.
Senzor is offline
Kakarot47
Senior Member
Join Date: May 2015
Location: Pakistan
Old 06-16-2016 , 18:07   Re: [Problem]zp_adv_fog on swarm mod
Reply With Quote #5

Not working Please fix
__________________



AssasinSniperNightmare ModArmageddon ModApolacyps Mod
Kakarot47 is offline
Send a message via Skype™ to Kakarot47
Kakarot47
Senior Member
Join Date: May 2015
Location: Pakistan
Old 06-23-2016 , 20:29   Re: [Problem]zp_adv_fog on swarm mod
Reply With Quote #6

bump
__________________



AssasinSniperNightmare ModArmageddon ModApolacyps Mod
Kakarot47 is offline
Send a message via Skype™ to Kakarot47
Kakarot47
Senior Member
Join Date: May 2015
Location: Pakistan
Old 07-01-2016 , 18:55   Re: [Problem]zp_adv_fog on swarm mod
Reply With Quote #7

1+
__________________



AssasinSniperNightmare ModArmageddon ModApolacyps Mod
Kakarot47 is offline
Send a message via Skype™ to Kakarot47
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 09:11.


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