Maark Posted October 2, 2019 Share Posted October 2, 2019 I created a script to set texture when player joins the car, (EngineApplyShaderToWorldTexture), but work only client-side, i wanna other players see the texture from the car, not only the local player see self texture. How i can create a script like this? Link to comment
Moderators IIYAMA Posted October 2, 2019 Moderators Share Posted October 2, 2019 4 hours ago, Maark said: I created a script to set texture when player joins the car, (EngineApplyShaderToWorldTexture), but work only client-side https://wiki.multitheftauto.com/wiki/OnClientPlayerVehicleEnter onClientPlayerVehicleEnter can also trigger for the remotePlayers(players other than yourself). So that issue doesn't require any serverside code. ------------------------------------------------- If you want to learn how to sync data, you could start with something not so complicated. And later learn how to use triggerEvents. 2 Link to comment
Maark Posted October 4, 2019 Author Share Posted October 4, 2019 On 02/10/2019 at 04:36, IIYAMA said: https://wiki.multitheftauto.com/wiki/OnClientPlayerVehicleEnter onClientPlayerVehicleEnter can also trigger for the remotePlayers(players other than yourself). So that issue doesn't require any serverside code. ------------------------------------------------- If you want to learn how to sync data, you could start with something not so complicated. And later learn how to use triggerEvents. so i can put like this? addEventHandler("onClientVehicleEnter", remotePlayers, applyShader) return remotePlayers nil in debugscript Link to comment
Moderators IIYAMA Posted October 4, 2019 Moderators Share Posted October 4, 2019 12 minutes ago, Maark said: so i can put like this? addEventHandler("onClientVehicleEnter", remotePlayers, applyShader) return remotePlayers nil in debugscript use: root It holds all players. (localPlayer + remoteplayers) 1 Link to comment
Maark Posted October 4, 2019 Author Share Posted October 4, 2019 33 minutes ago, IIYAMA said: use: root It holds all players. (localPlayer + remoteplayers) its impossible what im trying to do =/ im trying to apply a shader with if if BOPE == true then if id == 490 then local image = "skinbope" local bopetextura = dxCreateTexture("images/"..image..".png","dxt3") dxSetShaderValue(theTechnique,"gTexture",bopetextura) texturabope = theTechnique engineApplyShaderToWorldTexture(texturabope, "skin", theVehicle) elseif id == 596 then end end but if i put a condition (if) the engineApplyShaderToWorldTexture only apply for players who have the condition... Link to comment
Moderators IIYAMA Posted October 5, 2019 Moderators Share Posted October 5, 2019 12 hours ago, Maark said: but if i put a condition (if) the engineApplyShaderToWorldTexture only apply for players who have the condition... Then you have to synchronise this status with the server, for each player. Try to build that first. 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