Jump to content

Ryjalon

Member
  • Posts

    2
  • Joined

  • Last visited

Posts posted by Ryjalon

  1. Hey Jimmy!

     

    Thank you for the quick reply. Is there also a "deploy" set of code for this one. I see that you posted some code to add to fn_selfactions.sqf for packing up the bike but not sure what I would add in order to deploy the bike.

     

    Also, does this spawn bike addon require me to update the BattleEye filters so that it doesn't kill players when they get on the bike? if so, do you by chance know what I would add to the BattleEye text files to make exceptions for this script?

  2. Hello All,

     

    So I have a custom Deploy Bike script however I can't figure out why the menu to deploy the bike will not work. Just wondering if anyone wouldn't mind taking a look and seeing what I might be doing wrong. The folders are named correctly and I am not getting any errors in my RPT file. 

     

    Here is what I have at the very end of my fn_selfactions.sqf:

    //BIKE DEPLOY
    if ("ItemToolbox" in _weapons) 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=""#007ab7"">" + ("Deploy Bike") +"</t>"),"custom\Spawn_Bike\deploy.sqf","",5,false,true,"", ""];
            };
        } else {
            player removeAction s_player_deploybike;
            s_player_deploybike = -1;
    };
     
    //PACK BIKE
    if((_isBike) and _canDo) then {
    if (s_player_deploybike2 < 0) then {
            s_player_deploybike2 = player addaction[("<t color=""#007ab7"">" + ("Re-Pack Bike") +"</t>"),"custom\Spawn_Bike\pack.sqf","",5,false,true,"", ""];
        };
    } else {
        player removeAction s_player_deploybike2;
        s_player_deploybike2 = -1;
    

    Deploy.sqf

    private ["_Secondary"];
    Deploy=nil;
    canAbort = true;
    DamiSpawn = 
    [
    	["Deploy Bike Confirmation",true],
    	["Are you sure?", [-1], "", -5, [["expression", ""]], "1", "0"],
    	["", [-1], "", -5, 		[["expression", ""]], "1", "0"],
    	["No", [2], "", -5, 	[["expression", "Deploy=false;"]], "1", "1"],
    	["Yes", [3], "", -5, 	[["expression", "Deploy=true;"]], "1", "1"],
    	["", [-1], "", -5, 		[["expression", ""]], "1", "0"],
    	["Exit", [-1], "", -3, 	[["expression", "Deploy=false;"]], "1", "1"]
    ];
    
    showCommandingMenu "#USER:DamiSpawn";
    waitUntil {((!isNil 'Deploy')||(commandingMenu == ""))};
    if (isNil 'Deploy') then {Deploy=false;};
    if (Deploy) then
    {
    
        canAbort = false;
    	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_INS_EP1" createVehicle (position player);
        _object setVariable ["ObjectID", "1", true];
        _object setVariable ["ObjectUID", "1", true];
     
        player reveal _object;
     
        cutText [format["You've used your toolbox to build a bike! How magical!"], "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"];
     
    } else {
    	systemChat ("Deploy canceled.");
    };
    
    

    Pack.sqf

    private ["_dis","_sfx","_targetBike"];
    
    if (dayz_combat == 1) then {
      cutText [format["You are in combat and cannot re-build your bike."], "PLAIN DOWN"];
    } else {
       _targetBike = cursorTarget; 
       player removeAction s_player_deploybike2;
       player playActionNow "Medic";
       r_interrupt = false;
       sleep 2;
       player addWeapon "ItemToolbox";
       _nearbybikes = (getPosATL player) nearObjects ["Old_bike_TK_INS_EP1", 5];
       {deletevehicle _x;} forEach _nearbybikes;
       _dis = 5;
       _sfx = "repair";
       [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
       [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
       sleep 8;
       cutText [format["You have packed your bike and got back your toolbox!"], "PLAIN DOWN"];
       r_interrupt = false;
       player switchMove "";
       player playActionNow "stop";
    };
    

    Thank you for taking the time to look. ; )

×
×
  • Create New...