How can i change the lighting cvar on nemesis or survivor mode? Since the lighting cvar is for all mode, how can i change it per mode ?
Change Lighting on Nemesis & Survivor Mode
Okey, Try this one, But I did not try it on my game!
- #include <amxmodx>
- #include <ze_core>
- // Defines.
- #define GAMEMODE_NEMESIS "Nemesis"
- #define GAMEMODE_SURVIVOR "Survivor"
- // CVars.
- new g_szLightS[4],
- g_szNemLightS[4],
- g_szSurLightS[4]
- // Variables.
- new g_pCvarLightS,
- bool:g_bCustomLight
- public plugin_init()
- {
- // Load Plug-In.
- register_plugin("[ZE] Addon: Custom Lightning (Nemesis/Survivor)", "0.1", "z0h1r-LK")
- // CVars.
- g_pCvarLightS = get_cvar_pointer("mp_lighting")
- bind_pcvar_string(g_pCvarLightS, g_szLightS, charsmax(g_szLightS))
- bind_pcvar_string(register_cvar("ze_lighting_nemesis", "d"), g_szNemLightS, charsmax(g_szNemLightS))
- bind_pcvar_string(register_cvar("ze_lighting_survivor", "d"), g_szSurLightS, charsmax(g_szSurLightS))
- }
- public ze_gamemode_chosen(game_id, target)
- {
- new szName[MAX_NAME_LENGTH]
- ze_gamemode_get_name(game_id, szName, charsmax(szName))
- if (equali(szName, GAMEMODE_NEMESIS))
- {
- g_bCustomLight = true
- set_pcvar_string(g_pCvarLightS, g_szNemLightS)
- }
- else if (equal(szName, GAMEMODE_SURVIVOR))
- {
- g_bCustomLight = true
- set_pcvar_string(g_pCvarLightS, g_szSurLightS)
- }
- }
- public ze_roundend(iWinTeam)
- {
- if (g_bCustomLight)
- {
- g_bCustomLight = false
- set_pcvar_string(g_pCvarLightS, g_szLightS)
- }
- }
Console Variables:
- ze_lighting_nemesis "d" // Map Light Style in Nemesis Mode a..z (a = Darkest | z = Brightest | 0 = no Dark/no Shadow | "" = Disabled).
- ze_lighting_survivor "d" // Map Light Style in Survivor Mode a..z (a = Darkest | z = Brightest | 0 = no Dark/no Shadow | "" = Disabled).
z0h1r-LK
Hey, tested and it seems not to work in both modes. Plugin is running but no light change happens.
By the way, This plug-in is change light style in game mode Nemesis and Survivor.
- ze_lighting_nemesis d // Map Light Style a..z in Nemesis Mode (a = Darkest | z = Brightest | 0 = no Dark/no Shadow | "" = Disabled)
- ze_lighting_survivor d // Map Light Style a..z in Survivor Mode (a = Darkest | z = Brightest | 0 = no Dark/no Shadow | "" = Disabled)
@Snakeren Good Luck
z0h1r-LK
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute
Sign in
Who is online
Users browsing this forum: No registered users and 0 guests