Advertisement
Guest User

Untitled

a guest
Jan 15th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.52 KB | None | 0 0
  1. private ["_car"];
  2. _car = param [0, objNull, [objNull]];
  3. _skipRandomization = ({(typeOf _car isEqualTo _x) || (typeOf _car isKindOf _x) || (format ["%1", _car] isEqualTo _x)} count (getArray(missionConfigfile >> "disableRandomization")) > 0 || (_car getVariable ["BIS_enableRandomization", true]));
  4.  
  5. if !(local _car) exitWith {false};
  6. if !(_skipRandomization) exitWith {false};
  7.  
  8. _license = param [1, "", [""]];
  9. _license = toLower(_license);
  10.  
  11.  
  12. _licenseAlphaArray      = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];
  13. _licenseNumericArray    = ["0","1","2","3","4","5","6","7","8","9"];
  14. _licenseSelections      = [20,21,22,23,24,25,26];
  15.  
  16. if (_license == "") then
  17. {
  18.     {
  19.         _licenseRandom = _licenseAlphaArray;
  20.         if (_x > 6) then { _licenseRandom = _licenseNumericArray; };
  21.        
  22.         _licenseRandom = _licenseRandom call BIS_fnc_selectRandom;
  23.         _car setObjectTextureGlobal [_x, format["d3s_cars_core\license\%1.paa", _licenseRandom]];
  24.        
  25.         _license = _license + _licenseRandom;
  26.     } forEach _licenseSelections;
  27. } else {
  28.     _licenseArr = _license splitString "";
  29.     _licenseArr resize 7;
  30.     {
  31.         _licenseChar = _licenseArr select _forEachIndex;
  32.         if(isNil{_licenseChar}) then { _licenseChar = ""; };
  33.        
  34.         if (_licenseChar IN _licenseAlphaArray OR _licenseChar IN _licenseNumericArray) then
  35.         {
  36.             _car setObjectTextureGlobal [_x, format["d3s_cars_core\license\%1.paa", _licenseChar]];
  37.         } else {
  38.             _car setObjectTextureGlobal [_x, ""];
  39.         };
  40.     } forEach _licenseSelections;
  41. };
  42.  
  43. true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement