Home   Help Search Login Register  

Author Topic: A Quick Question regarding Locking Vehciles  (Read 1449 times)

0 Members and 1 Guest are viewing this topic.

Offline lee

  • Members
  • *
A Quick Question regarding Locking Vehciles
« on: 21 Dec 2008, 18:07:12 »
Hi troops this is my first post on the forum so it's bit of a biggy. First off i have very little to nil knowledge of Scripting, just to give u a heads up first lol. So what a friend and myslef have done have created a 24 town evolution fixed all the wee niggly bugs.
However what we want to do is Lock certain Vehicles to specific classes ie only pilots which we have added can only fly Harriers/A10's/Cobras and FFAR LB's. So that ie Standard Troops cant just jump in a Cobra and bugger of with it. What were trying to reinforce on our server is Team work, so the best way is to lock of specific vehicles to specific classes, and so far no one has gave me a idiot proof explanation me being the idiot.
So any help would be very very very appreciated :D

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: A Quick Question regarding Locking Vehciles
« Reply #1 on: 21 Dec 2008, 18:43:30 »
A long long time ago there was this team named Ballistic Addons Studio that modded OFP to new heights...

Now they are not too active, but they continue to bring us some goodie every now and then...sooo:

Ballistic Addons Studio presents...BAS f!!! :clap: :good:

Considering you're quite new, I'd suggest looking at that. It contains lots of goodies, and you'll probably learn a lot by using it...and guess what, they have EXACTLY what you're looking for ;)

Offline lee

  • Members
  • *
Re: A Quick Question regarding Locking Vehciles
« Reply #2 on: 21 Dec 2008, 19:45:09 »
Yup i have it but i really dont have the know how, in how to use it kinda way over my head :no: So if theres any scripting whizzes out there who would be willinn gto helpa  total noob for an hour or two i would very happy cause im at the pulling my hair out stage :scratch:
« Last Edit: 22 Dec 2008, 13:36:10 by lee »

Offline Blacknite

  • Members
  • *
  • Chiefs runs the navy!
Re: A Quick Question regarding Locking Vehciles
« Reply #3 on: 22 Dec 2008, 19:34:29 »
You can also use the codepad:  http://www.ofpec.com/ed_depot/index.php?action=details&id=539&game=ArmA

Whoever knows the code can unlock the vehicles.

Offline lee

  • Members
  • *
Re: A Quick Question regarding Locking Vehciles
« Reply #4 on: 22 Dec 2008, 22:54:53 »
Might be worth a bash asthe BAS -f isnt really designed to work with already existing missions/maps its more aimed at folsk starting from scratch hence why some of the info is well confusing to say the least.

Offline Odin

  • Members
  • *
Re: A Quick Question regarding Locking Vehciles
« Reply #5 on: 24 Dec 2008, 02:11:23 »
What about use a getIn EventHandler, add this to the init of vehicle's in question.

Code: [Select]
this addeventhandler ["getin", {_this execVM "pilotcheck.sqf"}];
pilotcheck.sqf

Code: [Select]
_vehicle = _this select 0;
_position = _this select 1;
_unit = _this select 2;
if (not(_position == "driver")) exitWith {hint "you are a passenger";};

if(_unit iskindOf "SoldierWPilot") then
{
Hint "you are the pilot";
}
else
{
hint "you are not a Pilot, get out";
unassignVehicle _unit;
[_unit] orderGetIn false;
_unit action ["EJECT", _vehicle];
};

I hope that helps

Odin