Jump to content
Sign in to follow this  
gossamersolid

Toggle Lock script won't allow re-locking

Recommended Posts

_vehicle = _this select 0;
_act = _this select 2;

_lock = true;
_label = Localize "STR_WF_Unlock";
if (_vehicle isKindOf "UAV") then {
_lock = true;_label = Localize "STR_WF_Unlock";
}
else {_lock = false;_label = Localize "STR_WF_Lock";
};

[_vehicle,_lock] Call CLTFNCSetVehicleLock;

_vehicle removeAction _act;
_act = _vehicle AddAction [_label,"Client\Action\Action_ToggleLock.sqf"];

What my goal was is for UAVs to remain locked no matter what. Currently what happens is that the UAVs cannot be unlocked (which is good).

The problem comes when somebody unlocks any other type of vehicle. It unlocks it, but when they press lock on it again, it doesn't re-lock.

If anybody could help, it would be much appreciated.

Share this post


Link to post
Share on other sites

_lock actually works? Unless I'm missing something important from having just woke up... this is basically what you're saying:

if (_vehicle isKindOf "UAV") then {
[b]true = true[/b];_label = Localize "STR_WF_Unlock";
}
else {[b]true = false[/b];_label = Localize "STR_WF_Lock";
};

Share this post


Link to post
Share on other sites

EDIT: Fixed!

was missing a brace!

Edited by GossamerS

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  

×