Jump to content

[Help]Tinted Car


HustraDev

Recommended Posts

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

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 by Simple01
Comment added
  • Like 1
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...