lucasds Posted October 27, 2019 Share Posted October 27, 2019 for i, markers in pairs(Entregas_Gases) do Markers_M = createMarker( markers[1], markers[2], markers[3]-1, "cylinder", 3, 255, 255, 255, 20) end for i, blipsMarkers in pairs(Entregas_Gases) do blipsM = createBlip(blipsMarkers[1], blipsMarkers[2], blipsMarkers[3], 41) end function teste1(source) msg.default("vc pisou no marker", source) end addEventHandler("onMarkerHit", Markers_M, teste1) Seguinte, quando eu coloco essas linhas de código n da erro nem nada, mas tbm n acontece nada, eu quero que quando a pessoa pise em cada marker da tabela, aconteça a função teste1, entende? mas sem que seja uma criação de markers fora da tabela, pq assim aumenta muitas linhas de código! Desde já, obrigado! Link to comment
DNL291 Posted October 27, 2019 Share Posted October 27, 2019 for i, markers in pairs(Entregas_Gases) do Markers_M = createMarker( markers[1], markers[2], markers[3]-1, "cylinder", 3, 255, 255, 255, 20) addEventHandler("onMarkerHit", Markers_M, function(hitElement, dim) if getElementType(hitElement) == "player" then msg.default("vc pisou no marker", hitElement) end end) end Movido para a área Portuguesa: https://forum.multitheftauto.com/forum/127-programação-em-Lua/ @LucasDSNL 1 Link to comment
lucasds Posted October 27, 2019 Author Share Posted October 27, 2019 Muito Obrigado DNL! Me ajudou bastante! 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