Auto Refuel, Deploy-able Bikes

i have another problem...i run it well,but other players cant find the menu of deploy bike...
i think thats because my modified fn_selfaction is a local file ,as a result others cant use these setting.
PS. i use my own pc to run this server , my fn_selfaction is in OA/@dayzoverwatch/addons/dayz_code.pbo
 
I had some trouble getting this to work. I copied everything into my SQF's and I would get an infinite full bar load screen. I'm at work right now so if you need me to post some stuff I can... just seeing if its something quick that you guys all know of
 
I am trying to get it to work on overwatch too, but i cant get it to work.
Can anyone see where i failed?

Btw, the way to build it is via scroll, right?


4oUfG.jpg



4oUgk.jpg




4oUyL.png



Fn_selfActions.sqf
Code:
        _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
    };
};
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
 
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;
};
 
//Krixes Self Bloodbag
    _mags = magazines player;


Init.sqf
Code:
/*
    INITILIZATION
*/
startLoadingScreen ["","RscDisplayLoadCustom"];
cutText ["","BLACK OUT"];
enableSaving [false, false];
 
//REALLY IMPORTANT VALUES
dayZ_instance = 1;                    // The instance
//dayZ_serverName = "UK1337";            // server name (country code + server number)
dayzHiveRequest = [];
initialized = false;
dayz_previousID = 0;
 
//disable greeting menu
player setVariable ["BIS_noCoreConversations", true];
//disable radio messages to be heard and shown in the left lower corner of the screen
 
