Download scripts/4_World/DayZ/Entities/ManBase/PlayerBaseClient.c from FelonieZ/DayZ_Scripts: direct link, hf CLI and curl.
- Browser
- Download file 2.08 kB
-
https://huggingface.co/datasets/FelonieZ/DayZ_Scripts/resolve/main/scripts/4_World/DayZ/Entities/ManBase/PlayerBaseClient.c
- Command line
-
hf download hf://datasets/FelonieZ/DayZ_Scripts/scripts/4_World/DayZ/Entities/ManBase/PlayerBaseClient.c
-
curl -L -o PlayerBaseClient.c https://huggingface.co/datasets/FelonieZ/DayZ_Scripts/resolve/main/scripts/4_World/DayZ/Entities/ManBase/PlayerBaseClient.c
2.08 kB
| class PlayerBaseClient extends PlayerBase | |
| { | |
| static ScriptedLightBase m_PersonalLight; | |
| static bool m_PersonalLightEnabledOnCurrentServer = false; // "disablePersonalLight" in server.cfg decides if this is true or false | |
| static bool m_PersonalLightDisabledByDebug = false; | |
| static bool m_PersonalLightIsSwitchedOn = true; | |
| //! Creates PL if it doesn't exist already. | |
| static void CreatePersonalLight() | |
| { | |
| if (!m_PersonalLight && ( !GetGame().IsServer() || !GetGame().IsMultiplayer() )) | |
| { | |
| m_PersonalLight = ScriptedLightBase.CreateLight(PersonalLight, "0 0 0"); | |
| } | |
| } | |
| /* | |
| override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx) | |
| { | |
| super.OnRPC(sender, rpc_type, ctx); | |
| switch( rpc_type ) | |
| { | |
| case ERPCs.RPC_TOGGLE_PERSONAL_LIGHT: | |
| { | |
| Param1<bool> is_enabled = new Param1<bool>(false); | |
| if (ctx.Read(is_enabled)) | |
| { | |
| m_PersonalLightEnabledOnCurrentServer = is_enabled.param1; | |
| UpdatePersonalLight(); | |
| } | |
| break; | |
| } | |
| } | |
| }*/ | |
| override void OnGameplayDataHandlerSync() | |
| { | |
| super.OnGameplayDataHandlerSync(); | |
| m_PersonalLightEnabledOnCurrentServer = !CfgGameplayHandler.GetDisablePersonalLight(); | |
| UpdatePersonalLight(); | |
| UpdateHitDirectionValues(); | |
| } | |
| //! Controls the ON/OFF switch of the Personal Light. PL will still shine only if the server allows it. | |
| static void SwitchPersonalLight(bool state) | |
| { | |
| if ( !GetGame().IsServer() || !GetGame().IsMultiplayer() ) | |
| { | |
| m_PersonalLightIsSwitchedOn = state; | |
| UpdatePersonalLight(); | |
| } | |
| } | |
| //! Updates state of PL | |
| static void UpdatePersonalLight() | |
| { | |
| string param; | |
| CreatePersonalLight(); | |
| // Allow PL unless it's disabled by debug or client-side starting parameter | |
| if ( !GetCLIParam("disablePersonalLight", param) && !m_PersonalLightDisabledByDebug && m_PersonalLightIsSwitchedOn ) | |
| { | |
| m_PersonalLight.SetEnabled(m_PersonalLightEnabledOnCurrentServer); | |
| } | |
| else | |
| { | |
| m_PersonalLight.SetEnabled(false); | |
| } | |
| } | |
| static void UpdateHitDirectionValues() | |
| { | |
| HitDirectionEffectBase.CheckValues(); | |
| } | |
| } |