DIFF

class CGameSource

DayZGame CGame

Constructors 2

Members 7

int m_DebugMonitorEnabled
private ref array<ref Param> m_ParamCache
Referenced by CGame()
ref AnalyticsManagerServer m_AnalyticsManagerServer
Referenced by CGame(), and GetAnalyticsServer()
ref AnalyticsManagerClient m_AnalyticsManagerClient
Referenced by CGame(), and GetAnalyticsClient()
ref MenuDefaultCharacterData m_CharacterData

Methods 273

proto native WorkspaceWidget GetWorkspace()
proto native WorkspaceWidget GetLoadingWorkspace()
void OnEvent(EventType eventTypeId, Param params)

Called when some system event occur.

eventTypeId
event type.
params
Param object, cast to specific param class to get parameters for particular event.
void OnProcessLifetimeChanged(int plmtype)
void OnLicenseChanged()
void OnAfterCreate()

Called after creating of CGame instance

void OnActivateMessage()

Called when recieving focus (windows)

void OnDeactivateMessage()

Called when loosing focus (windows)

bool OnInitialize()

Called once before game update loop starts, ret value indicates if init was done in scripts, otherwise it is done in the engine

void OnDeviceReset()

Called when inputs is not possible (Steam overlay active or something), all internal script variables should be reset here!

void OnUpdate(bool doSim, float timeslice)

Called on World update

doSim
False when simulation is paused, True otherwise
timeslice
time elapsed from last call
void OnPostUpdate(bool doSim, float timeslice)

Called on World update after simulation of entities

doSim
False when simulation is paused, True otherwise
timeslice
time elapsed from last call
void OnKeyPress(int key)

Called when key is pressed

key
direct input key code (DIK)
void OnKeyRelease(int key)

Called when key is released

key
direct input key code (DIK)
void OnMouseButtonPress(int button)

Called when mouse button is pressed

button
- number of button \ref Mouse
void OnMouseButtonRelease(int button)

Called when mouse button is released

button
- number of button \ref Mouse
UIScriptedMenu CreateScriptedMenu(int id)

create custom main menu part (submenu)

UIScriptedWindow CreateScriptedWindow(int id)

create custom window part

void OnRPC(PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx)

Called after remote procedure call is recieved for this object

target
object on which remote procedure is called, when NULL, RPC is evaluated by CGame as global
rpc_type
user defined identification of RPC
ctx
read context for params
Referenced by DayZGame.OnRPC()
proto native void RequestRestart(int code)

Sets exit code and restart in the right moment

proto native bool IsAppActive()

Returns if the application is focused on PC, returns true always on console

proto owned string GetHostName()

Gets the server name. (from client)

proto GetServersResultRow GetHostData()

Gets the server data. (from client)

proto native int Connect(UIScriptedMenu parent, string IpAddress, int port, string password)

Connects to IsServer

IpAddress
of the server
port
of the server set to 0 for default port
password
of the server

Returns: 0 on success, error code from ErrorModuleHandler on not success

proto native int ConnectLastSession(UIScriptedMenu parent, int selectedCharacter = -1)

Connects to last success network session

Returns: 0 on success, error code from ErrorModuleHandler on not success

proto native void DisconnectSession()

Disconnects from current multiplayer session

proto native void DisconnectSessionForce()

Forces disconnect from current multiplayer session even if not yet in the game

proto native void GetProfileStringList(string name, out TStringArray values)

Gets array of strings from profile variable

name
of the variable
values
output values
usage:
TStringArray lastInventoryArray = new TStringArray;
g_Game.GetProfileStringList("lastInventory", lastInventoryArray);
proto native void SetProfileStringList(string name, TStringArray values)

Sets array of strings to profile variable

name
of the variable
values
to set
proto void GetPlayerName(out string name)

Gets current player name

name
output value
proto void GetPlayerNameShort(int maxLength, out string name)

Gets current player name. If length of player name is grater than maxLength, then it is omitted and append ellipsis

maxLength
- max chars in name
name
- output value of player name with 'maxLength' characters and then ellipsis "..."
proto native void SetPlayerName(string name)

Sets current player name

name
proto native Entity CreatePlayer(PlayerIdentity identity, string name, vector pos, float radius, string spec)

Assign player entity to client (in multiplayer)

name
NoteWorks only on server
proto native void SelectPlayer(PlayerIdentity identity, Object player)

Selects player's controlled object

identity
identity used in MP (use NULL in singleplayer)
player
object which should be controlled by player
NoteWe can use only instances of DayZPlayer now
proto void GetPlayerNetworkIDByIdentityID(int playerIdentityID, out int networkIdLowBits, out int networkIdHightBits)

returns player's network id from identity id in out parameters

