Jump to content

Angelo Pereira

Members
  • Posts

    251
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by Angelo Pereira

  1. Hum, então você quer que eu faça um usando elemento? mas, antes era a favor das tabelas? engraçado, comenta isso, mais tudo bem. E para finalizar, sobre o tempo é de 1:20min, 10 + do tempo de receber a tabela + 10 min de verificar em 6 EXP.
  2. Fiz umas correções de faltar .. e um outputDebugString (Que eu não tinha visto). local table_experiencia = { } function time_level ( ) for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if acc and not isGuestAccount(acc) then if not table_experiencia[player] then --/> Caso o Jogador não Estiver na Tabela Então faça : table_experiencia[player] = 0 --/> Adiciona-lo com 0 elseif table_experiencia[player] >= 6 then --/> Caso o Jogador Já Tenha 6 EXP então faça : setElementData(player,"Level", tonumber(getElementData(player,"Level") or 0) +1) --/> Jogador Recebeu +1 Level outputChatBox ( "#ffffff[ #82FA58UP #ffffff] - Você Ganhou +1 Level", player, 255, 255, 255, true ) table_experiencia[player] = 0 --/> Seta-lo 0 novamente elseif table_experiencia[player] then --/> Caso o Jogador Esteja na Tabela Então Faça : table_experiencia[player] = tonumber(table_experiencia[player]) + 1 --/> Adicionar +1 a Cada 10min outputChatBox ( "#ffffff[ #82FA58UP #ffffff] - Você Ganhou +1 de Experiência. ("..tonumber(table_experiencia[player]).."/6)", player, 255, 255, 255, true ) end end end end setTimer ( time_level, 10000, 0 ) --/> A Cada 10 S / Demostração. Testado :
  3. Obviamente vai da erro, você colocou 2 sistem level, o que eu fiz do 0, e o seu bugado. Bastava ler o que eu fiz, para ver que a cada 10 minutos iria da 1 EXP, e não disse nenhum momento pra junta os dois LOL
  4. local table_experiencia = { } function time_level ( ) for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if acc and not isGuestAccount(acc) then if not table_experiencia[player] then --/> Caso o Jogador não Estiver na Tabela Então faça : table_experiencia[player] = 0 --/> Adiciona-lo com 0 elseif table_experiencia[player] >= 6 then --/> Caso o Jogador Já Tenha 6 EXP então faça : setElementData(player,"Level", tonumber(getElementData(player,"Level") or 0) +1) --/> Jogador Recebeu +1 Level outputChatBox ( "#ffffff[ #82FA58UP #ffffff] - Você Ganhou +1 Level", player, 255, 255, 255, true ) table_experiencia[player] = 0 --/> Seta-lo 0 novamente elseif table_experiencia[player] then --/> Caso o Jogador Esteja na Tabela Então Faça : table_experiencia[player] = tonumber(table_experiencia[player]) + 1 --/> Adicionar +1 a Cada 10min outputChatBox ( "#ffffff[ #82FA58UP #ffffff] - Você Ganhou +1 de Experiência. ("..tonumber(table_experiencia[player])"/6)", player, 255, 255, 255, true ) end end end end setTimer ( time_level, 60000*10, 0 ) --/> A Cada 10 min Ganha 1 EXP Tente isso, caso você não conseguir resolver o seu. Obs: Não testei.
  5. Eu indicaria usar setElementData só quando realmente necessário, quando você precisar manuseia esse elemento entre outros scripts, server-side e client-side. Só indago aqui, em minha percepção é : 1. Cada um tem sua maneira de manuseia códigos, fazer um resource, se delimitando ou não. 2. Se existe no wiki suas variedades de opções, é para serem usadas, e o que realmente define realmente um resource mal otimizado? Então para eu fazer um script, terei que inventar maneiras, para se dizer "foi diferente" e é mais "otimizado"? Quem garante? Bom, eu já fiz os testes, realmente tem muitas coisas que você consegue otimiza "Não estou polemizando", outras não fará nenhuma diferença, o que será mais indicado a fazer? eu ter que criar um resource que ficará recebendo informação? ou salva-lo diretamente em um elemento? utilizar exportações? triggers? pra mim, ambos é a mesma coisa, claro, cada um tem sua opinião. 3. E em timers, o que pode preocupar, é o tanto de timers sendo acionados, porem, vai depende para que você esta utilizando, você não pode apenas parar de usa-lo por que dizem que dará um resource menos otimizado, vai depende do código de como está sendo feito e para que, o indicado não é deixa um tempo muito rápido, porem, vai depende de cada necessidade.
  6. Não era esse o problema do veiculo indestrutivel, você colocou true quando sai da área, e false quando entrar, era somente isso mesmo. Sem problemas hehe, faz parte, já já você aquece e volta no ritmo, e bem vindo novamente, agora +1 pra ajudar o pessoal hehe
  7. Teste : (Fiz pequenas alterações). -- Format is: {x = 0, y = 0, z = 0, width = 0, depth = 0, height = 0}, local greenzones = { {x = 2441.173, y = -1721.99, z = 1 , width = 130, depth = 120, height = 100}, -- Grove Street {x = 304.336, y = -1836.197, z = 1 , width = 130, depth = 120, height = 100}, -- Praia Los Santos {x = 1154.833, y = -1385.175, z = 1 , width = 70, depth = 100, height = 115}, -- Los Santos Hospital } -- Initialize all zones on resource start local z = {} function initGreenzones() if greenzones and #greenzones ~= 0 then for _, v in ipairs(greenzones) do if v then if v.x and v.y and v.z and v.width and v.depth and v.height then local c = createColCuboid(v.x, v.y, v.z, v.width, v.depth, v.height) local rarea = createRadarArea(v.x, v.y, v.width, v.depth, 0, 255, 0, 150) setElementParent(rarea, c) if c then z[c] = true for _, p in ipairs(getElementsWithinColShape(c, "player")) do setElementData(p, "greenzone", true) end for _, v in ipairs(getElementsWithinColShape(c, "vehicle")) do setElementData(v, "greenzoneveh", true) end addEventHandler("onElementDestroy", c, function() if z[source] then z[source] = nil end end ) --/> Entrar na Área addEventHandler("onColShapeHit", c, function(h) if isElement(h) and getElementType(h) == "player" then if getElementData(h, "colShapeFix_OUT") then setElementData(h, "colShapeFix_OUT", false) return end -- Hack to prevent shooting bug: if player teleports from one greenzone directly to another and fails to clean up (on time) if getElementData(h, "greenzone") then setElementData(h, "colShapeFix_IN", true) triggerClientEvent(h, "onEnterGreenzone", h) else setElementData(h, "greenzone", true) toggleControl(h, "fire", false) toggleControl(h, "aim_weapon", false) toggleControl(h, "vehicle_fire", false) toggleControl(h, "vehicle_secondary_fire", false) outputChatBox("Você esta na area verde", h, 0, 220, 0) triggerClientEvent(h, "onEnterGreenzone", h) end end if isElement(h) and getElementType(h) == "vehicle" then setElementData(h, "greenzoneveh", true) setVehicleDamageProof(h, true) end end ) --/> Sair da Área addEventHandler("onColShapeLeave", c, function(h) if isElement(h) and getElementType(h) == "player" then if getElementData(h, "colShapeFix_IN") then setElementData(h, "colShapeFix_IN", false) return end if getElementData(h, "greenzone") then setElementData(h, "greenzone", false) toggleControl(h, "fire", true) toggleControl(h, "aim_weapon", true) toggleControl(h, "vehicle_fire", true) toggleControl(h, "vehicle_secondary_fire", true) outputChatBox("[AREA] Você saiu da area verde", h, 220, 220, 0) triggerClientEvent(h, "onLeaveGreenzone", h) else setElementData(h, "colShapeFix_OUT", true) end end if isElement(h) and getElementType(h) == "vehicle" then setTimer(setElementData, 350, 1, h, "greenzoneveh", false) setVehicleDamageProof(h, false) end end ) end end end end end end addEventHandler("onResourceStart", resourceRoot, initGreenzones) function resetGreenzoneData() for _, p in ipairs(getElementsByType("player")) do if isElement(p) then removeElementData(p, "greenzone") end end end addEventHandler("onResourceStop", resourceRoot, resetGreenzoneData)
  8. Ai perde a graça conta né, obviamente outros não conseguiram chegar nesta etapa, acho que você deveria conservar essas informações, pra cada um tentar conseguir informações próprias pro andamento do desafio, que é interessante, se não perde a graça hehe
  9. Eu também conseguir fazer-lo start, porem, apenas funciona uma parte do código, a parte descompilada, a parte compilada ainda tem uma proteção, que faz apenas o descompilado funcionar.
  10. Resolver isso não será simples, mas, se o problema está quando faz o salvamento, e quando o carro explode, e ele é respwanado para o local que foi a salvo, faça o seguinte : Utilize o evento de onVehicleExplode, e então quando explodir, remova este veiculo da tabela. (Uma possível solução, não que possa da certo).
  11. Caso queira uma ajuda mais avançada, poste todo o código aqui (Lembrando que aqui ninguém vai adivinhar o que está ocorrendo sem saber seus códigos). Se o problema é este, então ao jogador entrar no veiculo, não está carregando essas informações.
  12. Linha 37, faça (Exemplo dentre outros... --/> Isso se chama gambiar o script HEHE local proxima_tela = 0 --/> Adicione Fora da função, se não vai repetir sempre o 0. timer2 = setTimer( function () fadeCamera(false) if proxima_tela == 0 then local time = 60000 --/> Altere Caso Precisa o Valor do Tempo. local x1,y1,z1 = --/> Adicione Outra Localização de Partida. local x2,y2,z2 = --/> Adicione Outra Localização de Fim. smoothMoveCamera(x1,y1,z1,x1,y1,z1,x2,y2,z2,x2,y2,z2,time) proxima_tela = 1 elseif proxima_tela == 1 then local time = 60000 --/> Altere Caso Precisa o Valor do Tempo. local x1,y1,z1 = --/> Adicione Outra Localização de Partida. local x2,y2,z2 = --/> Adicione Outra Localização de Fim. smoothMoveCamera(x1,y1,z1,x1,y1,z1,x2,y2,z2,x2,y2,z2,time) proxima_tela = 2 --/> Caso Queira Fazer +, e caso queira retorna deixe em 0 end end, timer+1000, 1) --/> O tempo tem que ser acima do atual, para que antes a função acima remova o evento "onClientRender". ) Claro, existe outras formas melhores de se fazer isso, mas apenas foi um exemplo que talvez funcione, ou talvez não.
  13. Respondendo as duas perguntas, tem. 1. Você precisará configurar o script, ao invés de encerrar, iniciar em outra posição. 2. Você precisará ajusta-lo no setCameraMatrix, ou se não souber, apenas faça a camera andar do SUL, ao Norte.
  14. Faça assim : Lembrando, remova todo o seu código de cam já feito, que o script se encarregará disso. (Pra não haver problemas). Adicione em meio ao código de inicializaram do painel : local time = 60000 --/> Velocidade da Camera para Chegar no Alvo. local x1,y1,z1 = -711.65728759766,956.55621337891,12.357646942139 --/> Ponto Inicial local x2,y2,z2 = -729.13031005859,835.33831787109,23.970388412476 --/> Ponto Final smoothMoveCamera(x1,y1,z1,x1,y1,z1,x2,y2,z2,x2,y2,z2,time) Abaixo da Função, Então Adicione : local sm = {} sm.moov = 0 local function removeCamHandler() if(sm.moov == 1)then sm.moov = 0 end end local start = nil local animTime = nil local tempPos = {{},{}} local tempPos2 = {{},{}} local function camRender() if (sm.moov == 1) then local now = getTickCount() local x1,y1,z1 = interpolateBetween(tempPos[1][1], tempPos[1][2], tempPos[1][3], tempPos2[1][1], tempPos2[1][2], tempPos2[1][3], (now-start)/animTime, "Linear") local x2,y2,z2 = interpolateBetween(tempPos[2][1], tempPos[2][2], tempPos[2][3], tempPos2[2][1], tempPos2[2][2], tempPos2[2][3], (now-start)/animTime, "Linear") setCameraMatrix(x1,y1,z1,x2,y2,z2) else removeEventHandler("onClientRender",root,camRender) end end function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time) if(sm.moov == 1) then killTimer(timer1) killTimer(timer2) removeEventHandler("onClientRender",root,camRender) fadeCamera(true) end fadeCamera(true) sm.moov = 1 timer1 = setTimer(removeCamHandler,time,1) timer2 = setTimer(fadeCamera, time-1000, 1, false) start = getTickCount() animTime = time tempPos[1] = {x1,y1,z1} tempPos[2] = {x1t,y1t,z1t} tempPos2[1] = {x2,y2,z2} tempPos2[2] = {x2t,y2t,z2t} addEventHandler("onClientRender",root,camRender) return true end Caso de certo, basta fazer ajustes no código.
  15. Para resolver isso, faça : server-side addEventHandler("onResourceStart", resourceRoot, function () setGlitchEnabled("fastmove", false) setGlitchEnabled("fastsprint", false) setGlitchEnabled("quickstand", false) setGlitchEnabled("fastfire", false) setGlitchEnabled("crouchbug", false) end) --/> Também pode utilizar o recurso NoCrouchSlide (nocrouchslide) : --Link: https://community.multitheftauto.com/index.php?p=resources&s=details&id=13368 --/> Veja também se você não tem nenhum recurso de c-bug no servidor, caso tenha, pode interferir com o script acima.
  16. Eu expliquei de formas, um faça um check diretamente no comando, ou utilizando o trigger (você fez os dois, e não adicionou o que eu falei, enfim)... Sabemos que é da net, da pra identifica só pela bagunça, mas, não quer dizer que não pode ajeitar-lo. Teste isso : -- LG7 Scripter - Não remova os créditos por favor! -- Acesse meu canal e tenha mais conteúdos como esse: -- https://www.youtube.com/c/LG7MTA -- Tenha um(a) bom(a) Dia/Tarde/Noite local screenW, screenH = guiGetScreenSize() local resW, resH = 1366, 768 local x, y = (screenW/resW), (screenH/resH) Painel = false Identidade = false function DxRevistar() local IdRevistado = getElementData(localPlayer, "Suspeito:Nick") or "N/A" dxDrawLine((screenW * 0.3602) - 1, (screenH * 0.3008) - 1, (screenW * 0.3602) - 1, screenH * 0.7292, tocolor(0, 100, 200, 255), 1, false) dxDrawLine(screenW * 0.5256, (screenH * 0.3008) - 1, (screenW * 0.3602) - 1, (screenH * 0.3008) - 1, tocolor(0, 100, 200, 255), 1, false) dxDrawLine((screenW * 0.3602) - 1, screenH * 0.7292, screenW * 0.5256, screenH * 0.7292, tocolor(0, 100, 200, 255), 1, false) dxDrawLine(screenW * 0.5256, screenH * 0.7292, screenW * 0.5256, (screenH * 0.3008) - 1, tocolor(0, 100, 200, 255), 1, false) dxDrawRectangle(screenW * 0.3602, screenH * 0.3008, screenW * 0.1654, screenH * 0.4284, tocolor(47, 47, 47, 255), false) dxDrawText("Nome: #0064c8"..IdRevistado, screenW * 0.3624, screenH * 0.3086, screenW * 0.5227, screenH * 0.3385, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, true, false) dxDrawRectangle(screenW * 0.3624, screenH * 0.3516, screenW * 0.1603, screenH * 0.0391, Cor1, false) dxDrawText("Identidade", screenW * 0.4056, screenH * 0.3516, screenW * 0.4802, screenH * 0.3906, tocolor(255, 255, 255, 255), 1.10, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.3624, screenH * 0.3958, screenW * 0.1603, screenH * 0.0391, Cor2, false) dxDrawText("Checar CNH", screenW * 0.4056, screenH * 0.3958, screenW * 0.4802, screenH * 0.4349, tocolor(255, 255, 255, 255), 1.10, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.3624, screenH * 0.4414, screenW * 0.1603, screenH * 0.0391, Cor3, false) dxDrawText("Multar", screenW * 0.4056, screenH * 0.4414, screenW * 0.4802, screenH * 0.4805, tocolor(255, 255, 255, 255), 1.10, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.3624, screenH * 0.4870, screenW * 0.1603, screenH * 0.0391, Cor4, false) dxDrawText("Algemar", screenW * 0.4056, screenH * 0.4870, screenW * 0.4802, screenH * 0.5260, tocolor(255, 255, 255, 255), 1.10, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.3624, screenH * 0.5313, screenW * 0.1603, screenH * 0.0391, Cor5, false) dxDrawText("Revistar", screenW * 0.4056, screenH * 0.5313, screenW * 0.4802, screenH * 0.5703, tocolor(255, 255, 255, 255), 1.10, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.3624, screenH * 0.5768, screenW * 0.1603, screenH * 0.0391, Cor6, false) dxDrawText("Apreender drogas", screenW * 0.4056, screenH * 0.5768, screenW * 0.4802, screenH * 0.6159, tocolor(255, 255, 255, 255), 1.10, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.3624, screenH * 0.6224, screenW * 0.1603, screenH * 0.0391, Cor7, false) dxDrawText("Apreender armas", screenW * 0.4056, screenH * 0.6224, screenW * 0.4802, screenH * 0.6615, tocolor(255, 255, 255, 255), 1.10, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.3624, screenH * 0.6693, screenW * 0.1603, screenH * 0.0391, Cor8, false) dxDrawText("Prender", screenW * 0.4056, screenH * 0.6693, screenW * 0.4802, screenH * 0.7083, tocolor(255, 255, 255, 255), 1.10, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.5183, screenH * 0.3516, screenW * 0.0044, screenH * 0.0391, tocolor(0, 100, 200, 255), false) dxDrawRectangle(screenW * 0.5183, screenH * 0.3958, screenW * 0.0044, screenH * 0.0391, tocolor(0, 100, 200, 255), false) dxDrawRectangle(screenW * 0.5183, screenH * 0.4414, screenW * 0.0044, screenH * 0.0391, tocolor(0, 100, 200, 255), false) dxDrawRectangle(screenW * 0.5183, screenH * 0.4870, screenW * 0.0044, screenH * 0.0391, tocolor(0, 100, 200, 255), false) dxDrawRectangle(screenW * 0.5183, screenH * 0.5313, screenW * 0.0044, screenH * 0.0391, tocolor(0, 100, 200, 255), false) dxDrawRectangle(screenW * 0.5183, screenH * 0.5768, screenW * 0.0044, screenH * 0.0391, tocolor(0, 100, 200, 255), false) dxDrawRectangle(screenW * 0.5183, screenH * 0.6224, screenW * 0.0044, screenH * 0.0391, tocolor(0, 100, 200, 255), false) dxDrawRectangle(screenW * 0.5183, screenH * 0.6693, screenW * 0.0044, screenH * 0.0391, tocolor(0, 100, 200, 255), false) Cor1 = tocolor(30, 30, 30, 255) Cor2 = tocolor(30, 30, 30, 255) Cor3 = tocolor(30, 30, 30, 255) Cor4 = tocolor(30, 30, 30, 255) Cor5 = tocolor(30, 30, 30, 255) Cor6 = tocolor(30, 30, 30, 255) Cor7 = tocolor(30, 30, 30, 255) Cor8 = tocolor(30, 30, 30, 255) if isCursorOnElement(screenW * 0.3624, screenH * 0.3516, screenW * 0.1603, screenH * 0.0391) then Cor1 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.3624, screenH * 0.3958, screenW * 0.1603, screenH * 0.0391) then Cor2 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.3624, screenH * 0.4414, screenW * 0.1603, screenH * 0.0391) then Cor3 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.3624, screenH * 0.4870, screenW * 0.1603, screenH * 0.0391) then Cor4 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.3624, screenH * 0.5313, screenW * 0.1603, screenH * 0.0391) then Cor5 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.3624, screenH * 0.5768, screenW * 0.1603, screenH * 0.0391) then Cor6 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.3624, screenH * 0.6224, screenW * 0.1603, screenH * 0.0391) then Cor7 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.3624, screenH * 0.6693, screenW * 0.1603, screenH * 0.0391) then Cor8 = tocolor(0, 100, 200, 255) end end function AbrirPainel() if Identidade == false then if VMultar == false then if (Painel) then removeEventHandler("onClientRender",root,DxRevistar) Painel = false showCursor(false) else addEventHandler("onClientRender",root,DxRevistar) Painel = true showCursor(true) end end end end addEvent ( "L:Iniciou_Comando", true) addEventHandler ( "L:Iniciou_Comando", root, AbrirPainel ) VMultar = false function DxIdentidade() local Nick =getElementData(localPlayer, "Suspeito:Nick" ) or "N/A" local Nome =getElementData(localPlayer, "Suspeito:AirNew_RG_NomeCompleto")or "N/A" local Sobrenome =getElementData(localPlayer, "Suspeito:AirNew_RG_Sobrenome")or "N/A" local Idade =getElementData(localPlayer, "Suspeito:AirNew_RG_Idade")or "N/A" local Peso =getElementData(localPlayer, "Suspeito:Peso")or "80 Kg" local Altura =getElementData(localPlayer, "Suspeito:Altura")or "1,72m" local Sexo =getElementData(localPlayer, "Suspeito:Sexo")or "Masculino" local Porte =getElementData(localPlayer, "Suspeito:AirNewSCR_Porte_de_Armas")or "Não possui" local Wanted = getElementData(localPlayer, "Suspeito:Wanted")or "N/A" local Dinheiro =getElementData(localPlayer, "Suspeito:Dinheiro")or "N/A" local Level =getElementData(localPlayer, "Suspeito:Level")or "N/A" local ID = getElementData(localPlayer, "ID") or "N/A" local DinheiroSujo =getElementData(localPlayer, "Suspeito:moneysujo") or "0" dxDrawRectangle(screenW * 0.4114, screenH * 0.3216, screenW * 0.2584, screenH * 0.3099, tocolor(47, 47, 47, 255), false) dxDrawText("<", screenW * 0.4114, screenH * 0.3242, screenW * 0.4275, screenH * 0.3529, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Nome:", screenW * 0.4290, screenH * 0.3659, screenW * 0.4810, screenH * 0.3815, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("Idade:", screenW * 0.4290, screenH * 0.3945, screenW * 0.4810, screenH * 0.4102, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("Peso:", screenW * 0.4290, screenH * 0.4232, screenW * 0.4810, screenH * 0.4388, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("Altura:", screenW * 0.4290, screenH * 0.4518, screenW * 0.4810, screenH * 0.4674, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("Sexo:", screenW * 0.4290, screenH * 0.4805, screenW * 0.4810, screenH * 0.4961, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("ID: ", screenW * 0.4290, screenH * 0.5091, screenW * 0.4810, screenH * 0.5247, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("Level:", screenW * 0.4290, screenH * 0.5378, screenW * 0.4810, screenH * 0.5534, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("Porte de Armas:", screenW * 0.4290, screenH * 0.5664, screenW * 0.4810, screenH * 0.5820, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, true, false, false) dxDrawText("Nível de procurado:", screenW * 0.4290, screenH * 0.5951, screenW * 0.4810, screenH * 0.6107, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, true, false, false) dxDrawText("Dinheiro Limpo:", screenW * 0.5198, screenH * 0.3945, screenW * 0.5717, screenH * 0.4102, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("Dinheiro Sujo:", screenW * 0.5198, screenH * 0.4258, screenW * 0.5717, screenH * 0.4414, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(Nome.." "..Sobrenome, screenW * 0.4634, screenH * 0.3659, screenW * 0.6603, screenH * 0.3815, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(Idade, screenW * 0.4605, screenH * 0.3945, screenW * 0.5124, screenH * 0.4102, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(Peso, screenW * 0.4605, screenH * 0.4232, screenW * 0.5124, screenH * 0.4388, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(Altura, screenW * 0.4634, screenH * 0.4518, screenW * 0.5124, screenH * 0.4674, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(Sexo, screenW * 0.4597, screenH * 0.4805, screenW * 0.5124, screenH * 0.4961, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(ID, screenW * 0.4451, screenH * 0.5091, screenW * 0.4978, screenH * 0.5247, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(Level, screenW * 0.4627, screenH * 0.5378, screenW * 0.5154, screenH * 0.5534, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(Porte, screenW * 0.5081, screenH * 0.5664, screenW * 0.5608, screenH * 0.5820, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(Wanted, screenW * 0.5227, screenH * 0.5951, screenW * 0.5754, screenH * 0.6107, tocolor(0, 100, 200, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("R$ "..Dinheiro, screenW * 0.5966, screenH * 0.3945, screenW * 0.6493, screenH * 0.4102, tocolor(97, 255, 101, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("R$ "..DinheiroSujo, screenW * 0.5893, screenH * 0.4258, screenW * 0.6420, screenH * 0.4414, tocolor(255, 79, 79, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("Identidade", screenW * 0.4693, screenH * 0.3281, screenW * 0.6237, screenH * 0.3529, tocolor(255, 255, 255, 255), 1.00, "sans", "center", "center", false, false, false, false, false) end MotivoMulta = guiCreateEdit(x*595, y*302, x*178, y*23, "", false) guiSetAlpha ( MotivoMulta, 0.85 ) guiEditSetMaxLength ( MotivoMulta, 100) guiSetVisible ( MotivoMulta, false ) ValorMulta = guiCreateEdit(x*596, y*330, x*178, y*23, "", false) guiSetAlpha ( ValorMulta, 0.85 ) guiEditSetMaxLength ( ValorMulta, 100) guiSetVisible ( ValorMulta, false ) local bmotivo = guiCreateButton(screenW * 0.4107, screenH * 0.4805, screenW * 0.1413, screenH * 0.0299,"",false) guiSetAlpha(bmotivo,0) local bfechar = guiCreateButton(screenW * 0.4107, screenH * 0.5130, screenW * 0.1413, screenH * 0.0299,"",false) guiSetAlpha(bfechar,0) addEventHandler("onClientGUIClick",bmotivo, function () if VMultar == true then local motivo = guiGetText(MotivoMulta) local valor = guiGetText(ValorMulta) setElementData(localPlayer,"L:MotivoMulta",motivo) setElementData(localPlayer,"L:ValorMulta",valor) triggerServerEvent("L:MultouJogador",localPlayer) end end) addEventHandler("onClientGUIClick",bfechar, function () if VMultar == true then removeEventHandler("onClientRender", root, darmulta) VMultar = false showCursor(false) guiSetVisible ( MotivoMulta, false ) guiSetVisible ( ValorMulta, false ) AbrirPainelS() end end) local screenW, screenH = guiGetScreenSize() function darmulta() dxDrawRectangle(screenW * 0.3895, screenH * 0.3620, screenW * 0.1867, screenH * 0.2031, tocolor(27, 27, 27, 255), false) dxDrawText("MULTAR", screenW * 0.3902, screenH * 0.3633, screenW * 0.5761, screenH * 0.3828, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("MOTIVO:", screenW * 0.3895, screenH * 0.3958, screenW * 0.4363, screenH * 0.4232, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("VALOR:", screenW * 0.3895, screenH * 0.4297, screenW * 0.4363, screenH * 0.4570, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.4107, screenH * 0.4805, screenW * 0.1413, screenH * 0.0299, mul1, false) dxDrawText("MULTAR", screenW * 0.4107, screenH * 0.4805, screenW * 0.5520, screenH * 0.5104, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.4107, screenH * 0.5130, screenW * 0.1413, screenH * 0.0299, mul2, false) dxDrawText("VOLTAR", screenW * 0.4107, screenH * 0.5130, screenW * 0.5520, screenH * 0.5430, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) mul1 =tocolor(0, 0, 1, 255) mul2 = tocolor(0, 0, 1, 255) if isCursorOnElement(screenW * 0.4107, screenH * 0.4805, screenW * 0.1413, screenH * 0.0299) then mul1 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.4107, screenH * 0.5130, screenW * 0.1413, screenH * 0.0299) then mul2 = tocolor(0, 100, 200, 255) end end function FecharPainelS() removeEventHandler("onClientRender",root,DxRevistar) Painel = false showCursor(false) end function AbrirPainelS() addEventHandler("onClientRender",root,DxRevistar) Painel = true showCursor(true) end function ClicarIdentidade (_,state) if Identidade == true then if state == "down" then if isCursorOnElement (screenW * 0.4114, screenH * 0.3242, screenW * 0.4275, screenH * 0.3529) then playSoundFrontEnd ( 44 ) removeEventHandler("onClientRender", root, DxIdentidade) Identidade = false AbrirPainelS() end end end end addEventHandler ("onClientClick", root, ClicarIdentidade ) function ClicarNosBotoes (_,state) if Painel == true then if state == "down" then if isCursorOnElement (screenW * 0.3624, screenH * 0.3516, screenW * 0.1603, screenH * 0.0391) then triggerServerEvent ("L:VIdentidade", getLocalPlayer(), localPlayer) playSoundFrontEnd ( 44 ) FecharPainelS() addEventHandler("onClientRender", root, DxIdentidade) Identidade = true showCursor(true) elseif isCursorOnElement(screenW * 0.3624, screenH * 0.3958, screenW * 0.1603, screenH * 0.0391) then triggerServerEvent ("L:VCNH", getLocalPlayer(), localPlayer) playSoundFrontEnd ( 44 ) elseif isCursorOnElement(screenW * 0.3624, screenH * 0.4414, screenW * 0.1603, screenH * 0.0391) then playSoundFrontEnd ( 44 ) FecharPainelS() addEventHandler("onClientRender", root, darmulta) VMultar = true showCursor(true) guiSetVisible ( MotivoMulta, true ) guiSetVisible ( ValorMulta, true ) guiSetText(MotivoMulta, "") guiSetText(ValorMulta,"") elseif isCursorOnElement(screenW * 0.3624, screenH * 0.4870, screenW * 0.1603, screenH * 0.0391) then triggerServerEvent ("L:VAlgemar", getLocalPlayer(), localPlayer) playSoundFrontEnd ( 44 ) elseif isCursorOnElement(screenW * 0.3624, screenH * 0.5313, screenW * 0.1603, screenH * 0.0391) then triggerServerEvent ("L:VRevistar", getLocalPlayer(), localPlayer) playSoundFrontEnd ( 44 ) elseif isCursorOnElement(screenW * 0.3624, screenH * 0.5768, screenW * 0.1603, screenH * 0.0391) then triggerServerEvent ("L:VDrogas", getLocalPlayer(), localPlayer) playSoundFrontEnd ( 44 ) elseif isCursorOnElement(screenW * 0.3624, screenH * 0.6224, screenW * 0.1603, screenH * 0.0391) then triggerServerEvent ("L:VArmas", getLocalPlayer(), localPlayer) playSoundFrontEnd ( 44 ) elseif isCursorOnElement(screenW * 0.3624, screenH * 0.6693, screenW * 0.1603, screenH * 0.0391) then triggerServerEvent ("L:VPrender", getLocalPlayer(), localPlayer) playSoundFrontEnd ( 44 ) end end end end addEventHandler ("onClientClick", root, ClicarNosBotoes ) 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 Server-side -- LG7 Scripter - Não remova os créditos por favor! -- Acesse meu canal e tenha mais conteúdos como esse: -- https://www.youtube.com/c/LG7MTA -- Tenha um(a) bom(a) Dia/Tarde/Noite function AbrirPainel(source,cmd,pname) local accName = getAccountName ( getPlayerAccount ( source ) ) local cx,cy,cz = getElementPosition(cliente) local x,y,z = getElementPosition(source) local dist = getDistanceBetweenPoints3D(x,y,z,cx,cy,cz) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Policial" ) ) then cliente = getPlayerFromPartialName(pname) or getPlayerFromID(pname) if isElement(cliente) then if dist <= 7 then local PegarId = getPlayerFromID(cliente) local PegarNick = getPlayerName(cliente) local PegarNome = getElementData(cliente, "AirNew_RG_NomeCompleto") or "N/A" local PegarSobrenome = getElementData(cliente, "AirNew_RG_Sobrenome") or "N/A" local Idade = getElementData(cliente, "AirNew_RG_Idade") or "N/A" local Peso = getElementData(cliente, "Peso") or "70Kg" local Altura = getElementData(cliente, "Altura") or "1,70m" local Sexo = getElementData(cliente, "Sexo") or "Masculino" local Porte = getElementData(cliente, "AirNewSCR_Porte_de_Armas") or "Não possui" local Wanted = getPlayerWantedLevel(cliente) local Dinheiro = getPlayerMoney(cliente) local Level = getElementData(cliente, "Level") or "0" local ID = getElementData(cliente, "ID") or "N/A" local DinheiroSujo =getElementData(cliente, "moneysujo") or "0" setElementData(source, "Suspeito:ID", PegarId) setElementData(source, "Suspeito:Nick", PegarNick) setElementData(source, "Suspeito:AirNew_RG_NomeCompleto",PegarNome) setElementData(source, "Suspeito:AirNew_RG_Sobrenome",PegarSobrenome) setElementData(source, "Suspeito:AirNew_RG_Idade",Idade) setElementData(source, "Suspeito:Peso",Peso) setElementData(source, "Suspeito:Altura",Altura) setElementData(source, "Suspeito:Sexo",Sexo) setElementData(source, "Suspeito:AirNewSCR_Porte_de_Armas",Porte) setElementData(source, "Suspeito:Wanted",Wanted) setElementData(source, "Suspeito:Dinheiro",Dinheiro) setElementData(source, "Suspeito:Level",Level) setElementData(source, "Suspeito:ID",ID) setElementData(source, "Suspeito:moneysujo", DinheiroSujo) setElementData(source, "L:IDRevistado", PegarId) triggerClientEvent(source, "L:Iniciou_Comando", source) else outputChatBox("#0064c8» #ffffffEsse jogador está muito longe.",source,255,255,255,true) end else outputChatBox("#0064c8» #ffffffEsse jogador não existe ou está offiline.",source,255,255,255,true) end else outputChatBox("#0064c8» #ffffffVocê não tem permissão para esse comando.",source,255,255,255,true) end end addCommandHandler("v",AbrirPainel) function VCNH () if getElementData(cliente, "DNL:TestePratico", true ) then return end if getElementData(cliente, "DNL:Categoria(A)", true) then local moto = "Moto" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..moto, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(A)", false) then local moto = "Moto Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..moto, source, 255,255,255,true) end if getElementData(cliente, "DNL:Categoria(B)", true) then local carros = "Carro" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..carros, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(B)", true) then local carros = "Carro Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..carros, source, 255,255,255,true) end if getElementData(cliente, "DNL:Categoria(C)", true) then local caminhao = "Caminhão" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..caminhao, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(C)", true) then local caminhao = "Caminhão Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..caminhao, source, 255,255,255,true) end if getElementData(cliente, "DNL:Categoria(D)", true) then local carreta = "Carreta" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..carreta, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(D)", true) then local carreta = "Carreta Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..carreta, source, 255,255,255,true) end if getElementData(cliente, "DNL:Categoria(E)", true) then local helicoptero = "Helicoptero" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..helicoptero, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(E)", true) then local helicoptero = "Helicoptero Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..helicoptero, source, 255,255,255,true) end --else CNH = " false" then --local CNHN = ("Não Possui") --outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..CNHN, source, 255,255,255,true) end addEvent ( "L:VCNH", true) addEventHandler ( "L:VCNH", root, VCNH ) function VMultar() local Valor = getElementData(source,"L:ValorMulta") or 0 local Motivo = getElementData(source, "L:MotivoMulta") or "erro" outputChatBox("#0064c8»#ffffff Você multou o jogador #0064c8"..getPlayerName(cliente).."#ffffff por #0064c8$"..Valor.."#ffffff pelo motivo #0064c8".. Motivo, source, 255,255,255,true) outputChatBox("#0064c8»#ffffff O Polícial #0064c8"..getPlayerName(source).."#ffffff te multou por #0064c8$"..Valor.."#ffffff pelo motivo #0064c8"..Motivo, cliente, 255,255,255,true) takePlayerMoney(cliente,Valor) end addEvent ( "L:MultouJogador", true) addEventHandler ( "L:MultouJogador", root, VMultar ) algemar = false function VAlgemar2() local algemado = getElementData(cliente,"algemado") or false if algemado == false then setPedAnimation( cliente, "GRAVEYARD", "mrnM_loop", -1, true, false, false, false) -- Animação de algemar setElementFrozen( cliente, true ) -- Freezar jogador setPedAnimation( cliente, "GRAVEYARD", "mrnM_loop", -1, true, false, false, false) toggleControl(cliente, "fire", false) -- retirar função de atirar setPedAnimation( cliente, "GRAVEYARD", "mrnM_loop", -1, true, false, false, false) setElementData(cliente,"algemado",true) else setPedAnimation( cliente) -- Animação de algemar setElementFrozen( cliente, false ) -- Freezar jogador toggleControl(cliente, "fire", true) -- retirar função de atirar setElementData(cliente,"algemado",false) end end addEvent ( "L:VAlgemar", true) addEventHandler ( "L:VAlgemar", root, VAlgemar2 ) function VRevistar() local Drogas = getElementData(cliente, "L:Maconhas") or 0 outputChatBox ( "#0064c8» #ffffffDrogas do jogador:#0064c8 "..Drogas, source, 255, 255, 255, true ) outputChatBox ( "#0064c8» #ffffffArmas do jogador:", source, 255, 255, 255, true ) for slot = 0, 12 do local Armas = getPedWeapon ( cliente, slot ) local Municao = getPedTotalAmmo ( cliente, slot ) if Armas > 0 then if Municao > 0 then weapon_nome = getWeaponNameFromID ( Armas ) outputChatBox ( "#0064c8» #ffffff"..weapon_nome.." #0064c8- #ffffff"..Municao.." Bala(s)!", source, 255, 255, 255, true ) end end end end addEvent ( "L:VRevistar", true) addEventHandler ( "L:VRevistar", root, VRevistar ) function VDrogas() local Drogas = getElementData(cliente, "L:Maconhas") or 0 if Drogas > 0 then outputChatBox ( "#0064c8» #ffffffVocê prendeu #0064c8"..Drogas.."#ffffff do suspeito.", source, 255, 255, 255, true ) setElementData(cliente,"L:Maconhas",0) outputChatBox("Você abriu Drogas", source, 255,255,255) else outputChatBox ( "#0064c8» #ffffffEsse jogador não possui drogas.", source, 255, 255, 255, true ) end end addEvent ( "L:VDrogas", true) addEventHandler ( "L:VDrogas", root, VDrogas ) function VArmas() takeAllWeapons (cliente) outputChatBox ( "#0064c8» #ffffffVocê prendeu todas as armas do suspeito.", source, 255, 255, 255, true ) end addEvent ( "L:VArmas", true) addEventHandler ( "L:VArmas", root, VArmas ) ultimovei = false function verificarV(thePlayer) theVehicle = getPedOccupiedVehicle ( thePlayer ) local id = getElementModel ( theVehicle ) if id == 596 or id == 490 then ultimovei = true else ultimovei = false end end addEventHandler("onVehicleEnter",root,verificarV) function VPrender() local Preso = getElementData(cliente, "IndoPreso") or false if ultimovei == true then if Preso == false then attachElements (cliente,theVehicle, 0, -1.7, 0.7 ) setPedAnimation( cliente, "CRACK", "crckidle3", -1, true, false, false, false) -- Animação de algemar setElementData(cliente, "IndoPreso",true) else detachElements(cliente,theVehicle,0,2,0) setPedAnimation(cliente) setElementData(cliente,"IndoPreso",false) end else outputChatBox("#0064c8» #ffffffSeu ultimo veículo tem que ser um carro da polícia.",source,255,255,255,true) end end addEvent ( "L:VPrender", true) addEventHandler ( "L:VPrender", root, VPrender ) function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end function getPlayerFromID ( id ) for k, player in ipairs ( getElementsByType ( "player" ) ) do local p_id = getElementData ( player, "ID" ) if ( p_id == tonumber(id) ) then player_n = getPlayerName ( player ) return player, player_n end end end
  17. Concordamos hehe Eu ainda não entendi, mas, ele quer checar a categorias de um jogador? Se for, do jeito que fez, apenas vai pegar o da pessoa que fazer esse evento. agora, se quer adicionar, isso ao comando "v", é + fácil. Agora, saber como você quer adaptar fica difícil saber o que realmente está tentando fazer. Mas, como mencionei, se for querer adicionar isso ao comando "v", séria mais fácil, eu apenas darei um exemplo do jeito que já esta. function AbrirPainel(source,cmd,pname) local accName = getAccountName ( getPlayerAccount ( source ) ) local cx,cy,cz = getElementPosition(cliente) local x,y,z = getElementPosition(source) local dist = getDistanceBetweenPoints3D(x,y,z,cx,cy,cz) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Policial" ) ) then cliente = getPlayerFromPartialName(pname) or getPlayerFromID(pname) if isElement(cliente) then if dist <= 7 then local PegarId = getPlayerFromID(cliente) local PegarNick = getPlayerName(cliente) local PegarNome = getElementData(cliente, "AirNew_RG_NomeCompleto") or "N/A" local PegarSobrenome = getElementData(cliente, "AirNew_RG_Sobrenome") or "N/A" local Idade = getElementData(cliente, "AirNew_RG_Idade") or "N/A" local Peso = getElementData(cliente, "Peso") or "70Kg" local Altura = getElementData(cliente, "Altura") or "1,70m" local Sexo = getElementData(cliente, "Sexo") or "Masculino" local Porte = getElementData(cliente, "AirNewSCR_Porte_de_Armas") or "Não possui" local Wanted = getPlayerWantedLevel(cliente) local Dinheiro = getPlayerMoney(cliente) local Level = getElementData(cliente, "Level") or "0" local ID = getElementData(cliente, "ID") or "N/A" local DinheiroSujo =getElementData(cliente, "moneysujo") or "0" VCNH(cliente) --/> Adicionado. setElementData(source, "Suspeito:ID", PegarId) setElementData(source, "Suspeito:Nick", PegarNick) setElementData(source, "Suspeito:AirNew_RG_NomeCompleto",PegarNome) setElementData(source, "Suspeito:AirNew_RG_Sobrenome",PegarSobrenome) setElementData(source, "Suspeito:AirNew_RG_Idade",Idade) setElementData(source, "Suspeito:Peso",Peso) setElementData(source, "Suspeito:Altura",Altura) setElementData(source, "Suspeito:Sexo",Sexo) setElementData(source, "Suspeito:AirNewSCR_Porte_de_Armas",Porte) setElementData(source, "Suspeito:Wanted",Wanted) setElementData(source, "Suspeito:Dinheiro",Dinheiro) setElementData(source, "Suspeito:Level",Level) setElementData(source, "Suspeito:ID",ID) setElementData(source, "Suspeito:moneysujo", DinheiroSujo) setElementData(source, "L:IDRevistado", PegarId) triggerClientEvent(source, "L:Iniciou_Comando", source) else outputChatBox("#0064c8» #ffffffEsse jogador está muito longe.",source,255,255,255,true) end else outputChatBox("#0064c8» #ffffffEsse jogador não existe ou está offiline.",source,255,255,255,true) end else outputChatBox("#0064c8» #ffffffVocê não tem permissão para esse comando.",source,255,255,255,true) end end addCommandHandler("v",AbrirPainel) function VCNH( cliente ) --local CNH = getElementData(source, "DNL:Categoria(A)") --outputConsole(CNH) if getElementData(cliente, "DNL:TestePratico", true ) then return end if getElementData(cliente, "DNL:Categoria(A)", true) then local moto = "Moto" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..moto, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(A)", false) then local moto = "Moto Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..moto, source, 255,255,255,true) end if getElementData(cliente, "DNL:Categoria(B)", true) then local carros = "Carro" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..carros, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(B)", true) then local carros = "Carro Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..carros, source, 255,255,255,true) end if getElementData(cliente, "DNL:Categoria(C)", true) then local caminhao = "Caminhão" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..caminhao, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(C)", true) then local caminhao = "Caminhão Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..caminhao, source, 255,255,255,true) end if getElementData(cliente, "DNL:Categoria(D)", true) then local carreta = "Carreta" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..carreta, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(D)", true) then local carreta = "Carreta Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..carreta, source, 255,255,255,true) end if getElementData(cliente, "DNL:Categoria(E)", true) then local helicoptero = "Helicoptero" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..helicoptero, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(E)", true) then local helicoptero = "Helicoptero Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..helicoptero, source, 255,255,255,true) end --else CNH = " false" then --local CNHN = ("Não Possui") --outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..CNHN, source, 255,255,255,true) end --addEvent ( "L:VCNH", true) --addEventHandler ( "L:VCNH", root, VCNH ) Agora, se você esta tentando usar um trigger do client, para o server-side, você vai te que obter este player no client, mas, do jeito que esta ai, não funcionará ou então faça : linha : -- server-side / comando "v" / enviar o player revistado para o client-side triggerClientEvent(source, "L:Iniciou_Comando", source, cliente) --/> Enviar o Player Junto Para o Client local player_revistado = "" function exemplo1(cliente) player_revistado = cliente -- end addEvent("L:Iniciou_Comando", true) addEventHandler("L:Iniciou_Comando", getRootElement(), exemplo1) --/> Função que você esteja tentando executa ao clicar no botão para saber sua categorias function check_categoria () triggerServerEvent("L:VCNH", localPlayer, player_revistado ) end --/> Então no server-side dará certo dessa x function VCNH( cliente ) --local CNH = getElementData(source, "DNL:Categoria(A)") --outputConsole(CNH) if getElementData(cliente, "DNL:TestePratico", true ) then return end if getElementData(cliente, "DNL:Categoria(A)", true) then local moto = "Moto" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..moto, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(A)", false) then local moto = "Moto Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..moto, source, 255,255,255,true) end if getElementData(cliente, "DNL:Categoria(B)", true) then local carros = "Carro" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..carros, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(B)", true) then local carros = "Carro Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..carros, source, 255,255,255,true) end if getElementData(cliente, "DNL:Categoria(C)", true) then local caminhao = "Caminhão" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..caminhao, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(C)", true) then local caminhao = "Caminhão Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..caminhao, source, 255,255,255,true) end if getElementData(cliente, "DNL:Categoria(D)", true) then local carreta = "Carreta" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..carreta, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(D)", true) then local carreta = "Carreta Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..carreta, source, 255,255,255,true) end if getElementData(cliente, "DNL:Categoria(E)", true) then local helicoptero = "Helicoptero" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..helicoptero, source, 255,255,255,true) elseif getElementData(cliente, "DNL:Categoria(E)", true) then local helicoptero = "Helicoptero Não Possui" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..helicoptero, source, 255,255,255,true) end --else CNH = " false" then --local CNHN = ("Não Possui") --outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..CNHN, source, 255,255,255,true) end addEvent ( "L:VCNH", true) addEventHandler ( "L:VCNH", root, VCNH ) Caso precisar, faça uma verificação utilizando "getPlayerFromPartialName(cliente)", dessa forma, dará certo, porem só com o player que revista
  18. Você tirou o evento do client "onClientResourceStart" do painel, por isso não abre pois, o painel não foi criado para o jogador. Ex: addEventHandler("onClientResourceStart", resourceRoot, function () Painel = guiCreateWindow(258, 158, 484, 470, "Painel VIP", false) guiWindowSetSizable(Painel, false) PegarArmas = guiCreateButton(0.04, 0.16, 0.27, 0.11, "armas", true, Painel) guiSetFont(PegarArmas, "default-bold-small") guiSetProperty(PegarArmas, "NormalTextColour", "E947F9AB") pegarCarro = guiCreateButton(0.04, 0.39, 0.27, 0.12, "carro", true, Painel) guiSetFont(pegarCarro, "default-bold-small") guiSetProperty(pegarCarro, "NormalTextColour", "E947F9AB") PegarJetpack = guiCreateButton(0.05, 0.67, 0.27, 0.13, "jetpack", true, Painel) guiSetFont(PegarJetpack, "default-bold-small") guiSetProperty(PegarJetpack, "NormalTextColour", "E947F9AB") botaodestruir = guiCreateButton(0.38, 0.80, 0.30, 0.10, "destruir", true,Painel) guiSetFont(botaodestruir, "default-bold-small") guiSetProperty(botaodestruir, "NormalTextColour", "FF0AF468") addEventHandler("onClientGUIClick",PegarArmas,ClicarNoBotao) addEventHandler("onClientGUIClick",PegarJetpack,CliaBotao) addEventHandler("onClientGUIClick",pegarCarro,ClicaBotao) addEventHandler("onClientGUIClick",botaodestruir,CliaBot) guiSetVisible (Painel, false) --/> Adicionar ! end)
  19. O único bug de animação que eu me recordo, é.. Por exemplo, abrir um painel de animação, e fazer uma animação (envia para o lado server-side a animação), e então, quando clicar em stop animação (não envia para o server-side), fica no client-side, ou seja, para o player ele está normal, porem para o outros players, aparece que ele esta com animação.
  20. Seu problema é, o veiculo é explodido, ele retorna no mesmo local da explosão, isto? e você quer corrigir isto?
  21. As que não funcionam estão na ACL.XML em ACL no Painel P? Caso esteja, de /debugscript 3, e veja o problema, caso não conseguir arrumar, informe o erro aqui.
  22. # Olá Pessoal, estou precisando de algumas informações. Bom, estou com dificuldades de adicionar no mini radar, aquelas áreas de área verde/etc no mini radar. 1. Eu queria entender, o que eu preciso a partir dessa forma, conseguir criar os retângulos das áreas no mini radar. --/> Acho que é necessário essas informações, para alguém poder me ajudar ! --/> Fora local worldW, worldH = 1798,1798 local sx, sy = guiGetScreenSize() local rt = dxCreateRenderTarget(290,175) local x, y = sx/1459,sy/768 local y = x --/> Dentro do evento "onClientRender" : [Onde eu estou com dúvidas !] local mW, mH = dxGetMaterialSize(rt) local Px, Py = getElementPosition(localPlayer) local wX, wY = mW/2 -(Px/(6000/worldW)), mH/2 +(Py/(6000/worldH)) local camX,camY,camZ = getElementRotation(getCamera()) dxDrawImage(wX - worldW/2, mH/5 + (wY - worldH/2), worldW, worldH, "map.png", camZ, (Px/(6000/worldW)), -(Py/(6000/worldH))) --/> Cria RADAR. for i, areas in ipairs (getElementsByType("radararea")) do local x, y = getElementPosition(areas) local w, h = getRadarAreaSize(areas) local red,green,blue,alpha = 255,255,255,255 local red,green,blue,alpha = getRadarAreaColor(areas) -- -- -- -- dxDrawRectangle(_, _, _, _, tocolor(red,green,blue,alpha), true ) --/> Adicionei _, porquê não sei como posso fazer, apenas adicionar x,y,w,h, não dará certo end 2. Como é feito os cálculos, tentei de várias formas, sem sucesso, os retângulos, ficavam na tela. Procurei algum tutorial, e não encontrei aqui no fórum, caso tiver, por favor, me enviem !
  23. # 1º Dúvida, Faça : (Verificar Resource) function ReiniciarBases() local allResources = getResources() for index, res in ipairs(allResources) do if getResourceState(res) == "running" then if getResourceName(res) == "nome_do_resource_1" or getResourceName(res) == "nome_do_resource_2" then --/> Adicione + RESOURCE restartResource(res) end end end end #2º Dúvida, Faça : (Temporizador na função). local temporizador = false local tempo = 60000*10 --/> 10 Minutos. function ReiniciarBases() if temporizador == true then return end --/> Caso verificar em true, então retornará. temporizador = true setTimer ( function () temporizador = false end, tempo, 1) local allResources = getResources() for index, res in ipairs(allResources) do if getResourceState(res) == "running" then if getResourceName(res) == "[BASE]1" or getResourceName(res) == "[BASE]2" then --/> Adicione + RESOURCE restartResource(res) end end end end #3º Dúvida (Várias ACL) + (Ativar Função : ReiniciarBases() ) acl1 = "Console" acl2 = "Admin" Comando = "adm" function abrirPainel ( source ) local acc = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..acc, aclGetGroup (acl1)) or isObjectInACLGroup("user."..acc, aclGetGroup (acl2)) then ReiniciarBases() --/> Exemplo [APENAS, Caso queira executa essa função por Comando). end end addCommandHandler (Comando, abrirPainel)
  24. Acho eu, ele quer um comando para dar veiculo a um jogador que ao em vez por nick, seja por ID, e apenas quem tiver como console, fazer este comando. A Explicação dele é D+
×
×
  • Create New...