--/> Client-Side
local screenW,screenH = guiGetScreenSize()
local resW, resH = 1280, 960
local x, y = (screenW/resW), (screenH/resH)
local painel = false
function dx_Painel ()
if painel == true then
dxDrawRectangle(x*358, y*144, x*631, y*420, tocolor(0, 0, 0, 197), false)
dxDrawRectangle(x*358, y*144, x*631, y*47, tocolor(0, 0, 0, 203), false)
dxDrawText("Divinity Police",x*519, y*145, x*833, y*191, tocolor(254, 254, 254, 203), 1.50, "pricedown", "center", "center", false, false, false, false, false)
dxDrawRectangle(x*358, y*243, x*632, y*58, tocolor(61, 61, 61, 203), false)
dxDrawRectangle(x*358, y*347, x*632, y*58, tocolor(61, 61, 61, 203), false)
dxDrawRectangle(x*358, y*438, x*632, y*58, tocolor(61, 61, 61, 203), false)
dxDrawText("Pegar equipamentos", x*518, y*253, x*832, y*299, tocolor(254, 254, 254, 203), 1.50, "pricedown", "center", "center", false, false, false, false, false)
dxDrawText("Guardar equipamentos", x*515, y*357, x*829, y*403, tocolor(254, 254, 254, 203), 1.50, "pricedown", "center", "center", false, false, false, false, false)
dxDrawText("Pegar viatura", x*515, y*448, x*829, y*494, tocolor(254, 254, 254, 203), 1.50, "pricedown", "center", "center", false, false, false, false, false)
dxDrawText("X", x*915, y*153, x*961, y*185, tocolor(255, 255, 255, 255), 3.00, "default", "center", "center", false, false, false, false, false)
end
end
function abrir_painel ()
if painel == false then
addEventHandler("onClientRender", getRootElement(), dx_Painel)
painel = true
end
end
addEvent("Event:Abrir_Painel_Police", true)
addEventHandler("Event:Abrir_Painel_Police", getRootElement(), abrir_painel)
function fechar_painel () --/> Fechar o Painel / Não Esta Funcional é um Exemplo, Precisará Implementa no seu Script.
if painel == true then
painel = false
removeEventHandler("onClientRender", getRootElement(), dx_Painel)
end
end
--/> Server-Side
local marker = createMarker (1539.21252, -1647.53589, 4.89063, "cylinder", 1.5 ,50,100,100)
function abrir_painel (hitElement)
if getElementType(hitElement) == "player" then
triggerClientEvent(hitElement, "Event:Abrir_Painel_Police", hitElement)
end
end
addEventHandler("onMarkerHit", marker, abrir_painel)