Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
playerbaseclient.c
Go to the documentation of this file.
1
class
PlayerBaseClient
extends
PlayerBase
2
{
3
static
ScriptedLightBase
m_PersonalLight
;
4
static
bool
m_PersonalLightEnabledOnCurrentServer
=
false
;
// "disablePersonalLight" in server.cfg decides if this is true or false
5
static
bool
m_PersonalLightDisabledByDebug
=
false
;
6
static
bool
m_PersonalLightIsSwitchedOn
=
true
;
7
9
static
void
CreatePersonalLight
()
10
{
11
if
(!
m_PersonalLight
&& ( !
g_Game
.IsServer() || !
g_Game
.IsMultiplayer() ))
12
{
13
m_PersonalLight
=
ScriptedLightBase
.CreateLight(PersonalLight,
"0 0 0"
);
14
}
15
}
16
17
/*
18
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
19
{
20
super.OnRPC(sender, rpc_type, ctx);
21
22
switch( rpc_type )
23
{
24
case ERPCs.RPC_TOGGLE_PERSONAL_LIGHT:
25
{
26
Param1<bool> is_enabled = new Param1<bool>(false);
27
28
if (ctx.Read(is_enabled))
29
{
30
m_PersonalLightEnabledOnCurrentServer = is_enabled.param1;
31
UpdatePersonalLight();
32
}
33
34
break;
35
}
36
}
37
}*/
38
39
override
void
OnGameplayDataHandlerSync
()
40
{
41
super.OnGameplayDataHandlerSync();
42
m_PersonalLightEnabledOnCurrentServer
= !
CfgGameplayHandler
.
GetDisablePersonalLight
();
43
UpdatePersonalLight
();
44
UpdateHitDirectionValues
();
45
}
46
47
49
static
void
SwitchPersonalLight
(
bool
state)
50
{
51
if
( !
g_Game
.IsServer() || !
g_Game
.IsMultiplayer() )
52
{
53
m_PersonalLightIsSwitchedOn
= state;
54
UpdatePersonalLight
();
55
}
56
}
57
59
static
void
UpdatePersonalLight
()
60
{
61
string
param;
62
63
CreatePersonalLight
();
64
65
// Allow PL unless it's disabled by debug or client-side starting parameter
66
if
( !
GetCLIParam
(
"disablePersonalLight"
, param) && !
m_PersonalLightDisabledByDebug
&&
m_PersonalLightIsSwitchedOn
)
67
{
68
m_PersonalLight
.SetEnabled(
m_PersonalLightEnabledOnCurrentServer
);
69
}
70
else
71
{
72
m_PersonalLight
.SetEnabled(
false
);
73
}
74
}
75
76
static
void
UpdateHitDirectionValues
()
77
{
78
HitDirectionEffectBase
.
CheckValues
();
79
}
80
}
CfgGameplayHandler
Definition
cfggameplayhandler.c:2
CfgGameplayHandler::GetDisablePersonalLight
static bool GetDisablePersonalLight()
! ===================================================================================== !...
Definition
cfggameplayhandler.c:129
HitDirectionEffectBase
Definition
hitdirectionarrow.c:3
HitDirectionEffectBase::CheckValues
static void CheckValues()
range 0..180, randomized offset of direction to make it less acurate
Definition
hitdirectionbase.c:181
PlayerBase
Definition
playerbaseclient.c:2
PlayerBase::UpdateHitDirectionValues
static void UpdateHitDirectionValues()
Definition
playerbaseclient.c:76
PlayerBase::SwitchPersonalLight
static void SwitchPersonalLight(bool state)
Controls the ON/OFF switch of the Personal Light. PL will still shine only if the server allows it.
Definition
playerbaseclient.c:49
PlayerBase::m_PersonalLightEnabledOnCurrentServer
static bool m_PersonalLightEnabledOnCurrentServer
Definition
playerbaseclient.c:4
PlayerBase::UpdatePersonalLight
static void UpdatePersonalLight()
Updates state of PL.
Definition
playerbaseclient.c:59
PlayerBase::CreatePersonalLight
static void CreatePersonalLight()
Creates PL if it doesn't exist already.
Definition
playerbaseclient.c:9
PlayerBase::m_PersonalLightDisabledByDebug
static bool m_PersonalLightDisabledByDebug
Definition
playerbaseclient.c:5
PlayerBase::m_PersonalLight
static ScriptedLightBase m_PersonalLight
Definition
playerbaseclient.c:3
PlayerBase::m_PersonalLightIsSwitchedOn
static bool m_PersonalLightIsSwitchedOn
Definition
playerbaseclient.c:6
PlayerBase::OnGameplayDataHandlerSync
override void OnGameplayDataHandlerSync()
Definition
playerbaseclient.c:39
ScriptedLightBase
Definition
pointlightbase.c:2
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
GetCLIParam
proto bool GetCLIParam(string param, out string val)
Returns command line argument.
Games
Dayz
scripts
4_world
entities
manbase
playerbaseclient.c
Generated by
1.17.0