Skip to content

Instantly share code, notes, and snippets.

@commy2
Created July 4, 2016 18:33
Show Gist options
  • Save commy2/e93c9608dc05d905789987ec48c7c347 to your computer and use it in GitHub Desktop.
Save commy2/e93c9608dc05d905789987ec48c7c347 to your computer and use it in GitHub Desktop.
//init.sqf
My_fnc_addCustomUniform = {
params [["_unit", objNull, [objNull]], ["_uniform", "", [""]], ["_texture", "", [""]]];
_unit addUniform _uniform;
if (_texture != "") then {
_unit setObjectTextureGlobal [0, _texture];
(uniformContainer _unit) setVariable ["custom_texture", _texture, true];
};
};
0 spawn {
waitUntil {!isNull player};
player addEventHandler ["Take", {
params ["_unit"];
private _texture = (uniformContainer _unit) getVariable ["custom_texture", ""];
if (_texture != "") then {
_unit setObjectTextureGlobal [0, _texture];
};
}];
};
//Replace all `addUniform` with:
[player, "U_B_CombatUniform_mcam", "#(rgb,8,8,3)color(1,0,0,1)"] call My_fnc_addCustomUniform;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment