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.
// PLAYER2 BIKE DEPLOY
if((speed player <= 1) && _hasToolbox && _canDo) then {
if (s_player_deploybike < 0) then {
s_player_deploybike = player addaction[('"<t color="'"#007ab7"'">" + ("Deploy Bike") +"</t>");,"bike\deploy.sqf","'",5,false,true,"", "'"]
};
} else {
player removeAction s_player_deploy;
s_player_deploybike = -1;
};
if ("PartGeneric" in _mags) then {
hasBikeItem = true;
} else { hasBikeItem = false;};
if((speed player <= 1) && hasBikeItem && _canDo) then {
if (s_player_deploybike < 0) then {
s_player_deploybike = player addaction[("<t color=""#c70000"">" + ("Deploy bike") +"</t>"),"Scripts\deploy.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike;
s_player_deploybike = -1;
};
if (dayz_combat == 1) then {
cutText [format["You are in combat and cannot build a bike."'], "PLAIN DOWN"];
} else {
player removeAction s_player_deploybike;
player playActionNow "Medic";
r_interrupt = false;
player removeMagazine "PartGeneric";
sleep 6;
_object = createVehicle ["Old_bike_TK_INS_EP1", [0,0,0], [], 0, "CAN_COLLIDE"];
_object setVariable ["ObjectUID",""];
player reveal _object
cutText [format["You have used your scrap metal to build a bike!"], "PLAIN DOWN"];
r_interrupt = false;
player switchMove "";
player playActionNow "stop";
sleep 10;
cutText [format["Warning: This bike will be deleted on next restart!"], "PLAIN DOWN"];
};
I've got "deploy bike" option to show up with this:
But I cant get the bike to spawn. PLAYER2's deploy.sqf won't work. I've tried something like this:Code:if ("PartGeneric" in _mags) then { hasBikeItem = true; } else { hasBikeItem = false;}; if((speed player <= 1) && hasBikeItem && _canDo) then { if (s_player_deploybike < 0) then { s_player_deploybike = player addaction[("<t color=""#c70000"">" + ("Deploy bike") +"</t>"),"Scripts\deploy.sqf","",5,false,true,"", ""]; }; } else { player removeAction s_player_deploybike; s_player_deploybike = -1; };
Not working tho..Code:if (dayz_combat == 1) then { cutText [format["You are in combat and cannot build a bike."'], "PLAIN DOWN"]; } else { player removeAction s_player_deploybike; player playActionNow "Medic"; r_interrupt = false; player removeMagazine "PartGeneric"; sleep 6; _object = createVehicle ["Old_bike_TK_INS_EP1", [0,0,0], [], 0, "CAN_COLLIDE"]; _object setVariable ["ObjectUID",""]; player reveal _object cutText [format["You have used your scrap metal to build a bike!"], "PLAIN DOWN"]; r_interrupt = false; player switchMove ""; player playActionNow "stop"; sleep 10; cutText [format["Warning: This bike will be deleted on next restart!"], "PLAIN DOWN"]; };
if (dayz_combat == 1) then {
cutText [format["You are in Combat and cannot build a bike."], "PLAIN DOWN"];
} else {
private ["_object"];
player removeAction s_player_deploybike;
player playActionNow "Medic";
r_interrupt = false;
player removeWeapon "ItemToolbox";
player removeMagazine "PartGeneric";
_dis=10;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
sleep 6;
_object = createVehicle ["Old_bike_TK_INS_EP1", position player,[],0,"CAN_COLLIDE"];
_object setVariable ["ObjectID", "1", true];
_object setVariable ["ObjectUID", "1", true];
player reveal _object
cutText [format["You've used your toolbox to build a bike!"], "PLAIN DOWN"];
r_interrupt = false;
player switchMove "";
player playActionNow "stop";
sleep 10;
cutText [format["Warning: Spawned Bikes do not save after server restart!"], "PLAIN DOWN"];
};
if (("PartGeneric" in _mags) && _hasToolbox ) then {
hasBikeItem = true;
} else { hasBikeItem = false;};
if((speed player <= 1) && hasBikeItem && _canDo) then {
if (s_player_deploybike < 0) then {
s_player_deploybike = player addaction[("<t color=""#c70000"">" + ("Deploy bike") +"</t>"),"fixes\deploybike.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike;
s_player_deploybike = -1;
};
I got it to work except one big problem. The bike deploys\repacks as I want it to. The problem is when I get on the bike it kills me.
I should have stated before that I am running Overwatch. Is there a way to load a custom compiles without overrunning the overwatch scripts.
I tried this method before and found that self bloodbag - which is in the overwatch code (not sure where) - does not work.
Also how do I go about calling upon the fn_selfActions.sqf properly, it is in the init.sqf or it has to be within the custom compiles?
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf"; //Compile regular functions
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom compiles
if((speed player <= 1) && cursorTarget isKindOf "Old_bike_TK_CIV_EP1" && _canDo) then {
if (s_player_deploybike2 < 0) then {
s_player_deploybike2 = player addaction[("<t color=""#007ab7"">" + ("Re-Pack Bike") +"</t>"),"spawnbike\bike2.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike2;
s_player_deploybike2 = -1;
};
if((speed player <= 1) && _hasToolbox && _canDo) then {
if (s_player_deploybike < 0) then {
s_player_deploybike = player addaction[("<t color=""#007ab7"">" + ("Deploy Bike (will loose Toolbox)") +"</t>"),"spawnbike\bike.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike;
s_player_deploybike = -1;
};
if (dayz_combat == 1) then {
cutText [format["You are in Combat and cannot build a bike."], "PLAIN DOWN"];
} else {
player removeAction s_player_deploybike;
player playActionNow "Medic";
r_interrupt = false;
player removeWeapon "ItemToolbox";
_dis=10;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
sleep 6;
_object = "Old_bike_TK_CIV_EP1" createVehicle (position player);
_object setVariable ["ObjectID", "1", true];
_object setVariable ["ObjectUID", "1", true];
_object attachto [player,[0.0,3.0,0.5]];
sleep 3;
detach _object;
player reveal _object;
cutText [format["You've used your toolbox to build a bike."], "PLAIN DOWN"];
r_interrupt = false;
player switchMove "";
player playActionNow "stop";
sleep 10;
cutText [format["Warning: Spawned Bikes DO NOT SAVE after server restart!"], "PLAIN DOWN"];
if (dayz_combat == 1) then {
cutText [format["You are in Combat and cannot re-build your bike."], "PLAIN DOWN"];
} else {
player removeAction s_player_deploybike2;
player playActionNow "Medic";
r_interrupt = false;
player addWeapon "ItemToolbox";
deletevehicle cursortarget;
_dis=10;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
sleep 6;
cutText [format["You have packed your bike and been given back your toolbox"], "PLAIN DOWN"];
r_interrupt = false;
player switchMove "";
player playActionNow "stop";
};
To do deployable bikes on grab your fn_selfactions.sqf and add this below the _canDo = (!r_drag_sqf and !r_player_unconscious and !_onLader);
Code:if((speed player <= 1) && cursorTarget isKindOf "Old_bike_TK_CIV_EP1" && _canDo) then { if (s_player_deploybike2 < 0) then { s_player_deploybike2 = player addaction[("<t color=""#007ab7"">" + ("Re-Pack Bike") +"</t>"),"spawnbike\bike2.sqf","",5,false,true,"", ""]; }; } else { player removeAction s_player_deploybike2; s_player_deploybike2 = -1; }; if((speed player <= 1) && _hasToolbox && _canDo) then { if (s_player_deploybike < 0) then { s_player_deploybike = player addaction[("<t color=""#007ab7"">" + ("Deploy Bike (will loose Toolbox)") +"</t>"),"spawnbike\bike.sqf","",5,false,true,"", ""]; }; } else { player removeAction s_player_deploybike; s_player_deploybike = -1; };
make sure to make a spawnbike folder inside the mission pbo and make a
bike.sqf and a bike2.sqf here is the links to what you need to put in
the .sqf's, as well as change the call in compiles for the
fn_selfActions.sqf
bike.sqf
bike2.sqfCode:if (dayz_combat == 1) then { cutText [format["You are in Combat and cannot build a bike."], "PLAIN DOWN"]; } else { player removeAction s_player_deploybike; player playActionNow "Medic"; r_interrupt = false; player removeWeapon "ItemToolbox"; _dis=10; _sfx = "repair"; [player,_sfx,0,false,_dis] call dayz_zombieSpeak; [player,_dis,true,(getPosATL player)] spawn player_alertZombies; sleep 6; _object = "Old_bike_TK_CIV_EP1" createVehicle (position player); _object setVariable ["ObjectID", "1", true]; _object setVariable ["ObjectUID", "1", true]; _object attachto [player,[0.0,3.0,0.5]]; sleep 3; detach _object; player reveal _object; cutText [format["You've used your toolbox to build a bike."], "PLAIN DOWN"]; r_interrupt = false; player switchMove ""; player playActionNow "stop"; sleep 10; cutText [format["Warning: Spawned Bikes DO NOT SAVE after server restart!"], "PLAIN DOWN"];
Code:if (dayz_combat == 1) then { cutText [format["You are in Combat and cannot re-build your bike."], "PLAIN DOWN"]; } else { player removeAction s_player_deploybike2; player playActionNow "Medic"; r_interrupt = false; player addWeapon "ItemToolbox"; deletevehicle cursortarget; _dis=10; _sfx = "repair"; [player,_sfx,0,false,_dis] call dayz_zombieSpeak; [player,_dis,true,(getPosATL player)] spawn player_alertZombies; sleep 6; cutText [format["You have packed your bike and been given back your toolbox"], "PLAIN DOWN"]; r_interrupt = false; player switchMove ""; player playActionNow "stop"; };
_object = "Old_bike_TK_CIV_EP1" createVehicle (position player);
_object setVariable ["ObjectID", "1", true];
_object setVariable ["ObjectUID", "1", true];
_object = "Old_bike_TK_CIV_EP1" createVehicle (position player);
_object setVariable ["Sarge", "1", true];