diff --git a/addons/dogtags/functions/fnc_getDogtagData.sqf b/addons/dogtags/functions/fnc_getDogtagData.sqf index 68cc4a2bc4..5d813b2046 100644 --- a/addons/dogtags/functions/fnc_getDogtagData.sqf +++ b/addons/dogtags/functions/fnc_getDogtagData.sqf @@ -19,13 +19,24 @@ private _dogTagData = _target getVariable QGVAR(dogtagData); if (!isNil "_dogTagData") exitWith {_dogTagData}; // Create dog tag data once for the unit: nickname, code (eg. 135-13-900) and blood type +private ["_bloodTypeIndex", "_code"]; +//hint getplayeruid _target; +if ((typename getplayeruid _target) == "SCALAR") then { + _bloodTypeIndex = (getplayeruid _target) mod 8; + _code = (str getplayeruid _target) select [0, 3] + "-" + + (str getplayeruid _target) select [3, 2] + "-" + + (str getplayeruid _target) select [5, 3]; +} else { + _bloodTypeIndex = floor random 8; + _code = str(floor random 9) + str(floor random 9) + str(floor random 9) + "-" + + str(floor random 9) + str(floor random 9) + "-" + + str(floor random 9) + str(floor random 9) + str(floor random 9); +}; private _dogTagData = [ [_target, false, true] call EFUNC(common,getName), - str(floor random 9) + str(floor random 9) + str(floor random 9) + "-" + - str(floor random 9) + str(floor random 9) + "-" + - str(floor random 9) + str(floor random 9) + str(floor random 9), - selectRandom ["O POS", "O NEG", "A POS", "A NEG", "B POS", "B NEG", - "AB POS", "AB NEG"] + _code, + ["O POS", "O NEG", "A POS", "A NEG", "B POS", "B NEG", + "AB POS", "AB NEG"] select _bloodTypeIndex ]; // Store it _target setVariable [QGVAR(dogtagData), _dogTagData, true];