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

[ZP] Addon Round Fog


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 06-05-2011 , 14:32   [ZP] Addon Round Fog
Reply With Quote #1

Plugin Description:
This plugin is created for all HL1 fog lover, it makes different fog for each mod (infection, multi, swarm, plague, survivor, nemesis).

Cvars:
No cvars all hardcoded

Configuration:
* Please make sure to use OpenGL mod, because HL1 based game is suck!
* Remember to disable ZP original fog, look in "zombieplague.ini" and set "FOG = 0"

To set fog color and density:
PHP Code:
public zp_round_started(gamemode)
{
    switch(
gamemode)
    {
        
// Make sure density must between 0.0001 and 0.25
        // Max RGB color is 255
        
case MODE_INFECTIONCreateFog(00000.0008);
        case 
MODE_MULTICreateFog(010010000.0008);
        case 
MODE_PLAGUECreateFog(0010000.0008);
        case 
MODE_SURVIVORCreateFog(0001000.0008);
        case 
MODE_NEMESISCreateFog(0100000.0008);
        case 
MODE_SWARMCreateFog(01001001000.0005);
    }

To remove fog for certain player:
PHP Code:
CreateFog(id, .clear true); 
To remove fog for all players:
PHP Code:
CreateFog(0, .clear true); 
Credits:
Arkshine -- Custom Fog Stock.
Dolph_Ziggler -- His idea, nice yow!
Attached Files
File Type: sma Get Plugin or Get Source (ZP_Addon_RoundFog.sma - 1846 views - 1.9 KB)
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019

Last edited by yokomo; 06-05-2011 at 14:40.
yokomo is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 06-05-2011 , 14:43   Re: [ZP] Addon Round Fog
Reply With Quote #2

Good job!
I would add cvars for the colors of individual modes though.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 06-05-2011 , 14:47   Re: [ZP] Addon Round Fog
Reply With Quote #3

Quote:
Originally Posted by bibu View Post
Good job!
I would add cvars for the colors of individual modes though.
Nice, i hate to write cvars because it's too many.. so i will past to you to update it
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 06-05-2011 , 15:00   Re: [ZP] Addon Round Fog
Reply With Quote #4

Quote:
Originally Posted by yokomo View Post
so i will past to you to update it
No, since it isn't bad coded, I won't touch it.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Dolph_Ziggler
BANNED
Join Date: Jun 2011
Old 06-05-2011 , 15:03   Re: [ZP] Addon Round Fog
Reply With Quote #5

Quote:
Originally Posted by yokomo View Post
Nice, i hate to write cvars because it's too many.. so i will past to you to update it
niceee yokomo thank you very much )))
Dolph_Ziggler is offline
Send a message via MSN to Dolph_Ziggler
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 06-06-2011 , 11:08   Re: [ZP] Addon Round Fog
Reply With Quote #6

very nice
can you add fading fog? (in and out)
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Dolph_Ziggler
BANNED
Join Date: Jun 2011
Old 06-06-2011 , 11:11   Re: [ZP] Addon Round Fog
Reply With Quote #7

Quote:
Originally Posted by georgik57 View Post
very nice
can you add fading fog? (in and out)
what is fading ???
Dolph_Ziggler is offline
Send a message via MSN to Dolph_Ziggler
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 06-06-2011 , 11:12   Re: [ZP] Addon Round Fog
Reply With Quote #8

Quote:
Originally Posted by Dolph_Ziggler View Post
what is fading ???
gradual changing
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
bibu
Veteran Member
Join Date: Sep 2010
Old 06-06-2011 , 13:18   Re: [ZP] Addon Round Fog
Reply With Quote #9

Quote:
Originally Posted by yokomo View Post
so i will past to you to update it
Done.

Untested, please test all cvars out, hope it works flawlessly.
The colors should be by default ok.

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

#define PLUGIN    "ZP Round Fog"
#define VERSION    "1.0.0"
#define AUTHOR    "yokomo"

new zp_fog_infzp_fog_inf_colorzp_fog_inf_density
new zp_fog_multizp_fog_multi_colorzp_fog_multi_density
new zp_fog_plaguezp_fog_plague_colorzp_fog_plague_density
new zp_fog_survzp_fog_surv_colorzp_fog_surv_density
new zp_fog_nemzp_fog_nem_colorzp_fog_nem_density
new zp_fog_swarmzp_fog_swarm_colorzp_fog_swarm_density

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
zp_fog_inf register_cvar("zp_fog_inf""1")
    
zp_fog_inf_color register_cvar("zp_fog_inf_color""0 200 0")
    
zp_fog_inf_density register_cvar("zp_fog_inf_density""0.0002")
    
    
zp_fog_multi register_cvar("zp_fog_multi""1")
    
zp_fog_multi_color register_cvar("zp_fog_multi_color""200 0 0")
    
