Jump to content
  • 0

Pack bike does not work


Proximus

Question

Hey All

 

Since the Deploy Anything Script had a bugged bike, i'm trying to find a way around it to deploy and pack a bike.

 

Already can deploy the bike and ride it (without dying :P )

 

But the pack part isn't working.

When i get off the bike and look at it, i get the scroll option to pack it, but when i click it, nothing happends :(

 

I get no RPT error, just doesn't do anything.

 

Here is the part i added at the bottom of my custom fn_selfaction:

//PACK BIKE
_weapons = [currentWeapon player] + (weapons player) + (magazines player);
_isBike = typeOf cursorTarget in ["Old_bike_TK_INS_EP1"];


if((_isBike && (player distance cursorTarget < 5)) and _canDo) then {
if (s_player_deploybike2 < 0) then {
s_player_deploybike2 = player addaction[("<t color=""#33b5e5"">" + ("Re-Pack Bike") +"</t>"),"Scripts\Deploy\overwrites\click_actions\examples\packbike.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike2;
s_player_deploybike2 = -1;
};

 

And this is what my packbike.sqf looks like:

if (false) then { 
// player is in combat and cant pack his bike
    cutText [format["You are in combat and cannot re-pack your bike."], "PLAIN DOWN"];
} else {
if (typeOf cursorTarget == "Old_bike_TK_INS_EP1") then {
// player is looking at a bike and the target has a bike classname
// delete it first to avoid player changing to another target
deletevehicle cursorTarget; 
player removeAction s_player_deploybike2;
player playActionNow "Medic";
r_interrupt = false; 
        player addWeapon "ItemToolbox
_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 materials"], "PLAIN DOWN"];
r_interrupt = false;
player switchMove "";
player playActionNow "stop";
} else {
// player is not looking at a bike, or target does not have a bike classname
cutText [format["You have to be facing your bike to re-pack it!"], "PLAIN DOWN"];
};
};

 

What am i doing wrong?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...