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

Solved Sun Disable Extract from Z:R


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CryWolf
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 04-28-2015 , 15:42   Sun Disable Extract from Z:R
Reply With Quote #1

Hi guys i'm trying to extract the portion from Zombie Reloaded who disables the Sun from the sky but no success can anyone help ? so far by now
PHP Code:
#pragma semicolon 1

// #define DEBUG

#define PLUGIN_AUTHOR ""
#define PLUGIN_VERSION "0.00"

#include <sourcemod>
#include <sdktools>

new g_hCvarsList[CvarsList];

public 
Plugin:myinfo 
{
    
name "",
    
author PLUGIN_AUTHOR,
    
description "",
    
version PLUGIN_VERSION,
    
url ""
};

public 
OnPluginStart()
{
     
g_hCvarsList[CVAR_VEFFECTS_SUN_DISABLE]             =    CreateConVar("zr_veffects_sun_disable""0""Disable sun rendering on map.");
}

public 
VAmbienceCvarsHookSunDisable(Handle:cvar, const String:oldvalue[], const String:newvalue[])
{
    
// If fog is disabled, then disable.
    
new bool:sun GetConVarBool(g_hCvarsList[CVAR_VEFFECTS_SUN_DISABLE]);
    
    
// Apply fog.
    
VAmbienceApplySunDisable(!sun);
}

VAmbienceCvarsHook(bool:unhook false)
{
    if (
unhook)
        {
            
// Unhook sun cvars.
            
UnhookConVarChange(g_hCvarsList[CVAR_VEFFECTS_SUN_DISABLE], VAmbienceCvarsHookSunDisable);
        }
}

VAmbienceApplySunDisable(bool:disable false)
{
    
// Find sun entity.
    
new sun FindEntityByClassname(-1"env_sun");
    
    
// If sun is invalid, then stop.
    
if (sun == -1)
    {
        return;
    }
    
    
// If default, then re-enable sun rendering.
    
if (disable)
    {
        
// Turn on sun rendering.
        
AcceptEntityInput(sun"TurnOn");
        
        return;
    }
    
    
// Turn off sun rendering.
    
AcceptEntityInput(sun"TurnOff");

Errors:
Code:
New Sourcepawn Script.sp
C:\Users\CryWolf\AppData\Roaming\spedit\sourcepawn\scripts\New Sourcepawn Script.sp(11) : error 017: undefined symbol "CvarsList"
C:\Users\CryWolf\AppData\Roaming\spedit\sourcepawn\scripts\New Sourcepawn Script.sp(11) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\CryWolf\AppData\Roaming\spedit\sourcepawn\scripts\New Sourcepawn Script.sp(24) : error 017: undefined symbol "CVAR_VEFFECTS_SUN_DISABLE"
C:\Users\CryWolf\AppData\Roaming\spedit\sourcepawn\scripts\New Sourcepawn Script.sp(24) : warning 213: tag mismatch
C:\Users\CryWolf\AppData\Roaming\spedit\sourcepawn\scripts\New Sourcepawn Script.sp(30) : error 017: undefined symbol "CVAR_VEFFECTS_SUN_DISABLE"
C:\Users\CryWolf\AppData\Roaming\spedit\sourcepawn\scripts\New Sourcepawn Script.sp(67) : warning 203: symbol is never used: "VAmbienceCvarsHook"
Done
Thank you!
__________________
I dont walk trough this world with fear in my heart.
www.dark-arena.com L4D, CS1.6, CZ Servers

Last edited by CryWolf; 03-23-2017 at 17:13.
CryWolf is offline
Send a message via MSN to CryWolf Send a message via Yahoo to CryWolf
lingzhidiyu
Senior Member
Join Date: Mar 2014
Old 04-29-2015 , 00:54   Re: Sun Disable Extract from Z:R
Reply With Quote #2

PHP Code:
public OnMapStart()
{
    
VAmbienceApplySunDisable(false);
}

VAmbienceApplySunDisable(bool:disable false

    
// Find sun entity. 
    
new sun FindEntityByClassname(-1"env_sun"); 
     
    
// If sun is invalid, then stop. 
    
if (sun == -1
    { 
        return; 
    } 
     
    
// If default, then re-enable sun rendering. 
    
if (disable
    { 
        
// Turn on sun rendering. 
        
AcceptEntityInput(sun"TurnOn"); 
         
        return; 
    } 
     
    
// Turn off sun rendering. 
    
AcceptEntityInput(sun"TurnOff"); 

lingzhidiyu is offline
CryWolf
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 04-29-2015 , 15:31   Re: Sun Disable Extract from Z:R
Reply With Quote #3

thanks!
__________________
I dont walk trough this world with fear in my heart.
www.dark-arena.com L4D, CS1.6, CZ Servers
CryWolf is offline
Send a message via MSN to CryWolf Send a message via Yahoo to CryWolf
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 15:57.


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