{"name":"lock","operator":null,"title":"lock","type":"command","url":"https://community.bistudio.com/wiki/lock","revid":353298,"updated":"2024-03-15T17:11:43Z","groups":["Object Manipulation"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"global","server_exec":false},"exec":null,"description":"Lock vehicle (disable mounting / dismounting) for player.\nThis command will remove user get in/get out actions but will not stop player getting into or out of vehicle via script commands (e.g moveInCargo).\n\n> [!NOTE]\n> Alternative syntax is similar to setVehicleLock but with numbers.","syntaxes":[{"syntax":"vehicleName lock locked","since":null,"effect":null,"exec":null,"params":[{"name":"vehicleName","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"vehicleName: Object"},{"name":"locked","type":"Boolean","optional":false,"default":null,"description":"true to lock, false to unlock","types":["Boolean"],"since":null,"text":"locked: Boolean - true to lock, false to unlock"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"vehicleName","types":["Object"]},"right":{"text":"locked","types":["Boolean"]}},{"syntax":"vehicleName lock lockstate","since":"arma3 0.50","effect":null,"exec":null,"params":[{"name":"vehicleName","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"vehicleName: Object"},{"name":"lockstate","type":"Number","optional":false,"default":null,"description":"can be one of the following:\n\n0 - Unlocked\n\n1 - Default (player subordinate cannot enter until his leader says so)\n\n2 - Locked\n\n3 - Locked for player","types":["Number"],"since":null,"text":"lockstate: Number - can be one of the following:\n\n0 - Unlocked\n\n1 - Default (player subordinate cannot enter until his leader says so)\n\n2 - Locked\n\n3 - Locked for player"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"vehicleName","types":["Object"]},"right":{"text":"lockstate","types":["Number"]}}],"examples":[{"text":"```sqf\n_jeepOne lock true;\n```","code":["_jeepOne lock true;"]},{"text":"```sqf\nheli lock true;\nlocked heli; // 2\n\nheli lock false;\nlocked heli; // 0\n\nheli lock 1;\nlocked heli; // 1\n```","code":["heli lock true;\nlocked heli; // 2\n\nheli lock false;\nlocked heli; // 0\n\nheli lock 1;\nlocked heli; // 1"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["locked","setVehicleLock","lockDriver","lockCargo","lockTurret"],"notes":[{"user":"Tankbuster","date":"2010-01-09T22:48:00Z","text":"Lock prevents AI persons mounting or dismounting vehicles when ordered to do so and players are prevented from doing both too, but AI will still dismount when a vehicle is damaged."},{"user":"cali","date":"2010-09-22T04:56:00Z","text":"If an AI group (e.g Mechanized Infantry) has its vehicle locked with its crew in it, it will mount or dismount it anyway. But a player in this group won't be able to enter the vehicle."}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Introduced with Operation Flashpoint version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Scripting Commands: Global Effect","Take On Helicopters: Scripting Commands"]}