Jump to content

Interesting question.


off

Recommended Posts

Id like to know if there is a way to check if the player is under a roof, as happens in the game.

For example, when its raining and you go under a bridge, the effect of rain stop and when you come out, start again.

Link to comment
2 hours ago, Verius said:

Hm. Rather MTA doesn't share any trigger what allows that, anyway I didn't see this. But maybe there possibility use ProcessLineOfSight and check ray collision from player to roof. 
Example: 
 


processLineOfSight(playerX, playerY, playerZ, playerX, playerY, playerZ + maxHeightOfRoof)

Or use optional arguments with objects ID. 

Maybe it can work, good ideia

Edited by IgorRodriguesCo
Link to comment
1 hour ago, Egekan said:

function isElementUnderRoof(el)
	local x, y, z = getElementPosition(el)
		if getGroundPosition(x,y, z) == getGroundPosition(x,y,z+ 800) then
			return false
		else
			return true
		end
end

Use this.

Works, but not well

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