DayZ Scripting Tutorial
Requirements ... Bypass ... DayZ ... And yeah a menu to test it with
To Start off all scripts are written in the ArmA 2 Coding format so there is no GNU Editor to help you with this. I would Suggest using Notepad++ For windows or GEdit for Linux (who would be here with a linux os?). Scripting in DayZ is basically trial and error. these next few codes will teach you the fundamentals of coding sqf files.
To Start Off Lets Make a Simple Teleport Script (this file is attached)
Code:
player addWeapon 'ItemMap';
abcd=
{
_pos = [_this select 0, _this select 1, _this select 2];
(vehicle player) setpos [_pos select 0, _pos select 1, 0];
player setVariable["lastPos",1];player setVariable["lastPos",[]];
onMapSingleClick "";
openMap [false, false];
};
openMap [true, false];
onMapSingleClick "[_pos select 0, _pos select 1, _pos select 2] call abcd";
Now lets break it apart :
This spawns a map in the players Inventory
Code:
player addWeapon 'ItemMap';
This is the code that is run while the teleport is being executed
Code:
abcd=
{
//This Represents a Location it will be used to teleport the player
_pos = [_this select 0, _this select 1, _this select 2];
//this changes the players location to the position above ^^^ (Format [X,Y,Z])
(vehicle player) setpos [_pos select 0, _pos select 1, 0];
//This changes the players last position to null so you are not detected
player setVariable["lastPos",1];player setVariable["lastPos",[]];
//clears the on map single click
onMapSingleClick "";
//Closes the map ([False, False] Closes)
openMap [false, false];
};
this is the part that opens the map and executes the teleport
Code:
//Opens the map ([True, False] Opens)
openMap [true, false];
//When the map is single clicked it will do this
//Important : Call abcd runs that script before the teleport is executed
onMapSingleClick "[_pos select 0, _pos select 1, _pos select 2] call abcd";
Uploaded By Other User:

Originally Posted by
typh0
Quick Player Heal
Code:
player setdammage 0;
http://community.bistudio.com/wiki/setDammage
Player - This is your current player, can also be subsituted for "
This"
setdammage - Note the shitty spelling but as it says in wiki, they introduced
setdamage to fix the spelling mistake but its interchangeable.
0 - Is of type "Number".
0 being not damaged and
1 being fully damaged. Check link for more info.
https://community.bistudio.com/wiki/Number
No Recoil
Code:
nrIndex = _this select 1;
while {(vars select nrIndex) == "1"} do
{
player setUnitRecoilCoefficient 0;
};
if((vars select nrIndex) == "0") then
{
player setUnitRecoilCoefficient 1;
};
https://community.bistudio.com/wiki/...oilCoefficient
nrIndex == "1" - Declaring that the value
nrIndex is equal to 1.
while {(vars select nrIndex) == "1"} - When this is equal to 1 do whats inside the curly brackets.
player - as mentioned above.
setUnitRecoilCoefficient - This the value you are changing read the wiki for more info.
0 - Setting to
0 is no recoil, im not sure if
1 is the default value tho or if thats higher than the default
nrIndex == "0" - Allows it to be toggled. Could be done with an IF statement, I dont even know if ARMA supports IF statements tho.
I didnt write either of these Im sure they are in one of the public downloads.
I will update this with more scripting tutorials...