Jump to content

Ajuda Erro : server triggered clientside event open, but event is not added clientside


Recommended Posts

Estou editando esse script estou querendo colocar a funçao de passar no marker e ativar o painel porem quando dou start e passo na marca da esse erro no debugscript :server triggered clientside event open, but event is not added clientside e nao funciona nada

 

client : 

local screenW, screenH = guiGetScreenSize()
 

painel = false
function abrir ()


        dxDrawImage(screenW * 0.2818, screenH * 0.0508, screenW * 0.4575, screenH * 0.7956, "fx/fundo.png", 90, 0, 0, tocolor(2, 0, 5, 206), false)
        dxDrawText("PAINEL CORP / GANG", screenW * 0.3426, screenH * 0.0859, screenW * 0.6794, screenH * 0.1745, tocolor(255, 255, 255, 255), 1.50, "sans", "center", "center", false, false, false, false, false)
        dxDrawImage(screenW * 0.4100, screenH * 0.1133, screenW * 0.0161, screenH * 0.0273, "fx/estrela.png", 105, 0, 0, tocolor(59, 209, 29, 206), false)
        dxDrawImage(screenW * 0.5974, screenH * 0.1120, screenW * 0.0161, screenH * 0.0273, "fx/estrela.png", 105, 0, 0, tocolor(59, 209, 29, 206), false)
        dxDrawLine((screenW * 0.4436) - 1, (screenH * 0.2174) - 1, (screenW * 0.4436) - 1, screenH * 0.2786, tocolor(0, 0, 0, 245), 1, false)
        dxDrawLine(screenW * 0.5747, (screenH * 0.2174) - 1, (screenW * 0.4436) - 1, (screenH * 0.2174) - 1, tocolor(0, 0, 0, 245), 1, false)
        dxDrawLine((screenW * 0.4436) - 1, screenH * 0.2786, screenW * 0.5747, screenH * 0.2786, tocolor(0, 0, 0, 245), 1, false)
        dxDrawLine(screenW * 0.5747, screenH * 0.2786, screenW * 0.5747, (screenH * 0.2174) - 1, tocolor(0, 0, 0, 245), 1, false)
        dxDrawRectangle(screenW * 0.4436, screenH * 0.2174, screenW * 0.1310, screenH * 0.0612, tocolor(58, 208, 28, 74), false)
        dxDrawText("VIDA E COLETE", (screenW * 0.4458) - 1, (screenH * 0.2174) - 1, (screenW * 0.5747) - 1, (screenH * 0.2786) - 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("VIDA E COLETE", (screenW * 0.4458) + 1, (screenH * 0.2174) - 1, (screenW * 0.5747) + 1, (screenH * 0.2786) - 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("VIDA E COLETE", (screenW * 0.4458) - 1, (screenH * 0.2174) + 1, (screenW * 0.5747) - 1, (screenH * 0.2786) + 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("VIDA E COLETE", (screenW * 0.4458) + 1, (screenH * 0.2174) + 1, (screenW * 0.5747) + 1, (screenH * 0.2786) + 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("VIDA E COLETE", screenW * 0.4458, screenH * 0.2174, screenW * 0.5747, screenH * 0.2786, tocolor(255, 255, 255, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawLine((screenW * 0.4436) - 1, (screenH * 0.2917) - 1, (screenW * 0.4436) - 1, screenH * 0.3529, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5747, (screenH * 0.2917) - 1, (screenW * 0.4436) - 1, (screenH * 0.2917) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.4436) - 1, screenH * 0.3529, screenW * 0.5747, screenH * 0.3529, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5747, screenH * 0.3529, screenW * 0.5747, (screenH * 0.2917) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.4436, screenH * 0.2917, screenW * 0.1310, screenH * 0.0612, tocolor(58, 208, 28, 74), false)
        dxDrawText("KIT DE ARMAS", (screenW * 0.4458) - 1, (screenH * 0.2917) - 1, (screenW * 0.5747) - 1, (screenH * 0.3529) - 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("KIT DE ARMAS", (screenW * 0.4458) + 1, (screenH * 0.2917) - 1, (screenW * 0.5747) + 1, (screenH * 0.3529) - 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("KIT DE ARMAS", (screenW * 0.4458) - 1, (screenH * 0.2917) + 1, (screenW * 0.5747) - 1, (screenH * 0.3529) + 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("KIT DE ARMAS", (screenW * 0.4458) + 1, (screenH * 0.2917) + 1, (screenW * 0.5747) + 1, (screenH * 0.3529) + 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("KIT DE ARMAS", screenW * 0.4458, screenH * 0.2917, screenW * 0.5747, screenH * 0.3529, tocolor(255, 255, 255, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawLine((screenW * 0.4436) - 1, (screenH * 0.3659) - 1, (screenW * 0.4436) - 1, screenH * 0.4271, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5747, (screenH * 0.3659) - 1, (screenW * 0.4436) - 1, (screenH * 0.3659) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.4436) - 1, screenH * 0.4271, screenW * 0.5747, screenH * 0.4271, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5747, screenH * 0.4271, screenW * 0.5747, (screenH * 0.3659) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.4436, screenH * 0.3659, screenW * 0.1310, screenH * 0.0612, tocolor(58, 208, 28, 74), false)
        dxDrawText("SKIN", (screenW * 0.4458) - 1, (screenH * 0.3659) - 1, (screenW * 0.5747) - 1, (screenH * 0.4271) - 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("SKIN", (screenW * 0.4458) + 1, (screenH * 0.3659) - 1, (screenW * 0.5747) + 1, (screenH * 0.4271) - 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("SKIN", (screenW * 0.4458) - 1, (screenH * 0.3659) + 1, (screenW * 0.5747) - 1, (screenH * 0.4271) + 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("SKIN", (screenW * 0.4458) + 1, (screenH * 0.3659) + 1, (screenW * 0.5747) + 1, (screenH * 0.4271) + 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("SKIN", screenW * 0.4458, screenH * 0.3659, screenW * 0.5747, screenH * 0.4271, tocolor(255, 255, 255, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawLine((screenW * 0.4436) - 1, (screenH * 0.4401) - 1, (screenW * 0.4436) - 1, screenH * 0.5013, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5747, (screenH * 0.4401) - 1, (screenW * 0.4436) - 1, (screenH * 0.4401) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.4436) - 1, screenH * 0.5013, screenW * 0.5747, screenH * 0.5013, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5747, screenH * 0.5013, screenW * 0.5747, (screenH * 0.4401) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.4436, screenH * 0.4401, screenW * 0.1310, screenH * 0.0612, tocolor(58, 208, 28, 74), false)
        dxDrawText("SKIN 2", (screenW * 0.4458) - 1, (screenH * 0.4401) - 1, (screenW * 0.5747) - 1, (screenH * 0.5013) - 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("SKIN 2", (screenW * 0.4458) + 1, (screenH * 0.4401) - 1, (screenW * 0.5747) + 1, (screenH * 0.5013) - 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("SKIN 2", (screenW * 0.4458) - 1, (screenH * 0.4401) + 1, (screenW * 0.5747) - 1, (screenH * 0.5013) + 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("SKIN 2", (screenW * 0.4458) + 1, (screenH * 0.4401) + 1, (screenW * 0.5747) + 1, (screenH * 0.5013) + 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("SKIN 2", screenW * 0.4458, screenH * 0.4401, screenW * 0.5747, screenH * 0.5013, tocolor(255, 255, 255, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawLine((screenW * 0.4436) - 1, (screenH * 0.5143) - 1, (screenW * 0.4436) - 1, screenH * 0.5755, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5747, (screenH * 0.5143) - 1, (screenW * 0.4436) - 1, (screenH * 0.5143) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.4436) - 1, screenH * 0.5755, screenW * 0.5747, screenH * 0.5755, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5747, screenH * 0.5755, screenW * 0.5747, (screenH * 0.5143) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.4436, screenH * 0.5143, screenW * 0.1310, screenH * 0.0612, tocolor(58, 208, 28, 74), false)
        dxDrawText("CARRO", (screenW * 0.4458) - 1, (screenH * 0.5143) - 1, (screenW * 0.5747) - 1, (screenH * 0.5755) - 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("CARRO", (screenW * 0.4458) + 1, (screenH * 0.5143) - 1, (screenW * 0.5747) + 1, (screenH * 0.5755) - 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("CARRO", (screenW * 0.4458) - 1, (screenH * 0.5143) + 1, (screenW * 0.5747) - 1, (screenH * 0.5755) + 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("CARRO", (screenW * 0.4458) + 1, (screenH * 0.5143) + 1, (screenW * 0.5747) + 1, (screenH * 0.5755) + 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("CARRO", screenW * 0.4458, screenH * 0.5143, screenW * 0.5747, screenH * 0.5755, tocolor(255, 255, 255, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawLine((screenW * 0.4436) - 1, (screenH * 0.5885) - 1, (screenW * 0.4436) - 1, screenH * 0.6497, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5747, (screenH * 0.5885) - 1, (screenW * 0.4436) - 1, (screenH * 0.5885) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.4436) - 1, screenH * 0.6497, screenW * 0.5747, screenH * 0.6497, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5747, screenH * 0.6497, screenW * 0.5747, (screenH * 0.5885) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.4436, screenH * 0.5885, screenW * 0.1310, screenH * 0.0612, tocolor(58, 208, 28, 74), false)
        dxDrawText("CARRO 2", (screenW * 0.4458) - 1, (screenH * 0.5885) - 1, (screenW * 0.5747) - 1, (screenH * 0.6497) - 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("CARRO 2", (screenW * 0.4458) + 1, (screenH * 0.5885) - 1, (screenW * 0.5747) + 1, (screenH * 0.6497) - 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("CARRO 2", (screenW * 0.4458) - 1, (screenH * 0.5885) + 1, (screenW * 0.5747) - 1, (screenH * 0.6497) + 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("CARRO 2", (screenW * 0.4458) + 1, (screenH * 0.5885) + 1, (screenW * 0.5747) + 1, (screenH * 0.6497) + 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("CARRO 2", screenW * 0.4458, screenH * 0.5885, screenW * 0.5747, screenH * 0.6497, tocolor(255, 255, 255, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawLine((screenW * 0.4436) - 1, (screenH * 0.6628) - 1, (screenW * 0.4436) - 1, screenH * 0.7240, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5747, (screenH * 0.6628) - 1, (screenW * 0.4436) - 1, (screenH * 0.6628) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.4436) - 1, screenH * 0.7240, screenW * 0.5747, screenH * 0.7240, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5747, screenH * 0.7240, screenW * 0.5747, (screenH * 0.6628) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.4436, screenH * 0.6628, screenW * 0.1310, screenH * 0.0612, tocolor(58, 208, 28, 74), false)
        dxDrawText("DESTRUIR", (screenW * 0.4458) - 1, (screenH * 0.6628) - 1, (screenW * 0.5747) - 1, (screenH * 0.7240) - 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("DESTRUIR", (screenW * 0.4458) + 1, (screenH * 0.6628) - 1, (screenW * 0.5747) + 1, (screenH * 0.7240) - 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("DESTRUIR", (screenW * 0.4458) - 1, (screenH * 0.6628) + 1, (screenW * 0.5747) - 1, (screenH * 0.7240) + 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("DESTRUIR", (screenW * 0.4458) + 1, (screenH * 0.6628) + 1, (screenW * 0.5747) + 1, (screenH * 0.7240) + 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("DESTRUIR", screenW * 0.4458, screenH * 0.6628, screenW * 0.5747, screenH * 0.7240, tocolor(255, 255, 255, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("COPYRIGHT © NOME DO SEU SERVER - 2018", (screenW * 0.4846) - 1, (screenH * 0.7839) - 1, (screenW * 0.5242) - 1, (screenH * 0.8086) - 1, tocolor(0, 0, 0, 255), 1.00, "clear", "center", "center", false, false, false, false, false)
        dxDrawText("COPYRIGHT © NOME DO SEU SERVER - 2018", (screenW * 0.4846) + 1, (screenH * 0.7839) - 1, (screenW * 0.5242) + 1, (screenH * 0.8086) - 1, tocolor(0, 0, 0, 255), 1.00, "clear", "center", "center", false, false, false, false, false)
        dxDrawText("COPYRIGHT © NOME DO SEU SERVER - 2018", (screenW * 0.4846) - 1, (screenH * 0.7839) + 1, (screenW * 0.5242) - 1, (screenH * 0.8086) + 1, tocolor(0, 0, 0, 255), 1.00, "clear", "center", "center", false, false, false, false, false)
        dxDrawText("COPYRIGHT © NOME DO SEU SERVER - 2018", (screenW * 0.4846) + 1, (screenH * 0.7839) + 1, (screenW * 0.5242) + 1, (screenH * 0.8086) + 1, tocolor(0, 0, 0, 255), 1.00, "clear", "center", "center", false, false, false, false, false)
        dxDrawText("COPYRIGHT © NOME DO SEU SERVER - 2018", screenW * 0.4846, screenH * 0.7839, screenW * 0.5242, screenH * 0.8086, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false)
        dxDrawLine((screenW * 0.4436) - 1, (screenH * 0.8711) - 1, (screenW * 0.4436) - 1, screenH * 0.9323, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5747, (screenH * 0.8711) - 1, (screenW * 0.4436) - 1, (screenH * 0.8711) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.4436) - 1, screenH * 0.9323, screenW * 0.5747, screenH * 0.9323, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5747, screenH * 0.9323, screenW * 0.5747, (screenH * 0.8711) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.4436, screenH * 0.8711, screenW * 0.1310, screenH * 0.0612, tocolor(58, 208, 28, 74), false)
        dxDrawText("FECHAR", (screenW * 0.4458) - 1, (screenH * 0.8711) - 1, (screenW * 0.5747) - 1, (screenH * 0.9323) - 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("FECHAR", (screenW * 0.4458) + 1, (screenH * 0.8711) - 1, (screenW * 0.5747) + 1, (screenH * 0.9323) - 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("FECHAR", (screenW * 0.4458) - 1, (screenH * 0.8711) + 1, (screenW * 0.5747) - 1, (screenH * 0.9323) + 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("FECHAR", (screenW * 0.4458) + 1, (screenH * 0.8711) + 1, (screenW * 0.5747) + 1, (screenH * 0.9323) + 1, tocolor(0, 0, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false)
        dxDrawText("FECHAR", screenW * 0.4458, screenH * 0.8711, screenW * 0.5747, screenH * 0.9323, tocolor(255, 255, 255, 255), 1.00, "sans", "center", "center", false, false, false, false, false)


   
   
   
        
    end

function abrirbind()
if painel == false then
showCursor (true)
addEventHandler ("onClientRender", root,abrir)
painel = true
else
if painel == true then
showCursor(false)
removeEventHandler("onClientRender",root,abrir)
painel = false
end
end
end
addEvent("PAINELCORPOUGANG", true)
addEventHandler("PAINELCORPOUGANG", getRootElement(), abrirbind)

function isCursorOnElement(x,y,w,h)
 local mx,my = getCursorPosition ()
 local fullx,fully = guiGetScreenSize()
 cursorx,cursory = mx*fullx,my*fully
 if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
  return true
 else
  return false
 end
end

function veiculo (_,state)
if painel == true then
if  state == "down"  then
if  isCursorOnElement(screenW * 0.4436, screenH * 0.5143, screenW * 0.1310, screenH * 0.0612) then
triggerServerEvent ("carrop", localPlayer)
end
end
end
end
addEventHandler ("onClientClick", root, veiculo)

-----------------------------------------------------------------------

function veiculo2 (_,state)
if painel == true then
if  state == "down"  then
if  isCursorOnElement(screenW * 0.4436, screenH * 0.5885, screenW * 0.1310, screenH * 0.0612) then
triggerServerEvent ("carrop2", localPlayer)
end
end
end
end
addEventHandler ("onClientClick", root, veiculo2)

-----------------------------------------------------------------------

function arm (_,state)
if painel == true then
if  state == "down"  then
if  isCursorOnElement(screenW * 0.4436, screenH * 0.2917, screenW * 0.1310, screenH * 0.0612) then
triggerServerEvent ("arma", localPlayer)
end
end
end
end
addEventHandler ("onClientClick", root, arm)

-----------------------------------------------------------------------

function skin (_,state)
if painel == true then
if  state == "down"  then
if  isCursorOnElement(screenW * 0.4436, screenH * 0.3659, screenW * 0.1310, screenH * 0.0612) then
triggerServerEvent ("skinns", localPlayer)
end
end
end
end
addEventHandler ("onClientClick", root, skin)

-----------------------------------------------------------------------

function skin2 (_,state)
if painel == true then
if  state == "down"  then
if  isCursorOnElement(screenW * 0.4436, screenH * 0.4401, screenW * 0.1310, screenH * 0.0612) then
triggerServerEvent ("skinns2", localPlayer)
end
end
end
end
addEventHandler ("onClientClick", root, skin2)

-----------------------------------------------------------------------

function destrui (_,state)
if painel == true then
if  state == "down"  then
if  isCursorOnElement(screenW * 0.4436, screenH * 0.6628, screenW * 0.1310, screenH * 0.0612) then
triggerServerEvent ("destroi", localPlayer)
end
end
end
end
addEventHandler ("onClientClick", root, destrui)

-----------------------------------------------------------------------

function blinda (_,state)
if painel == true then
if  state == "down"  then
if  isCursorOnElement(screenW * 0.5306, screenH * 0.2989, screenW * 0.0788, screenH * 0.0600) then
triggerServerEvent ("blindagem", localPlayer)
end
end
end
end
addEventHandler ("onClientClick", root, blinda)

-----------------------------------------------------------------------

function life (_,state)
if painel == true then
if  state == "down"  then
if  isCursorOnElement(screenW * 0.4436, screenH * 0.2174, screenW * 0.1310, screenH * 0.0612) then
triggerServerEvent ("vida", localPlayer)
end
end
end
end
addEventHandler ("onClientClick", root, life)

function col (_,state)
if painel == true then
if  state == "down"  then
if  isCursorOnElement(screenW * 0.4436, screenH * 0.2174, screenW * 0.1310, screenH * 0.0612) then
triggerServerEvent ("colete", localPlayer)
end
end
end
end
addEventHandler ("onClientClick", root, col)

-----------------------------------------------------------------------

function fecharpainel (_,state)
if painel == true then
if state == "down" then
if isCursorOnElement (0.4458, 0.8711, 0.5747, 0.9323) then
removeEventHandler ("onClientRender", root, abrir)
showCursor (false)
painel = false
end
end
end
end
addEventHandler ("onClientClick", root, fecharpainel)

 

server: 

 

local praia = createMarker (1570.239, -1623.809, 13.589, "cylinder", 2, 0, 255, 255, 255)

function showPanel(thePlayer)
  accountname = getAccountName(getPlayerAccount(thePlayer))
  if isObjectInACLGroup("user." .. accountname, aclGetGroup("PMESP")) then -------- ACL DA SUA CORP
    triggerClientEvent(thePlayer, "PAINELCORPOUGANG", getRootElement())
   else
  end
end

function open (source)
triggerClientEvent (source, "open", root)
end
addEventHandler ("onMarkerHit", praia, open)

function open (source)
triggerClientEvent (source, "open", root)
end
addEventHandler ("onMarkerHit", cj, open)


veh = {}
function criarxx()
    if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) 
 veh[source] = nil 
 end
    local x,y,z = getElementPosition(source)
    veh[source] = createVehicle(400, x,y,z + 2)
 warpPedIntoVehicle (source,veh[source])
end
addEvent("carrop",true)
addEventHandler("carrop",root,criarxx)


---------------------------------------------------------------------------------------


function criarxx2()
    if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) 
 veh[source] = nil 
 end
    local x,y,z = getElementPosition(source)
    veh[source] = createVehicle(401, x,y,z + 2)
 warpPedIntoVehicle (source,veh[source])
end
addEvent("carrop2",true)
addEventHandler("carrop2",root,criarxx2)


---------------------------------------------------------------------------------------


function arm ()
    giveWeapon(source, 1, 2000)
    giveWeapon(source, 2, 2000)
    giveWeapon(source, 10, 2000)
    giveWeapon(source, 23, 2000)
    giveWeapon(source, 26, 2000)
    giveWeapon(source, 28, 2000)
    giveWeapon(source, 31, 2000)
    giveWeapon(source, 34, 2000)
    giveWeapon(source, 37, 2000)
    giveWeapon(source, 39, 2000)
    giveWeapon(source, 43, 2000)
    giveWeapon(source, 46, 2000)
end
addEvent("arma",true)
addEventHandler ( "arma", getRootElement(), arm )


---------------------------------------------------------------------------------------
 

function skin ()
     setPedSkin ( source, 271 )
end
addEvent("skinns",true)
addEventHandler ( "skinns", getRootElement(), skin )

---------------------------------------------------------------------------------------


function skin2 ()
     setPedSkin ( source, 280 )
end
addEvent("skinns2",true)
addEventHandler ( "skinns2", getRootElement(), skin2 )


---------------------------------------------------------------------------------------


function destrui ()
destroyElement ( veh[source] )
end
addEvent ("destroi", true)
addEventHandler ("destroi", getRootElement(), destrui)


---------------------------------------------------------------------------------------


function life ()
setElementHealth (source, 100)
outputChatBox ("", source, 255,255,255, true)
     end
addEvent("vida",true)
addEventHandler ( "vida", getRootElement(), life )

function col ()
setPedArmor (source, 100)
outputChatBox ("", source, 255,255,255, true)
     end
addEvent("colete",true)
addEventHandler ( "colete", getRootElement(), col )


---------------------------------------------------------------------------------------


function baseft ()
setElementPosition (source, -404.152, -1448.217, 25.755)


end
addEvent ("baseft", true)
addEventHandler ("baseft", getRootElement(), baseft)


             

 

Edited by DNL291
Código corretamente formatado com Lua
Link to comment

O evento que irá mostrar o dx é o "PAINELCORPOUGANG", você não está chamando ele. E também, existem duas funções com o mesmo nome, chame a função showPanel no "onMarkerHit"

Esse código precisa de uma melhorada, completamente bagunçada a indentação, utiliza funções antigas (setPedSkin) e além disso está muito mal otimizado.

@madgameron

  • Like 1
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...