Arsilex Posted September 6, 2013 Share Posted September 6, 2013 Hello i have this code.. pShader = dxCreateShader( 'clothestex.fx' ) if( pShader ) then local pTexture = dxCreateTexture( 'bandgang3.png' ) if( pTexture ) then dxSetShaderValue( pShader, 'gTexture', pTexture ) outputDebugString("yes") engineApplyShaderToWorldTexture( pShader, 'cj_ped_glasses' ) end end // Variable to fetch the texture from the script texture gTexture; // My nice technique. Requires absolutely no tools, worries nor skills technique TexReplace { pass P0 { // Set the texture Texture[0] = gTexture; // LET THE MAGIC DO ITS MAGIC! } } but not remplace the clothe... I have something wrong? Link to comment
HunT Posted September 6, 2013 Share Posted September 6, 2013 Without debug how can help u? The function how work? Command or resource start or gui element? Anyway check the arguments about dxCreateShader :https://wiki.multitheftauto.com/wiki/DxCreateShader Link to comment
Arsilex Posted September 6, 2013 Author Share Posted September 6, 2013 In debug no errors. resource start Link to comment
HunT Posted September 6, 2013 Share Posted September 6, 2013 Client : function replaceClothes() local theShader = dxCreateShader( "material/effect.fx", 0, 0, true,"ped") local theTexture = dxCreateTexture( "material/trackytop1pro.png" ) dxSetShaderValue(theShader,"gTexture",theTexture) engineApplyShaderToWorldTexture(theShader,"cj_ped_torso") end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), replaceClothes) function resetClothes() if theShader then engineRemoveShaderFromWorldTexture ( theShader, "cj_ped_torso" ) end end addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()),resetClothes ) FX : texture gTexture; technique hello { pass P0 { Texture[0] = gTexture; } } Resource Example : http://www.mediafire.com/download/bhks2 ... lothes.zip ----------------------------- Resource Start replace the texture and resource stop restore the texture. Link to comment
Arsilex Posted September 6, 2013 Author Share Posted September 6, 2013 thx now work perfectly Link to comment
gamerxx Posted May 4, 2017 Share Posted May 4, 2017 (edited) if i want make this shader on texture > shirtbplaid what should i do ? here's cj_ped_torso < this is a class to cj torso clothes Edited May 4, 2017 by gamerxx Link to comment
pa3ck Posted May 5, 2017 Share Posted May 5, 2017 You can see that the example above is also for cj_ped_torso, all you have to do is change the texture name to yours and that should be it. 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