off Posted June 3, 2018 Share Posted June 3, 2018 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
Verius Posted June 3, 2018 Share Posted June 3, 2018 (edited) 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. Edited June 3, 2018 by Verius Link to comment
off Posted June 3, 2018 Author Share Posted June 3, 2018 (edited) 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 June 3, 2018 by IgorRodriguesCo Link to comment
Egekan Posted June 3, 2018 Share Posted June 3, 2018 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. Link to comment
off Posted June 3, 2018 Author Share Posted June 3, 2018 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now