Guys, i can't find the problem , help me, the problems repeating value, i can't close the dx panel.
@50p or other help.
value = 1
function panel()
for _, vehicle in ipairs ( getElementsByType ( "vehicle" ) ) do
x1, y1, z1 = getElementPosition ( vehicle )
x2, y2, z2 = getElementPosition ( localPlayer )
x3, y3, z3 = getCameraMatrix() -- Get local players position.
local distanceBetweenPoints = getDistanceBetweenPoints3D(x1, y1, z1, x3, y3, z3)
if(distanceBetweenPoints < 25 and value == 1) then
addEventHandler("onClientRender", root, webBrowserRender)
showCursor(true)
showChat(false)
setPedAnimation(localPlayer,"ped","xpressscratch")
loadBrowserURL(webBrowser, "http://mta/local/index.html")
focusBrowser(webBrowser)
elseif distanceBetweenPoints < 25 and value == 0 then
removeEventHandler("onClientRender", root, webBrowserRender)
removeEventHandler("onClientRender", root, mOS)
showCursor(false)
showChat(true)
value = 1
end
end
end
bindKey("J","down",panel)