Alright so CommanderRetra and I worked on this for awhile and couldn't get it to work quite right, we had everything down except the explosion. A dude named Buttface adjusted the code to where the explosion would be handled serverside, and it worked. Big thanks to that man.
First off, you will need an overwritten fn_selfActions.sqf and compiles.sqf from dayz_code.pbo. Place these in a Fixes folder in your mission.pbo. Find the line in your compiles.sqf that calls on the fn_selfActions.sqf and change it to look like this
then open your init.sqf and find the line that controls the compiles, and change it to
while your in your init.sqf at the bottom paste this :
now open your selfActions.sqf and at the bottom paste :
Then make a Scripts folder in your mission.pbo and create a few files to be placed in there.
continued on next post
First off, you will need an overwritten fn_selfActions.sqf and compiles.sqf from dayz_code.pbo. Place these in a Fixes folder in your mission.pbo. Find the line in your compiles.sqf that calls on the fn_selfActions.sqf and change it to look like this
Code:
fnc_usec_selfActions = compile preprocessFileLineNumbers "Fixes\fn_selfActions.sqf";
then open your init.sqf and find the line that controls the compiles, and change it to
Code:
call compile preprocessFileLineNumbers "Fixes\compiles.sqf"; //Compile custom compiles
while your in your init.sqf at the bottom paste this :
Code:
if (isServer) then {
"DZ_boobyTrap" addPublicVariableEventHandler {[_this select 1] execVM 'Scripts\createBomb.sqf'};
};
Code:
if (("ItemEtool" in weapons player) && ("PartWoodPile" in magazines player)) then {
hasBombItem = true;
} else {
hasBombItem = false;
};
if ((speed player <= 1) && hasBombItem) then {
hasBomb = true;
} else {
hasBomb = false;
};
if ((hasBomb) && ("HandGrenade_West" in magazines player)) then {
if (s_player_makeBomb < 0) then {
s_player_makeBomb = player addAction [("<t color=""#c30000"">" + ("Place Exploding Booby Trap") +"</t>"),"Scripts\setBomb.sqf","",5,false,true,"",""];
};
} else {
player removeAction s_player_makeBomb;
s_player_makeBomb = -1;
};
Then make a Scripts folder in your mission.pbo and create a few files to be placed in there.
continued on next post