Jump to content

Ajuda com teleport de markers


Recommended Posts

Posted

Então galera, me ajudem na seguinte situação:

 

Estou criando um marker com teleport pra interior, mas não quero que o player seja teleportado estando em um veiculo, o que eu devo usar para bloquear isso?

  • Other Languages Moderators
Posted (edited)

Verifique se o jogador que colidiu no marker está em um veículo usando a função getPlayerOccupiedVehicle. Se estiver, a função não deve funcionar.

 

Edited by Lord Henry
Posted
20 minutes ago, Lord Henry said:

Mostre a função.

function entrar (source)
	setElementPosition (source, 388.208984375, 173.7236328125, 1008.3828125)
	setElementInterior (source, 3)
	setElementDimension (source, 21)
	setElementRotation (source, 0, 0, 90) 
end
addEventHandler ("onMarkerHit", entrada, entrar)

 

  • Other Languages Moderators
Posted
function entrar (source)
	if getElementType (source) == "player" and not getPedOccupiedVehicle (source) then -- Se o elemento que colidiu no marker for um player e ele estiver a pé, então:
		setElementPosition (source, 388.208984375, 173.7236328125, 1008.3828125)
		setElementInterior (source, 3)
		setElementDimension (source, 21)
		setElementRotation (source, 0, 0, 90)
	end
end
addEventHandler ("onMarkerHit", entrada, entrar)

 

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