Geo Posted April 24, 2020 Posted April 24, 2020 Hypothetical scenario. Say that I've a table, maybe something like: gang_zone = {} gang_zone[1] = {} gang_zone[2] = {} gang_zone[3] = {} gang_zone[1] = createColCuboid(123, 456, 789, 1012) gang_zone[2] = createColCuboid(934, 534, 135, 1941) gang_zone[3] = createColCuboid(913, 851, 153, 3913) Is there a way a single onColShapeHit listens for a element hit on all these areas at the same time?
KronoS Lettify Posted April 25, 2020 Posted April 25, 2020 Try to set ID to the element. And on event onColShapeHit set root element on 2° argument in addEventHandler, and inside function filter the colshape hitted by ID. Página Facebook: The News Joker (The Piadas & News) Discord: @kronos.lettify em Discord oficial do MTA Dê um THANKS se minha ajuda ou comentário foi útil para você.
Moderators IIYAMA Posted April 25, 2020 Moderators Posted April 25, 2020 14 hours ago, Geo said: Is there a way a single onColShapeHit listens for a element hit on all these areas at the same time? See this tutorial. Or attach the addEventHandler on to the resourceRoot. This will trigger the eventHandler only for elements created by the same resource. 1 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Geo Posted April 27, 2020 Author Posted April 27, 2020 On 25/04/2020 at 09:14, IIYAMA said: See this tutorial. Or attach the addEventHandler on to the resourceRoot. This will trigger the eventHandler only for elements created by the same resource. Thank you so much man! 1
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