WASSIm. Posted March 3, 2013 Posted March 3, 2013 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)
Castillo Posted March 3, 2013 Posted March 3, 2013 Mind giving more information? what is the problem?
Brunoo Posted March 3, 2013 Posted March 3, 2013 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
Castillo Posted March 3, 2013 Posted March 3, 2013 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 )
WASSIm. Posted March 3, 2013 Author Posted March 3, 2013 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
WASSIm. Posted March 3, 2013 Author Posted March 3, 2013 You put it as client side? do you get any error? yes this client side and nothing error
X-SHADOW Posted March 3, 2013 Posted March 3, 2013 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
X-SHADOW Posted March 3, 2013 Posted March 3, 2013 There's nothing different in that script. Then i think it's Meta.xml Problem lol
Castillo Posted March 4, 2013 Posted March 4, 2013 Either your texture names are wrong, or your shader isn't good.
WASSIm. Posted March 4, 2013 Author Posted March 4, 2013 Either your texture names are wrong, or your shader isn't good. plis how fix ?
Ren_712 Posted March 11, 2013 Posted March 11, 2013 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" )
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