Jump to content

Sparta

Members
  • Posts

    14
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Sparta's Achievements

Square

Square (6/54)

0

Reputation

  1. --Função no SERVER addEvent ("DS: Pegar_armas", true) addEventHandler ("DS: Pegar_armas", root, function (jogador, plano) if plano == "Bronze" then for _, v in ipairs (armas_bronze) do if not exports.inventario: hasItemS (jogador, v) then extensions.inventario: giveItem (jogador, v, 1, 1, 1, 1) end end elseif plano == "Prata" then for _, v in ipairs (armas_prata) do if not exports.inventario : hasItemS (jogador, v) depois exporta.inventario: giveItem (jogador, v, 1, 1, 1, 1) end end elseif plano == "Ouro" então triggerEvent ("TS: giveItem", source, source, 28, 1) - Arma elseif plano == "Diamante" then for _, v in ipairs (armas_diamante) do if not extensions.inventario: hasItemS (jogador, v) depois exportações.inventario: giveItem (jogador, v, 1, 1, 1, 1) end end end end) Essa função funciona da seguinte maneira, o jogador abre o painel e ao clicar para pegar armas esse elemento 'triggerEvent ("TS: giveItem", source, source, 28, 1)' seta no invetario do mesmo a arma com id 28 e 1 quantidade, na primeira vez funciona normalmente mas na segunda ele incrementa automaticamente 2 quantiade e assim sucessivamnete, o erro pode estar nesta parte?
  2. Galera to querendo trocar apenas as roupas do mta, por exemplo, poder inserir no cj diversos tipos de roupas, mas não consigo achar roupas modificadas, alguém pode me ajudar?
  3. Criar um script de receber dinheiro, a partir de um comando qualquer player recebe uma quantidade de dinheiro específica.
  4. Opa galera, não sei muito de .Lua e gostaria de um projeto muito simples, um painel que possa dar dinheiro a um determinado player usando o id ou nick. Agradeço a quem poder ajudar.
  5. KKKKKKKK, Blz é porque eu não tenho tanto tempo. Como quero adicionar a um painel já pronto fico meio complicado pra min, já que para pegar qualquer emprego usa-se a condição "DNL:Pedir_Demissao" e sinceramente não sei o que fazer, pois só quando pegasse o trabalho de mecânico fosse adicionado a acl function darmecanico (type, join, leave) if (type == "DNL:Pegar_Emprego") then if (isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (client)), aclGetGroup("Mecanico"))) then outputChatBox ("Você já está no trabalho de mecanico!", client, 255, 30, 30) else aclGroupAddObject (aclGetGroup("Mecanico"), "user."..getAccountName (getPlayerAccount (client))) outputChatBox ("Parabéns! Agora você está trabalhando de mecânio!", client, 0, 255, 0) end elseif (type == "DNL:Pegar_Emprego") then if (isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (client)), aclGetGroup("Mecanico"))) then aclGroupRemoveObject (aclGetGroup("Mecanico"), "user."..getAccountName (getPlayerAccount (client))) outputChatBox ("Você saiu do trabalho de mecânico!", client, 0, 255, 0) else outputChatBox ("Você não está no trabalho de mecânico!", client, 255, 30, 30) end end end addEvent ("onRequestPegarEmprego", true) addEventHandler ("onRequestPegarEmprego", root, darmecanico)
  6. Como sou leigo no assunto tem como fazer pra min?
  7. Então galera to com uma agencia de emprego, e queria adicionar mais empregos, especificamente o de mecânico, é bem simples adicionar um emprego mas no caso do de mecânico é necessário estar no grupo "Mecanico" na acl, eu queria ajuda para quando pegar o emprego de mecânico ser automaticamente adicionado no grupo mecânico da acl. CODIGO DA AGENCIA SERVE --Pegar Trabalho function Pegar_Emprego (source, Trab, Level, Hab) local Trabalho = getElementData ( source, "Emprego" ) or "Desempregado" local Habilicao = getElementData ( source, "DNL:Categoria("..Hab..")") local Level_Player = tonumber(getElementData(source, "Level")) or 0 if Level_Player >= tonumber(Level) then if Trabalho == Trab then triggerClientEvent(source, "addNotification", root, "#ffffffINFO: #ffffffVocê Já Trabalha Como #106FE7"..Trab.."", "info") return end if Habilicao == false then triggerClientEvent(source, "addNotification", root, "#ffffffErro: #ffffffVocê Não Tem Habilitação ("..Hab..") e Não Pode Trabalhar Como ("..Trab..")", "erro") return end setElementData ( source, "Emprego", Trab ) triggerClientEvent(source, "addNotification", root, "#ffffffINFO: #ffffffVocê Agora Trabalha de #106FE7"..Trab.."", "info") else triggerClientEvent(source, "addNotification", root, "#ffffffErro: #ffffffSeu Level é Muito Baixo e Você Não Pode Trabalhar Como #106FE7"..Trab.."", "erro") end end addEvent("DNL:Pegar_Emprego", true) addEventHandler("DNL:Pegar_Emprego", root, Pegar_Emprego) --Demissao Trabalho function Pedir_Demissao (source) local Trabalho = getElementData ( source, "Emprego" ) or "Desempregado" if Trabalho == "Desempregado" then triggerClientEvent(source, "addNotification", root, "#ffffffErro: #ffffffVocê não está empregado para se demitir.", "erro") return end setElementData ( source, "Emprego", "Desempregado" ) triggerClientEvent(source, "addNotification", root, "#ffffffSucesso: #ffffffVocê Se Demitiu Do Emprego de #106FE7"..Trabalho.."", "sucesso") end addEvent("DNL:Pedir_Demissao", true) addEventHandler("DNL:Pedir_Demissao", root, Pedir_Demissao) CODIGO CLIENTE DA AGENCIA local screenW,screenH = guiGetScreenSize() local resW,resH = 1366,768 local x,y = (screenW/resW), (screenH/resH) local Font_1 = dxCreateFont("font/font.ttf", y*11) local Font_2 = dxCreateFont("font/font1.ttf", y*11) local Font_3 = dxCreateFont("font/fontNick.ttf", y*10) local Font_4 = dxCreateFont("font/OpenSans-Bold.ttf", y*11) ------------- ############################################ ------------- ------------- # Edite aqui (Level, Habilitação) # ------------- ------------- ############################################ ------------- Trabalhos = { {"Lixeiro", 0, "Nenhuma"}, -- Emprego, Level, Habilitação {"Carregador", 3, "Nenhuma"}, -- Emprego, Level, Habilitação {"Pescaria", 0, "Nenhuma"}, -- Emprego, Level, Habilitação {"Mineirador", 0, "Nenhuma"}, -- Emprego, Level, Habilitação {"Pizzaboy", 5, "A"}, -- Emprego, Level, Habilitação {"Sedex", 10, "C"}, -- Emprego, Level, Habilitação {"Caminhoneiro", 15, "D"}, -- Emprego, Level, Habilitação } --===================================-- ------------- Abrir/Fechar ------------ --===================================-- function Abrir_agencia () if isEventHandlerAdded("onClientRender", getRootElement(), Dx_Agencia) then return end showCursor(true) ListaTrabalhos:SetVisible(true) addEventHandler("onClientRender", root, Dx_Agencia) end addEvent("AG:Abrir", true) addEventHandler("AG:Abrir", root, Abrir_agencia) function CloseAgencia () if isEventHandlerAdded("onClientRender", getRootElement(), Dx_Agencia) then showCursor(false) ListaTrabalhos:SetVisible(false) removeEventHandler("onClientRender", root, Dx_Agencia) end end --=======================================-- ------------- Interface Painel ------------ --=======================================-- function Dx_Agencia () exports["Blur"]:dxDrawBluredRectangle(x*488, y*138, x*391, y*491, tocolor(255, 255, 255, 255)) dxDrawRectangle(x*488, y*138, x*391, y*491, tocolor(0, 0, 0, 170), false) dxDrawRectangle(x*489, y*138, x*391, y*38, tocolor(0, 0, 0, 212), false) dxDrawLine(x*488, y*176, x*880, y*176, tocolor(16, 111, 231, 255), x*2, false) dxDrawText("Agencia de Empregos", x*621, y*146, x*746, y*161, tocolor(255, 255, 255, 255), 1.00, Font_1, "left", "top", false, false, false, false, false) dxDrawImage(x*500, y*494, x*366, y*37, "Img/botao.png", 0, 0, 0, CorEmprego, false) dxDrawText("Pegar Emprego", x*639, y*502, x*729, y*519, tocolor(0, 0, 0, 255), 1.00, Font_1, "left", "top", false, false, false, false, false) CorEmprego = tocolor(16, 111, 231, 170) if isCursorOnElement(x*500, y*494, x*366, y*37) then CorEmprego = tocolor(16, 111, 231, 200) end dxDrawImage(x*500, y*538, x*366, y*37, "Img/botao.png", 0, 0, 0, CorDemissao, false) dxDrawText("Pedir Demissão", x*640, y*546, x*726, y*563, tocolor(0, 0, 0, 255), 1.00, Font_1, "left", "top", false, false, false, false, false) CorDemissao = tocolor(16, 111, 231, 170) if isCursorOnElement(x*500, y*538, x*366, y*37) then CorDemissao = tocolor(16, 111, 231, 200) end dxDrawImage(x*500, y*582, x*366, y*37, "Img/botao.png", 0, 0, 0, CorSair, false) dxDrawText("Sair Agencia", x*650, y*590, x*719, y*609, tocolor(0, 0, 0, 255), 1.00, Font_1, "left", "top", false, false, false, false, false) CorSair = tocolor(16, 111, 231, 170) if isCursorOnElement(x*500, y*582, x*366, y*37) then CorSair = tocolor(16, 111, 231, 200) end end --================================-- ------------- GridTable ------------ --================================-- addEventHandler("onClientResourceStart", resourceRoot, function () ListaTrabalhos = dxGridW:Create(494, 183, 379, 302) ListaTrabalhos:AddColumn("Emprego", 140) ListaTrabalhos:AddColumn("Level", 105) ListaTrabalhos:AddColumn("Habilitação", 120) ListaTrabalhos:SetVisible(false) for i,v in ipairs (Trabalhos) do ListaTrabalhos:AddItem(1, tostring(v[1])) ListaTrabalhos:AddItem(2, tostring(v[2])) ListaTrabalhos:AddItem(3, tostring(v[3])) end end) --=============================-- ------------- Clicks ------------ --=============================-- function Pegar_Trabalho ( _,state ) if isEventHandlerAdded("onClientRender", getRootElement(), Dx_Agencia) then if state == "down" then if isCursorOnElement(x*500, y*582, x*366, y*37) then -- Fechar Agencia CloseAgencia () end if isCursorOnElement(x*500, y*494, x*366, y*37) then -- Pegar Emprego if ListaTrabalhos:GetSelectedItem() > -1 then local Trab = ListaTrabalhos:GetItemDetails(1, ListaTrabalhos:GetSelectedItem()) local Level = ListaTrabalhos:GetItemDetails(2, ListaTrabalhos:GetSelectedItem()) local Hab = ListaTrabalhos:GetItemDetails(3, ListaTrabalhos:GetSelectedItem()) playSoundFrontEnd(12) triggerServerEvent("DNL:Pegar_Emprego", root, localPlayer, Trab, Level, Hab) else triggerEvent("addNotification", root, "#ffffffINFO: #ffffffSelecione o Emprego que Você Deseja Trabalhar", "info") end elseif isCursorOnElement(x*500, y*538, x*366, y*37) then -- Demissão playSoundFrontEnd(12) triggerServerEvent("DNL:Pedir_Demissao", root, localPlayer) end end end end addEventHandler ( "onClientClick", root, Pegar_Trabalho ) --=============================-- ------------- IGNORA ------------ --=============================-- --==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==- addEventHandler("onClientKey", root, function (button, press) if isEventHandlerAdded("onClientRender", getRootElement(), Dx_Agencia) then if button == "F1" or button == "F2" or button == "F3" or button == "F5" or button == "F6" or button == "F7" or button == "F9" or button == "F10" or button == "F11" or button == "F12" or button == "t" or button == "p" or button == "m" then cancelEvent() end end end ) --==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==- 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 --==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==- local x,y = guiGetScreenSize() 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 --==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==- CODIGO SERVE DO EMPREGO DE MECANICO Grupo = "Mecanico" -- Mude o Grupo da Acl Aqui! Preco_Kit = 500 -- Mude Preço do kit aqui! LimiteReparoMec = 20 -- Mude Limite de Kit Aqui! --[[ ><><><><><><><><><><><><><><><><><><><>< >< Infos Trabalho >< ><><><><><><><><><><><><><><><><><><><>< --]] function Info (source) accountname = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user." .. accountname, aclGetGroup(Grupo)) then outputChatBox("#00ff00=====================================================", source, 255, 255, 255, true) outputChatBox("#00FF00", source, 255, 255, 255, true) outputChatBox("#00ff00/qg - #ffffffPara Marcar seu Local de Trabalho no Mapa.", source, 255, 255, 255, true) outputChatBox("#00FF00", source, 255, 255, 255, true) outputChatBox("#00ff00Trabalhar - #ffffffClique no veiculo Para Repara-lo.", source, 255, 255, 255, true) outputChatBox("#00FF00", source, 255, 255, 255, true) outputChatBox("#00ff00=====================================================", source, 255, 255, 255, true) end end addCommandHandler ( "infos", Info ) function Quartel_Emprego ( source ) accountname = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user." .. accountname, aclGetGroup(Grupo)) then if isElementVisibleTo ( Blip_Emprego, source ) then setElementVisibleTo ( Blip_Emprego, source, false ) exports.Scripts_Dxmessages:outputDx(source, "Seu Local de Trabalho foi Desmarcado do Mapa!", "info") else setElementVisibleTo ( Blip_Emprego, source, true ) exports.Scripts_Dxmessages:outputDx(source, "Seu Local de Trabalho foi Marcado no Mapa!", "info") end end end addCommandHandler ( "qg", Quartel_Emprego ) --[[ ><><><><><><><><><><><><><><><><><><><>< >< Trabalho >< ><><><><><><><><><><><><><><><><><><><>< --]] AbrirPainelMecanico = createMarker(1481.7296142578,-1767.330078125,18.795755386353 -1, "cylinder", 1.2, 0, 255, 0, 50) setElementVisibleTo ( AbrirPainelMecanico, root, true ) Blip_Emprego = createBlipAttachedTo( AbrirPainelMecanico, 42 ) setElementVisibleTo ( Blip_Emprego, root, false ) function OpenPainelMed(source) accountname = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user." .. accountname, aclGetGroup(Grupo)) then if isElementWithinMarker(source, AbrirPainelMecanico) then triggerClientEvent(source,"MEC:Painel",source) setElementVisibleTo ( Blip_Emprego, source, false ) end else exports.Scripts_Dxmessages:outputDx(source, "Apenas Mecânicos podem entrar aqui!", "warning") end end addEventHandler( "onMarkerHit", AbrirPainelMecanico, OpenPainelMed )
  8. Aconteceu uns problemas e eu não pude responder antes, eu testei ele dentro do script da agência e não funcionou além de usar outro painel e colocar if (type == "pegarEmprego"), que ta abrangendo todos empregos, mas a questão principal era incluir ele dentro do painel da agência, mas não consegui sou um pouco leigo no assunto. OBS: No painel de emprego da agencia eu consegui adicionar o nome do emprego e o requisito do level e funciona até com a hud que mostra seu emprego, quero ao pegar o emprego de mecânico ser incluído no grupo "Mecanico" da acl. Código da agencia original. SERVE -- Pegar Trabalho function Pegar_Emprego (source, Trab, Level, Hab) local Trabalho = getElementData ( source, "Emprego" ) or "Desempregado" local Habilicao = getElementData ( source, "DNL:Categoria("..Hab..")") local Level_Player = tonumber(getElementData(source, "Level")) or 0 if Level_Player >= tonumber(Level) then if Trabalho == Trab then triggerClientEvent(source, "addNotification", root, "#ffffffINFO: #ffffffVocê Já Trabalha Como #106FE7"..Trab.."", "info") return end if Habilicao == false then triggerClientEvent(source, "addNotification", root, "#ffffffErro: #ffffffVocê Não Tem Habilitação ("..Hab..") e Não Pode Trabalhar Como ("..Trab..")", "erro") return end setElementData ( source, "Emprego", Trab ) triggerClientEvent(source, "addNotification", root, "#ffffffINFO: #ffffffVocê Agora Trabalha de #106FE7"..Trab.."", "info") else triggerClientEvent(source, "addNotification", root, "#ffffffErro: #ffffffSeu Level é Muito Baixo e Você Não Pode Trabalhar Como #106FE7"..Trab.."", "erro") end end addEvent("DNL:Pegar_Emprego", true) addEventHandler("DNL:Pegar_Emprego", root, Pegar_Emprego) -- Demissao Trabalho function Pedir_Demissao (source) local Trabalho = getElementData ( source, "Emprego" ) or "Desempregado" if Trabalho == "Desempregado" then triggerClientEvent(source, "addNotification", root, "#ffffffErro: #ffffffVocê não está empregado para se demitir.", "erro") return end setElementData ( source, "Emprego", "Desempregado" ) triggerClientEvent(source, "addNotification", root, "#ffffffSucesso: #ffffffVocê Se Demitiu Do Emprego de #106FE7"..Trabalho.."", "sucesso") end addEvent("DNL:Pedir_Demissao", true) addEventHandler("DNL:Pedir_Demissao", root, Pedir_Demissao) Não sei se é necessário mas ta aqui o código de trabalho de mecânico Grupo = "Mecanico" -- Grupo da Acl! Preco_Kit = 500 -- Preço do kit! LimiteReparoMec = 20 -- Limite de Kit! --Infos Trabalho function Info (source) accountname = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user." .. accountname, aclGetGroup(Grupo)) then outputChatBox("#00ff00=====================================================", source, 255, 255, 255, true) outputChatBox("#00FF00", source, 255, 255, 255, true) outputChatBox("#00ff00/qg - #ffffffPara Marcar seu Local de Trabalho no Mapa.", source, 255, 255, 255, true) outputChatBox("#00FF00", source, 255, 255, 255, true) outputChatBox("#00ff00Trabalhar - #ffffffClique no veiculo Para Repara-lo.", source, 255, 255, 255, true) outputChatBox("#00FF00", source, 255, 255, 255, true) outputChatBox("#00ff00=====================================================", source, 255, 255, 255, true) end end addCommandHandler ( "infos", Info ) function Quartel_Emprego ( source ) accountname = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user." .. accountname, aclGetGroup(Grupo)) then if isElementVisibleTo ( Blip_Emprego, source ) then setElementVisibleTo ( Blip_Emprego, source, false ) exports.Scripts_Dxmessages:outputDx(source, "Seu Local de Trabalho foi Desmarcado do Mapa!", "info") else setElementVisibleTo ( Blip_Emprego, source, true ) exports.Scripts_Dxmessages:outputDx(source, "Seu Local de Trabalho foi Marcado no Mapa!", "info") end end end addCommandHandler ( "qg", Quartel_Emprego ) -- Trabalho AbrirPainelMecanico = createMarker(1481.7296142578,-1767.330078125,18.795755386353 -1, "cylinder", 1.2, 0, 255, 0, 50) setElementVisibleTo ( AbrirPainelMecanico, root, true ) Blip_Emprego = createBlipAttachedTo( AbrirPainelMecanico, 42 ) setElementVisibleTo ( Blip_Emprego, root, false ) function OpenPainelMed(source) accountname = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user." .. accountname, aclGetGroup(Grupo)) then if isElementWithinMarker(source, AbrirPainelMecanico) then triggerClientEvent(source,"MEC:Painel",source) setElementVisibleTo ( Blip_Emprego, source, false ) end else exports.Scripts_Dxmessages:outputDx(source, "Apenas Mecânicos podem entrar aqui!", "warning") end end addEventHandler( "onMarkerHit", AbrirPainelMecanico, OpenPainelMed )
  9. O código abaixo é de uma agência de emprego, os empregos veio todos prontos só que não tinha o de mecânico e fui e adicionei, porém para ser mecânico o mod requer o usuário em um grupo na acl, queria ajuda para quando o player pegar o trabalho de mecânico se adicionado automaticamente no grupo da acl e quando pedir demissão ser retirado. Trabalhos = { {"Lixeiro", 0, "Nenhuma" }, -- Emprego, Level, Habilitação {"Carregador", 3,"Nenhuma" }, {"Pizzaboy", 7, "A"}, {"Sedex", 10, "C"}, {"Caminhoneiro", 15, "D"}, {"Mecânico", 15, "C" }, {"Pescaria", 25, "Nenhuma"}, {"Mineirador", 60, "Nenhuma"}, }
  10. Sim eu atualizei, mesmo assim não tinha funcionado, mas eu troquei o script do banco e deu certo!
  11. Só mais uma dúvida, para configurar o sistema de banco a hud, no caso quando deposita aparecer na hud. Eu consegui configurar o sistema de level que é separado utilizando local Level = getElementData(localPlayer,"Level") or 0 mas o de banco não consigo! Sistema da hud! local SaldoBanco = getElementData(localPlayer,"banco:Saldo") or 0 dxDrawText(""..SaldoBanco, x*1175, y*107, x*1195, y*128, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) Sistema do banco! addEvent("paraYatirPara",true) addEventHandler("paraYatirPara",root, function (miktar) local acc = getPlayerAccount (source) if (miktar) then local para = getPlayerMoney (source) if (para >= tonumber(miktar)) then local bankaParasi = getAccountData (acc,"BankaPara") takePlayerMoney (source,miktar) setAccountData (acc,"BankaPara",tonumber(bankaParasi) + tonumber (miktar)) local bankaParasi2 = getAccountData (acc,"BankaPara") local para = getPlayerMoney (source) triggerClientEvent(source, "paraYatirParaC", source,bankaParasi2,para,""..tostring(miktar).." $ foi DEPOSITADO!") local pName = getPlayerName (source) local BankMiktar = getAccountData (acc,"BankaPara") else local bankaParasi2 = getAccountData (acc,"BankaPara") local para = getPlayerMoney (source) triggerClientEvent(source, "paraYatirParaC", source,bankaParasi2,para,"Dinheiro insuficiente!") addEvent("paraCekPara",true) addEventHandler("paraCekPara",root, function (miktar) local acc = getPlayerAccount (source) if (miktar) then local bankaParasi = getAccountData (acc,"BankaPara") if (tonumber(bankaParasi) >= tonumber(miktar)) then givePlayerMoney (source,tonumber(miktar)) setAccountData (acc,"BankaPara",tonumber(bankaParasi) - tonumber (miktar)) local bankaParasi2 = getAccountData (acc,"BankaPara") triggerClientEvent(source, "paraCekParaC", source,bankaParasi2,""..tostring(miktar).." $ Foi retirado!") local pName = getPlayerName (source) local BankMiktar = getAccountData (acc,"BankaPara") else local bankaParasi2 = getAccountData (acc,"BankaPara") triggerClientEvent(source, "paraCekParaC", source,bankaParasi2,"Você não tem dinheiro suficiente no banco!") end OBS: não é todo o script do banco!
  12. Cara vc pode me ajudar Pq Já tentei e não consegui so um pouco leigo no assunto
  13. GALERA TO CRIANDO UM SERVE, COLOQUEI UMA HUD E UM PAINEL LOGIN MAS O A HUD FICA SOBREPÕE O PAINEL LOGIN, ALGUÉM ME AJUDA IMAGEM DA HUD BUGADA: https://imgur.com/BFxvCck local screenH, screenW = guiGetScreenSize() local x, y = (screenH/1366), (screenW/768) local fonte = dxCreateFont("files/fonts/fonte.ttf", 10) --[[ dxDrawRectangle(451, 298, 186, 97, tocolor(0, 0, 0, 122), false) dxDrawRectangle(461, 308, 166, 77, tocolor(229, 112, 17, 208), false) ]] function HUD () if getElementData(getLocalPlayer(), "isPolice") then jobPolice = "Policial" else jobPolice = nil end local showammo1 = getPedAmmoInClip (localPlayer,getPedWeaponSlot(localPlayer)) local showammo2 = getPedTotalAmmo(localPlayer)-getPedAmmoInClip(localPlayer) local showammo3 = getPedTotalAmmo(getLocalPlayer()) local clip = getPedAmmoInClip (getLocalPlayer()) local weapon = getPedWeapon ( getLocalPlayer() ) local arma = getWeaponNameFromID ( weapon ) local SaldoBanco = getElementData(localPlayer,"banco:Saldo") or 0 local Procurado = getPlayerWantedLevel(localPlayer) local Level = getElementData(localPlayer,"Level") or 0 local Emp = jobPolice or (getElementData(getLocalPlayer(), "Emprego") or "Desempregado") local dinheiro1 = ("%008d"):format(getPlayerMoney(getLocalPlayer())) local color1 = tocolor(0,0,0,178) local color2 = tocolor(0,0,0,178) local color3 = tocolor(0,0,0,178) dxDrawImage(x*920, y*-25, x*215, y*112, "files/img/RetanguloHud.png", 0, 0, 0, tocolor(0, 0, 0, 255), true) dxDrawImage(x*1110, y*-25, x*215, y*112, "files/img/RetanguloHud.png", 0, 0, 0, tocolor(0, 0, 0, 255), true) dxDrawImage(x*1110, y*25, x*215, y*112, "files/img/RetanguloHud.png", 0, 0, 0, tocolor(0, 0, 0, 255), true) dxDrawImage(x*920, y*25, x*215, y*112, "files/img/RetanguloHud.png", 0, 0, 0, tocolor(0, 0, 0, 255), true) dxDrawImage(x*1020, y*70, x*215, y*112, "files/img/RetanguloHud.png", 0, 0, 0, tocolor(0, 0, 0, 255), false) dxDrawImage(x*944, y*18, x*26, y*30, "files/img/IconeMala.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(x*1134, y*15, x*31, y*38, "files/img/IconeDinheiro.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(x*1139, y*70, x*23, y*26, "files/img/IconeCartao.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(x*1050, y*116, x*23, y*21, "files/img/EstrelaIcone.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawText("Level: "..Level, x*944, y*-9, x*1202, y*173, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawText(""..SaldoBanco, x*1175, y*40, x*1195, y*128, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawText(""..Procurado, x*1090, y*36, x*1189, y*219, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawText("$"..dinheiro1, x*1175, y*-16, x*1195, y*82, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawText(Emp, x*985, y*-16, x*1195, y*82, tocolor(255, 255, 255, 255), x*1.00, fonte, "left", "center", false, false, true, false, false) dxDrawText("Arma: "..arma.. " || Pente: " ..tostring (showammo1).." / "..tostring (showammo2), x*1075, y*250, x*1195, y*82, tocolor(255, 255, 255, 255), x*0.9, fonte, "left", "center", false, false, true, false, false) end addEventHandler("onClientRender", getRootElement(), HUD) function OnStop () setPlayerHudComponentVisible("armour", true) setPlayerHudComponentVisible("wanted", true) setPlayerHudComponentVisible("weapon", true) setPlayerHudComponentVisible("money", true) setPlayerHudComponentVisible("health", true) setPlayerHudComponentVisible("clock", true) setPlayerHudComponentVisible("breath", true) setPlayerHudComponentVisible("ammo", true) end addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), OnStop) function OnStart () setPlayerHudComponentVisible("armour", false) setPlayerHudComponentVisible("wanted", false) setPlayerHudComponentVisible("weapon", false) setPlayerHudComponentVisible("money", false) setPlayerHudComponentVisible("health", false) setPlayerHudComponentVisible("clock", false) setPlayerHudComponentVisible("breath", false) setPlayerHudComponentVisible("ammo", false) end addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), OnStart ) local hudTable = { "ammo", "armour", "clock", "health", "money", "weapon", "wanted", "area_name", "vehicle_name", "breath", "clock" } addEventHandler("onClientResourceStart", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, false) end end ) addEventHandler("onClientResourceStop", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, true) end end )
×
×
  • Create New...