mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Attempt on making blood type and service number unique for players
This commit is contained in:
parent
6df82aad55
commit
88cf6aad98
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user