Master_MTA Posted June 18, 2020 Share Posted June 18, 2020 the version 1.5.7 of mta sa have problem with onColShapeHit onMarkerHit any hit or key binding functions& events if u use getElementType() even if there is check before it for example addEventHandler("onMarkerHit",root,function(e) outputChatBox("element Type"..getElementType(e)) end) -- the bug still showen even if i do that addEventHandler("onMarkerHit",root,function(e) if e and isElement(e) then outputChatBox("element Type"..getElementType(e)) end end) so my sol was like that function isAmElement(e) if isElement( e ) then return true end return false end -- if i do like that it's still not working --[[ function isAmElement(e) return isElement( e ) or false end ]]-- addEventHandler("onMarkerHit",root,function(e) if not isAmElement(e) then return end outputChatBox("element Type"..getElementType(e)) end) it's weird problem Link to comment
MrKAREEM Posted June 19, 2020 Share Posted June 19, 2020 (edited) it works with me? createMarker(1601, 1212, 12.434, "cylinder", 15, 10, 244, 23, 255) function isAmElement(element) if isElement( element ) then return outputChatBox('type:'..type(element)) end return false end function onHit(e) if isAmElement(e) then outputChatBox('hit:'..getElementType(e)) end end addEventHandler("onMarkerHit", root, onHit) edit : i tried your function it works with me Edited June 19, 2020 by MrKAREEM 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