Change Lighting on Nemesis & Survivor Mode

Coding Help/Re-API Supported
Post Reply
Snakeren
Member
Member
Turkey
Posts: 42
Joined: 3 years ago
Contact:

Change Lighting on Nemesis & Survivor Mode

#1

Post by Snakeren »

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 ?

User avatar
z0h1r-LK
Mod Developer
Mod Developer
Morocco
Posts: 562
Joined: 5 years ago
Location: The Red City ❤
Contact:

#2

Post by z0h1r-LK »

  • Okey, Try this one, But I did not try it on my game!

  1. #include <amxmodx>
  2. #include <ze_core>
  3.  
  4. // Defines.
  5. #define GAMEMODE_NEMESIS "Nemesis"
  6. #define GAMEMODE_SURVIVOR "Survivor"
  7.  
  8. // CVars.
  9. new g_szLightS[4],
  10.     g_szNemLightS[4],
  11.     g_szSurLightS[4]
  12.  
  13. // Variables.
  14. new g_pCvarLightS,
  15.     bool:g_bCustomLight
  16.  
  17. public plugin_init()
  18. {
  19.     // Load Plug-In.
  20.     register_plugin("[ZE] Addon: Custom Lightning (Nemesis/Survivor)", "0.1", "z0h1r-LK")
  21.  
  22. // CVars.
  23. g_pCvarLightS = get_cvar_pointer("mp_lighting")
  24. bind_pcvar_string(g_pCvarLightS, g_szLightS, charsmax(g_szLightS))
  25. bind_pcvar_string(register_cvar("ze_lighting_nemesis", "d"), g_szNemLightS, charsmax(g_szNemLightS))
  26. bind_pcvar_string(register_cvar("ze_lighting_survivor", "d"), g_szSurLightS, charsmax(g_szSurLightS))
  27. }
  28.  
  29. public ze_gamemode_chosen(game_id, target)
  30. {
  31.     new szName[MAX_NAME_LENGTH]
  32.     ze_gamemode_get_name(game_id, szName, charsmax(szName))
  33.  
  34. if (equali(szName, GAMEMODE_NEMESIS))
  35. {
  36.     g_bCustomLight = true
  37.     set_pcvar_string(g_pCvarLightS, g_szNemLightS)
  38. }
  39. else if (equal(szName, GAMEMODE_SURVIVOR))
  40. {
  41.     g_bCustomLight = true
  42.     set_pcvar_string(g_pCvarLightS, g_szSurLightS)
  43. }
  44. }
  45.  
  46. public ze_roundend(iWinTeam)
  47. {
  48.     if (g_bCustomLight)
  49.     {
  50.         g_bCustomLight = false
  51.         set_pcvar_string(g_pCvarLightS, g_szLightS)
  52.     }
  53. }
  • Console Variables:

  1. ze_lighting_nemesis "d"                 // Map Light Style in Nemesis Mode a..z (a = Darkest | z = Brightest | 0 = no Dark/no Shadow | "" = Disabled).
  2. ze_lighting_survivor "d"                 // Map Light Style in Survivor Mode a..z (a = Darkest | z = Brightest | 0 = no Dark/no Shadow | "" = Disabled).
Snakeren
Member
Member
Turkey
Posts: 42
Joined: 3 years ago
Contact:

#3

Post by Snakeren »

Hey, tested and it seems not to work in both modes. Plugin is running but no light change happens.

User avatar
z0h1r-LK
Mod Developer
Mod Developer
Morocco
Posts: 562
Joined: 5 years ago
Location: The Red City ❤
Contact:

#4

Post by z0h1r-LK »

By the way, This plug-in is change light style in game mode Nemesis and Survivor.

    1. ze_lighting_nemesis d          // Map Light Style a..z in Nemesis Mode (a = Darkest | z = Brightest | 0 = no Dark/no Shadow | "" = Disabled)
    2. 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 🍀

Snakeren
Member
Member
Turkey
Posts: 42
Joined: 3 years ago
Contact:

#5

Post by Snakeren »

z0h1r-LK wrote: 3 weeks ago

Sorry, I do a bug in plug-in 😁

  • ze_lighting_modes.sma

Hey bro, thanks for that! One little fix is needed, the lighting does not turn back to its value of ze_lighting in next round.

User avatar
z0h1r-LK
Mod Developer
Mod Developer
Morocco
Posts: 562
Joined: 5 years ago
Location: The Red City ❤
Contact:

#6

Post by z0h1r-LK »

Post Reply

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

Register

Sign in

Who is online

Users browsing this forum: No registered users and 0 guests