//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
//call compile preprocessFileLineNumbers "\z\addons\ow_assets\init\variables1.sqf";
// variables1-5.sqf Changes amount of weapon’s holder that can spawn in a 200m area where variables5.sqf spawns the lowest amount, adjust to get better performance.
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";                    //Initilize the publicVariable event handlers
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";    //Functions used by CLIENT for medical
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";                    //Compile regular functions
progressLoadingScreen 1.0;
stream_locationCheck = {
//Thank you very fucking much, KK!
};
"filmic" setToneMappingParams [0.153, 0.357, 0.231, 0.1573, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
 
[] execVM "\ddopp_taserpack\scripts\init_Taser.sqf";
/* BIS_Effects_* fixes from Dwarden */
BIS_Effects_EH_Killed = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\BIS_Effects\killed.sqf";
BIS_Effects_AirDestruction = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\BIS_Effects\AirDestruction.sqf";
BIS_Effects_AirDestructionStage2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\BIS_Effects\AirDestructionStage2.sqf";
 
BIS_Effects_globalEvent = {
    BIS_effects_gepv = _this;
    publicVariable "BIS_effects_gepv";
    _this call BIS_Effects_startEvent;
};
 
BIS_Effects_startEvent = {
    switch (_this select 0) do {
        case "AirDestruction": {
                [_this select 1] spawn BIS_Effects_AirDestruction;
        };
        case "AirDestructionStage2": {
                [_this select 1, _this select 2, _this select 3] spawn BIS_Effects_AirDestructionStage2;
        };
        case "Burn": {
                [_this select 1, _this select 2, _this select 3, false, true] spawn BIS_Effects_Burn;
        };
    };
};
 
"BIS_effects_gepv" addPublicVariableEventHandler {
    (_this select 1) call BIS_Effects_startEvent;
};
 
if ((!isServer) && (isNull player) ) then
{
    waitUntil {!isNull player};
    waitUntil {time > 3};
};
 
if ((!isServer) && (player != player)) then
{
    waitUntil {player == player};
    waitUntil {time > 3};
};
 
if (isServer) then {
    _serverMonitor = [] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
    // "PVDZ_sec_atp" addPublicVariableEventHandler { diag_log format["%1", _this select 1];};
};
 
if (!isDedicated) then {
    //Conduct map operations
    0 fadeSound 0;
    waitUntil {!isNil "dayz_loadScreenMsg"};
    dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
 
    //Run the player monitor
    _id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
    _playerMonitor = [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
    // [] execVM "\z\addons\dayz_code\system\antihack.sqf";
};
 
// Logo watermark: adding a logo in the bottom left corner of the screen with the server name in it
if (!isNil "dayZ_serverName") then {
    [] spawn {
        waitUntil {(!isNull Player) and (alive Player) and (player == player)};
        waituntil {!(isNull (findDisplay 46))};
        5 cutRsc ["wm_disp","PLAIN"];
        ((uiNamespace getVariable "wm_disp") displayCtrl 1) ctrlSetText dayZ_serverName;
    };
};
 
[] ExecVM "DX_custom_monitor.sqf";
[] execVM "kh_actions.sqf";
 
You do not have a compiles or fn_selfActions sqf in your mission.pbo you need to make sure you copy both those into your pbo and go to your init and change the callcompress for the compiles.sqf to the pbo which would look something like this:
Code:
call compile preprocessFileLineNumbers "Fixes\compiles.sqf";//Compile regular functions
once you have done that go into your compiles.sqf and change the call for fn_selfActions to something like this:
Code:
fnc_usec_selfActions = compile preprocessFileLineNumbers "Fixes\fn_selfActions.sqf";//Checks which actions for self
IT WILL NOT WORK UNLESS YOU DO THIS.
 
You do not have a compiles or fn_selfActions sqf in your mission.pbo you need to make sure you copy both those into your pbo and go to your init and change the callcompress for the compiles.sqf to the pbo which would look something like this:
Code:
call compile preprocessFileLineNumbers "Fixes\compiles.sqf";//Compile regular functions
once you have done that go into your compiles.sqf and change the call for fn_selfActions to something like this:
Code:
fnc_usec_selfActions = compile preprocessFileLineNumbers "Fixes\fn_selfActions.sqf";//Checks which actions for self
IT WILL NOT WORK UNLESS YOU DO THIS.

best way is to have custom one under the regular that way it keeps the main functions. that's what i got anyway :p
 
I am trying to get it to work on overwatch too, but i cant get it to work.
Can anyone see where i failed?

Btw, the way to build it is via scroll, right?


Yes scroll is the right way, but what you need to remember is to add the exclusion from your anti-hack if you have one. IE Overwatch / Blur anti-hack you need to find your AH.sqf file, open it and look for

Code:
_dayzActions =

That is where you add the exclusions. IE there will be things like s_player_debug,s_player_calldog etc already.

You need to add the exclusions for these scripts there. Depending on how many of them you use:

s_player_deploybike,s_player_deploybike2,s_player_deploybike3,s_player_deploybike4,s_player_deploybike5,s_player_deploybike6,

If you DO HAVE this Anti-Hack and you do not add these then only the admins will see the scroll menu.

Another thing you'll have to do is check the BE's attachto filter and make sure these bikes etc are not in there. If they are comment the line out like this:

//5 "Old_bike_TK_CIV_EP1"

Best of luck to you!
 
You do not have a compiles or fn_selfActions sqf in your mission.pbo you need to make sure you copy both those into your pbo and go to your init and change the callcompress for the compiles.sqf to the pbo which would look something like this:
Code:
call compile preprocessFileLineNumbers "Fixes\compiles.sqf";//Compile regular functions
once you have done that go into your compiles.sqf and change the call for fn_selfActions to something like this:
Code:
fnc_usec_selfActions = compile preprocessFileLineNumbers "Fixes\fn_selfActions.sqf";//Checks which actions for self
IT WILL NOT WORK UNLESS YOU DO THIS.



Thx for the help, its working now!
Get up the good scripting!
 
Just a NOTE on the Gyro crafting.

Use the code "GyroC_DZ" for crafting the Gyro instead of "CSJ_GyroC" because the CSJ_GyroC has radar on it that will make your players see all the vehicles as a grey dot. Way to OP
 
I have mine set up to where you can upgrade a gyrocopter with a machine gun just for shits and giggles after you build a gyro, but I did mine in a progressive state so I use 2 different types of gyros.
 
I have mine set up to where you can upgrade a gyrocopter with a machine gun just for shits and giggles after you build a gyro, but I did mine in a progressive state so I use 2 different types of gyros.

That's badass man!!!! I have the bikes and gyros working , but think I got lost in all the different posts on exactly where you can add upgrades to them. Or is it a piece of the bi-plane m240 code you are using? YakB would be nasty! Lulz!!!:D
 
To do deployable bikes on overwatch 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
http://pastebin.com/1cacH7Nh

bike2.sqf
http://pastebin.com/fvL0Ty4M

Pack it up and test it out, you need a toolbox to build the bike though.

Great WORK !!!!!!

MUCHAS GRACIAS ......works on OverWatch 0.2.4 (HFB-Servers)

Visit Us:
Isolation - Overwatch - 88.190.47.209:2322
 
I put the script according to above putting right underneath self blood bag script in fn_selfAction file, but just kills my character whenever I ride onto the bike....

Try to put it not underneath self blood, but before.

Code:
scriptName "Functions\misc\fn_selfActions.sqf";[/COLOR]
[COLOR=#808080]/***********************************************************[/COLOR]
[COLOR=#808080]    ADD ACTIONS FOR SELF[/COLOR]
[COLOR=#808080]    - Function[/COLOR]
[COLOR=#808080]    - [] call fnc_usec_selfActions;[/COLOR]
[COLOR=#808080]************************************************************/[/COLOR]
[COLOR=#808080]private["_isStash","_vehicle","_inVehicle","_bag","_classbag","_isWater","_hasAntiB","_hasFuelE","_hasFuel5","_hasbottleitem","_hastinitem","_hasKnife","_hasToolbox","_hasTent","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_ownerID","_isAnimal","_isDog","_isZombie","_isDestructable","_isTent","_isFuel","_isAlive","_canmove","_rawmeat","_hasRawMeat","_allFixed","_hitpoints","_damage","_part","_cmpt","_damagePercent","_color","_string","_handle","_dogHandle","_lieDown","_warn","_dog","_speed"];[/COLOR]
 
[COLOR=#808080]_vehicle = vehicle player;[/COLOR]
[COLOR=#808080]_inVehicle = (_vehicle != player);[/COLOR]
[COLOR=#808080]_bag = unitBackpack player;[/COLOR]
[COLOR=#808080]_classbag = typeOf _bag;[/COLOR]
[COLOR=#808080]_isWater = (surfaceIsWater (position player)) or dayz_isSwimming;[/COLOR]
[COLOR=#808080]_hasAntiB = "ItemAntibiotic" in magazines player;[/COLOR]
[COLOR=#808080]_hasFuelE20 = "ItemJerrycanEmpty" in magazines player;[/COLOR]
[COLOR=#808080]_hasFuelE5 = "ItemFuelcanEmpty" in magazines player;[/COLOR]
[COLOR=#808080]//boiled Water[/COLOR]
[COLOR=#808080]_hasbottleitem = "ItemWaterbottle" in magazines player;[/COLOR]
[COLOR=#808080]_hastinitem = false;[/COLOR]
[COLOR=#808080]{[/COLOR]
[COLOR=#808080]    if (_x in magazines player) then {[/COLOR]
[COLOR=#808080]        _hastinitem = true;[/COLOR]
[COLOR=#808080]    };[/COLOR]
 
[COLOR=#808080]} forEach boil_tin_cans;[/COLOR]
 
 
[COLOR=#808080]_hasKnife = "ItemKnife" in items player;[/COLOR]
[COLOR=#808080]_hasMatches = "ItemMatchbox" in items player;[/COLOR]
[COLOR=#808080]_hasToolbox = "ItemToolbox" in items player;[/COLOR]
[COLOR=#808080]//_hasTent = "ItemTent" in items player;[/COLOR]
[COLOR=#808080]_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;[/COLOR]
[COLOR=#808080]_nearLight = nearestObject [player,"LitObject"];[/COLOR]
[COLOR=#808080]_canPickLight = false;[/COLOR]
 
[COLOR=#808080]if (!isNull _nearLight) then {[/COLOR]
[COLOR=#808080]    if (_nearLight distance player < 4) then {[/COLOR]
[COLOR=#808080]        _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);[/COLOR]
[COLOR=#808080]    };[/COLOR]
[COLOR=#808080]};[/COLOR]
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
 
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((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 "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;
};
 
[COLOR=#ffff00]_isCraft = cursorTarget isKindOf "Land_Chest_EP1";[/COLOR]
[COLOR=#ffff00]_insight = (count ((position player) nearObjects ["Land_Chest_EP1", 5]));[/COLOR]
[COLOR=#ffff00]_isnear = _insight > 0;[/COLOR]
[COLOR=#ffff00]if ((speed player <= 1) && _isCraft && _isnear && _canDo) then[/COLOR]
[COLOR=#ffff00]    {[/COLOR]
[COLOR=#ffff00]        if (s_player_craftBullet < 0) then {[/COLOR]
[COLOR=#ffff00]        s_player_craftBullet = player addAction [("<t color=""#c70000"">" + ("Special OG-Crafting") +"</t>"),"fixes\craft\excute.sqf",cursorTarget, 0, false, true, "",""];[/COLOR]
[COLOR=#ffff00]        };[/COLOR]
[COLOR=#ffff00]    } else[/COLOR]
[COLOR=#ffff00]    {[/COLOR]
[COLOR=#ffff00]        player removeAction s_player_craftBullet;[/COLOR]
[COLOR=#ffff00]        s_player_craftBullet = -1;[/COLOR]
[COLOR=#ffff00]    };[/COLOR]
//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 u dont use the Crafting System 4 Backpack/Weapons and more , dont use code in yellow

So it works 4 me. I hope i could help
 
Try to put it not underneath self blood, but before.

Code:
scriptName "Functions\misc\fn_selfActions.sqf";
/***********************************************************
    ADD ACTIONS FOR SELF
    - Function
    - [] call fnc_usec_selfActions;
************************************************************/
private["_isStash","_vehicle","_inVehicle","_bag","_classbag","_isWater","_hasAntiB","_hasFuelE","_hasFuel5","_hasbottleitem","_hastinitem","_hasKnife","_hasToolbox","_hasTent","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_ownerID","_isAnimal","_isDog","_isZombie","_isDestructable","_isTent","_isFuel","_isAlive","_canmove","_rawmeat","_hasRawMeat","_allFixed","_hitpoints","_damage","_part","_cmpt","_damagePercent","_color","_string","_handle","_dogHandle","_lieDown","_warn","_dog","_speed"];
 
_vehicle = vehicle player;
_inVehicle = (_vehicle != player);
_bag = unitBackpack player;
_classbag = typeOf _bag;
_isWater = (surfaceIsWater (position player)) or dayz_isSwimming;
_hasAntiB = "ItemAntibiotic" in magazines player;
_hasFuelE20 = "ItemJerrycanEmpty" in magazines player;
_hasFuelE5 = "ItemFuelcanEmpty" in magazines player;
//boiled Water
_hasbottleitem = "ItemWaterbottle" in magazines player;
_hastinitem = false;
{
    if (_x in magazines player) then {
        _hastinitem = true;
    };
 
} forEach boil_tin_cans;
 
 
_hasKnife = "ItemKnife" in items player;
_hasMatches = "ItemMatchbox" in items player;
_hasToolbox = "ItemToolbox" in items player;
//_hasTent = "ItemTent" in items player;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_nearLight = nearestObject [player,"LitObject"];
_canPickLight = false;
 
if (!isNull _nearLight) then {
    if (_nearLight distance player < 4) then {
        _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
    };
};
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
 
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((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 "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;
};
//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;
    };

Sry 4 the second post.....but in the first one there are errors inside the code.
 
Auto refuel -

inside your mission folder edit your init.sqf

After

Code:
if (!isDedicated) then {

add

Code:
[] execVM "Scripts\kh_actions.sqf";

so it looks like this..
Code:
if (!isDedicated) then {[] execVM "Scripts\kh_actions.sqf";

Next create a folder inside your mission root called "Scripts" and place the file "kh_actions.sqf" and "kh_vehicle_refuel.sqf"

and your done.

kh_actions.sqf
Code:
private ["_vehicle", "_vehicle_refuel_id"];
//Awesomely Edited by Seven, Then modified by Muddr
_vehicle = objNull;
diag_log "Running ""kh_actions"".";
 
_distance = 15; // Distance from object to display Refuel Message
_amount= 0.02; // Amount of fuel to add per loop. Default was 0.005
 
while {true} do
{
    if (!isNull player) then {
        private ["_currentVehicle", "_isNearFeed", "_countFuel"];
                _currentVehicle = vehicle player;
                _countFuel = (count ((position _currentVehicle) nearObjects ["Land_Fuel_tank_big", _distance]));
                _countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_A_FuelStation_Feed", _distance]));
                _countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_Ind_TankSmall", _distance]));
                _countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_Ind_TankSmall2", _distance]));
                _countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_Ind_TankSmall2_EP1", _distance]));
                _countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_fuel_tank_stairs", _distance]));
                _isNearFeed = _countFuel > 0;
 
        if (_vehicle != _currentVehicle) then {
            if (!isNull _vehicle) then {
                _vehicle removeAction _vehicle_refuel_id;
                _vehicle = objNull;
            };
 
            if (_currentVehicle != player && _isNearFeed && !(_currentVehicle isKindof "Bicycle")) then {  //change "Bicycle" to "Land" to allow only air vehicles to aut-refuel
                _vehicle = _currentVehicle;
 
                _vehicle_refuel_id = _vehicle addAction ["Refuel", "Scripts\kh_vehicle_refuel.sqf", [_amount], -1, false, true, "", "vehicle _this == _target && local _target"];
            };
        };
 
        if (!_isNearFeed) then {
            _vehicle removeAction _vehicle_refuel_id;
            _vehicle = objNull;
        };
    };
    sleep 2;
}

kh_vehicle_refuel.sqf

Code:
private ["_target", "_caller", "_id"];
 
_target = _this select 0;
_caller = _this select 1;
_id = _this select 2;
_args = _this select 3;
_amount = _args select 0;
 
if (isNil "ib_refueling_in_progress") then { ib_refueling_in_progress = false; };
 
if (!ib_refueling_in_progress) then {
 
        ib_refueling_in_progress = true;
 
        titleText ["Refueling", "PLAIN DOWN", 3];
 
        while {(vehicle _caller == _target) and (local _target)} do {
                private ["_velocity", "_cfcust"];
 
                _velocity = velocity _target;
                _cfcust = fuel _target;
 
                if ((_velocity select 0 > 1) or (_velocity select 1 > 1) or (_velocity select 2 > 1)) exitWith {
                        titleText ["Refueling Stopped", "PLAIN DOWN", 3];
                };
                if (_cfcust >= 1.0) exitWith {
                        titleText ["Done Refueling", "PLAIN DOWN", 3];
                };
 
                sleep 0.5;
 
                _cfcust = _cfcust + _amount;
 
                if (_cfcust >= 1.0) then { _cfcust = 1.0; };
 
                _target setFuel _cfcust;
        };
 
        titleFadeOut 1;
 
        ib_refueling_in_progress = false;
};
works tooo gracias
 
To do deployable bikes on overwatch 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
http://pastebin.com/1cacH7Nh

bike2.sqf
http://pastebin.com/fvL0Ty4M

Pack it up and test it out, you need a toolbox to build the bike though.



hey hey,

dont work for me :/ try it under using your instruduction.

add the code in self actions in the dayz_code.pbo and add folder with both bike.sqf's in the chernarus aka mission.pbo - uploaded it, but i have no option as player to build a bike or repack a bike (toolbox was in toolbelt)...

hmm? :/



Edit:
AHHHHHHHHHHHH!

I have to add the compiles folder or selfaction.sqf from the dayz_code.pbo into the mission.pbo?!

all or only the .sqf? and if all, must i delete it then in the dayz_code.pbo? the point is, that the mission.pbo is very big than... not good

no other ways?
 
Back
Top