Maark

[HELP] How set a car texture when the player enter in the car?

Recommended Posts

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?

Share this post


Link to post
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.

  • Thanks 2

Share this post


Link to post
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

Share this post


Link to post
12 minutes ago, Maark said:

 

so i can put like this?


addEventHandler("onClientVehicleEnter", remotePlayers, applyShader)

 

return remotePlayers nil in debugscript

use: root

Tre.png

It holds all players. (localPlayer + remoteplayers)

 

 

  • Thanks 1

Share this post


Link to post
33 minutes ago, IIYAMA said:

use: root

Tre.png

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

Share this post


Link to post
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.

Share this post


Link to post

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.