mirror of
https://github.com/valmojr/armatak.git
synced 2026-08-20 00:42:56 +00:00
added function to handle names for vehicles
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
params ["_fullName"];
|
||||
|
||||
private _nameParts = _fullName splitString " ";
|
||||
private _nameCount = count _nameParts;
|
||||
|
||||
if (_nameCount == 1) then {
|
||||
_fullName
|
||||
} else {
|
||||
private _firstName = _nameParts select 0;
|
||||
private _lastName = _nameParts select (_nameCount - 1);
|
||||
|
||||
if ((count _lastName) >= 7) then {
|
||||
_lastName
|
||||
} else {
|
||||
format ["%1 %2", _firstName select [0, 1], _lastName]
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user