[Release] Mission vehicles warning + Bicycle handbrake

Sandbird

Valued Member!
Mission vehicles warning + Bicycle handbrake
This little tweak does 2 things that i think are useful for any server that has the Deploy bike script, Missions and Mountains :p
Got the idea when i was looting a barrack, and on the back wall, there was a body next to a bike, under a big mountain, lol. He obviously couldn't slow down and ended up crashing there.

So what this script does in short is:
- It Informs the players that the vehicle they entered will not be saved on the map if its a Mission vehicle, so they know not to horde it at their base with the rest of their vehicles.
- (Optional) Checks if a player is on a bike (mountain bike in this case) and allow him to handbrake when his speed is over 20.

From 120 m/h i went to 0 in 2 seconds.
Both messages are shown on side chat...as a system message.

Now why did i add both scripts under the same script ? To save me an extra while loop...You can separate them if you want.

Setup
  1. Download the files and put them in your mission file inside folder \custom Click Here
  2. Open your init.sqf
    At the bottom add:
    Code:
    _null = [] execVM "custom\sanddzai.sqf";

  3. Open both files with an editor. There are 2 things you have to change here according to your mission files.
    I use DZAI variable for my mission spawned vehicles, so i have:
    Code:
    _vehicleDZAI = vehicle player getVariable ["DZAI",0];
    If your mission spawned vehicles have a different value (like Mission, or Sarge), then replace my "DZAI" with your value.

    Also i use the MMT_Civ bike model when i Deploy a bike. If you are using the Old_bike_TK_CIV_EP1 or whatever, then replace the "MMT_Civ" values with your classname, in both files!

  4. If you dont want the handbreak option, then delete this from sanddzai.sqf
    Code:
    if (_inVehicle and (typeOf(_vehicle) == "MMT_Civ")) then {
        _null = [_vehicle] execVM "custom\sandbreak.sqf";
    };
Troubleshooting

If your Mission vehicles dont have that extra variable on them (DZAI), then the script wont recognize them as mission vehicles and show the message to the players. What you have to do is open your mission files in your dayz_server folder and find where it creates Vehicles for the missions.
It should look something like:

Code:
_veh  = createVehicle [_vehclass,_position, [], 0, "CAN_COLLIDE"];
All you have to do is under that line add:
Code:
_veh setVariable ["DZAI",1,true];
Notice the 1 doesnt have " " like DZAI has.
This is how i check for mission vehicles. If you have quotes (like "1"), then you have to do the same with my files as well and add the extra quotes when i do, getVariable DZAI !!!!!!!

Thats it...enjoy
http://opendayz.net/threads/support-mission-vehicles-warning-bicycle-handbrake.21257/
 
Last edited:
Back
Top