identity
PlayerIdentity.id used in MP (use NULL in singleplayer)
networkIdLowBits
lower bits of 64bit network id
networkIdHighBits
higher bits of 64bit network id
NoteUsable only on server
proto native Object GetObjectByNetworkId(int networkIdLowBits, int networkIdHighBits)

Returns entity identified by network id

networkIdLowBits
identity used in MP (use NULL in singleplayer)
networkIdHighBits
object which should be controlled by player
proto native bool RegisterNetworkStaticObject(Object object)

Static objects cannot be replicated by default (there are too many objects on the map). Use this method when you want to replicate some scripted variables. Cannot be called in object's constructor, because networking is not initialized yet

object
static object to replicate

Returns: false, if registration wasn't successful or when object is already registered

proto native bool IsNetworkInputBufferFull()

Returns the state of the buffer for network inputs (UAInterface)

Returns: true, if the buffer is filled and client simulation must stop

NoteSee: NetworkInputBufferEventTypeID
NoteClient side only, returns false on the server always
proto native void SelectSpectator(PlayerIdentity identity, string spectatorObjType, vector position)

Creates spectator object (mostly cameras)

identity
identity used in MP (use NULL in singleplayer)
spectatorObjType
classname for spectator object (like cameras)
position
where to create spectator instance
proto native void UpdateSpectatorPosition(vector position)

Updates spectator position on server = position of network bubble

position
proto native void SendLogoutTime(Object player, int time)

Inform client about logout time (creates logout screen on specified client)

player
object which is logging out
time
length of logout
NoteWorks only on server
proto native void DisconnectPlayer(PlayerIdentity identity, string uid = "")

Destroy player info and disconnect

NoteWorks only on server
proto native void AddToReconnectCache(PlayerIdentity identity)

Add player to reconnect cache to be able to rejoin character still existing in the world

identity
of player
NoteWorks only on server and no database requests are sent
proto native void RemoveFromReconnectCache(string uid)

Remove player from reconnect cache

uid
of the player
NoteWorks only on server
proto native void ClearReconnectCache()

Remove all player from reconnect cache

NoteWorks only on server
proto native void StorageVersion(int iVersion)

Set actual storage version - for next save

Referenced by CGame()
proto native int LoadVersion()

Returns actual storage version - loading

proto native int SaveVersion()

Returns actual storage version - saving

proto bool ConfigGetText(string path, out string value)

Get string value from config on path.

path
of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
value
output

Returns: true on success

proto bool ConfigGetTextRaw(string path, out string value)

Get raw string value from config on path.

path
of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
value
output in raw format (localization keys '$STR_' are not translated)

Returns: true on success

Noteuse 'FormatRawConfigStringKeys' method to change localization keys to script-friendly
string ConfigGetTextOut(string path)

Get string value from config on path.

path
of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.

Returns: value output string

References ConfigGetText()
bool FormatRawConfigStringKeys(inout string value)

Changes localization key format to script-friendly format.

original
config string.

Returns: value output string with '$' substituted to script-friendly '#'. If not found, does nothing.

References string.Replace()
string GetModelName(string class_name)

Get name of the p3d file of the given class name.

class
name of the desired object

Returns: Name of the object's p3d file (without the '.p3d' suffix)

Referenced by Object.GetModelName()
proto native float ConfigGetFloat(string path)

Get float value from config on path.

path
of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.

Returns: value

proto native vector ConfigGetVector(string path)

Get vector value from config on path.

path
of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.

Returns: value

proto native int ConfigGetInt(string path)

Get int value from config on path.

path
of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.

Returns: value

proto native int ConfigGetType(string path)

Returns type of config value

path
of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.

Returns: one of constants CT_INT, CT_FLOAT, CT_STRING, CT_ARRAY, CT_CLASS, CT_OTHER

proto native void ConfigGetTextArray(string path, out TStringArray values)

Get array of strings from config on path.

