how to add Deploy bike and Gyro?

Chris Atkins

Valued Member!
Open your fn_selfactions.sqf.
Around line 38 or so, you should see
Code:
_isPlant = typeOf _cursorTarget in Dayz_plants;
Underneath that, add
Code:
_isBike = typeOf _cursorTarget in ["Old_bike_TK_INS_EP1","Old_bike_TK_CIV_EP1"];
Then, look for this around line 48 or so
Code:
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
and directly underneath, add

Code:
_hasToolbox =  "ItemToolbox" in items player;
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=""#4abba7"">" + ("Re-Pack Bike") +"</t>"),"Scripts\deploy\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=""#4abba7"">" + ("Deploy Bike") +"</t>"),"Scripts\deploy\Bike.sqf","",5,false,true,"", ""];
    };
} else {
    player removeAction s_player_deploybike;
    s_player_deploybike = -1;
};


if((speed player <= 1) && _hasToolbox && _canDo) then {
    if (s_player_deploymoz < 0) then {
        s_player_deploymoz = player addaction[("<t color=""#4abba7"">" + ("Deploy Mozzie") +"</t>"),"Scripts\deploy\make_mozzie.sqf","",5,false,true,"", ""];
    };
} else {
    player removeAction s_player_deploymoz;
    s_player_deploymoz = -1;
};
This will give you the ability to build a bike and a mozzie.

Next, create a "scripts\deploy" folder in your mission pbo.
Download this and place in the "scripts\deploy" folder.

In order to prevent players from dying once they deploy a bike and get on, you will need to open your server pbo and then find the server_cleanup.fsm. Open your server_cleanup.fsm. Find this block of code
Code:
"//Check for hackers" \n
       "// {" \n
       " //     if(vehicle _x != _x && !(vehicle _x in _safety) && (typeOf vehicle _x) != ""ParachuteWest"") then {" \n
       "//        diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n
       " //          (vehicle _x) setDamage 1;" \n
       " //          _x setDamage 1;" \n
       "//     };" \n
       "// } forEach allUnits;" \n
       "" \n
The // indicate that this block of code will be ignored. Otherwise your players will be killed when getting on the bike after it's deployed (this may have already been done when I setup your halo spawn).

Now repack both your server and mission pbos.

***NOTE
If you use infiSTAR AH you will need to white list these (2) actions
Code:
s_player_deploybike, s_player_deploymoz,
 

Chris Atkins

Valued Member!
You should have two folders, one called "scripts" and another called "deploy" The "deploy" folder goes inside the "scripts" folder. The files in my link above, all those SQF files go inside the "deploy" folder.

Make sure that is how you have it setup. This is all done mission pbo.
 
Top