ozulus Posted May 29, 2015 Share Posted May 29, 2015 I am using this code, when the scripts started, i can see texture but other players can not see. Please help me what should i do?? Note: I have shader.fx local vehicle = getOccupiedVehicle() local Shader = dxCreateShader( "shader.fx" ) local Texture = dxCreateTexture( "mavericktexture.png" ) dxSetShaderValue( Shader, "Tex", Texture ) engineApplyShaderToWorldTexture( Shader, "Bell_206B_T", vehicle ) Link to comment
WhoAmI Posted May 29, 2015 Share Posted May 29, 2015 c-side addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) triggerServerEvent ( "loadForAll", localPlayer ); end ); addEvent ( "load", true ) addEventHandler ( "load", root, function ( ) local vehicle = getOccupiedVehicle ( source ) local Shader = dxCreateShader( "shader.fx" ) local Texture = dxCreateTexture( "mavericktexture.png" ) dxSetShaderValue( Shader, "Tex", Texture ) engineApplyShaderToWorldTexture( Shader, "Bell_206B_T", vehicle ) end ); s-side addEvent ( "loadForAll", true ) addEventHandler ( "loadForAll", root, function ( ) triggerClientEvent ( "load", source ); end ); Link to comment
ozulus Posted May 29, 2015 Author Share Posted May 29, 2015 Thank u so much! I'll try it Link to comment
3B00DG4MER Posted May 30, 2015 Share Posted May 30, 2015 Ow, i had that problem before so i've to trigger to Server then trigger Again to client I'll do it in my script Link to comment
ALw7sH Posted May 30, 2015 Share Posted May 30, 2015 And you can set an element data to the vehicle and when it stream in apply the shader to it Ithink this is better than triggers Link to comment
ozulus Posted May 30, 2015 Author Share Posted May 30, 2015 This code works well, thanks. Also, how can i do only one player? For example i am vip player and i have shader. Other players haven't shader. Link to comment
Perfect Posted June 1, 2015 Share Posted June 1, 2015 If 'VIP' is a team name then this should work:- addEventHandler ( "onClientResourceStart", resourceRoot, function () local vehicle = getOccupiedVehicle ( localPlayer ) local Shader = dxCreateShader( "shader.fx" ) local Texture = dxCreateTexture( "mavericktexture.png" ) if (getPlayerTeam(localPlayer) == getTeamFromName("VIP")) then dxSetShaderValue( Shader, "Tex", Texture ) engineApplyShaderToWorldTexture( Shader, "Bell_206B_T", vehicle ) end end ) Link to comment
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