AGAKAZZYN Posted July 29, 2020 Posted July 29, 2020 eu estou fazendo um dx e preciso abrir ele, mas esta dando o seguinte erro: attempt to call global 'isEventHandlerAdded' (a nil value)
DNL291 Posted July 29, 2020 Posted July 29, 2020 Porque essa função não é nativa do MTA e ela não está adicionada ao código. isEventHandlerAdded
AGAKAZZYN Posted July 30, 2020 Author Posted July 30, 2020 então como faço para esse comando funcionar? bindKey("k","down",function () if not isEventHandlerAdded("onClientRender", root, inventario ) then showCursor (true) addEventHandler ("onClientRender", root, inventario) changeVisibility("qtd", true) end end) bindKey("BACKSPACE", "down", function() if isEventHandlerAdded("onClientRender", root, inventario )then removeEventHandler("onClientRender", getRootElement(), inventario) showCursor (false) changeVisibility("qtd", false) end end)
ber Posted July 30, 2020 Posted July 30, 2020 Essa função foi feita pela comunidade e não é nativa do MTA. Você precisa copiar o código que tem na Wiki para que a função funcione. Basta colocar esse código: function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end
Gw8 Posted July 30, 2020 Posted July 30, 2020 Precisamos da galera da perfomance neste post PLEASEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!!!! enfim não é 500 milhoes de vezes mais simples colocar um boolean ai? quem invento essa mizeria 1
ber Posted July 30, 2020 Posted July 30, 2020 10 hours ago, Gw8 said: Precisamos da galera da perfomance neste post PLEASEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!!!! enfim não é 500 milhoes de vezes mais simples colocar um boolean ai? quem invento essa mizeria né...
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