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

[Solved] How to make this darkness effect?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Mitchell
~lick~
Join Date: Mar 2010
Old 11-25-2012 , 14:28   Re: How to make this darkness effect?
Reply With Quote #16

Quote:
Originally Posted by Mitch View Post
seeing how ive had this code since halloween
Code:
#include <sourcemod>
#include <sdktools>

new FogIndex = -1;
new Float:mapFogStart = 0.0;
new Float:mapFogEnd = 175.0;
new Float:mapFogDensity = 1.0;

public OnPluginStart()
{
    RegAdminCmd("sm_fogoff", fogoff, ADMFLAG_ROOT, "");
    RegAdminCmd("sm_fogon", fogon, ADMFLAG_ROOT, "");
}
public OnMapStart()
{
    new ent; 
    ent = FindEntityByClassname(-1, "env_fog_controller");
    if (ent != -1) 
    {
        FogIndex = ent;
    }
    else
    {
        FogIndex = CreateEntityByName("env_fog_controller");
        DispatchSpawn(FogIndex);
    }
    DoFog();
    AcceptEntityInput(FogIndex, "TurnOff");
}

public Action:fogoff(client, args)
{AcceptEntityInput(FogIndex, "TurnOff");}    

public Action:fogon(client, args)
{AcceptEntityInput(FogIndex, "TurnOn");}

DoFog()
{
    if(FogIndex != -1) 
    {
        DispatchKeyValue(FogIndex, "fogblend", "0");
        DispatchKeyValue(FogIndex, "fogcolor", "0 0 0");
        DispatchKeyValue(FogIndex, "fogcolor2", "0 0 0");
        DispatchKeyValueFloat(FogIndex, "fogstart", mapFogStart);
        DispatchKeyValueFloat(FogIndex, "fogend", mapFogEnd);
        DispatchKeyValueFloat(FogIndex, "fogmaxdensity", mapFogDensity);
    }
}
This should do what you are trying to do, or atleast replicate what i saw in the video
Bit off topic, but you scared the hell out of me, i was like: "wait a second... i didnt post here...."
Mitchell 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 06:06.


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