Jump to content
Sign in to follow this  
ben_sherman

[Help] Problems with unlocking vehicle in script.

Recommended Posts

Hey there,

I've trying to create a lock and unlock script triggered by pressing a key. So far I've got it to lock the vehicle but not unlocking them.

I can't really find the issue here but if anyone could help me I would be pleased.

_vcls = nearestobjects [getpos player, ["LandVehicle", "Air", "ship"], 7];
_vcl = _vcls select 0;

if(_vcl lock true) then {
_vcl setvehiclelock "DEFAULT";
_handled=true;
} else {
_vcl setvehiclelock "LOCKED";
_handled=true;
};

Thanks for all help!

Share this post


Link to post
Share on other sites

AFAIK Default lock equals "locked", atleast if you try placing a vehicle with default lock in editor. So that might be the issue here, although I'm not entirely sure.

Share this post


Link to post
Share on other sites

Thanks, well I got it to work after a while. But Some how if I lock one of the vehicles and go to an other to lock the one I locked before gets unlocked...

Don't really know how to fix it.

Btw, tack! (Thanks!)

Share this post


Link to post
Share on other sites

Lock:

Lock vehicle (disable mounting / dismounting) for player.

It doesn't return if the vehicle is unlocked or not.

You'd use

if (locked _vcl) then

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×