Jump to content

Help me please


Annas

Recommended Posts

How to get an object Texture Name , so i can use "engineApplyShaderToWorldTexture" without writting the texture name , i tried this but it's not working..

    local LogiC_gate = createObject ( 980, 0, 0, 0, 0, 0, 0 ) -- FAKE ID's 
    applyCustomTextures( LogiC_gate, "testing") 
  
function applyCustomTextures(object, texture) 
        local shaderElement = dxCreateShader ( "shader.fx", 0, 0, false, "object" ) 
        texture = dxCreateTexture( "textures/"..texture..".png" ) 
        dxSetShaderValue( shaderElement, "Tex0", texture) 
        texturename = engineGetModelTextureNames(object) 
--- THIS  
        engineApplyShaderToWorldTexture( shaderElement, texturename, object) 
end 

Link to comment
addEventHandler( "onClientElementStreamIn", getRootElement( ), 
    function ( ) 
        if getElementType( source ) == "object" then 
            applyCustomTextures( source, "testing") 
            --[b]edited take it again..[/b] 
        end 
    end 
); 

Link to comment

I wont start a new topic as im talking about the same subject..

I would like to make this , on player quit , save the EngineApplyShaderToWorldTexture ..

The Problem:

1- change the texture

2- All able to see that object with that texture

3- i'll Quit/left the game

4- login again

8- I wont see the object with the New texture that i made before i reconnect

9- But others (who didnt reconnect) able to see the object with new texture shader.

(So when a player reconnect, the new texture will lost, so i should applyShaderToWorldTexture again ..)

(I need it when a player Reconnect, it been saved, so when he quit & join again he will see the New texture that i made)

Wish you understand my bad english :?

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