path
of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
value
output
usage :
TStringArray characterAnimations = new TStringArray;
g_Game.ConfigGetTextArray("CfgMovesMaleSdr2 States menu_idleUnarmed0 variantsPlayer", characterAnimations);
Referenced by ActionRepairTent.RepairDamageTransfer(), ActionSkinning.SpawnItems(), AttachmentCategoriesRow.Init()
Show 40 more, Attachments.GetItemSlots(), AttachmentsOutOfReach.CreateAttachmentPosition(), BaseBuildingBase.GetAttachmentSlots(), BetaSound.SaySound(), BillboardSet.LoadConfig(), Construction.DropNonUsableMaterialsServer(), Construction.GetCollisionBoxData(), Construction.GetRequiredParts(), Construction.HasConflictPart(), Construction.HasRequiredPart(), ConstructionActionData.GetAttachmentsFromSelection(), ConstructionActionData.GetAttachmentSlotFromSelection(), DamageSystem.GetComponentNamesFromDamageZone(), DamageSystem.GetDamageZoneMap(), DayZGame.CheckAmmoCompability(), DayZPlayerImplement.HandleView(), DefaultCharacterCreationMethods.GetConfigArrayCountFromSlotID(), DefaultCharacterCreationMethods.GetConfigAttachmentTypes(), FireplaceBase.LockOvenAttachments(), HiddenSelectionsData.GetHiddenSelectionsConfig(), HiddenSelectionsData.GetHiddenSelectionsMaterialsConfig(), HiddenSelectionsData.GetHiddenSelectionsTexturesConfig(), HiddenSelectionsData.HiddenSelectionsData(), IntroSceneCharacter.LoadCharacterData(), Inventory.LoadPlayerAttachmentIndexes(), InventoryItemSoundAttach.LoadSoundEvents(), InventoryItemSoundDetach.LoadSoundEvents(), InventoryItemType.SetAttachSoundEvent(), InventoryItemType.SetDetachSoundEvent(), ItemBase.KindOf(), PlayerContainer.PlayerContainer(), PlayerContainer.SetPlayer(), PluginConfigViewer.GetConfigRecursive(), PluginDiagMenu.OnInit(), PluginLifespan.LoadFromCfg(), SceneEditorMenu.GetItemNamesForSlots(), SceneObject.GetConfigAttachments(), SelectionTranslation.SearchAndTranslate(), SoundLookupTable.LoadTable(), and ZombieContainer.InitGhostSlots()
proto native void ConfigGetTextArrayRaw(string path, out TStringArray values)

Get array of raw strings from config on path.

path
of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
value
output in raw format (localization keys '$STR_' are not translated)
usage :
Noteuse 'FormatRawConfigStringKeys' method to change localization keys to script-friendly
TStringArray characterAnimations = new TStringArray;
g_Game.ConfigGetTextArrayRaw("CfgMovesMaleSdr2 States menu_idleUnarmed0 variantsPlayer", characterAnimations);
proto native void ConfigGetFloatArray(string path, out TFloatArray values)

Get array of floats from config on path.

path
of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
value
output
proto native void ConfigGetIntArray(string path, out TIntArray values)

Get array of integers from config on path.

path
of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
value
output
proto bool ConfigGetChildName(string path, int index, out string name)

Get name of subclass in config class on path.

path
of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
index
of subclass in class
name
output

Returns: true on success, false if path or child is not found

proto bool ConfigGetBaseName(string path, out string base_name)

Get name of base class of config class on path.

path
of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
name
output

Returns: true on success, false if path or base is not exists

proto native int ConfigGetChildrenCount(string path)

Get count of subclasses in config class on path.

path
of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
index
of parameter in class
name
output

Returns: true on success, false if path or child is not found

proto native bool ConfigIsExisting(string path)
proto native void ConfigGetObjectFullPath(Object obj, out TStringArray full_path)
Referenced by ObjectIsKindOf()
proto native void GetModInfos(notnull out array<ref ModInfo> modArray)
proto native bool GetModToBeReported()
string ConfigPathToString(TStringArray array_path)

Converts array of strings into single string.

Array
of strings like {"All", "AllVehicles", "Land"}

Returns: Converts given array into something lile "All AllVehicles Land".

???
References array.Count(), and array.Get()
proto bool CommandlineGetParam(string name, out string value)

Get command line parameter value.

name
of parameter
value
output

Returns: true when parameter exists, false otherwise
usage :

// you run e.g.: DayZInt.exe -scriptDebug=true
string value;
if (g_Game.CommandlineGetParam("scriptDebug", value) && value == "true")
{
	Print("Script debugging on!");
}
proto native void BeginOptionsVideo()
proto native void EndOptionsVideo()
proto native void AdminLog(string text)
proto native bool PreloadObject(string type, float distance)

Preload objects with certain type in certain distance from camera.

type
of objects which should be preloaded
distance
from camera in which objects should be preloaded

Returns: true on success

proto native Object CreateStaticObjectUsingP3D(string p3dFilename, vector position, vector orientation, float scale = 1.0, bool createLocal = false)
proto native Object CreateObject(string type, vector pos, bool create_local = false, bool init_ai = false, bool create_physics = true)

Creates object of certain type

type
of objects to create
pos
position where to create object
create_local
if True, object is not spawned on clients only on server
init_ai
if creating object is LightAI class, by this param is initialised AI or not

Returns: new Object

proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local = false)
proto native SoundWaveOnVehicle CreateSoundWaveOnObject(Object source, SoundObject soundObject, AbstractWave soundWave)
proto native Object CreateObjectEx(string type, vector pos, int iFlags, int iRotation = RF_DEFAULT)