zp_fog_multi_density register_cvar("zp_fog_multi_density""0.0002")
    
    
zp_fog_plague register_cvar("zp_fog_plague""1")
    
zp_fog_plague_color register_cvar("zp_fog_inf_plague""153 50 204")
    
zp_fog_plague_density register_cvar("zp_fog_inf_plague""0.0010")
    
    
zp_fog_surv register_cvar("zp_fog_surv""1")
    
zp_fog_surv_color register_cvar("zp_fog_surv_color""58 95 208")
    
zp_fog_surv_density register_cvar("zp_fog_surv_density""0.0008")
    
    
zp_fog_nem register_cvar("zp_fog_nem""1")
    
zp_fog_nem_color register_cvar("zp_fog_nem_color""255 0 0")
    
zp_fog_nem_density register_cvar("zp_fog_nem_density""0.0008")
    
    
zp_fog_swarm register_cvar("zp_fog_swarm""1")
    
zp_fog_swarm_color register_cvar("zp_fog_swarm_color""200 200 0")
    
zp_fog_swarm_density register_cvar("zp_fog_swarm_density""0.0005")
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
}

public 
plugin_cfg()
{
    
set_task(1.0"event_round_start")
}

public 
event_round_start()
{
    
CreateFog(0, .clear true)
}

public 
client_putinserver(id)
{
    
CreateFog(id, .clear true)
}

public 
zp_round_started(gamemode)
{
    new 
rgb
    
    
switch(gamemode)
    {
        case 
MODE_INFECTION:
        {
            if(
get_pcvar_num(zp_fog_inf))
            {
                
PrePareFogColor(zp_fog_inf_colorrgb)
            
                
CreateFog(0rgbget_pcvar_float(zp_fog_inf_density))
            }
        }
        case 
MODE_MULTI:
        {
            if(
get_pcvar_num(zp_fog_multi))
            {
                
PrePareFogColor(zp_fog_multi_colorrgb)
            
                
CreateFog(0rgbget_pcvar_float(zp_fog_multi_density))
            }
        }
        case 
MODE_PLAGUE:
        {
            if(
get_pcvar_num(zp_fog_plague))
            {
                
PrePareFogColor(zp_fog_plague_colorrgb)
            
                
CreateFog(0rgbget_pcvar_float(zp_fog_plague_density))
            }
        }
        case 
MODE_SURVIVOR:
        {
            if(
get_pcvar_num(zp_fog_surv))
            {
                
PrePareFogColor(zp_fog_surv_colorrgb)
            
                
CreateFog(0rgbget_pcvar_float(zp_fog_surv_density))
            }
        }
        case 
MODE_NEMESIS:
        {
            if(
get_pcvar_num(zp_fog_nem))
            {
                
PrePareFogColor(zp_fog_nem_colorrgb)
            
                
CreateFog(0rgbget_pcvar_float(zp_fog_nem_density))
            }
        }
        case 
MODE_SWARM:
        {
            if(
get_pcvar_num(zp_fog_swarm))
            {
                
PrePareFogColor(zp_fog_swarm_colorrgb)
            
                
CreateFog(0rgbget_pcvar_float(zp_fog_swarm_density))
            }
        }
    }
}

public 
PrePareFogColor(cvar, &r, &g, &b)
{
    static 
color[16], piece[5]
    
get_pcvar_string(cvarcolor15)
    
    
strbreak(colorpiece4color15)
    
str_to_num(piece)
    
    
strbreak(colorpiece4color15)
    
str_to_num(piece)
    
str_to_num(color)
}

// Stock create fog by Arkshine
stock CreateFog (const index 0, const red 127, const green 127, const blue 127, const Float:density_f 0.001bool:clear false
{    
    static 
msgFog
    
    
if(msgFog || (msgFog get_user_msgid("Fog")))     
    {         
        new 
density _:floatclamp(density_f0.00010.25) * _:!clear      
        message_begin
(index MSG_ONE_UNRELIABLE MSG_BROADCASTmsgFog, .player index)      
        
write_byte(clamp(red0255))   
        
write_byte(clamp(green0255))         
        
write_byte(clamp(blue 0255))        
        
write_byte((density 0xFF))       
        
write_byte((density >>  8) & 0xFF)     
        
write_byte((density >> 16) & 0xFF)    
        
write_byte((density >> 24) & 0xFF)    
        
message_end()
    } 

__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 06-06-2011 , 14:22   Re: [ZP] Addon Round Fog
Reply With Quote #10

Quote:
Originally Posted by georgik57 View Post
very nice
can you add fading fog? (in and out)
That was dynamic fog just like Silenthill mod?

to make dynamic fog we need to set task just like zp thunder event.. ermm

@bibu
Wow got cvars yow! gonna test it, thanks.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo 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 15:55.


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