forked from igorkis-scrts/A3-Antistasi-Plus
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd353e4
commit 443c7e8
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
Author: | ||
Silence | ||
Description: | ||
Locks or unlocks _vehicle with _state | ||
Params: | ||
_vehicle <OBJECT> <Default: ObjNull> | ||
_state <BOOL> <Default: false> | ||
Usage: | ||
[cursorObject, true] call A3U_fnc_setLock; | ||
Return: | ||
true if successful <BOOL> | ||
*/ | ||
|
||
params [ | ||
["_vehicle", ObjNull], | ||
["_state", false] | ||
]; | ||
|
||
if (_vehicle isEqualTo ObjNull || {isNil "_vehicle"}) exitWith {false}; | ||
|
||
_vehicle lock _state; | ||
|
||
[format["%1 has been locked. State: %2", typeOf _vehicle, _state], _fnc_scriptName] call A3U_fnc_log; | ||
|
||
true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
params [ | ||
["_vehicle", ObjNull] | ||
]; | ||
|
||
if (_vehicle isEqualTo ObjNull || {isNil "_vehicle"}) exitWith {false}; | ||
|
||
switch (locked _vehicle) do | ||
{ | ||
case 0: | ||
{ | ||
[_vehicle, true] call A3U_fnc_setLock; | ||
}; | ||
case 1; | ||
case 2; | ||
case 3: | ||
{ | ||
[_vehicle, false] call A3U_fnc_setLock; | ||
}; | ||
default | ||
{ | ||
diag_log format["Vehicle %1 lock state was not recognized. Perhaps it is null?", typeOf _vehicle]; | ||
}; | ||
}; | ||
|
||
true; |