Search the Community
Showing results for tags 'painel dx'.
-
BOM ESTE É O CLIENT.LUA do meu painel, quando do o /painel ele aparece e o cursor tbm, mas quando repito o comando " para fechar " só o cursor sai, e o painel fica Painel_On = false local function Painel_Agencia() Janela_Agencia_Emprego = guiCreateWindow(0.22, 0.07, 0.54, 0.80, "", true) guiWindowSetMovable(Janela_Agencia_Emprego, false) guiWindowSetSizable(Janela_Agencia_Emprego, false) guiSetAlpha(Janela_Agencia_Emprego, 1.00) guiSetProperty(Janela_Agencia_Emprego, "CaptionColour", "FF1B0743") Label_Top = guiCreateLabel(0.29, 0.11, 0.40, 0.09, "AGENCIA DE EMPREGO", true, Janela_Agencia_Emprego) guiSetFont(Label_Top, "clear-normal") guiLabelSetHorizontalAlign(Label_Top, "center", false) guiLabelSetVerticalAlign(Label_Top, "center") Butoon_Catador = guiCreateButton(0.01, 0.26, 0.27, 0.10, "CATADOR", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Catador, "NormalTextColour", "FFFFFFFF") Butoon_Jornal = guiCreateButton(0.71, 0.26, 0.27, 0.10, "ENTREGADOR DE JORNAL", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Jornal, "NormalTextColour", "FFFFFFFF") Butoon_Pedreiro = guiCreateButton(0.01, 0.38, 0.27, 0.10, "PEDREIRO", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Pedreiro, "NormalTextColour", "FFFFFFFF") Butoon_Pescador = guiCreateButton(0.71, 0.38, 0.27, 0.10, "PESCADOR", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Pescador, "NormalTextColour", "FFFFFFFF") Butoon_MotoBoy = guiCreateButton(0.01, 0.49, 0.27, 0.10, "MOTO BOY", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_MotoBoy, "NormalTextColour", "FFFFFFFF") Butoon_Gas = guiCreateButton(0.71, 0.49, 0.27, 0.10, "ENTREGADOR DE GÁS", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Gas, "NormalTextColour", "FFFFFFFF") Butoon_Leite = guiCreateButton(0.01, 0.61, 0.27, 0.10, "ENTRAGADOR DE LEITE", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Leite, "NormalTextColour", "FFFFFFFF") Butoon_Eletricista = guiCreateButton(0.71, 0.61, 0.27, 0.10, "ELETRICISTA", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Eletricista, "NormalTextColour", "FFFFFFFF") Butoon_Caminhoneiro = guiCreateButton(0.01, 0.73, 0.27, 0.10, "CAMINHONEIRO", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Caminhoneiro, "NormalTextColour", "FFFFFFFF") Butoon_Minerador = guiCreateButton(0.71, 0.73, 0.27, 0.10, "MINERADOR", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Minerador, "NormalTextColour", "FFFFFFFF") Butoon_Sair = guiCreateButton(10, 532, 719, 59, "SAIR", false, Janela_Agencia_Emprego) guiSetProperty(Butoon_Sair, "NormalTextColour", "FFFFFFFF") end addCommandHandler("painel", function() if Painel_On == false then addEventHandler("onClientRender",getRootElement(),Painel_Agencia) Painel_On = true showCursor(true) else removeEventHandler("onClientRender", getRootElement(), Painel_Agencia) Painel_On = false showCursor(false) end end)
- 3 replies
-
- script
- scripiting
- (and 6 more)
-
Painel DX Bugado Bom, eu recentemente baixei um script de painel dx, o problema e que eu utilizo MTA no Modo Janela por questões de FPS, só que painel só funciona direito se eu tiver com a Tela Cheia, eu gostaria de saber como eu posso estar arrumando o script para que ele possa Funcionar tanto na Tela cheia, como na Modo Janela Print do Painel Modo Janela Print do Painel Tela cheia Codigo Caso vocês precisem se forem detectar o problema no código em si cFenixMTA.lua --[[ ################################################ # # # SCRIPT DESENVOLVIDO POR: # # Facebook.com/FENIXMTA/ # # Youtube.com/FENIXMTA # # Não retire os créditos ! # # # ################################################ --]] local screenW, screenH = guiGetScreenSize() local resW, resH = 1360,768 local x, y = (screenW/resW), (screenH/resH) local dxfont0_fonte = dxCreateFont("Files/fonte.ttf", 10) local dxfont1_fonte = dxCreateFont("Files/fonte.ttf", 12) FM_gridList = dxGrid:Create(screenW * 0.4034, screenH * 0.4844, screenW * 0.1757, screenH * 0.1237) colum = FM_gridList:AddColumn("Tempo", 230) FM_gridList:SetVisible(false) local components = { "Segundo(s)", "Minuto(s)", "Hora(s)", "Dia(s)" } for _, component in ipairs( components ) do FM_gridList:AddItem ( colum ,component) end local ID = createElement("FM_dxEditBox") local Motivo = createElement("FM_dxEditBox") local Tempo = createElement("FM_dxEditBox") function dxPainel () dxDrawRectangle(screenW * 0.3477, screenH * 0.2708, screenW * 0.2870, screenH * 0.4310, tocolor(0, 0, 0, 160), false) dxDrawRectangle(screenW * 0.3477, screenH * 0.2708, screenW * 0.2870, screenH * 0.0391, tocolor(0, 0, 0, 160), false) dxDrawRectangle(screenW * 0.3477, screenH * 0.3099, screenW * 0.1127, screenH * 0.0000, tocolor(255, 0, 0, 255), false) dxDrawRectangle(screenW * 0.3477, screenH * 0.3099, screenW * 0.2870, screenH * 0.0039, tocolor(255, 0, 0, 255), false) dxDrawText("Painel de Punições", 475, 208, 867, 238, tocolor(255, 255, 255, 255), 1.00, dxfont0_fonte, "center", "center", false, false, false, false, false) dxDrawEditBox("ID Jogador", screenW * 0.4034, screenH * 0.3320, screenW * 0.1757, screenH * 0.0378, false, 100, ID) dxDrawEditBox("Motivo do Ban", screenW * 0.4034, screenH * 0.3828, screenW * 0.1757, screenH * 0.0378, false, 200, Motivo) dxDrawEditBox("Tempo do Ban", screenW * 0.4034, screenH * 0.4336, screenW * 0.1757, screenH * 0.0378, false, 200, Tempo) dxDrawImage(screenW * 0.4341, screenH * 0.6276, screenW * 0.1142, screenH * 0.0612, "Files/button.png", 0, 0, 0, tocolor(255, 0, 0, 255), false) dxDrawText("Banir", screenW * 0.4341, screenH * 0.6250, screenW * 0.5483, screenH * 0.6888, tocolor(255, 255, 255, 255), 1.00, dxfont1_fonte, "center", "center", false, false, false, false, false) end function abrirDx () if not isEventHandlerAdded("onClientRender", getRootElement(), dxPainel) then addEventHandler("onClientRender", root , dxPainel) showCursor(true) FM_gridList:SetVisible(true) else removeEventHandler ("onClientRender" , root, dxPainel) showCursor(false) FM_gridList:SetVisible(false) end end addEvent ("FM_OpenPainel", true) addEventHandler ("FM_OpenPainel", getRootElement(), abrirDx ) function Banir (_,state) if isEventHandlerAdded("onClientRender", root, dxPainel) then if state == "down" then if cursorPosition (screenW * 0.4341, screenH * 0.6276, screenW * 0.1142, screenH * 0.0612) then local ID_Jogador = getElementData(ID, "FM_Texto") local Motivo_Banir = getElementData(Motivo, "FM_Texto") local Tempo_Banir = getElementData(Tempo, "FM_Texto") local gridItem = FM_gridList:GetSelectedItem() local Tempo_Selecionado = FM_gridList:GetItemDetails( colum, gridItem, 1) or nil local ID = tonumber ( ID_Jogador ) or nil local T_Banir = tonumber ( Tempo_Banir ) or nil if ID == tonumber("0") or ID == nil then return outputChatBox("ID") end if Motivo_Banir == "" or Motivo_Banir == nil then return outputChatBox("Motivo") end if T_Banir == tonumber("0") or T_Banir == nil then return outputChatBox("TEMPO") end if Tempo_Selecionado == nil then return outputChatBox("Escolha tempo") end triggerServerEvent ( "FM_banirJogador", getLocalPlayer(), ID , T_Banir, Tempo_Selecionado, Motivo_Banir ) end end end end addEventHandler ( "onClientClick", root, Banir ) 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 function cursorPosition(x, y, w, h) if (not isCursorShowing()) then return false end 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 sFenixMTA.lua --[[ ################################################ # # # SCRIPT DESENVOLVIDO POR: # # Facebook.com/FENIXMTA/ # # Youtube.com/FENIXMTA # # Não retire os créditos ! # # # ################################################ --]] function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end Acl = "Admin" -- Grupo do Painel P , que terá acesso ao Dx Cmd = "punir" -- Comando para abrir o Dx function abrirDx (source,command) local acc = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..acc, aclGetGroup (Acl)) then triggerClientEvent (source, "FM_OpenPainel", source) end end addCommandHandler(Cmd ,abrirDx) function banirJogador ( ID , T_Banir , Tempo_Selecionado , Motivo_Banir) local FDP = getPlayerID(ID) if Tempo_Selecionado == "Segundo(s)" then Multiplicador = 1 elseif Tempo_Selecionado == "Minuto(s)" then Multiplicador = 60 elseif Tempo_Selecionado == "Hora(s)" then Multiplicador = 3600 elseif Tempo_Selecionado == "Dia(s)" then Multiplicador = 86400 end Tempo = T_Banir*Multiplicador banPlayer ( FDP, true, false, true, "" , ""..Motivo_Banir.."" , ""..Tempo.."" ) end addEvent("FM_banirJogador" , true) addEventHandler("FM_banirJogador" , getRootElement() , banirJogador) addEventHandler ( "onResourceStart", resourceRoot, function ( mod ) if isObjectInACLGroup ( "resource." .. getResourceName ( mod ), aclGetGroup ( "Admin" ) ) then outputDebugString ( "Banco Itaú Ativado com Sucesso.", 3 ) else cancelEvent ( ) outputChatBox ( "#FFA500[ATENÇÃO] #FFFFFF- Para Ativar este #FFA500Resource #FFFFFF[...] Adicione sua ACL no #FFA500Admin.", root, 255, 255, 255, true ) end end )
-
[PT-BR] Paineis identicos, apenas com as function diferentes, dando interferencia, como arrumar ? os paineis são separados por acl, mas quando aperto a bind key, ele abre os dois, mas não tem permissão para acessar os recursos, mesmo assim atrapalha, por que todos os paineis das corporaçoes, são o mesmo, alterando apenas as function e o grupo de acl script:
-
glock = createMarker(297.947, -80.809, 1000.600, "cylinder", 1, 255, 0, 0, 40) setElementInterior(glock, 4) local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawLine(365 - 1, 222 - 1, 365 - 1, 546, tocolor(48, 212, 5, 255), 1, false) dxDrawLine(660, 222 - 1, 365 - 1, 222 - 1, tocolor(48, 212, 5, 255), 1, false) dxDrawLine(365 - 1, 546, 660, 546, tocolor(48, 212, 5, 255), 1, false) dxDrawLine(660, 546, 660, 222 - 1, tocolor(48, 212, 5, 255), 1, false) dxDrawRectangle((screenW - 295) / 2, (screenH - 324) / 2, 295, 324, tocolor(28, 28, 28, 179), false) dxDrawRectangle(422, 254, 0, 66, tocolor(255, 255, 255, 255), false) dxDrawImage(365, 222, 295, 324, ":GUI/images/examples/new_city_sfundo.png", 0, 0, 0, tocolor(108, 108, 108, 77), false) dxDrawLine(375 - 1, 452 - 1, 375 - 1, 536, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(650, 452 - 1, 375 - 1, 452 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(375 - 1, 536, 650, 536, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(650, 536, 650, 452 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(375, 452, 275, 84, tocolor(21, 131, 10, 210), false) dxDrawText("R$15.000", 380 - 1, 398 - 1, 655 - 1, 448 - 1, tocolor(0, 0, 0, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("R$15.000", 380 + 1, 398 - 1, 655 + 1, 448 - 1, tocolor(0, 0, 0, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("R$15.000", 380 - 1, 398 + 1, 655 - 1, 448 + 1, tocolor(0, 0, 0, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("R$15.000", 380 + 1, 398 + 1, 655 + 1, 448 + 1, tocolor(0, 0, 0, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("R$15.000", 380, 398, 655, 448, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("comprar", 385, 464, 640, 526, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawRectangle(365, 222, 295, 32, tocolor(48, 212, 5, 255), false) dxDrawImage(442, 259, 150, 153, ":GUI/images/examples/G-18.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("Glock-18", 369, 228, 654, 249, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false) end )
-
eu tinha feito com bind no "k", mas quero passar o painel para o marker. Marker glock = createMarker(297.947, -80.809, 1000.600, "cylinder", 1, 255, 0, 0, 40) setElementInterior(glock, 4) Server function showPanellr(thePlayer) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("Porte")) then triggerClientEvent(thePlayer, "painelglock", getRootElement()) end end function onResStartlr() for index, player in ipairs(getElementsByType("player")) do bindKey(player, "k", "down", showPanellr) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onResStartlr) function onPlayerJoinlr() bindKey(source, "k", "down", showPanellr) end addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoinlr) function cleanAlllr(player) for index, player in ipairs(getElementsByType("player")) do unbindKey(player, "k", "down", showPanellr) end end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), cleanAlllr) function arma () giveWeapon( source, 22, 300, true ) outputChatBox ('( #ff0000INFO#ffffff ) #ffff00Você comprou #00ff00Glock-18 !',source,255,255,255,true) end addEvent("glock",true) addEventHandler ( "glock", getRootElement(), arma ) Client local screenW,screenH = guiGetScreenSize() local resW, resH = 1365,767 local x, y = (screenW/resW), (screenH/resH) function Pdx () dxDrawLine(333 - 1, 194 - 1, 333 - 1, 574, tocolor(38, 237, 11, 254), 1, false) dxDrawLine(691, 194 - 1, 333 - 1, 194 - 1, tocolor(38, 237, 11, 254), 1, false) dxDrawLine(333 - 1, 574, 691, 574, tocolor(38, 237, 11, 254), 1, false) dxDrawLine(691, 574, 691, 194 - 1, tocolor(38, 237, 11, 254), 1, false) dxDrawRectangle((screenW - 358) / 2, (screenH - 380) / 2, 358, 380, tocolor(0, 0, 0, 138), false) dxDrawImage(333, 194, 358, 380, ":GUI/images/examples/new_city_sfundo.png", 0, 0, 0, tocolor(254, 254, 254, 50), false) dxDrawImage(417, 257, 202, 160, ":GUI/images/examples/G-18.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawRectangle(333, 194, 358, 53, tocolor(21, 133, 6, 111), false) dxDrawRectangle(359, 468, 310, 80, tocolor(21, 133, 6, 111), false) dxDrawText("R$15.000", 346, 417, 681, 463, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("Glock-18", 338, 203, 681, 237, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("comprar", 372, 481, 659, 538, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) end function abrir (_,state) if painel == false then showCursor(true) addEventHandler("onClientRender", root, Pdx) painel = true else showCursor(false) removeEventHandler("onClientRender", root, Pdx) painel = false end end addEvent("painelglock", true) addEventHandler("painelglock", root , abrir) function togglePanel() if getElementData(localPlayer,nomeDaACL_Comandante) then if not isEventHandlerAdded("onClientRender",root,onClientRender) then guiGridListClear(playerList) for id, player in ipairs(getElementsByType("player")) do guiGridListSetItemText(playerList, guiGridListAddRow(playerList), 1, getPlayerName(player):gsub('#%x%x%x%x%x%x', ''), false, false) end guiSetVisible(playerList,true) guiSetVisible(edit,true) aVisible = true rVisible = true addEventHandler("onClientRender",root,onClientRender) showCursor(true) else guiSetVisible(playerList,false) guiSetVisible(edit,false) removeEventHandler("onClientRender",root,onClientRender) showCursor(false) end end end 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 arma (_,state) if painel == true then if state == "down" then if isCursorOnElement(372, 481, 659, 538) then triggerServerEvent ("glock", localPlayer) end end end end addEventHandler ("onClientClick", root, arma) preciso só da introdução do comando o resto deixa cmg (faz tempo que não mexo com isso, ja esqueci de muitas coisas) quero por o painel de comprar a glock no marker indicado....
-
Então qnd eu ativo o painel de gang e da corp quando eu vou spawnar de um dos paineis o carro ele vem o carro da gang e da corp Alguem me ajuda pls
-
Bom pessoal, fiz recentemente um painel de recrutamento, no qual o jogador pode criar um recrutamento em determinado local, dimensão, e teletransporte. O sistema funcionou corretamente, porém, preciso duplicar esse recurso para que duas gangs possam usa-lo, e quando dupliquei os dois mods eles bugaram, como se eu estivesse usando dois painéis, por exemplo: quando crio um recrutamento através do painel do resource painelrecrutar_w ele cria o recrutamento nesse recurso e no outro(painelrecrutar), como criando dois teletransportes. Já tive esse mesmo problema ao duplicar painéis, quando uso um parece que estou usando dois(o duplicado e original). Alguém sabe como resolver esse problema? Grato.