Jump to content

Mods


TheSmart

Recommended Posts

TheSmart - most of the ped models have only 1 texture, also You might replace textures per entity (eg. localPlayer, or any other player, ped)

client.lua

  
local texture = dxCreateTexture("textrue.png",dxt1) 
local shader = dxCreateShader("replace.fx",0,0,false,"ped") 
dxSetShaderValue(shader,"sTexreplace",texture) 
engineApplyShaderToWorldTexture(shader,"*",localPlayer) 
  

replace.fx

  
texture sTexreplace; 
  
technique replaceTexture 
{ 
 pass P0 
 { 
  Texture[0] = sTexreplace; 
 } 
} 
  

Link to comment

that should work? but it not working no error in debugscript 3

function applyShader ( ) 
    local shader = dxCreateShader ( "shader.fx" ); -- creating shader 
    local texture = dxCreateTexture ( "test.png" ); -- creating texture from image 
    if ( shader and texture ) then -- checking if everything is okay 
        dxSetShaderValue ( shader, "Tex0", texture ); -- applying texture to shader 
        
        setElementModel ( localPlayer, 1 ); -- setting skin to player 
        engineApplyShaderToWorldTexture ( shader, "*", localPlayer ); -- applying shader  for player who used command 
    end 
end 
addCommandHandler ( "shader", applyShader ); -- creating command /shader to applyShader function. 

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...