deployable bike

can someone tell me if i have done this right please?,
Code:
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
 
//Krixes Self Bloodbag 
_mags = magazines player;
 
// Krixes Self Bloodbag
if ("ItemBloodbag" in _mags) then {
hasBagItem = true;
} else { hasBagItem = false;};
if((speed player <= 1) && hasBagItem && _canDo) then {
if (s_player_selfBloodbag < 0) then {
s_player_selfBloodbag = player addaction[("<t color=""#c70000"">" + ("Self Bloodbag") +"</t>"),"\z\addons\dayz_code\actions\player_selfbloodbag.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_selfBloodbag;
s_player_selfBloodbag = -1;
};
if((speed player <= 1) && cursorTarget isKindOf "CSJ_GyroC" && _canDo) then {
if (s_player_deploybike6 < 0) then {
s_player_deploybike6 = player addaction[("<t color=""#007ab7"">" + ("Re-Pack GyroCopter") +"</t>"),"spawnbike\bike6.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike6;
s_player_deploybike6 = -1;
};
 
if((speed player <= 1) && cursorTarget isKindOf "TT650_Civ" && _canDo) then {
if (s_player_deploybike5 < 0) then {
s_player_deploybike5 = player addaction[("<t color=""#007ab7"">" + ("Upgrade to GyroCopter") +"</t>"),"spawnbike\bike5.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike5;
s_player_deploybike5 = -1;
};
 
if((speed player <= 1) && cursorTarget isKindOf "TT650_Civ" && _canDo) then {
if (s_player_deploybike4 < 0) then {
s_player_deploybike4 = player addaction[("<t color=""#007ab7"">" + ("Re-Pack Motorcycle") +"</t>"),"spawnbike\bike4.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike4;
s_player_deploybike4 = -1;
};
 
if((speed player <= 1) && cursorTarget isKindOf "Old_bike_TK_CIV_EP1" && _canDo) then {
if (s_player_deploybike3 < 0) then {
s_player_deploybike3 = player addaction[("<t color=""#007ab7"">" + ("Upgrade to Motorcycle") +"</t>"),"spawnbike\bike3.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike3;
s_player_deploybike3 = -1;
};
 
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;
is this the right way?. any help will be great thanks.
 
Back
Top