Creates object of certain type

type
of objects to create
pos
position where to create object
iFlags
are used to setup object and/ or spawn behavior
iRotation
are used to setup object rotation on spawn (or default if not specified)

Returns: new Object

proto native void ObjectDelete(Object obj)
Referenced by ActionBaseCB.OnFinish(), ActionBuryAshes.OnFinishProgressServer(), ActionBuryBody.OnFinishProgressServer()
Show 46 more, ActionDigOutStash.OnFinishProgressServer(), AreaDamageManager.DestroyDamageTriggerEx(), BarbedWire.SoundBuzzLoopStop(), BarrelHoles_ColorBase.DestroyClutterCutter(), BaseBuildingBase.DestroyConstruction(), BaseBuildingBase.DestroyConstructionKit(), CombinationLock.DestroyLock(), Construction.DestroyCollisionTrigger(), Construction.DestroyMaterialsServer(), Construction.TakeMaterialsServer(), CTActor.SetHandsItem(), CTObjectFollower.DestroyFollowedObject(), DayZIntroScene.DayZIntroScene(), DayZIntroSceneXbox.~DayZIntroSceneXbox(), DayZPlayerInventory.ValidateDestroy(), EffectArea.EEDelete(), Fireplace.DestroyClutterCutter(), FlammableBase.EEDelete(), FlammableBase.OnWorkStop(), FlammableBase.TryTransformIntoStick(), GameInventory.LocalDestroyEntity(), GardenBase.CreatePlant(), GardenPlot.EEDelete(), GardenPlot.OnPlacementComplete(), HandActionDestroy.Action(), Hologram.~Hologram(), IntroSceneCharacter.CharacterUnload(), IntroSceneCharacter.SetAttachment(), ItemBase.ClearInventory(), MenuDefaultCharacterData.EquipDefaultCharacter(), ParticleTest.EEDelete(), PlantBase.OnStoreSave(), PlayerBase.ClearInventory(), PluginDayzPlayerDebug.PlayerSyncDelete(), PMTPlayback.CheckOnePlayingSA(), PMTPlayback.CheckStop(), PortableGasStove.DestroyFireplace(), Refridgerator.OnWorkStop(), SceneObject.~SceneObject(), SceneObject.RemoveAttachment(), ScriptedLightBase.DeleteLightNow(), SeedPackBase.EmptySeedPack(), Slot.~Slot(), TentBase.DestroyClutterCutter(), TrapBase.EEDelete(), and UIPropertyAttachment.OnClick()
proto native void ObjectDeleteOnClient(Object obj)
proto native void RemoteObjectDelete(Object obj)

RemoteObjectDelete - deletes only remote object (unregisters from network). do not use if not sure what you do

proto native void RemoteObjectTreeDelete(Object obj)

RemoteObjectDelete - deletes only remote object tree (unregisters from network). do not use if not sure what you do

proto native void RemoteObjectCreate(Object obj)

RemoteObjectCreate - postponed registration of network object (and creation of remote object). do not use if not sure what you do

proto native int ObjectRelease(Object obj)
Referenced by Object.Release()
proto void ObjectGetType(Object obj, out string type)
proto void ObjectGetDisplayName(Object obj, out string name)
proto native vector ObjectGetSelectionPosition(Object obj, string name)
proto native vector ObjectGetSelectionPositionLS(Object obj, string name)
proto native vector ObjectGetSelectionPositionMS(Object obj, string name)
proto native vector ObjectGetSelectionPositionWS(Object obj, string name)
proto native vector ObjectWorldToModel(Object obj, vector worldPos)
proto native bool IsObjectAccesible(EntityAI item, Man player)

returns true if player can access item's cargo/attachments (check only distance)

proto native void ReloadShape(Object obj)DIAG_DEVELOPER
proto native bool AddInventoryJuncture(Man player, notnull EntityAI item, InventoryLocation dst, bool test_dst_occupancy, int timeout_ms, Managed userData = null)
proto native bool HasInventoryJunctureItem(notnull EntityAI item)
Referenced by EntityAI.TryDelete()
proto native bool HasInventoryJunctureDestination(Man player, notnull InventoryLocation dst)
proto native bool AddActionJuncture(Man player, notnull EntityAI item, int timeout_ms, Managed userData = null)
proto native bool ExtendActionJuncture(Man player, notnull EntityAI item, int timeout_ms)
proto native bool ExecuteEnforceScript(string expression, string mainFnName)

Delevoper only: Executes Enforce Script expression, if there is an error, is printed into the script console

proto native void DumpInstances(bool csvFormatting)

Delevoper only: Dump all script allocations

