Jump to content

idk where to report a bug


Recommended Posts

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

it works with me?

 

p_1631694yl1.png

 

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 by MrKAREEM
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...