Jump to content

help


WASSIm.

Recommended Posts

Posted

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) 
  
  

Omerta Roleplay

Posted

Mind giving more information? what is the problem?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

i think u want to restrict a skin for the players in staff steam if so there is no need to use server side since those functions can be used in client

Posted

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 ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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 :(

Omerta Roleplay

Posted

Why not?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You put it as client side? do you get any error?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
  
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

My ingame nickname : Ops!

-DeathMatch GameMode By Ops! : 5%

Posted

There's nothing different in that script.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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" ) 

I make shaders .. mainly. My community resources

I'll do some custom stuff, I'm open for cooperation.

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