proto native bool ScriptTest()
proto native void GetDiagModeNames(out TStringArray diag_names)

Get list of all debug modes

proto native void SetDiagModeEnable(int diag_mode, bool enabled)

Set specific debug mode

proto native bool GetDiagModeEnable(int diag_mode)

Gets state of specific debug mode

proto native void GetDiagDrawModeNames(out TStringArray diag_names)

Get list of all debug draw modes

proto native void SetDiagDrawMode(int diag_draw_mode)

Set debug draw mode

proto native int GetDiagDrawMode()

Gets current debug draw mode

proto native bool IsPhysicsExtrapolationEnabled()

If physics extrapolation is enabled, always true on retail release builds

proto native int GizmoGetCount()

Return the number of gizmos

proto native Class GizmoGetInstance(int index)

Return the instance passed in for the gizmo

proto native Managed GizmoGetTracker(int index)

Return the tracker passed in for the gizmo

proto native int GizmoFindByTracker(Managed tracker)

Returned index is invalid if any other Gizmo function is called

proto native void GizmoClear(int index)

Clear the gizmo

proto native void GizmoClearAll()

Clear all gizmos

proto native void GizmoSelectObject(Object object)

Applies impulses to set the position when dynamic, otherwise sets the transform in the physics scene

Tracker for 'GizmoFind' is the passed in object

proto native void GizmoSelectPhysics(Physics physics)

Applies impulses to set the position when dynamic, otherwise sets the transform in the physics scene. Doesn't work in multiplayer

Tracker for 'GizmoFind' is the owned Entity

Note: Currently, GizmoGetInstance doesn't work due to Script Error: 'Physics' can't be compared against 'Class'

proto native void GizmoSelectUser(Managed instance)

Scripted controls, requires the following methods to be implemented in the class void Gizmo_SetWorldTransform(vector[4] transform, bool finalize) void Gizmo_GetWorldTransform(vector[4] transform)

Tracker for 'GizmoFind' is the passed in instance

proto native float GetFps()

Returns average FPS of last 16 frames

Returns: fps in milliseconds

proto native float GetLastFPS()

Returns current framerate.

Returns: Current framerate as frames per second.

proto native float GetAvgFPS(int nFrames = 64)

Returns average framerate over last n frames.

nFrames
The number of frames to compute average of, up to 64.

Returns: Average frames per second over last n frames.

proto native float GetMinFPS(int nFrames = 64)

Returns minimum framerate over last n frames.

nFrames
The number of frames to find minimum of, up to 64.

Returns: Minimum frames per second over last 64 frames.

Referenced by GetFPSStats()
proto native float GetMaxFPS(int nFrames = 64)

Returns maximum framerate over last n frames.

nFrames
The number of frames to find maximum of, up to 64.

Returns: Maximum frames per second over last n frames.

Referenced by GetFPSStats()
void GetFPSStats(out float min, out float max, out float avg, int nFrames = 64)

Outputs framerate statistics.

min
Outputs minimum framerate over last n frames in frames per second.
max
Outputs maximum framerate over last n frames in frames per second.
avg
Outputs average framerate over last n frames in frames per second.
nFrames
The number of frames to take into account, up to 64.
proto native void GetObjectsAtPosition(vector pos, float radius, out array<Object> objects, out array<CargoBase> proxyCargos)

Returns list of all objects in circle "radius" around position "pos"

pos
radius
objects
output array
proto native void GetObjectsAtPosition3D(vector pos, float radius, out array<Object> objects, out array<CargoBase> proxyCargos)

Returns list of all objects in sphere "radius" around position "pos"

pos
radius
objects
output array
proto native bool GoBuyWorldDLC(string sWorldName)
proto void FormatString(string format, string params[], out string output)
DayZPlayer GetPlayerByIndex(int index = 0)
References Class.Cast(), Count(), GetPlayers()
Show 1 more, players()
proto native void StoreLoginData(ParamsWriteContext ctx)

Stores login userdata as parameters which are sent to server

proto native vector GetWorldDirectionFromScreen(vector world_pos)

Transforms position in world to position in screen in pixels as x, y component of vector, z parameter represents distance between camera and world_pos

proto native vector GetScreenPos(vector world_pos)

Transforms position in world to position in screen in pixels as x, y component of vector, z parameter represents distance between camera and world_pos

proto native vector GetScreenPosRelative(vector world_pos)

Transforms position in world to position in screen in percentage (0.0 - 1.0) as x, y component of vector, z parameter represents distance between camera and world_pos

proto native void RPC(Object target, int rpcType, notnull array<ref Param> params, bool guaranteed, PlayerIdentity recipient = null)

Initiate remote procedure call. When called on client, RPC is evaluated on server; When called on server, RPC is executed on all clients

target
object on which remote procedure is called, when NULL, RPC is evaluated by CGame as global
rpc_type
user defined identification of RPC
params
custom params array
recipient
specified client to send RPC to. If NULL, RPC will be send to all clients (specifying recipient increase security and decrease network traffic)
const int RPC_LOW_BLOOD_PRESSURE_EFFECT = 0;
...
// on server side, after blood pressure of player is low...
Param1<float> p = new Param1<float>(m_blood_pressure);
array<param> params = new array<param>;
params.Insert(p);
g_Game.RPC(player, RPC_LOW_BLOOD_PRESSURE_EFFECT, params);
// or shortcut
g_Game.RPCSingleParam(player, RPC_LOW_BLOOD_PRESSURE_EFFECT, p);
...
// on client
class PlayerBase
{
	// override OnRPC function
	void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
	{
		// dont forget to propagate this call trough class hierarchy!
		super.OnRPC(rpc_type, ctx);

		switch(rpc_type)
		{
			case RPC_LOW_BLOOD_PRESSURE_EFFECT:
				Param1<float> p = Param1<float>(0);
				if (ctx.Read(p))
				{
					float blood_pressure = p.param1;
					float effect_intensity = 1.0 - blood_pressure;
					ShowFancyScreenEffect(effect_intensity);
				}
			break;
		}
	}
}
proto native void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient = null)

see CGame.RPC

proto native void RPCSelf(Object target, int rpcType, notnull array<ref Param> params)

Not actually an RPC, as it will send it only to yourself

proto native void RPCSelfSingleParam(Object target, int rpcType, Param param)
proto native void ProfilerStart(string name)

Use for profiling code from start to stop, they must match have same name, look wiki pages for more info: https://confluence.bistudio.com/display/EN/Profiler

proto native void ProfilerStop(string name)

Use for profiling code from start to stop, they must match have same name, look wiki pages for more info: https://confluence.bistudio.com/display/EN/Profiler

proto native void Chat(string text, string colorClass)

Prints text into game chat.

text
to print
colorClass
??
usage :
g_Game.Chat("Item splitted", "colorAction");
Referenced by PlayerBase.Message()
proto native void ChatMP(Man recipient, string text, string colorClass)
Referenced by PlayerBase.Message()
proto native void ChatPlayer(string text)
proto native void MutePlayer(string muteUID, string playerUID, bool mute)

Mutes voice of source player to target player

muteUID
uid of player you want to mute
playerUID
uid of player that (doesnt't) want to hear muteUID
proto native void MuteAllPlayers(string listenerId, bool mute)

Mute all players for listenerId

listenerId
uid of player
mute
true, if player can not listen anybody. Otherwise false.
proto native void EnableVoN(Object player, bool enable)

Enable/disable VoN for target player

player
in question
enable
sets if player can use VoN
proto native void SetVoiceEffect(Object player, int effect, bool enable)

Enable/disable VoN effect (only on server)

player
in question
voice
effect (VoiceEffectMumbling = 1, VoiceEffectExtortion = 2, VoiceEffectObstruction = 4)
enable
or disable effect
proto native void SetVoiceLevel(int level)

Set voice level of VoN (only on client) (VoiceLevelWhisper = 0, VoiceLevelNormal = 1, VoiceLevelShout = 2)

level
of voice
proto native int GetVoiceLevel(Object player = null)

Get voice level of VoN (on both client and server) (VoiceLevelWhisper = 0, VoiceLevelNormal = 1, VoiceLevelShout = 2)

proto native void EnableMicCapture(bool enable)

Enable microphone to locally capture audio from user. Audio heard does NOT automatically get transmitted over network

enable
enables or disabled listening
proto native bool IsMicCapturing()

Returns whether mic is currently capturing audio from user

proto native bool IsInPartyChat()

Returns whether user is currently in a voice party (currently only supported on xbox)

proto native void SetMission(Mission mission)
proto native void StartRandomCutscene(string world)

Starts intro

proto native void PlayMission(string path)

Starts mission (equivalent for SQF playMission). You MUST use double slash \\

proto protected native void CreateMission(string path)

Create only enforce script mission, used for mission script reloading

proto native void RestartMission()
proto native void AbortMission()

Returns to main menu, leave world empty for using last mission world

Referenced by DayZGame.OnEvent()
proto native void RespawnPlayer()
proto native bool CanRespawnPlayer()
proto native void SetLoginTimerFinished()
proto native void SetMainMenuWorld(string world)
Referenced by DayZGame.DayZGame()
proto native owned string GetMainMenuWorld()
proto native void LogoutRequestTime()

Logout methods

proto native void LogoutRequestCancel()
Referenced by LogoutMenu.Cancel()
proto native bool IsMultiplayer()
proto native bool IsServer()
proto native bool IsDedicatedServer()

Robust check which is preferred than the above, as it is valid much sooner

NoteYou may want to use #ifdef SERVER instead for slight performance gain...
static bool IsDigitalCopy()
void SetDebugMonitorEnabled(int value)
proto native void GetPlayerIndentities(out array<PlayerIdentity> identities)
proto native bool GetSurface(SurfaceDetectionParameters params, SurfaceDetectionResult result)

API for surface detection

proto native float SurfaceRoadY3D(float x, float y, float z, RoadSurfaceDetection rsd)
proto float SurfaceGetType(float x, float z, out string type)

Returns: Y position the surface was found

proto void SurfaceUnderObjectEx(notnull Object object, out string type, out string impact, out int liquidType)
proto void SurfaceUnderObjectByBone(notnull Object object, int boneType, out string type, out int liquidType)
proto native float SurfaceGetNoiseMultiplier(Object directHit, vector pos, int componentIndex)
proto native vector SurfaceGetNormal(float x, float z)
proto native float SurfaceGetSeaLevelMin()
proto native float SurfaceGetSeaLevelMax()
proto native float SurfaceGetSeaWaveMax()

Get max sea wave height

proto native float SurfaceGetSeaWaveCurrent()

Get current sea wave height

proto native float GetWaterSurfaceHeightNoFakeWave(vector posWS)

Get the nearest water or object surface under a point, ignoring land (without the fake wave that's on top of the real wave)

proto native float GetWaterSurfaceHeightWithFakeWave(vector posWS)

Get the nearest water or object surface under a point, ignoring land (with the fake wave that's on top of the real wave)

proto native void UpdatePathgraphRegion(vector regionMin, vector regionMax)
float GetHighestSurfaceYDifference(array<vector> positions)

Returns the largest height difference between the given positions

vector GetSurfaceOrientation(float x, float z)

Returns tilt of the ground on the given position in degrees, so you can use this value to rotate any item according to terrain.

bool GetSurfaceDigPile(string surface, out string result)
References ConfigGetText()
bool IsSurfaceFertile(string surface)

Checks if the surface is fertile

References ConfigGetInt()
void SurfaceUnderObjectExCorrectedLiquid(notnull Object object, out string type, out string impact, out int liquidType)
void SurfaceUnderObjectByBoneCorrectedLiquid(notnull Object object, int boneType, out string type, out int liquidType)
void UpdatePathgraphRegionByObject(Object object)
proto native bool IsBoxColliding(vector center, vector orientation, vector edgeLength, array<Object> excludeObjects, array<Object> collidedObjects = NULL)

Finds all objects that are in choosen oriented bounding box (OBB)

center
vector, center of OBB
orientation
vector, direction (front vector), used for calculation of OBB rotation
edgeLength
vector, sizes of whole box
excludeObjects
array<Object>, objects that should be excluded from collision check
collidedObjects
array<Object>, out parameter, objects that collided with OBB

Returns: bool, true if at least one object collided with OBB, false otherwise

NoteObject that doesn't have collision geometry will be ignored, as this only uses geometry
vector pos = GetPosition();
vector orientation = GetOrientation();
vector size = "10 4 8";
array<Object> excluded_objects = new array<Object>;
excluded_objects.Insert(this);
array<Object> nearby_objects = new array<Object>;

if(g_Game.IsBoxColliding( pos, orientation, size, excluded_objects, nearby_objects))
{
	for (int i = 0, c = nearby_objects.Count(); i < c; ++i)
	{
		PrintString("object " + i.ToString());
	}
}
proto native bool IsBoxCollidingGeometry(vector center, vector orientation, vector edgeLength, int iPrimaryType, int iSecondaryType, array<Object> excludeObjects, array<Object> collidedObjects = NULL)

Finds all objects with geometry iType that are in choosen oriented bounding box (OBB)

center
vector, center of OBB
orientation
vector, direction (front vector), used for calculation of OBB rotation
edgeLength
vector, sizes of whole box
iPrimaryType
int, type of intersection, possible values ObjIntersectFire(0), ObjIntersectView(1), ObjIntersectGeom(2), ObjIntersectIFire(3), ObjIntersectNone(4)
iSecondaryType
int, type of intersection, possible values ObjIntersectFire(0), ObjIntersectView(1), ObjIntersectGeom(2), ObjIntersectIFire(3), ObjIntersectNone(4)
excludeObjects
array<Object>, objects that should be excluded from collision check
collidedObjects
array<Object>, out parameter, objects that collided with OBB

Returns: bool, true if at least one object collided with OBB, false otherwise

vector pos = GetPosition();
vector orientation = GetOrientation();
vector size = "10 4 8";
array<Object> excluded_objects = new array<Object>;
excluded_objects.Insert(this);
array<Object> nearby_objects = new array<Object>;

if(g_Game.IsBoxCollidingGeometry( pos, orientation, size, ObjIntersectView, ObjIntersectGeom, excluded_objects, nearby_objects))
{
	for (int i = 0, c = nearby_objects.Count(); i < c; ++i)
	{
		PrintString("object " + i.ToString());
	}
}
proto native bool IsBoxCollidingGeometryProxy(notnull BoxCollidingParams params, array<Object> excludeObjects, array<ref BoxCollidingResult> collidedObjects = NULL)
proto native Weather GetWeather()

Returns weather controller object.

proto native void SetEVUser(float value)

Sets custom camera camera EV. range: -50.0..50.0? //TODO

Referenced by DayZGame.SetEVValue()
proto native void OverrideDOF(bool enable, float focusDistance, float focusLength, float focusLengthNear, float blur, float focusDepthOffset)
proto native void AddPPMask(float ndcX, float ndcY, float ndcRadius, float ndcBlur)
proto native void OverrideInventoryLights(vector diffuse, vector ambient, vector ground, vector dir)

override inventory light

diffuse
directional light
ambient
ambient light
ground
ground light
dir
direction of light, Vector(0,0,1) is from camera
proto native void NightVissionLightParams(float lightIntensityMul, float noiseIntensity)

set night vission parameters (set to zero when to disable it)

lightIntensityMul
multiplicator of lights intensity
noiseIntensity
intensity of noise PP
proto native void InitDamageEffects(Object effect)

Initialization of damage effects

proto native EntityAI GetEntityByPersitentID(int b1, int b2, int b3, int b4)

This function returns valid data only inside AfterLoad event. Do not use this in anywhere else.

Its main purpose is only for keep track on object connections after server restarts, all data related to this function are deleted when server initialization is done.

bool ObjectIsKindOf(Object object, string cfg_parent_name)

Returns is object inherited from parent class name

object
Object
cfg_parent_name
Parent Config Class name ("DZ_LightAI")

Returns: bool is object inherited from parent class name

bool is_kind = g_Game.IsKindOf( my_animal, "DZ_LightAI");
PrintString(ToString(is_kind));

>> 1
int ConfigFindClassIndex(string config_path, string searched_member)

Searches given config path (config_path) for the given member (searched_member) and returns its index. \nReturns -1 if not found.
usage:

int skinning_class_index = g_Game.ConfigFindClassIndex(cfgPath_animal, "Skinning");
proto int GetTime()

returns mission time in milliseconds

ScriptCallQueue GetCallQueue(int call_category)

Returns CallQueue for certain category

call_category
call category, valid values are:
CALL_CATEGORY_SYSTEM - calls & timers in this queue are processed every time without any restrictions
CALL_CATEGORY_GUI - calls & timers in this queue are processed when GUI is enabled (even during pase game)
CALL_CATEGORY_GAMEPLAY - calls & timers in this queue are processed only during mission, when game is not paused
usage:
g_Game.GetCallQueue(CALL_CATEGORY_GUI).Call(this, "Refresh"); // calls "Refresh" function on "this" with no arguments
g_Game.GetCallQueue(CALL_CATEGORY_GUI).Call(this, "Show", new Param1<bool>(true)); // calls "Show" function on "this" with one bool argument
g_Game.GetCallQueue(CALL_CATEGORY_GUI).Call(this, "SetPos", new Param2<float, float>(0.2, 0.5)); // calls "SetPos" function on "this" with two float arguments
ScriptInvoker GetUpdateQueue(int call_category)
ScriptInvoker GetPostUpdateQueue(int call_category)
TimerQueue GetTimerQueue(int call_category)

Returns TimerQueue for certain category

call_category
call category, valid values are:
CALL_CATEGORY_SYSTEM - calls & timers in this queue are processed every time without any restrictions
CALL_CATEGORY_GUI - calls & timers in this queue are processed when GUI is enabled (even during pase game)
CALL_CATEGORY_GAMEPLAY - calls & timers in this queue are processed only during mission, when game is not paused
DragQueue GetDragQueue()

Returns DragQueue. Callbacks are called on mouse move until mouse button is released, then the queue is cleaned.

string CreateDefaultPlayer()

returns class name of first valid survivor (TODO address confusing naming?)

string CreateRandomPlayer()

returns class name of random survivor (TODO address confusing naming?)

TStringArray ListAvailableCharacters()

outputs array of all valid survivor class names

bool IsInventoryOpen()
proto native ContentDLC GetContentDLCService()

Return DLC service (service for entitlement keys for unlock content)

proto native int GetLogoutAfterCancelTimeout()