Jump to content

Нахождение модели стандартного объекта


Recommended Posts

Доброго времени суток.

Каким образом можно получить модель объекта карты самой GTA (например, по клику)? Пробовал искать алгоритм в MapEditor, но безуспешно.

Заранее благодарен

Link to comment
1 hour ago, Kenix said:

ProcessLineOfSight

Возвращаемый аргумент, который тебе нужен:  worldModelID

 

Проверил, но, увы, не сработало. Может координаты клика находятся перед объектом, но задевают его?

addEventHandler("onClientClick", root, function(button, state, x, y, worldX, worldY, worldZ)
	
	if state ~= "down" then
		return
	end

	local v = localPlayer.position
	local hit, _, _, _, element, _, _, _, material, _, _, model = processLineOfSight(v.x, v.y, v.z, worldX, worldY, worldZ)

	if hit and model then
		outputDebugString("model = "..model)
	end

end)

 

Link to comment
4 hours ago, Essle said:

 

Проверил, но, увы, не сработало. Может координаты клика находятся перед объектом, но задевают его?


addEventHandler("onClientClick", root, function(button, state, x, y, worldX, worldY, worldZ)
	
	if state ~= "down" then
		return
	end

	local v = localPlayer.position
	local hit, _, _, _, element, _, _, _, material, _, _, model = processLineOfSight(v.x, v.y, v.z, worldX, worldY, worldZ)

	if hit and model then
		outputDebugString("model = "..model)
	end

end)

 

Попробуй установить includeWorldModelInformation на true. 

Quote
  • worldModelID: If includeWorldModelInformation was set to true and a world model was hit, this will contain the model ID.
Link to comment

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