Advertisement
KiloSwiss

camoTexture.sqf

Jan 21st, 2023 (edited)
2,066
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 0.98 KB | Gaming | 0 0
  1. span class="re5"> params [["_veh", objNull, [objNull]]];
  2.  
  3. if (isNull _veh) exitWith {};
  4. if !(_veh isKindOf "LandVehicle") exitWith {};
  5.  
  6. getRoadInfo roadAt _veh params ["", "", "", "_roadTexture", "", "", "", "", "_isBridge"];
  7.  
  8. if (_isBridge) exitWith {};
  9.  
  10. if (isNil {_veh getVariable "CAMO_defaultTextures"}) then {
  11.     _veh setVariable ["CAMO_defaultTextures", getArray(configfile >> "CfgVehicles" >> typeOf _veh >> "hiddenSelectionsTextures")];
  12. };
  13.  
  14. private _newTextures = _veh getVariable ["CAMO_defaultTextures", ["#(rgb,8,8,3)color(1,0,0,1)"]];
  15.  
  16. if (
  17.     _roadTexture == "" ||
  18.     {"beton.paa" in toLower _roadTexture} ||
  19.     {"surf_roadconcrete_co.paa" in toLower _roadTexture}
  20. ) then {
  21.     _roadTexture = surfaceTexture getPosATL _veh;
  22. };
  23.  
  24. if (_roadTexture != "") then {
  25.     _newTextures = _newTextures apply {_roadTexture};
  26. };
  27.  
  28. // Only apply textures if they changed
  29. if (_newTextures isNotEqualTo getObjectTextures _veh) then {
  30.     { _veh setObjectTextureGlobal [_forEachIndex, _x] } forEach _newTextures;
  31. };
Tags: Arma3 SQF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement