Jump to content

help


WASSIm.

Recommended Posts

hi guys

plis help idk what problem

CLIENT

        function skinstaffoff ( ) 
        local skin1 = dxCreateTexture ( "images/wfyclotoff.jpg", "dxt5" ) 
        local skin2 = dxCreateTexture ( "images/wmyclotoff.jpg", "dxt5" ) 
        local shader1 = dxCreateShader ( "texture.fx" ) 
        local shader2 = dxCreateShader ( "texture.fx" ) 
        dxSetShaderValue ( shader1, "gTexture", skin1 ) 
        dxSetShaderValue ( shader2, "gTexture", skin2 ) 
        engineApplyShaderToWorldTexture ( shader1, "wfyclot" ) 
        engineApplyShaderToWorldTexture ( shader2, "wmyclot" ) 
    end 
addEventHandler ( "onClientResourceStart", resourceRoot, skinstaffoff) 
  
   function skinstaff ( ) 
        triggerEvent ("onserverteam", source, onserverteam)  
        local skin1 = dxCreateTexture ( "images/wfyclot.jpg", "dxt5" ) 
        local skin2 = dxCreateTexture ( "images/wmyclot.jpg", "dxt5" ) 
        local shader1 = dxCreateShader ( "texture.fx" ) 
        local shader2 = dxCreateShader ( "texture.fx" ) 
        dxSetShaderValue ( shader1, "gTexture", skin1 ) 
        dxSetShaderValue ( shader2, "gTexture", skin2 ) 
        engineApplyShaderToWorldTexture ( shader1, "wfyclot" ) 
        engineApplyShaderToWorldTexture ( shader2, "wmyclot" ) 
    end 
addEventHandler ( "onClientResourceStart", resourceRoot, skinstaff) 
  

function onserverteam ( ) 
 if ( getTeamName(getPlayerTeam(source)) == "STAFF" ) then 
end 
end 
addEvent("onserverteam",true) 
addEventHandler("onserverteam", resourceRoot, onserverteam) 
  
  

Link to comment

If that's what he wants, then this should do:

function skinstaff ( ) 
    local team = getPlayerTeam ( localPlayer ) 
    if ( team and getTeamName ( team ) == "STAFF" ) then 
        local skin1 = dxCreateTexture ( "images/wfyclot.jpg", "dxt5" ) 
        local skin2 = dxCreateTexture ( "images/wmyclot.jpg", "dxt5" ) 
        local shader1 = dxCreateShader ( "texture.fx" ) 
        local shader2 = dxCreateShader ( "texture.fx" ) 
        dxSetShaderValue ( shader1, "gTexture", skin1 ) 
        dxSetShaderValue ( shader2, "gTexture", skin2 ) 
        engineApplyShaderToWorldTexture ( shader1, "wfyclot" ) 
        engineApplyShaderToWorldTexture ( shader2, "wmyclot" ) 
    end 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, skinstaff ) 

Link to comment
If that's what he wants, then this should do:
function skinstaff ( ) 
    local team = getPlayerTeam ( localPlayer ) 
    if ( team and getTeamName ( team ) == "STAFF" ) then 
        local skin1 = dxCreateTexture ( "images/wfyclot.jpg", "dxt5" ) 
        local skin2 = dxCreateTexture ( "images/wmyclot.jpg", "dxt5" ) 
        local shader1 = dxCreateShader ( "texture.fx" ) 
        local shader2 = dxCreateShader ( "texture.fx" ) 
        dxSetShaderValue ( shader1, "gTexture", skin1 ) 
        dxSetShaderValue ( shader2, "gTexture", skin2 ) 
        engineApplyShaderToWorldTexture ( shader1, "wfyclot" ) 
        engineApplyShaderToWorldTexture ( shader2, "wmyclot" ) 
    end 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, skinstaff ) 

not work :(

Link to comment
  
addEventHandler( 
    'onClientResourceStart', resourceRoot, 
    function() 
        if(getPlayerTeam(getTeamName( localPlayer ) == 'STAFF')) then 
        skin1 = dxCreateTexture ( "images/wfyclot.jpg", "dxt5" ) 
        skin2 = dxCreateTexture ( "images/wmyclot.jpg", "dxt5" ) 
        shader1 = dxCreateShader ( "texture.fx" ) 
        shader2 = dxCreateShader ( "texture.fx" ) 
        dxSetShaderValue ( shader1, "gTexture", skin1 ) 
        dxSetShaderValue ( shader2, "gTexture", skin2 ) 
        engineApplyShaderToWorldTexture ( shader1, "wfyclot" ) 
        engineApplyShaderToWorldTexture ( shader2, "wmyclot" ) 
    end 
end 
) 

and Show Meta.xml

Link to comment
Either your texture names are wrong, or your shader isn't good.

plis how fix ?

It seems that you need add some arguments to dxCreateShader - to make it work for ped textures.

For example:

 local shader1 = dxCreateShader ( "texture.fx",0,0,false,"ped" ) 

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