Jump to content

Jaga

Members
  • Posts

    58
  • Joined

  • Last visited

Everything posted by Jaga

  1. eu dei uma olhadinha e n entendi muito, poderia me dar um exemplo ?
  2. entao soque eu quero que crie quando o elementData "Transportador" for true, e q n precisasse entrar no veiculo para aparecer o marker
  3. vehicle[player] = createVehicle(428, 2016.916, -1751.494, 13.383) local x, y, z = getElementPosition(vehicle[player]) marker[player] = createMarker(x, y - 4.6, z, "cylinder", 1.0, 255, 255, 255) eu fiz esse marker para gerar atras do veiculo especifico, mas se eu movo ele, ele continua no msm lugar, so muda para a pos onde o veiculo esta, teria um jeito de eu fzr para criar o marker direto sempre atras do veiculo ? tentei usar o attachElements mas nao consegui usar. Codigo todo. vehicle = {} marker = {} itemobj = {} function Transportador(player) local Transporte = getElementData(player, "Transportador") if not isPedInVehicle(player) then if isElementWithinMarker(player, Emprego) then if Transporte == false then setElementData(player, "Transportador", true) vehicle[player] = createVehicle(428, 2016.916, -1751.494, 13.383) triggerClientEvent(player, "Quantidade", vehicle[player]) exports['infinity_infobox']:showInfobox(player, "Você agora está trabalhando de transportador, empilhe o carro.", "success") elseif Transporte == true then setElementData(player, "Transportador", false) destroyElement(vehicle[player]) exports['infinity_infobox']:showInfobox(player, "Você não está mais trabalhando de transportador", "info") end end end end --==================================== Place MoneyBag ====================================-- function BolsaValor(player) local Px, Py, Pz = getElementPosition(player) local Bag = tonumber(getElementData(player, "BagMoney")) or 0 if getElementData(player, "Transportador") then if not isPedInVehicle(player) then local x, y, z = getElementPosition(vehicle[player]) if isElementWithinMarker(player, Sacolas) then if Bag < 1 then marker[player] = createMarker(x, y - 4.6, z - 0.7, "cylinder", 1.0, 255, 255, 255) setElementData(player, "BagMoney", Bag +1) itemobj[player] = createObject(1550, Px, Py, Pz) setElementFrozen(player, true) setTimer(triggerClientEvent, 100, 1, player, "progressService", root, 1, "") setPedAnimation(player, "CARRY", "liftup", 1000, false, true, false, false, _, true) exports.bone_attach:attachElementToBone(itemobj[player], player, 11, -0.01, 0.04, 0.06, 46, 110, -14) setTimer(function() setPedAnimation(player, "CARRY", "crry_prtial", 4.1, true, true, true) setElementFrozen(player, false) exports['infinity_infobox']:showInfobox(player, "Você pegou uma Sacola, coloque dentro do caminhão.", "success") end, 1000, 1) else exports['infinity_infobox']:showInfobox(player, "Você já está com uma sacola na mão.", "error") end end end end end
  4. Opa funcionou para pegar o itens mas oque faz ele funcionar é eu retirando o... if isElement(Lixeiras[i]) then destroyElement(Lixeiras[i]) end Soque se eu retirar esse destroyElement e so colocar o setElementVisibleTo ele apenas vai fazer o marker sumir, mas mesmo assim vai continuar pegando os itens caso passe os cima, entao precisava fazer o destroyElement e dps fzr o Element voltar quando saisse e voltasse para o trabalho
  5. --==================================== Markers e Visibilidades ====================================-- local posLixeiras = { [1] = {1983.001, -1744.44, 13.547}, [2] = {1993.668, -1738.607, 13.547}, } local Lixeiras = {} local blipLixeiras = {} addEventHandler('onResourceStart', resourceRoot, function () for i, pos in ipairs (posLixeiras) do Lixeiras[i] = createMarker(pos[1], pos[2], pos[3], "cylinder", 1.2, 70, 58, 88, 100) blipLixeiras[i] = createBlipAttachedTo(Lixeiras[i], 2) setBlipVisibleDistance(blipLixeiras[i], 2000) setElementVisibleTo(blipLixeiras[i], root, true) setElementVisibleTo(Lixeiras[i], root, true) setElementVisibleTo(Lixeiras[i], root, true) addEventHandler("onMarkerHit", Lixeiras[i], PegarLixo) end end) function getMarkerPositionInTable (marker) for i, m in ipairs (Lixeiras) do if marker == m then return i end end return false end --==================================== Pegar Emprego ====================================-- function Emprego(player) local Lixeiro = getElementData(player, "Lixeiro") if Lixeiro == false then setElementData(player, "Lixeiro", true) exports['infinity_infobox']:showInfobox(player, "Você agora está trabalhando de lixeiro", "success") elseif Lixeiro == true then setElementData(player, "Lixeiro", false) exports['infinity_infobox']:showInfobox(player, "Você não está mais trabalhando de lixeiro", "info") end end addCommandHandler("lixeiro", Emprego) --==================================== Pegar Item na Lixeira ====================================-- Itens = { {"plastic"}, {"battery"}, {"legos"}, {"glass"}, {"battery"}, {"glass"}, {"legos"}, {"plastic"}, {"plastic"}, {"battery"}, {"legos"}, {"glass"}, {"legos"}, {"battery"}, {"glass"}, {"plastic"}, {"glass"}, {"legos"}, {"plastic"}, {"battery"}, {"legos"}, {"glass"}, {"plastic"}, {"battery"}, {"legos"}, {"glass"}, {"legos"}, {"battery"}, {"glass"}, {"plastic"}, {"glass"}, {"legos"}, {"plastic"}, {"battery"}, {"legos"}, {"glass"}, {"battery"}, {"glass"}, {"legos"}, {"plastic"}, {"plastic"}, {"battery"}, {"legos"}, {"glass"}, } function PegarLixo(hitElement) local RandomItens = math.random(#Itens) local random = math.random(4, 20) if getElementData(hitElement, "Lixeiro") then local i = getMarkerPositionInTable(source) if not i then return end if not isPedInVehicle (hitElement) then setElementFrozen(hitElement, true) setTimer(triggerClientEvent, 1100, 1, hitElement, "progressService", root, 6, "") setPedAnimation(hitElement, "CARRY", "liftup", 6500, true, false, false, false) setTimer(function() if isElement(Lixeiras[i]) then destroyElement(Lixeiras[i]) end exports["Bahamas_Inventory"]:BHM_GiveItem(hitElement, RandomItens, random) exports['infinity_infobox']:showInfobox(hitElement, "Você recolheu oque estava nessa lata de lixo", "success") setElementFrozen(hitElement, false) end, 6500, 1) end end end Ele meio que está pronto soque o RandomItens não está funcionando e não estou conseguindo colocar ele para funfar, e eu eu coloquei o destroyElement apos usar o marker, mas queria fzr q o element do marker voltasse quando eu saisse e voltasse para o emprego pelo o /lixeiro mas n sei como fazer
  6. Opa rapaziada eu tava precisando de ajuda com um bglh, vou mostrar aq. Estou tentando fzr um emprego de lixeiro mas nao queria usar tantos e tantos elementData e queria fazer por tabela. A parte de pegar o emprego está suave, e para aparecer os blip e marker tbm apenas quando pegar o emprego ta suave. lixeira1 = createMarker(1983.001, -1744.44, 13.547, "cylinder", 1.2, 70, 58, 88, 100) lixeira2 = createMarker(1993.668, -1738.607, 13.547, "cylinder", 1.2, 70, 58, 88, 100) bliplixeira1 = createBlipAttachedTo(lixeira1, 2) setBlipVisibleDistance(bliplixeira1, 2000) setElementVisibleTo(bliplixeira1, root, false) setElementVisibleTo(lixeira1, root, false) setElementVisibleTo(lixeira2, root, false) Eu quero transformar os marker em uma tabela para ficar mais limpo o codigo function PegarLixo1(source) local Lixeiro = getElementData(source, "Lixeiro") if Lixeiro == true then if isElementWithinMarker(source, lixeira1) then local random = math.random(4, 20) exports["Bahamas_Inventory"]:BHM_GiveItem(source, "dollars", random) setElementVisibleTo(lixeira1, source, false) setElementVisibleTo(bliplixeira1, source, false) setElementFrozen(source, true) setTimer(triggerClientEvent, 1100, 1, source, "progressService", root, 6, "") setPedAnimation(source, "uzi", "uzi_reload", 6500, true, false, false, false) setTimer(function() exports['infobox']:showInfobox(source, "Você recolheu oque estava nessa lata de lixo", "success") setElementFrozen(source, false) end, 6500, 1) end end end addEventHandler("onMarkerHit", lixeira1, PegarLixo1) Aqui é a parte que seria para pegar oq estaria nos markers, mas eu queria que quando pegasse em 1 marker sumiria e apenas quando sair e pegar o emprego dnv resetaria tudo. e eu sei fzr para n ficar repetindo o marker e tals mas eu teria q ficar duplicando esse codigo varias e varias vezes e nao quero fazer isso, eu quero deixar limpo e leve quem poder me ajudar eu ia agradecer dms pprt
  7. Estou com uma lojinha com inventario acoplado e estou modificando ele totalmente, e queria fazer um metodo de ao arrastar o item da lojinha para o Dx expecifico ele iria compraria o item e iria para o inventario, e que tambem daria para digitar a quantidade e arrastar o item para o dx e viria essa quantidade especifica if shop == "food" then dxDrawText("Loja de Alimentos", x*980, y*120, x*130, y*38, tocolor(255, 255, 255, 255), 0.80, hype.Fonte01, "left", "top", false, false, false, true, false) if tonumber(editQuantidade) then dxDrawText("Total: $"..FoodShopItems[selecionado][2]*editQuantidade, x*780, y*256, x*130, y*38, tocolor(255, 255, 255, 255), 0.60, hype.Fonte01, "left", "center", false, false, false, true, false) end for i, v in pairs(SlotItens["Slots"]) do for index, value in pairs(FoodShopItems) do if i == index then dxDrawImage(SlotItens["Slots"][i][1], SlotItens["Slots"][i][2], SlotItens["Slots"][i][3], SlotItens["Slots"][i][4], "gfx/itens/"..FoodShopItems[index][1]..".png", 0, 0, 0, tocolor(255, 255, 255, 255)) end end end if isCursorShowing() and not isTradeVisible and not isReceivingTrade then for i, v in pairs(SlotItens["Slots"]) do if isCursorOnElement(SlotItens["Slots"][i][1], SlotItens["Slots"][i][2], SlotItens["Slots"][i][3], SlotItens["Slots"][i][4]) then for index, value in pairs(pesoItens) do if FoodShopItems[i] ~= nil then if FoodShopItems[i][1] == index then if not itemMoving then local y = SlotItens["Slots"][i][2] + SlotItens["Slots"][i][4] + (screenH/200) local size = 0 local cX, cY = getCursorPosition() local cachePeso = string.format("%.1f", tostring(pesoItens[index][1])) if dxGetTextWidth(realName[FoodShopItems[i][1]][1], 0.50, hype.Fonte01) > dxGetTextWidth("Quantidade: "..FoodShopItems[i][2], 0.50, hype.Fonte01) then size = dxGetTextWidth(realName[FoodShopItems[i][1]][1], 0.50, hype.Fonte01) + (screenW/55) else size = dxGetTextWidth("Quantidade: "..FoodShopItems[i][2], 0.50, hype.Fonte01) + (screenW/55) end dxDrawRoundedRectangle(screenW*cX-(size/2), y, size, screenH * 0.0800, tocolor(28, 28, 28, 255), 5) dxDrawText(realName[FoodShopItems[i][1]][1].."\nPeso: "..cachePeso.."kg\nValor: $"..FoodShopItems[i][2], screenW*cX-(size/2), y, screenW*cX-(size/2)+size, y+screenH * 0.0800, tocolor(255, 255, 255, 255), 0.50, hype.Fonte01, "center", "center", false, false, false, false, false) end end end end end end end
  8. --- Painel DX function Painel() for i = 1,#Pos do if #Edit["Artigos"] >= Pos[i][1] then local Index = Pos[i][1] if Selecionado == Index then dxDrawRoundedRectangle(x*Pos[i][2],y*Pos[i][3],x*Pos[i][4],y*Pos[i][5], tocolor(64, 105, 225, 255), 2) --- Fundo Artigos else dxDrawRoundedRectangle(x*Pos[i][2],y*Pos[i][3],x*Pos[i][4],y*Pos[i][5], tocolor(54, 54, 54, 255), 2) --- Fundo Artigos end end end dxDrawText(""..Edit["Artigos"][Opcao2][1].."", x*1400, y*384, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo dxDrawText(""..Edit["Artigos"][Opcao1][1].."", x*1400, y*364, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo dxDrawText(""..Edit["Artigos"][Opcao3][1].."", x*1400, y*404, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo dxDrawText(""..Edit["Artigos"][Opcao4][1].."", x*1400, y*424, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo dxDrawText(""..Edit["Artigos"][Opcao5][1].."", x*1400, y*444, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo dxDrawText(""..Edit["Artigos"][Opcao6][1].."", x*1400, y*464, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo dxDrawText("Adicionar", x*600, y*344, x*16, y*16, tocolor(255, 255, 255, 255), 0.45, infinity.Fonte01, "left", "top", false, false, false, false, false) --- Adicionar dxDrawText("Remover", x*780, y*344, x*16, y*16, tocolor(255, 255, 255, 255), 0.45, infinity.Fonte01, "left", "top", false, false, false, false, false) --- Remover end ---------- Abrir Painel ------ Painel = false function OpenPanel() if Painel == false then addEventHandler("onClientRender", root, PanelPrision) Painel = true showCursor(true) Pos = { [1] = {1,595, 362, 230, 20}, [2] = {2,595, 382, 230, 20}, [3] = {3,595, 402, 230, 20}, [4] = {4,595, 422, 230, 20}, [5] = {5,595, 442, 230, 20}, [6] = {6,595, 462, 230, 20}, } Selecionado = 0 end end addEvent("Prison", true) addEventHandler("Prison", root, OpenPanel) function Close() if Painel == true then if cursorPosition(x*858.4, y*308, x*16, y*16) then removeEventHandler("onClientRender", root, PanelPrision) IDPlayer = {} Painel = false setElementData(DID, "state", false) setElementData (DID, "text", "") showCursor(false) end end end addEventHandler("onClientClick", root, Close) --------------- (Sistema de selecionar o DX que fica o artigo, e nao o artigo em si) function SelecionarPos(button, state) if Painel == true then if button == "left" and state == "down" then for i = 1,#Pos do if cursorPosition (x*Pos[i][2],y*Pos[i][3],x*Pos[i][4],y*Pos[i][5]) then if Selecionado ~= Pos[i][1] then Selecionado = Pos[i][1] else Selecionado = 0 end end end end end end addEventHandler("onClientClick",root,SelecionarPos) --------- Meu Edit --------- Edit = { {"Policial"}, --- Acl {1531.79126, -1671.59375, 13.38281}, --- Posição Marker {255, 255, 255, 255}, --- Cor Marker {"Torne-se um policial para ter acesso a este local"}, --- Mensagem Erro {"Painel de apreensão aberto com sucesso"}, --- Mensagem Sucesso ["Artigos"] = { {"Porte Ilegal - Art. 16°", 20}, --- Artigo, Tempo {"Furto - Art. 155°", 20}, --- Artigo, Tempo {"Roubo a Mão Armada - Art. 157°", 20}, --- Artigo, Tempo {"Trafico de Armas - Art.87°", 20}, --- Artigo, Tempo {"Formação de Quadrilha - Art. 288°", 20}, --- Artigo, Tempo {"Negociação de Armas - Art. 180°", 20}, --- Artigo, Tempo {"Trafico de Drogas - Art. 33°", 20}, --- Artigo, Tempo {"Ameaça - Art. 147°", 20}, --- Artigo, Tempo {"Suborno - Art. 333°", 20}, --- Artigo, Tempo {"Alta Velocidade - Art. 218°", 20}, --- Artigo, Tempo {"Tentativa de Fuga - Art. 329°", 20}, --- Artigo, Tempo {"Direção Perigosa - Art. 175°", 20}, --- Artigo, Tempo {"Corrida Ilegal - Art. 173°", 20}, --- Artigo, Tempo {"Obstrução de Via Publica - Art. 246°", 20}, --- Artigo, Tempo {"Agressão - Art. 129°", 20}, --- Artigo, Tempo {"Sequestro - Art. 148°", 20}, --- Artigo, Tempo {"Tentativa de Homicídio - Art. 131°", 20}, --- Artigo, Tempo {"Homicídio Culposo - Art. 121°", 20}, --- Artigo, Tempo {"Cumplicidade - Art. 27°", 20}, --- Artigo, Tempo {"Desobediência - Art. 195°", 20}, --- Artigo, Tempo {"Corrupção - Art. 317°", 20}, --- Artigo, Tempo {"Vandalismo - Art. 163°", 20}, --- Artigo, Tempo {"Abuso de Autoridade - Art. 4°", 20}, --- Artigo, Tempo {"Apoligia ao Crime - Art. 287°", 20}, --- Artigo, Tempo {"Extorsão - Art. 158°", 20}, --- Artigo, Tempo {"Calunia - Art. 138°", 20}, --- Artigo, Tempo {"Foragido - Art. 410°", 20}, --- Artigo, Tempo } } Rapaziada, estou fazendo um sistema de apreensão que tem que selecionar o artigo e ira somando o tempo automaticamente, mas não sei como eu posso fazer isso de adicionar, pois sou novo nessa area, se alguem poder me ajudar
  9. Denada qualquer duvida só chamar
  10. Ocorreu tudo certo então ?
  11. Algum erro aparece no Debugscript 3 ?
  12. local Nome = createElement("InfinityEdit") local Idade = createElement("InfinityEdit") local Sexo = createElement("InfinityEdit") function Registro() dxDrawText("Nome:", x*524, y*420.2, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "left", "top", false, false, false, false, false) --- Nome dxDrawText("Passaporte: "..SeuID, x*524, y*432.2, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "left", "top", false, false, false, false, false) --- Passaporte dxDrawText("Sexo:", x*524, y*456.2, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "left", "top", false, false, false, true, false) --- Sexo dxDrawText("Idade:", x*524, y*444.2, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "left", "top", false, false, false, false, false) --- Idade dxDrawEditBox("", x*555, y*420.2, x*90, y*14, false, 10, Nome) dxDrawEditBox("", x*553, y*444.2, x*90, y*14, false, 2, Idade) dxDrawEditBox("", x*548, y*457, x*90, y*14, false, 9, Sexo) end --==================================== Painel DX ====================================-- Painel = false function AbrirPainel() if Painel == false then addEventHandler("onClientRender", root, Registro) Painel = true showCursor(true) end end addEvent("Registro", true) addEventHandler("Registro", root, AbrirPainel) function FecharPainel() if Painel == true then if cursorPosition (x*820, y*308, x*16, y*16) then removeEventHandler("onClientRender", root, Registro) Painel = false setElementData(Nome,"state",false) setElementData(Idade,"state",false) setElementData(Sexo,"state",false) showCursor(false) end end end addEventHandler("onClientClick", root, FecharPainel) --==================================== Funções ====================================-- function ClickButton(button, state) if Painel == true then if button == "left" and state == "down" then if cursorPosition (x*554, y*420.2, x*16, y*16) then setElementData(Nome,"state",true) else setElementData(Nome,"state",false) end if cursorPosition (x*553, y*444.2, x*90, y*14) then setElementData(Idade,"state",true) else setElementData(Idade,"state",false) end if cursorPosition (x*548, y*457, x*90, y*14) then setElementData(Sexo,"state",true) else setElementData(Sexo,"state",false) end end end end addEventHandler("onClientClick", root, ClickButton) Olá, rapaziada estou fazendo um sistema de Identidade e estou fazendo por dxDrawEditBox, e eu dei uma estudadinha sobre os sistemas de identidade mas não entendi muito, se alguem puder me dar um começo doque fazer agradeço, obrigado pela atenção rapaziada
  13. Você pode usar em seu Client local ped = createPed(147, 1829.142, -1435.576, 13.958) setElementRotation(ped, -0, 0, 180) setElementFrozen(ped, true) addEventHandler("onClientRender", root, function() if (getDistanceBetweenPoints3D( 1829.142, -1435.576, 13.958 +1.0, getElementPosition(getLocalPlayer()))) < 10 then local coords = {getScreenFromWorldPosition( 1829.142, -1435.576, 13.958 +1.0)} if coords[1] and coords[2] then dxDrawText("Seu texto", coords[1], coords[2], coords[1], coords[2], tocolor( 255, 255, 255, 255), 1.55, "default", "center", "center", false, false, false, true, false) end end end)
  14. Isso pode ser um "Bug de resolução" pode postar o codigo da Hud para dar uma olhada ?
  15. Olá, mas ninguem possui acesso ao painel P, apenas quem seta eles, verifique se não possui algum (user.*) em alguma ACL que possui o painel P
  16. Olá, substituia isso em ser script, isso ira verificar se a Conta da pessoa que passar no marker ira estar na AclPermitida(Apenas alterar para o nome que deseja) function hit (element) if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup ("AclPermitida")) then if Markers.ID[source] then if getElementType(element) == "player" then triggerClientEvent(element, "TS:AbrirFArmas", element) end end end end addEventHandler("onMarkerHit", resourceRoot, hit) Espero ter ajudado, caso tenha duvidas so falar
  17. --------------- EDIT --------------- Edit = { {"Policial"}, --- Acl {1531.79126, -1671.59375, 13.38281}, --- Posição Marker {255, 255, 255, 255}, --- Cor Marker {"Torne-se um policial para ter acesso a este local"}, --- Mensagem Erro {"Painel de apreensão aberto com sucesso"}, --- Mensagem Sucesso ["Artigos"] = { {"Porte Ilegal - Art. 16°", 20}, --- Artigo, Tempo {"Furto - Art. 155°", 20}, --- Artigo, Tempo {"Roubo a Mão Armada - Art. 157°", 20}, --- Artigo, Tempo {"Trafico de Armas - Art.87°", 20}, --- Artigo, Tempo {"Formação de Quadrilha - Art. 288°", 20}, --- Artigo, Tempo {"Negociação de Armas - Art. 180°", 20}, --- Artigo, Tempo {"Trafico de Drogas - Art. 33°", 20}, --- Artigo, Tempo {"Ameaça - Art. 147°", 20}, --- Artigo, Tempo {"Suborno - Art. 333°", 20}, --- Artigo, Tempo {"Alta Velocidade - Art. 218°", 20}, --- Artigo, Tempo {"Tentativa de Fuga - Art. 329°", 20}, --- Artigo, Tempo {"Direção Perigosa - Art. 175°", 20}, --- Artigo, Tempo {"Corrida Ilegal - Art. 173°", 20}, --- Artigo, Tempo {"Obstrução de Via Publica - Art. 246°", 20}, --- Artigo, Tempo {"Agressão - Art. 129°", 20}, --- Artigo, Tempo {"Sequestro - Art. 148°", 20}, --- Artigo, Tempo {"Tentativa de Homicídio - Art. 131°", 20}, --- Artigo, Tempo {"Homicídio Culposo - Art. 121°", 20}, --- Artigo, Tempo {"Cumplicidade - Art. 27°", 20}, --- Artigo, Tempo {"Desobediência - Art. 195°", 20}, --- Artigo, Tempo {"Corrupção - Art. 317°", 20}, --- Artigo, Tempo {"Vandalismo - Art. 163°", 20}, --- Artigo, Tempo {"Abuso de Autoridade - Art. 4°", 20}, --- Artigo, Tempo {"Apoligia ao Crime - Art. 287°", 20}, --- Artigo, Tempo {"Extorsão - Art. 158°", 20}, --- Artigo, Tempo {"Calunia - Art. 138°", 20}, --- Artigo, Tempo {"Foragido - Art. 410°", 20}, --- Artigo, Tempo } } ---------- Client ----------- (Irei encurtar o codigo para voces apenas verem como é) local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1360), (screenH/768) local infinity = { Fonte01 = dxCreateFont("fonts/fonte.ttf", y*16), } local DID = createElement("ID") Opcao1 = 1 Opcao2 = 2 Opcao3 = 3 Opcao4 = 4 Opcao5 = 5 Opcao6 = 6 --==================================== Painel DX ====================================-- function PanelPrision() dxDrawRoundedRectangle(x*464, y*308, x*410, y*216, tocolor(28, 28, 28, 255), 3) --- Apenas o fundo do painel dxDrawText("Nome: "..Nome, x*475, y*436.2, x*16, y*16, tocolor(255, 255, 255, 255), 0.45, infinity.Fonte01, "left", "top", false, false, false, false, false) --- Nome (Oque eu realmente quero que apereça quando colocar o ID da pessoas) dxDrawText("Idade: ", x*475, y*448.2, x*16, y*16, tocolor(255, 255, 255, 255), 0.45, infinity.Fonte01, "left", "top", false, false, false, false, false) --- Idade (Oque eu realmente quero que apereça quando colocar o ID da pessoas) dxDrawText("Passaporte: ", x*475, y*460.2, x*16, y*16, tocolor(255, 255, 255, 255), 0.45, infinity.Fonte01, "left", "top", false, false, false, false, false) --- Passaporte (Oque eu realmente quero que apereça quando colocar o ID da pessoas) dxDrawText("Sexo: ", x*475, y*472.2, x*16, y*16, tocolor(255, 255, 255, 255), 0.45, infinity.Fonte01, "left", "top", false, false, false, true, false) --- Sexo (Oque eu realmente quero que apereça quando colocar o ID da pessoas) for i = 1,#Pos do if #Edit["Artigos"] >= Pos[i][1] then local Index = Pos[i][1] if Selecionado == Index then dxDrawRoundedRectangle(x*Pos[i][2],y*Pos[i][3],x*Pos[i][4],y*Pos[i][5], tocolor(64, 105, 225, 255), 2) --- Fundo Artigos else dxDrawRoundedRectangle(x*Pos[i][2],y*Pos[i][3],x*Pos[i][4],y*Pos[i][5], tocolor(54, 54, 54, 255), 2) --- Fundo Artigos end end end dxDrawText(""..Edit["Artigos"][Opcao1][1].."", x*1400, y*384, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo dxDrawText(""..Edit["Artigos"][Opcao2][1].."", x*1400, y*364, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo dxDrawText(""..Edit["Artigos"][Opcao3][1].."", x*1400, y*404, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo dxDrawText(""..Edit["Artigos"][Opcao4][1].."", x*1400, y*424, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo dxDrawText(""..Edit["Artigos"][Opcao5][1].."", x*1400, y*444, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo dxDrawText(""..Edit["Artigos"][Opcao6][1].."", x*1400, y*464, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo dxDrawRoundedRectangle(x*595, y*320, x*100, y*20, tocolor(54, 54, 54, 255), 2) --- Escrever ID dxDrawEditBox("", x*616, y*319, x*100, y*20, false, 5, DID) -- Local para escrever o ID end ----- Função de abrir o painel ------- Painel = false function OpenPanel() if Painel == false then addEventHandler("onClientRender", root, PanelPrision) Painel = true showCursor(true) Pos = { [1] = {1,595, 362, 230, 20}, [2] = {2,595, 382, 230, 20}, [3] = {3,595, 402, 230, 20}, [4] = {4,595, 422, 230, 20}, [5] = {5,595, 442, 230, 20}, [6] = {6,595, 462, 230, 20}, } Selecionado = 0 end end addEvent("Prison", true) addEventHandler("Prison", root, OpenPanel) function Close() if Painel == true then if cursorPosition(x*858.4, y*308, x*16, y*16) then removeEventHandler("onClientRender", root, PanelPrision) Painel = false showCursor(false) end end end addEventHandler("onClientClick", root, Close) -------- Oque habilita escrever no local ------- function ClickButton (button, state) if Painel == true then if button == "left" and state == "down" then if cursorPosition(x*616, y*318.5, x*100, y*20) then setElementData(DID, "state", true) end end end end addEventHandler("onClientClick", root, ClickButton) ------ Abaixo tem o sistema de scroll, não tem motivo de eu mmostrar ------ ------------- Server -------------- function OpenPanel(thePlayer) if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup (Edit[1][1])) then triggerClientEvent(thePlayer, "Prison", thePlayer) exports['infinity_infobox']:showInfobox(thePlayer, Edit[5][1], "success") else exports['infinity_infobox']:showInfobox(thePlayer, Edit[4][1], "error") end end addEventHandler("onMarkerHit", marker, OpenPanel) Olá eu irei explicar melhor nesse post oque estou precisando sobre minha duvida. Encurtei meu script para vocês terem uma noção do que realmente precisa, eu estou fazendo um painel de prender pessoas, e não tera como selecionar a pessoa (https://prnt.sc/110xyna), terá que escrever o ID dela no painel, e ira aparecer em um local o Nome, Idade, etc. Mas não ira aparecer nada até escrever o ID da pessoa, após escrever o ID da pessoa ira aparecer as informações faladas, soque sou novo nessa área de script e estou procurando ajuda sobre isso, caso alguem consiga me ajudar e me explicar como ou em que tenho que me basear para fazer, eu iria ficar muito grato pois estou a tempos tentando fazer isso e não consigo, Obrigado a todos que me ajudarem.
  18. local DID = createElement("ID") function PanelPrision() dxDrawText("Nome: "..Nome, x*475, y*436.2, x*16, y*16, tocolor(255, 255, 255, 255), 0.45, infinity.Fonte01, "left", "top", false, false, false, false, false) --- Nome dxDrawText("Idade: 24", x*475, y*448.2, x*16, y*16, tocolor(255, 255, 255, 255), 0.45, infinity.Fonte01, "left", "top", false, false, false, false, false) --- Idade dxDrawText("Passaporte: "..IdPlayer.."", x*475, y*460.2, x*16, y*16, tocolor(255, 255, 255, 255), 0.45, infinity.Fonte01, "left", "top", false, false, false, false, false) --- Passaporte dxDrawText("Sexo: Masculino", x*475, y*472.2, x*16, y*16, tocolor(255, 255, 255, 255), 0.45, infinity.Fonte01, "left", "top", false, false, false, true, false) --- Sexo if cursorPosition(x*595, y*320, x*100, y*20) then dxDrawRoundedRectangle(x*595, y*320, x*100, y*20, tocolor(64, 64, 64, 255), 2) --- Escrever ID else dxDrawRoundedRectangle(x*595, y*320, x*100, y*20, tocolor(54, 54, 54, 255), 2) --- Escrever ID end dxDrawText("ID:", x*604, y*322, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "left", "top", false, false, false, false, false) --- Escrever ID dxDrawEditBox("", x*616, y*319, x*100, y*20, false, 5, DID) end Painel = false function OpenPanel() if Painel == false then addEventHandler("onClientRender", root, PanelPrision) Painel = true showCursor(true) Pos = { [1] = {1,595, 362, 230, 20}, [2] = {2,595, 382, 230, 20}, [3] = {3,595, 402, 230, 20}, [4] = {4,595, 422, 230, 20}, [5] = {5,595, 442, 230, 20}, [6] = {6,595, 462, 230, 20}, } Selecionado = 0 end end addEvent("Prison", true) addEventHandler("Prison", root, OpenPanel) function Close() if Painel == true then if cursorPosition(x*858.4, y*308, x*16, y*16) then removeEventHandler("onClientRender", root, PanelPrision) Painel = false showCursor(false) end end end addEventHandler("onClientClick", root, Close) function ClickButton (button, state) if Painel == true then if button == "left" and state == "down" then if cursorPosition(x*616, y*318.5, x*100, y*20) then setElementData(DID, "state", true) end end end end addEventHandler("onClientClick", root, ClickButton) ------------- Server ----------- local marker = createMarker(Edit[2][1], Edit[2][2], Edit[2][3] -1, "cylinder", 1.10, Edit[3][1], Edit[3][2], Edit[3][3], Edit[3][4]) setElementData(marker, "infinity:custom", true) --==================================== Função ====================================-- function OpenPanel(thePlayer) if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup (Edit[1][1])) then triggerClientEvent(thePlayer, "Prison", thePlayer) exports['infinity_infobox']:showInfobox(thePlayer, Edit[5][1], "success") else exports['infinity_infobox']:showInfobox(thePlayer, Edit[4][1], "error") end end addEventHandler("onMarkerHit", marker, OpenPanel) Rapaziada, estou fazendo um script aqui de prisão e preciso fazer um sistema que quando escrever o ID da pessoa ira aparecer as informações dela, se alguem poder me ajudar, pois nao sei como comecar a fazer quando escrever o id aparecer
  19. Estou fazendo um chat HTML e preciso desativar o chat (Sem ser showChat(False)), eu quero desativar para eles não escreverem, ou se escreverem não ira mandar no chat
  20. Painel = false function OpenPanel() if Painel == false then addEventHandler("onClientRender", root, PanelPrision) Painel = true showCursor(true) Pos = { [1] = {1,595, 362, 230, 20}, [2] = {2,595, 382, 230, 20}, [3] = {3,595, 402, 230, 20}, [4] = {4,595, 422, 230, 20}, [5] = {5,595, 442, 230, 20}, [6] = {6,595, 462, 230, 20}, } Selecionado = 0 end end addEvent("Prison", true) addEventHandler("Prison", root, OpenPanel) function PanelPrision() dxDrawRoundedRectangle(x*595, y*343, x*230, y*144, tocolor(54, 54, 54, 255), 2) --- Fundo Artigos for i = 1,#Pos do if #Edit["Artigos"] >= Pos[i][1] then local Index = Pos[i][1] if Selecionado == Index then dxDrawRoundedRectangle(x*Pos[i][2],y*Pos[i][3],x*Pos[i][4],y*Pos[i][5], tocolor(64, 105, 225, 255), 2) --- Fundo Artigos else dxDrawRoundedRectangle(x*Pos[i][2],y*Pos[i][3],x*Pos[i][4],y*Pos[i][5], tocolor(54, 54, 54, 255), 2) --- Fundo Artigos end end end dxDrawText(""..Edit["Artigos"][Opcao1][1].."", x*1400, y*384, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo dxDrawText(""..Edit["Artigos"][Opcao2][1].."", x*1400, y*364, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo dxDrawText(""..Edit["Artigos"][Opcao3][1].."", x*1400, y*404, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo dxDrawText(""..Edit["Artigos"][Opcao4][1].."", x*1400, y*424, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo dxDrawText(""..Edit["Artigos"][Opcao5][1].."", x*1400, y*444, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo dxDrawText(""..Edit["Artigos"][Opcao6][1].."", x*1400, y*464, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "center", "top", false, false, false, false, false) --- Artigo end function ScrollBaixo(button) if isCursorOnElement(x*595, y*343, x*230, y*144) then if button == "mouse_wheel_down" then for i = 1,#Pos do Pos[i][1] = Pos[i][1] + 6 -- (Para não ficar descendo ou subindo a seleção) proximaPagina = Opcao6 +1 if proximaPagina > #Edit["Artigos"] then return end Opcao1 = Opcao1 +1 Opcao2 = Opcao2 +1 Opcao3 = Opcao3 +1 Opcao4 = Opcao4 +1 Opcao5 = Opcao5 +1 Opcao6 = Opcao6 +1 end end end end bindKey("mouse_wheel_down", "down", ScrollBaixo) function ScrollCima(button) if isCursorOnElement(x*595, y*343, x*230, y*144) then if button == "mouse_wheel_up" then for i = 1,#Pos do Pos[i][1] = Pos[i][1] -6 -- (Para não ficar descendo ou subindo a seleção) paginaAnterior = Opcao1 -1 if paginaAnterior == 0 then return end Opcao1 = Opcao1 -1 Opcao2 = Opcao2 -1 Opcao3 = Opcao3 -1 Opcao4 = Opcao4 -1 Opcao5 = Opcao5 -1 Opcao6 = Opcao6 -1 end end end end bindKey("mouse_wheel_up","down",ScrollCima) function SelecionarPos(b,s) if Painel == true then if b == "left" and s == "down" then for i = 1,#Pos do if cursorPosition(x*Pos[i][2],y*Pos[i][3],x*Pos[i][4],y*Pos[i][5]) then if Selecionado ~= Pos[i][1] then Selecionado = Pos[i][1] else Selecionado = 0 end end end end end end addEventHandler("onClientClick",root,SelecionarPos) ---------------- EDIT -------------- --[[ ██╗░░██╗░█████╗░██╗░░██╗██╗███╗░░██╗░█████╗░███╗░░██╗ ██║░██╔╝██╔══██╗██║░░██║██║████╗░██║██╔══██╗████╗░██║ █████═╝░███████║███████║██║██╔██╗██║███████║██╔██╗██║ ██╔═██╗░██╔══██║██╔══██║██║██║╚████║██╔══██║██║╚████║ ██║░╚██╗██║░░██║██║░░██║██║██║░╚███║██║░░██║██║░╚███║ ╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝╚═╝╚═╝░░╚══╝╚═╝░░╚═╝╚═╝░░╚══╝ ]] Edit = { {"Policial"}, --- Acl {1531.79126, -1671.59375, 13.38281}, --- Posição Marker {255, 255, 255, 255}, --- Cor Marker {"Torne-se um policial para ter acesso a este local"}, --- Mensagem Erro {"Painel de apreensão aberto com sucesso"}, --- Mensagem Sucesso ["Artigos"] = { {"Porte Ilegal - Art. 16°", 20}, --- Artigo, Tempo {"Furto - Art. 155°", 20}, --- Artigo, Tempo {"Roubo a Mão Armada - Art. 157°", 20}, --- Artigo, Tempo {"Trafico de Armas - Art.87°", 20}, --- Artigo, Tempo {"Formação de Quadrilha - Art. 288°", 20}, --- Artigo, Tempo {"Negociação de Armas - Art. 180°", 20}, --- Artigo, Tempo {"Trafico de Drogas - Art. 33°", 20}, --- Artigo, Tempo {"Ameaça - Art. 147°", 20}, --- Artigo, Tempo {"Suborno - Art. 333°", 20}, --- Artigo, Tempo {"Alta Velocidade - Art. 218°", 20}, --- Artigo, Tempo {"Tentativa de Fuga - Art. 329°", 20}, --- Artigo, Tempo {"Direção Perigosa - Art. 175°", 20}, --- Artigo, Tempo {"Corrida Ilegal - Art. 173°", 20}, --- Artigo, Tempo {"Obstrução de Via Publica - Art. 246°", 20}, --- Artigo, Tempo {"Agressão - Art. 129°", 20}, --- Artigo, Tempo {"Sequestro - Art. 148°", 20}, --- Artigo, Tempo {"Tentativa de Homicídio - Art. 131°", 20}, --- Artigo, Tempo {"Homicídio Culposo - Art. 121°", 20}, --- Artigo, Tempo {"Cumplicidade - Art. 27°", 20}, --- Artigo, Tempo {"Desobediência - Art. 195°", 20}, --- Artigo, Tempo {"Corrupção - Art. 317°", 20}, --- Artigo, Tempo {"Vandalismo - Art. 163°", 20}, --- Artigo, Tempo {"Abuso de Autoridade - Art. 4°", 20}, --- Artigo, Tempo {"Apoligia ao Crime - Art. 287°", 20}, --- Artigo, Tempo {"Extorsão - Art. 158°", 20}, --- Artigo, Tempo {"Calunia - Art. 138°", 20}, --- Artigo, Tempo {"Foragido - Art. 410°", 20}, --- Artigo, Tempo } }
  21. Opcoes = { {"1"}, {"2"}, {"3"}, {"4"}, {"5"}, {"6"}, } Pos = { {726, 330 , 343, 37}, {726, 405, 343, 37}, {726, 480, 343, 37}, {726, 555, 343, 37}, } Opcao1 = 1 Opcao2 = 2 Opcao3 = 3 Opcao4 = 4 function Abrir_Painel() if isEventHandlerAdded("onClientRender",getRootElement(), DxTest) then removeEventHandler("onClientRender",root,DxTest) showCursor(false) else addEventHandler("onClientRender",root,DxTest) showCursor(true) end end bindKey("l","down",Abrir_Painel) function DxTest() dxDrawRectangle(724, 261, 345, 381, tocolor(1, 0, 0, 102), false) dxDrawRectangle(725, 258, 344, 63, tocolor(1, 0, 0, 248), false) for i, v in ipairs(Pos) do dxDrawRectangle(v[1],v[2],v[3],v[4], tocolor(1, 0, 0, 150), false) end dxDrawText(""..Opcoes[Opcao1][1].."", 900, 341, 1070, 369, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Opcoes[Opcao2][1].."", 900, 341 +75, 1070, 369, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Opcoes[Opcao3][1].."", 900, 341 +150, 1070, 369, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Opcoes[Opcao4][1].."", 900, 341 +225, 1070, 369, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) end function AbaixarPos(button) if isCursorOnElement(724, 261, 345, 381) then if button == "mouse_wheel_down" then proximaPagina = Opcao4 +1 if proximaPagina > #Opcoes then return end Opcao1 = Opcao1 +1 Opcao2 = Opcao2 +1 Opcao3 = Opcao3 +1 Opcao4 = Opcao4 +1 end end end bindKey("mouse_wheel_down", "down", AbaixarPos) function AumentarPos(button) if isCursorOnElement(724, 261, 345, 381) then if button == "mouse_wheel_up" then paginaAnterior = Opcao1 -1 if paginaAnterior == 0 then return end Opcao1 = Opcao1 -1 Opcao2 = Opcao2 -1 Opcao3 = Opcao3 -1 Opcao4 = Opcao4 -1 end end end bindKey("mouse_wheel_up","down",AumentarPos) 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 isCursorOnElement(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 Coloquei a função onde eu peguei de base do LucasST (Não é meu codigo), mas eu apenas editei algumas coisas que não prejudica nada, mas resumindo eu quero fazer uma forma de seleção nos que estão escrito em "Pos" que apos clicar ira selecionar as "Opções", e ao eu rolar o scroll ele ira sumir pois tara selecionado no que foi selecionado
  22. local infinity = { state = false, Fonte01 = dxCreateFont("fonts/fonte.ttf", y*16), selected = nil, } if Edit["Artigos"][1] then if infinity.selected == 1 then dxDrawRoundedRectangle(x*595, y*360, x*230, y*20, tocolor(64, 105, 225, 255), 2) --- Fundo Artigos end dxDrawText(Edit["Artigos"][1][1], x*655, y*362, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "left", "top", false, false, false, false, false) --- Artigo end if Edit["Artigos"][2] then if infinity.selected == 2 then dxDrawRoundedRectangle(x*595, y*380, x*230, y*20, tocolor(64, 105, 225, 255), 2) --- Fundo Artigos end dxDrawText(Edit["Artigos"][2][1], x*665, y*382, x*16, y*16, tocolor(255, 255, 255, 255), 0.50, infinity.Fonte01, "left", "top", false, false, false, false, false) --- Artigo end function Amostra (_,state) if infinity.state == true then if state == "down" then if cursorPosition(x*595, y*360, x*230, y*20) then if Edit["Artigos"][1] then infinity.selected = 1 end elseif cursorPosition(x*595, y*380, x*230, y*20) then if Edit["Artigos"][2] then infinity.selected = 2 end elseif isCursorOnElement(x*600, y*343, x*60, y*8) then if infinity.selected >= 1 and infinity.selected <= 2 then triggerServerEvent("AddOrRemove", localPlayer, localPlayer, {"Adicionar", infinity.selected}) end elseif isCursorOnElement(x*780, y*343, x*60, y*8) then if infinity.selected >= 1 and infinity.selected <= 2 then triggerServerEvent("AddOrRemove", localPlayer, localPlayer, {"Remove", infinity.selected}) end end end end end addEventHandler("onClientClick", root, Amostra) Olá estou fazendo esse sistema de Prisão, e estou fazendo essa lista de artigos pois não sei mecher com GridList, e todos os artigos não iram caber aqui então irei ter que fazer um sistema de scroll, e eu não sei fazer isso e nem como começar, e queria pedir a ajuda de vocês para como começar e retirar minhas duvidas, irei mandar a print da metade do painel (https://prnt.sc/10ynu7a)
  23. Ola, tenho um script de ID-System, e retirei o DxText para ninguem ver, mas queria saber como faço para apenas quem estiver com a tag conseguir ver o id a cima da cabeça do player. local drawDistance = 32 g_StreamedInPlayers = {} function onClientRender() local cx, cy, cz, lx, ly, lz = getCameraMatrix() for k, player in pairs(g_StreamedInPlayers) do if isElement(player) and isElementStreamedIn(player) then do local vx, vy, vz = getPedBonePosition(player, 4) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then local x, y = getScreenFromWorldPosition(vx, vy, vz + 0.3) if x and y then local ID = getElementData(player, "ID") or "N/A" local w = dxGetTextWidth(ID, 0.1, "default-bold") local h = dxGetFontHeight(1, "default-bold") dxDrawText("", x - 1 - w / 1, y - 1 - h - 12, w, h, CorTag, 1.20, "default-bold", "left", "top", false, false, false, false, false) CorTag = tocolor(255, 255, 255) if getElementData(player, "Cor", true) then CorTag = tocolor(159,61,61) end end end end else table.remove(g_StreamedInPlayers, k) end end end addEventHandler("onClientRender", root, onClientRender) function CorTagid () if getElementData(localPlayer, "Cor", true) then setElementData(localPlayer, "Cor", false) else setElementData(localPlayer, "Cor", true) end end bindKey ( "z", "both", CorTagid ) function onClientElementStreamIn() if getElementType(source) == "player" and source ~= getLocalPlayer() then setPlayerNametagShowing(source, false) table.insert(g_StreamedInPlayers, source) end end addEventHandler("onClientElementStreamIn", root, onClientElementStreamIn) function onClientResourceStart(startedResource) visibleTick = getTickCount() counter = 0 local players = getElementsByType("player") for k, v in pairs(players) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart)
  24. ola gente, estou fazendo esse seguinte dashboard aqui, e quero que quando clique em usuario ele mude para outra imagem, e assim em diante nos outros, mas n sei como comecar, alguem pd me ajudar? esse 'e o script ate agr, ele esta correto ate agr --[[ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ## ####### ###### # # # # ####### # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ❖ Scritp Por Kahinan ❖ ❖ Discord: flying demon angry-?#1622 ]] local screenW,screenH = guiGetScreenSize() local resW, resH = 1280, 720 local x, y = (screenW/resW), (screenH/resH) local components = { "area_name", "radio", "vehicle_name" } function CroakHud ( ... ) if (not isPlayerMapVisible()) then local Dinheiro = getPlayerMoney(localPlayer) local Banco = getElementData(localPlayer, "Bank:Caixa") or "0" local Sujo = getElementData(localPlayer, "Dinheiro_AirNewSCR") or "0" local vida = math.floor(getElementHealth(getLocalPlayer())) local colete = math.floor(getPedArmor(getLocalPlayer())) local fome = getElementData(getLocalPlayer(), "hunger") or 100 local sede = getElementData(getLocalPlayer(), "sede") or 100 local XP = getElementData(getLocalPlayer(), "Level") or "N/A" local tag = getElementData(getLocalPlayer(), "ID") or "N/A" local Nick = getPlayerName(getLocalPlayer()) or "SEM NOME" dxDrawImage(screenW * 0.1406, screenH * 0.1352, screenW * 0.6870, screenH * 0.7269, "img/dashboard.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("$ "..Dinheiro, screenW * 0.3255, screenH * 0.3935, screenW * 0.4000, screenH * 0.4148, tocolor(0, 0, 0, 255), 1.40, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("$ "..Banco, screenW * 0.5036, screenH * 0.3935, screenW * 0.5781, screenH * 0.4148, tocolor(0, 0, 0, 255), 1.40, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..XP, screenW * 0.6802, screenH * 0.3935, screenW * 0.7547, screenH * 0.4148, tocolor(0, 0, 0, 255), 1.40, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("$ "..Sujo, screenW * 0.6802, screenH * 0.6630, screenW * 0.7547, screenH * 0.6843, tocolor(0, 0, 0, 255), 1.40, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("COLETE: "..colete.."%", screenW * 0.5036, screenH * 0.6630, screenW * 0.5781, screenH * 0.6843, tocolor(0, 0, 0, 255), 1.40, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("ID: "..tag, screenW * 0.3255, screenH * 0.6630, screenW * 0.4000, screenH * 0.6843, tocolor(0, 0, 0, 255), 1.40, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("VIDA: "..vida.."%", screenW * 0.5036, screenH * 0.6324, screenW * 0.5781, screenH * 0.6537, tocolor(0, 0, 0, 255), 1.40, "default-bold", "left", "top", false, false, false, false, false) end end local isDXVisible = false bindKey ("TAB", "both", function() if isDXVisible then removeEventHandler( "onClientRender", root, CroakHud ) else addEventHandler( "onClientRender", root, CroakHud ) end isDXVisible = not isDXVisible end) function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1.%2') if ( k==0 ) then break end end return formatted end local screenWidth,screenHeight = guiGetScreenSize() addEventHandler("onClientResourceStart", resourceRoot, function() myScreenSource = dxCreateScreenSource ( screenWidth, screenHeight ) end )
  25. ola sou novo no sistema de dx, mas estou comecando a aprender agora, e estou tentando fazer um aqui, mas o debugscript 3 consta que esta tudo certo, mas o painel nao abre, ainda nao coloquei funcao para clicar em algo e fechar, mas so quero que ele abra apenas o painel mas ainda nada. CLIENT local screenW,screenH = guiGetScreenSize() local resW,resH = 1366,768 local x,y = (screenW/resW), (screenH/resH) painel = false ------------------------------------- function PainelBIKE () dxDrawImage(screenW * 0.1589, screenH * 0.0130, screenW * 0.6292, screenH * 0.9259, "painel.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(screenW * 0.6865, screenH * 0.2056, screenW * 0.0359, screenH * 0.0574, "fechar.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(screenW * 0.2474, screenH * 0.2806, screenW * 0.1953, screenH * 0.3704, "bmx.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(screenW * 0.4828, screenH * 0.2806, screenW * 0.1964, screenH * 0.3704, "mountain.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(screenW * 0.3594, screenH * 0.5861, screenW * 0.1974, screenH * 0.1370, "alugar.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end ---------------------------------------- function Open (_,state) if painel == false then showCursor(true) addEventHandler("onClientRender", root, PainelBIKE) painel = true else showCursor(false) removeEventHandler("onClientRender", root, PainelBIKE) painel = false end end addEvent("OpenDxBike", true) addEventHandler("OpenDxBike", root, Open) SERVER mrkpanel = createMarker(1489.361, -1741.148, 13.547 -1,"cylinder",1.2,0,0,255,255) function AbrirPainelBike(thePlayer) local account = getPlayerAccount (thePlayer) if isGuestAccount (account) then outputChatBox ( "#ff0000✘ #ffffffAGENCIA #ff0000✘➺ #FFFFFFVocê não pode alugar um bike deslogado, Crie uma Conta!", thePlayer, 255,255,255,true) return end if isElementWithinMarker(thePlayer, mrkpanel) then triggerClientEvent(thePlayer,"OpenDxBike") end end addEventHandler("onMarkerHit", mrkpanel, AbrirPainelBike)
×
×
  • Create New...