off Posted June 3, 2018 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.
Verius Posted June 3, 2018 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
off Posted June 3, 2018 Author 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
Egekan Posted June 3, 2018 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.
off Posted June 3, 2018 Author 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
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