HustraDev Posted October 21, 2016 Share Posted October 21, 2016 Hi Guys ,,, Well i have this code that add tint on vehicle but i have problem with it i want The shader apply only for one specified car not all models like When player comes to the shop and wants he's infernus to get tint i want the script to only change the infernus texture not all textures i hope you get the idea my code , local shader = dxCreateShader("tint.fx", 1, 0, true) -- Create a shader local vehicle = getPedOccupiedVehicle ( source ) engineApplyShaderToWorldTexture(shader, "plm_glass", vehicle) -- i want The shader only Applys on [ texture ] for Vehicle Link to comment
Simple0x47 Posted October 21, 2016 Share Posted October 21, 2016 (edited) I think you're looking for this. function tintCar() -- Applies the shader for all the infernus local shader = dxCreateShader("tint.fx", 1, 0, true ) local vehicles = getElementsByType("vehicle") for i = 1, #vehicles do local v = vehicles[ i ] if ( getElementModel( v ) == 411 ) -- you can also add a comparation for just tinting for those infernus which are bought tinted engineApplyShaderToWorldTexture( shader, "plm_glass", v ) end end end addEventHandler( "onClientResourceStart", root, tintCar ) Edited October 21, 2016 by Simple01 Comment added 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now