The.Pheonix Posted June 5, 2016 Share Posted June 5, 2016 yo guys i am noob and can someone tell me what wrong is with this script ? local picSize = Vector2(2, 5) -- scale the projected image local picPos = Vector2(0, -0.08) -- set image center position local picBright = false -- some vehicle do not have specular hightlighting (ie uranus) in this case set to 'true' local mask = true -- mask vertices with position lower than element position z component local maskHeight = -0.1 -- z position offset local texAddress = 4 -- wrap or mirror for repeated, border for a single one local enableDirt = true local enableEnv = true addEventHandler("onClientResourceStart", getRootElement(), function() if getVersion ().sortable < "1.4.0" then outputChatBox( "Resource is not compatible with this client." ) return end for k, v in ipairs ( getElementsByType ( "vehicle" )) do if getElementData(v, "vehicle.locked") then if getElementData(v, "vehicle.lockedto") == "Phoenix's Legion" then shader, tec = DxShader("proj_paint_flat.fx", 0, 70, false, "vehicle") local texture = DxTexture("p.png", "dxt3") shader:setValue("gTextureColor", texture) shader:setValue("sPicSize", picSize.x, picSize.y) shader:setValue("sPicPos", picPos.x, picPos.y) shader:setValue("sPicBright", picBright) shader:setValue("sTexAddress", texAddress) shader:setValue("sMask", mask) shader:setValue("sMaskHeight", maskHeight) shader:setValue("sEnableDirt", enableDirt) shader:setValue("sEnableEnv", enableEnv) shader:applyToWorldTexture("vehiclegrunge256", v) -- Apply shader shader:applyToWorldTexture("?emap*", v) -- Apply shader local pos = v:getPosition() local elFw = v.matrix:getForward() local elUp = v.matrix:getUp() shader:setValue('elementFwVector', elFw.x, elFw.y, elFw.z) shader:setValue('elementUpVector', elUp.x, elUp.y, elUp.z) shader:setValue('elementPosition', pos.x, pos.y, pos.z) end end end end ) everything is almost fine, after movieng vehicle logo dont movies with vehicle (if u still dont understand logo is not attached to vehicle) Link to comment
HunT Posted June 5, 2016 Share Posted June 5, 2016 Why u no edit the .dff ? Edit the .dff probably dont cause lag Link to comment
The.Pheonix Posted June 5, 2016 Author Share Posted June 5, 2016 Why u no edit the .dff ?Edit the .dff probably dont cause lag i want add logos for gang cars. if i will add in TXD player most donwload too much because its RPG server and there will be many gangs. Link to comment
HunT Posted June 5, 2016 Share Posted June 5, 2016 But after edit the .dff u can use engineApplyShaderToWorldTexture for change the logo. Some cars with different logos. If u want i can edit the .dff but i need info about vehicle id and where u want put the logo. Link to comment
Ren_712 Posted June 6, 2016 Share Posted June 6, 2016 You have to update elementPosition, elementFwVector and elementUpVector onClientPreRender. Just like in the original projected_paint script. Link to comment
The.Pheonix Posted June 6, 2016 Author Share Posted June 6, 2016 You have to update elementPosition, elementFwVector and elementUpVector onClientPreRender. Just like in the original projected_paint script. then sometimes i getting error "with this function already handled" Link to comment
The.Pheonix Posted June 6, 2016 Author Share Posted June 6, 2016 But after edit the .dff u can use engineApplyShaderToWorldTexture for change the logo. Some cars with different logos.If u want i can edit the .dff but i need info about vehicle id and where u want put the logo. i have around 30 mods and i am going add more cars too and edit so much dff ? I think this way will be much easyer Link to comment
HunT Posted June 6, 2016 Share Posted June 6, 2016 Well if u need put the logo on 30 vehicles maybe is better u idea, hope no lag . Link to comment
Ren_712 Posted June 7, 2016 Share Posted June 7, 2016 You have to pick the vehicle matrix and get position and the 2 vectors. No need for the rest. That's why you are getting the "with this function already handled" error. Update the values mentioned onClientPreRender event. Link to comment
The.Pheonix Posted June 7, 2016 Author Share Posted June 7, 2016 You have to pick the vehicle matrix and get position and the 2 vectors. No need for the rest. That's why you are getting the "with this function already handled" error. Update the values mentioned onClientPreRender event. can u give me example how to do correct ? 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