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!
__________________