SpecT Posted July 21, 2016 Share Posted July 21, 2016 (edited) Hello people! I want to ask you a shader related question. Is it possible to set the rainbow skid marks shader just for car1? So in this case the other players will only see car1's rainbow skid marks but theirs will be the default ones. Thanks in advance! Edited July 25, 2016 by Guest Link to comment
Walid Posted July 21, 2016 Share Posted July 21, 2016 Hello people!I want to ask you a shader related question. Is it possible to set the rainbow skid marks shader just for car1? So in this case the other players will only see car1's rainbow skid marks but theirs will be the default ones. Thanks in advance! Yes it's Link to comment
SpecT Posted July 21, 2016 Author Share Posted July 21, 2016 Could you explain how ? I tried by applying it to the vehicle but it doesn't seem to work. Link to comment
Walid Posted July 21, 2016 Share Posted July 21, 2016 Could you explain how ?I tried by applying it to the vehicle but it doesn't seem to work. show me your code Link to comment
SpecT Posted July 21, 2016 Author Share Posted July 21, 2016 This is triggered from server (loop) to all the clients function handleSkidmarks(isEnabled) local vehicle = getPedOccupiedVehicle(getLocalPlayer()) myShader, tec = dxCreateShader ( "skidmark/skidmarks.fx" ) if isEnabled then engineApplyShaderToWorldTexture ( myShader, "particleskid", vehicle ) end selectPreset(4) end Link to comment
Walid Posted July 22, 2016 Share Posted July 22, 2016 Hello?BUMP Here is all what you need , it's just an example -- Server side if isPedInVehicle(thePlayer) then local vehicle = getPedOccupiedVehicle(thePlayer) local model = getElementModel(vehicle) if model == 533 then -- Feltzer triggerClientEvent( root,"eventName", root,vehicle) end end -- Client side function handleSkidmarks(vehicle) -- apply shader here end addEvent("eventName", true) addEventHandler("eventName", root,handleSkidmarks) Link to comment
SpecT Posted July 22, 2016 Author Share Posted July 22, 2016 That's what I have done. The problem is the applying of the shader. It doesn't seem to get applied to my vehicle's skid marks (and it should). I tried with debugging methods but everything is working just fine but the engineApplyShaderToWorldTexture won't apply it if I put the vehicle in the function arguments. Maybe the skid marks aren't connected with the vehicle... So what should I do now ? Link to comment
Walid Posted July 23, 2016 Share Posted July 23, 2016 That's what I have done.The problem is the applying of the shader. It doesn't seem to get applied to my vehicle's skid marks (and it should). I tried with debugging methods but everything is working just fine but the engineApplyShaderToWorldTexture won't apply it if I put the vehicle in the function arguments. Maybe the skid marks aren't connected with the vehicle... So what should I do now ? BUMPAny advices ? Show me full code. Link to comment
SpecT Posted July 23, 2016 Author Share Posted July 23, 2016 - Server side: function onEnableSkidmarks() local specialVehicle = nil for i,player in pairs(getElementsByType("player")) do if isPlayerLogged(player) and isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) local skidEnabled = getPlayerData(player,"skidmarksEnabled") if skidEnabled == true then specialVehicle = vehicle end end end if specialVehicle then triggerClientEvent( root,"handleSkidmarks", root,specialVehicle) end end - Client side: function handleSkidmarks(vehicle) local myShader, tec = dxCreateShader ( "data/shader/skidmark/skidmarks.fx" ) if vehicle then engineApplyShaderToWorldTexture ( myShader, "particleskid", vehicle) outputChatBox("Applying...") selectPreset(4) end end addEvent("handleSkidmarks",true) addEventHandler("handleSkidmarks",root,handleSkidmarks) Link to comment
SpecT Posted July 23, 2016 Author Share Posted July 23, 2016 What do you think, @Walid ? Link to comment
Walid Posted July 23, 2016 Share Posted July 23, 2016 What do you think, @Walid ? Sorry for the late reply i'm busy, As i can see you are using ccw resource (Skid marks) , ask him if it's possible to apply the shader only for one car. already create something like that before. Link to comment
SpecT Posted July 25, 2016 Author Share Posted July 25, 2016 I wrote him and the answer is NO. CCW: "GTA skidmarks are global" Admins, feel free to close this topic! 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