Results 1 to 3 of 3

Thread: Toggle Lock script won't allow re-locking

  1. #1
    Second Lieutenant GossamerSolid's Avatar
    Join Date
    Feb 3 2006
    Location
    Ontario, Canada
    Posts
    4,009

    Toggle Lock script won't allow re-locking

    Code:
    _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.

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

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

  3. #3
    Second Lieutenant GossamerSolid's Avatar
    Join Date
    Feb 3 2006
    Location
    Ontario, Canada
    Posts
    4,009
    Author of the Thread
    EDIT: Fixed!

    was missing a brace!
    Last edited by GossamerSolid; Oct 5 2009 at 00:12.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •