Jump to content

[AJUDA] Abrir painel apenas se o player estiver em um veículo. (Client-Side)


Recommended Posts

Posted

Tentei da seguinte maneira:
 

function open (_,state)
	if getElementType() == "vehicle" then
		if painelF5 == false then
			showCursor(true)
			addEventHandler("onClientRender", root, painelF5Dx)
			painelF5 = true
			showCursor(true)
		else
			showCursor(false)
			removeEventHandler("onClientRender", root, painelF5Dx)
			painelF5 = false
			showCursor(false)
		end
	end
end
addEvent("painel_f5", true)
addEventHandler("painel_f5", root , open)

Sem sucesso... O que será que pode ser ? 

Posted
if getPedOccupiedVehicle(localPlayer) then
  -- código
end

Coloque essa verificação.

Please do not PM me with scripting related question nor support, use the forums instead.

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