fn_getUnitPositionId

This commit is contained in:
Wyqer 2019-12-07 11:08:47 +01:00
parent 0407c62377
commit fd215c17fa
No known key found for this signature in database
GPG Key ID: D7E2F8BD7F1E48FA
1 changed files with 12 additions and 9 deletions

View File

@ -2,25 +2,28 @@
File: fn_getUnitPositionId.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2019-12-03
Last Update: 2019-12-03
Last Update: 2019-12-07
License: MIT License - http://www.opensource.org/licenses/MIT
Description:
No description added yet.
Gets the position ID of given unit with vehicleVarName bypassing.
Parameter(s):
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
_unit - Unit to get the position ID from [OBJECT, defaults to objNull]
Returns:
Function reached the end [BOOL]
Position ID [NUMBER]
*/
// TODO
params [ "_unit" ];
private ["_vvn", "_str"];
_vvn = vehicleVarName _unit;
params [
["_unit", objNull, [objNull]]
];
if (isNull _unit) exitWith {["Null object given"] call BIS_fnc_error; -1};
private _vvn = vehicleVarName _unit;
_unit setVehicleVarName "";
_str = str _unit;
private _str = str _unit;
_unit setVehicleVarName _vvn;
parseNumber (_str select [(_str find ":") + 1])