estou voltando aq novamente pois n consegui de jeito nenhum usar o retangulo como botão, vou mandar o codigo e pfv alguem me ajude , me fala onde eu to errando
CLIENT:
local screenW, screenH = guiGetScreenSize()
local mostrar = false
function paineldx()
if mostrar == true then
dxDrawRectangle(screenW * 0.3109, screenH * 0.2931, screenW * 0.3781, screenH * 0.4153, tocolor(0, 0, 0, 235), false)
dxDrawRectangle(screenW * 0.3109, screenH * 0.6764, screenW * 0.3789, screenH * 0.0319, tocolor(0, 89, 173, 254), false)
dxDrawRectangle(screenW * 0.3102, screenH * 0.2931, screenW * 0.3789, screenH * 0.0319, tocolor(0, 89, 173, 254), false)
dxDrawLine((screenW * 0.4445) - 1, (screenH * 0.4500) - 1, (screenW * 0.4445) - 1, screenH * 0.5514, tocolor(0, 0, 0, 255), 1, false)
dxDrawLine(screenW * 0.5555, (screenH * 0.4500) - 1, (screenW * 0.4445) - 1, (screenH * 0.4500) - 1, tocolor(0, 0, 0, 255), 1, false)
dxDrawLine((screenW * 0.4445) - 1, screenH * 0.5514, screenW * 0.5555, screenH * 0.5514, tocolor(0, 0, 0, 255), 1, false)
dxDrawLine(screenW * 0.5555, screenH * 0.5514, screenW * 0.5555, (screenH * 0.4500) - 1, tocolor(0, 0, 0, 255), 1, false)
dxDrawRectangle(screenW * 0.4445, screenH * 0.4500, screenW * 0.1109, screenH * 0.1014, tocolor(115, 0, 0, 254), false)
dxDrawText("ARMA", screenW * 0.4437, screenH * 0.4486, screenW * 0.5555, screenH * 0.5514, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false)
end
end
addEventHandler("onClientRender", root,paineldx)
function mostrardx()
if mostrar == false then
showCursor(true)
mostrar = true
addEventHandler("onClientRender", root,paineldx)
else
showCursor(false)
mostrar = false
removeEventHandler("onClientRender", root,paineldx)
end
end
bindKey("z","down", mostrardx)
function sidearma(button,state)
if paineldx == true then
if state == "down" then
if isCursorOnElement(screenW * 0.4445, screenH * 0.4500, screenW * 0.1109, screenH * 0.1014) then
triggerServerEvent("dararmaevento", localPlayer)
end
end
end
end
addEventHandler("onClientClick", root, sidearma)
SERVER:
function dararmaaa()
giveWeapon ( source, 31, 200 )
end
addEvent("dararmaevento", true)
addEventHandler("dararmaevento", root, dararmaaa)