glowpowner
Member
Hello i read some stuff about how to put deploy bike in your mission
this what i did but i cant create the bike when i spawn a bike in the admin panel and walk to the bike i can repack it but not deploy it
can some on help with this
fn_selfActions.sqf
i added the self action below
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
bike.sqf
bike2.sqf
this what i did but i cant create the bike when i spawn a bike in the admin panel and walk to the bike i can repack it but not deploy it
can some on help with this
fn_selfActions.sqf
i added the self action below
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
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>"),"scripts\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>"),"scripts\bike.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike;
s_player_deploybike = -1;
};
bike.sqf
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 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"];
};
//bike deploy script by Player2 - OpenDayz Release Coming Soon!
bike2.sqf
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";
};