Jump to content
  • 0

Deploy Bike Script Problem


Ryjalon

Question

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. ; )

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

First off download this: http://www.speedyshare.com/qXu6J/download/spawnbike.rar

 

Place both folders in root directory of mission.pbo

 

 

Then go to fn_selfactions.sqf and add this:

//---------------PACK BIKE---------------
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;
};
//-----------------END--------------------

Then Add this into description.ext at the very bottom:

#include "Addons\RightClick\extra_rc.hpp"

This will add a right click option onto the toolbox. Try this, if no luck me know. its been ages since ive messed with bikes.

Link to comment
Share on other sites

  • 0

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?

Link to comment
Share on other sites

  • 0

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?

Updating battleye filters is really not hard to do when you get the hang of it.  I will try to explain.

 

Step 1:

When you get your mod installed/working get on the server and try it!  Deploy your bike and if you get kicked by battleye simply write down the code it gives you.  Example 1: "Kicked by BattlEye Script Restriction #0.  Example 2: Kicked by BattlEye SetPos Restriction #1.

 

The important Bits are what kind of kick (SetPos/Script/PublicVariable/etc)  and the # number.

 

Step2:  open battleye folder.  find the corresponding Log file and open it up.  (example:  Scripts.Log, SetPos.Log).  Also open the Corresponding Text File (example: Scripts.txt, SetPos.txt)

 

In the log you should see something like this:

05.06.2014 19:49:08: Brockie (192.168.1.200:2316) ggg8b8014611e8af66620926b333dp69 - #0 "; _dummy = [_this,"players"] execVM "\ca\ui\scripts\dedicatedServerInterface.sqf";"

You can see the date, time, player name, IP, guid, and the script #number and then beside all that in quotations the part of the script that battleye didn't like.  In my example I was kicked by battleye for trying to access the ingame Server Control Panel Interface.  Copy from your log the script in quotations that is giving you problems for the next step.

 

Step 3:

 

In the corresponding .txt file you will be adding an exception to the filters.  This is where the #number is handy.  The number should tell you approximately at what line you need to add your new code. So if it says #0 it would mean you need to add the code to the first line in the .txt file.  Remember to skip the Line that says //New.

 

To add the code go to the end of the line and put one space followed by != followed by pasting the code from step 2 WITH QUOTATIONS

Example:

//new
5 "dedicatedServerInterface" !="; _dummy = [_this,"players"] execVM "\ca\ui\scripts\dedicatedServerInterface.sqf";"

the number 5 means to log and kick a player if it sees this line happen.  Our != means to allow a specific action.

 

So if you get kicked for making a bike, it will look a little different but hopefully you get the idea.

 

Sometimes it might be a little more difficult to find the line that you need to add your code but as you can see from my example, it should usually be pretty obvious.

Link to comment
Share on other sites

  • 0

Ryjalon - Are you running Antihack from InfiStar?

If so, you cannot see the menu to deploy your bike, cause you most likely have not yet set the allowed CMDMenus to include "#USER:DamiSpawn".

The original script you posted involves answering questions in the command menu, which will be blocked by default by the antihack, unless told to ignore it.

Link to comment
Share on other sites

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
  • Discord

×
×
  • Create New...