Created
July 4, 2016 18:33
-
-
Save commy2/e93c9608dc05d905789987ec48c7c347 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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