Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Example of how you would do this:
Make a file, name it whatever you want.
Inside that file, place the following code in:
In any !isDedicated (where player monitor) condition, add a call to your file:Code:dayz_spaceInterrupt = { private ["_dikCode", "_handled","_displayg"]; _dikCode =_this select 1; _handled = false; if (_dikCode in (actionKeys "GetOver")) then { if (!r_fracture_legs and (time - dayz_lastCheckBit > 4)) then { _inBuilding = [player] call fnc_isInsideBuilding; _nearbyObjects = nearestObjects[getPosATL player, ["TentStorage", "Hedgehog_DZ", "Sandbag1_DZ","TrapBear","Wire_cat1"], 8]; if (!_inBuilding and (count _nearbyObjects == 0)) then { dayz_lastCheckBit = time; call player_CombatRoll; }; }; }; if ((_dikCode in actionKeys "Prone") and r_drag_sqf) then { force_dropBody = true; }; if ((_dikCode in actionKeys "Crouch") and r_drag_sqf) then { force_dropBody = true; }; if (_dikCode in actionKeys "MoveLeft") then {r_interrupt = true}; if (_dikCode in actionKeys "MoveRight") then {r_interrupt = true}; if (_dikCode in actionKeys "MoveForward") then {r_interrupt = true}; if (_dikCode in actionKeys "MoveBack") then {r_interrupt = true}; if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true}; if (_dikCode in actionKeys "PushToTalk" and (time - dayz_lastCheckBit > 10)) then { dayz_lastCheckBit = time; [player,15,true,(getPosATL player)] spawn player_alertZombies; }; [FONT=Consolas]if (_dikCode in actionKeys "VoiceOverNet" and (time - dayz_lastCheckBit > 10)) then { [60,15] call fnc_usec_pitchWhine; //60 - Itensity (whine sound) 15 - Seconds it lasts [] spawn { playSound "All_haha"; //Built in sounds @ http://pastebin.com/Lcx6W0Nn playSound "All_haha"; // Playing the sound multiple times at once increases the volume of the sound. playSound "All_haha"; playSound "All_haha"; disableUserInput true; sleep 1; disableUserInput false; }; cutText ['NO VOICE ON SIDE!','PLAIN DOWN']; dayz_lastCheckBit = time; [player,15,true,(getPosATL player)] spawn player_alertZombies; };[/FONT] if (_dikCode in actionKeys "PushToTalkDirect" and (time - dayz_lastCheckBit > 10)) then { dayz_lastCheckBit = time; [player,5,false,(getPosATL player)] spawn player_alertZombies; }; if (_dikCode in actionKeys "Chat" and (time - dayz_lastCheckBit > 10)) then { dayz_lastCheckBit = time; [player,15,false,(getPosATL player)] spawn player_alertZombies; }; if (_dikCode in actionKeys "User20" and (time - dayz_lastCheckBit > 5)) then { dayz_lastCheckBit = time; _nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf"; }; if ((_dikCode == 0x3E or _dikCode == 0x0F or _dikCode == 0xD3) and (time - dayz_lastCheckBit > 10)) then { dayz_lastCheckBit = time; call dayz_forceSave; }; if (_dikCode == 0xB8 or _dikCode == 0x38 or _dikCode == 0x3E or _dikCode == 0x2A or _dikCode == 0x36 or _dikCode == 0x01) then { _displayg = findDisplay 106; if (!isNull _displayg) then { call player_gearSync; call dayz_forceSave; } else { if (dialog) then { call player_gearSync; call dayz_forceSave; }; }; }; _handled };
execVM "myfile.sqf";
The code I've posted is something I use on my servers, I may have forgot to remove a few things, but essentially you can add tons of actions via this method. These additional key presses (if you add any) will also not be prevented by things like anti hacks, which is good for mods like dogs (because the get-off function does not work with the anti-hack, seeing as it uses display 46 to add a keyDown statement).
dayz_spaceInterrupt = {
private ["_dikCode", "_handled","_displayg"];
_dikCode =_this select 1;
_handled = false;
if (_dikCode in (actionKeys "GetOver")) then {
if (!r_fracture_legs and (time - dayz_lastCheckBit > 4)) then {
_inBuilding = [player] call fnc_isInsideBuilding;
_nearbyObjects = nearestObjects[getPosATL player, ["TentStorage", "Hedgehog_DZ", "Sandbag1_DZ","TrapBear","Wire_cat1"], 8];
if (!_inBuilding and (count _nearbyObjects == 0)) then {
dayz_lastCheckBit = time;
call player_CombatRoll;
};
};
};
if ((_dikCode in actionKeys "Prone") and r_drag_sqf) then { force_dropBody = true; };
if ((_dikCode in actionKeys "Crouch") and r_drag_sqf) then { force_dropBody = true; };
if (_dikCode in actionKeys "MoveLeft") then {r_interrupt = true};
if (_dikCode in actionKeys "MoveRight") then {r_interrupt = true};
if (_dikCode in actionKeys "MoveForward") then {r_interrupt = true};
if (_dikCode in actionKeys "MoveBack") then {r_interrupt = true};
if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true};
if (_dikCode in actionKeys "PushToTalk" and (time - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = time;
[player,15,true,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "VoiceOverNet" and (time - dayz_lastCheckBit > 10)) then
{
[60,15] call fnc_usec_pitchWhine; //60 - Itensity (whine sound) 15 - Seconds it lasts
[] spawn
{
playSound "Fotxtrot"; //Built in sounds @ http://pastebin.com/Lcx6W0Nn
playSound "Uniform"; // Playing the sound multiple times at once increases the volume of the sound.
playSound "Charlie";
playSound "Kilo";
playSound "Yankee";
playSound "Oscar";
playSound "Uniform";
disableUserInput true;
sleep 1;
disableUserInput false;
};
cutText ['NO VOICE ON SIDE!','PLAIN DOWN'];
dayz_lastCheckBit = time;
[player,15,true,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "PushToTalkDirect" and (time - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = time;
[player,5,false,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "Chat" and (time - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = time;
[player,15,false,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "User20" and (time - dayz_lastCheckBit > 5)) then {
dayz_lastCheckBit = time;
_nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
};
if ((_dikCode == 0x3E or _dikCode == 0x0F or _dikCode == 0xD3) and (time - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = time;
call dayz_forceSave;
};
if (_dikCode == 0xB8 or _dikCode == 0x38 or _dikCode == 0x3E or _dikCode == 0x2A or _dikCode == 0x36 or _dikCode == 0x01) then {
_displayg = findDisplay 106;
if (!isNull _displayg) then {
call player_gearSync;
call dayz_forceSave;
} else {
if (dialog) then {
call player_gearSync;
call dayz_forceSave;
};
};
};
_handled
};
Example of how you would do this:
Make a file, name it whatever you want.
Inside that file, place the following code in:
In any !isDedicated (where player monitor) condition, add a call to your file:Code:dayz_spaceInterrupt = { private ["_dikCode", "_handled","_displayg"]; _dikCode =_this select 1; _handled = false; if (_dikCode in (actionKeys "GetOver")) then { if (!r_fracture_legs and (time - dayz_lastCheckBit > 4)) then { _inBuilding = [player] call fnc_isInsideBuilding; _nearbyObjects = nearestObjects[getPosATL player, ["TentStorage", "Hedgehog_DZ", "Sandbag1_DZ","TrapBear","Wire_cat1"], 8]; if (!_inBuilding and (count _nearbyObjects == 0)) then { dayz_lastCheckBit = time; call player_CombatRoll; }; }; }; if ((_dikCode in actionKeys "Prone") and r_drag_sqf) then { force_dropBody = true; }; if ((_dikCode in actionKeys "Crouch") and r_drag_sqf) then { force_dropBody = true; }; if (_dikCode in actionKeys "MoveLeft") then {r_interrupt = true}; if (_dikCode in actionKeys "MoveRight") then {r_interrupt = true}; if (_dikCode in actionKeys "MoveForward") then {r_interrupt = true}; if (_dikCode in actionKeys "MoveBack") then {r_interrupt = true}; if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true}; if (_dikCode in actionKeys "PushToTalk" and (time - dayz_lastCheckBit > 10)) then { dayz_lastCheckBit = time; [player,15,true,(getPosATL player)] spawn player_alertZombies; }; if (_dikCode in actionKeys "VoiceOverNet" and (time - dayz_lastCheckBit > 10)) then { [60,15] call fnc_usec_pitchWhine; //60 - Itensity (whine sound) 15 - Seconds it lasts [] spawn { playSound "all_haha"; //Built in sounds @ http://pastebin.com/Lcx6W0Nn playSound "all_haha"; // Playing the sound multiple times at once increases the volume of the sound. disableUserInput true; sleep 1; disableUserInput false; }; cutText ['NO VOICE ON SIDE!','PLAIN DOWN']; dayz_lastCheckBit = time; [player,15,true,(getPosATL player)] spawn player_alertZombies; }; if (_dikCode in actionKeys "PushToTalkDirect" and (time - dayz_lastCheckBit > 10)) then { dayz_lastCheckBit = time; [player,5,false,(getPosATL player)] spawn player_alertZombies; }; if (_dikCode in actionKeys "Chat" and (time - dayz_lastCheckBit > 10)) then { dayz_lastCheckBit = time; [player,15,false,(getPosATL player)] spawn player_alertZombies; }; if (_dikCode in actionKeys "User20" and (time - dayz_lastCheckBit > 5)) then { dayz_lastCheckBit = time; _nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf"; }; if ((_dikCode == 0x3E or _dikCode == 0x0F or _dikCode == 0xD3) and (time - dayz_lastCheckBit > 10)) then { dayz_lastCheckBit = time; call dayz_forceSave; }; if (_dikCode == 0xB8 or _dikCode == 0x38 or _dikCode == 0x3E or _dikCode == 0x2A or _dikCode == 0x36 or _dikCode == 0x01) then { _displayg = findDisplay 106; if (!isNull _displayg) then { call player_gearSync; call dayz_forceSave; } else { if (dialog) then { call player_gearSync; call dayz_forceSave; }; }; }; _handled };
execVM "myfile.sqf";
The code I've posted is something I use on my servers, I may have forgot to remove a few things, but essentially you can add tons of actions via this method. These additional key presses (if you add any) will also not be prevented by things like anti hacks, which is good for mods like dogs (because the get-off function does not work with the anti-hack, seeing as it uses display 46 to add a keyDown statement).
player_onSide = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_onSide.sqf";
if ((_dikCode in actionKeys "PushToTalk") || (_dikCode in actionKeys "VoiceOverNet")) then {
player spawn player_onSide;
};
private["_display","_channelDisplay","_text","_channel"];
disableSerialization;
_channelDisplay = findDisplay 63;
if( !isNull _channelDisplay) then {
_text = _channelDisplay displayCtrl 101;
_channel = ctrlText _text;
if( _channel == localize "STR_SIDE_CHANNEL" ) then {
player setDamage 1;
};
};
I'll just leave this here.....
Code:player_onSide = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_onSide.sqf"; if ((_dikCode in actionKeys "PushToTalk") || (_dikCode in actionKeys "VoiceOverNet")) then { player spawn player_onSide; };
I'm sure you guys will find something fun to do with it.Code:private["_display","_channelDisplay","_text","_channel"]; disableSerialization; _channelDisplay = findDisplay 63; if( !isNull _channelDisplay) then { _text = _channelDisplay displayCtrl 101; _channel = ctrlText _text; if( _channel == localize "STR_SIDE_CHANNEL" ) then { player setDamage 1; }; };
I don't recommend the current kill instantly I just put it there while testing...
private["_display","_channelDisplay","_text","_channel"];
disableSerialization;
_channelDisplay = findDisplay 63;
if( !isNull _channelDisplay) then {
_text = _channelDisplay displayCtrl 101;
_channel = ctrlText _text;
if( _channel == localize "STR_SIDE_CHANNEL" ) then {
[60,15] call fnc_usec_pitchWhine; //60 - Itensity (whine sound) 15 - Seconds it lasts
[] spawn
{
playSound "explosionlarge_1"; //Built in sounds @ http://pastebin.com/Lcx6W0Nn
playSound "explosionlarge_1"; // Playing the sound multiple times at once increases the volume of the sound.
playSound "explosionlarge_1";
playSound "explosionlarge_1";
disableUserInput true;
sleep 1;
disableUserInput false;
};
cutText ['NO VOICE IN SIDECHAT!','PLAIN DOWN',25];
dayz_lastCheckBit = time;
[player,15,true,(getPosATL player)] spawn player_alertZombies;
};
};