To find the answer to your question, use the search or choose a category to read the related questions.
 
 
Advanced
 
 

Print this article    (2)
VehicleLock Example
This example was created for ArmaHolic by DarkXess. (Original Author: Demonized)

It is to show how simple "Script Snippets" or "Modules" etc are easy to set up for missions makers
by using and showing in the example form in which it was created.

How to use "VehicleLock Example"

To lock a Vehicle from anyone but you, start first by making the script called "vehiclelock.sqf"

And put this inside:

_vehicle = _this select 0; // i added this line.
_vehicle addEventHandler ["GetIn",
{
private ["_veh", "_pos", "_unit", "_namesArray"];
_veh = _this select 0;
_pos = _this select 1;
_unit = _this select 2;
_namesArray = ["yourname", "yourname2", "yourname3"];

if !(name _unit in _namesArray) then
{
_unit action ["Eject", vehicle _unit];
};
}];

Now, where you see "yourname" 2 and 3 .. this is where you put your ingame name or whoever
you want to allow to use vehicles with.

Put this the below code in the init box of the vehicle in which you want to lock:

_null = [vehiclename] execVM "vehiclelock.sqf";

And there you go! all done, now you can have a mission etc where noobs done come and take your ride :-)

VehicleLock Example
Back To Top
Updated: Sunday 10th of June 2012 10:06 AM,  Asked By: DarkXess,  viewed 3740 times