Jump to content

Blaack

Members
  • Posts

    155
  • Joined

  • Last visited

  • Days Won

    3

Blaack last won the day on August 3 2021

Blaack had the most liked content!

Recent Profile Visitors

1,062 profile views

Blaack's Achievements

Busta

Busta (15/54)

52

Reputation

  1. veh = {} function criarxx() if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end local x,y,z = getElementPosition(source) veh[source] = createVehicle(467, x,y,z + 2) warpPedIntoVehicle (source,veh[source]) end addEvent("carrop",true) addEventHandler("carrop",root,criarxx) --------------------------------------------------------------------------------------- function criarxx2() if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end local x,y,z = getElementPosition(source) veh[source] = createVehicle(502, x,y,z + 2) warpPedIntoVehicle (source,veh[source]) end addEvent("carrop2",true) addEventHandler("carrop2",root,criarxx2) addEventHandler("onPlayerQuit", getRootElement(), -- evento acionado quando qualquer player do servidor sair. function () if veh[source] then -- verifica se existe veh[source] if isElement(veh[source]) then -- verificar se veh[source] é um elemento destroyElement(veh[source]) -- destroi veh[source] end end end Isso?
  2. Não entendi sua dúvida, mas não seria o GetFunctionsBoundToKey ?
  3. Mas o evento que ele está utilizando nesse caso já é server-side, imagino que o código seja lado server-side sim. Mas enfim, teste desta maneira: addEventHandler("onMarkerHit", Destroy, function ( thePlayer ) if thePlayer and isElement(thePlayer) and getElementType(thePlayer) == "player" then -- verifica thePlayer, se é um elemento e se é um element do tipo player local conta = getPlayerAccount (thePlayer) if conta and not isGuestAccount(conta) then -- verifica se a conta existe e se esta logado local acc = getAccountName(conta) -- verificando o nome da conta do player if isObjectInACLGroup ("user."..acc, aclGetGroup("Policial")) then -- verifica se o rapaz possui a acl policial local veh = getPedOccupiedVehicle(thePlayer) -- verifica se o player está em um veiculo if veh then local model = getElementModel(veh) -- verifica o modelo do veiculo if model == 598 or model == 599 or model == 490 then destroyElement (veh) exports.InfoDx:addBox(thePlayer, "Veiculo Detruido Com Sucesso", "success") end end end end end end)
  4. Olá, boa tarde tudo bem? Você pode resolver verificando se o elemento que hitou o marker é um player, e se for se ele está logado. Teste desta maneira: ------------------------------------------------------------------------------ -------------------------------[PORTÃO PRENDER]------------------------------- ------------------------------------------------------------------------------ --- MARKERS --- local gate3 = createObject(986, 1588.599609375, -1638.2998046875, 13.199999809265, 0, 0, 0) local marker3 = createMarker(1588.599609375, -1638.2998046875, 13.199999809265, "cylinder", 5, 0, 0, 0, 0) --- FUNÇÃO ABRIR --- function moveGate3(thePlayer) if thePlayer and isElement(thePlayer) and getElementType(thePlayer) == "player" then if not isGuestAccount(getPlayerAccount(thePlayer)) then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)) , aclGetGroup("Policial")) then moveObject(gate3, 1000, 1588.599609375, -1638.2998046875, 4.5) end end end end addEventHandler("onMarkerHit", marker3, moveGate3) --- FUNÇÃO FECHAR --- function move_back_gate3() moveObject(gate3, 1000, 1588.599609375, -1638.2998046875, 13.199999809265) end addEventHandler("onMarkerLeave", marker3, move_back_gate3)
  5. Men, não sei explicar o porque (realmente) Mas mudei o nome da função aqui e funcionou kk Realmente da maneira que está não funciona...
  6. Já tem isso no seu código, apenas fiz algo para aparecer caso ele não tenha armamento: --[[ =========================================================== # Minha página: https://www.facebook.com/TioSteinScripter/# # ╔════╗╔══╗╔═══╗ ╔═══╗╔════╗╔═══╗╔══╗╔═╗─╔╗ # # ║╔╗╔╗║╚╣─╝║╔═╗║ ║╔═╗║║╔╗╔╗║║╔══╝╚╣─╝║║╚╗║║ # # ╚╝║║╚╝─║║─║║─║║ ║╚══╗╚╝║║╚╝║╚══╗─║║─║╔╗╚╝║ # # ──║║───║║─║║─║║ ╚══╗║──║║──║╔══╝─║║─║║╚╗║║ # # ──║║──╔╣─╗║╚═╝║ ║╚═╝║──║║──║╚══╗╔╣─╗║║─║║║ # # ──╚╝──╚══╝╚═══╝ ╚═══╝──╚╝──╚═══╝╚══╝╚╝─╚═╝ # =========================================================== --]] ------------ Variaveis Comando = "p" ACL = "policial" -------------------------------- Funções Iniciais function AbrirPainel(source, comando, id) if(id) then local playerID = tonumber(id) if(playerID) then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup(ACL)) then if getElementData(source, "TS:Abordando") then return end local Jogador = getPlayerID(playerID) if not Jogador then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffNão foi possivel encontrar o jogador !", "info") return end --if Jogador == source then return end local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end triggerClientEvent(source, "TS:AbrirPolicial", source) setElementData(source, "TS:Abordando", Jogador) toggleAllControls ( source, false ) end end end end addCommandHandler(Comando, AbrirPainel) function FecharPolicial (source) toggleAllControls (source, true ) end addEvent("TS:FecharPolicial", true) addEventHandler("TS:FecharPolicial", root, FecharPolicial) function Algemar (source) local Jogador = getElementData(source, "TS:Abordando") if Jogador then if getElementData(Jogador, "TS:Algemado") == false then local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end toggleAllControls (Jogador, false ) setElementData(Jogador, "TS:Algemado", true) setElementFrozen(Jogador, true) triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê foi algemado!", "info") setPedAnimation( Jogador, "GRAVEYARD", "mrnM_loop", -1, true, false, false, false) else local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end setPedAnimation(Jogador, nil) toggleAllControls (Jogador, true ) setElementData(Jogador, "TS:Algemado", false) setElementFrozen(Jogador, false) triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê foi desalgemado!", "info") end end end addEvent("TS:Algemar", true) addEventHandler("TS:Algemar", root, Algemar) function Revistar (source) local Jogador = getElementData(source, "TS:Abordando") if Jogador then setPedAnimation( source, "POLICE", "plc_drgbst_01", 3100, true, false, false, false) triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO Policial está te revistando!", "info") if getPlayerWantedLevel(Jogador) >= 1 then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador está pedido!",source,255,0,0,true) else outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não está pedido!",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(A)") == true then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação A!",source,255,0,0,true) else outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação A!",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(B)") == true then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação B!",source,255,0,0,true) else outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação B!",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(C)") == true then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação C!",source,255,0,0,true) else outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação C!",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(D)") == true then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação D!",source,255,0,0,true) else outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação D!",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(E)") == true then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação E!",source,255,0,0,true) else outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação E!",source,255,0,0,true) end local Quantidade = getElementData(source, "TS:"..Droga_Selecionada.."") or 0 local arma = false for slot = 0, 12 do local Armamento = getPedWeapon ( Jogador, slot ) if Armamento > 0 then local NomeDaArma = getWeaponNameFromID ( Armamento ) arma = true outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem "..NomeDaArma.."!",source,255,0,0,true) end end if not arma then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não está armado!",source,255,0,0,true) end end end addEvent("TS:Revistar", true) addEventHandler("TS:Revistar", root, Revistar) VeiculoPolicial = {} function salvacarro (vei, assento, vitima) VeiculoPolicial[source] = vei end addEventHandler ('onPlayerVehicleEnter', root, salvacarro) function ColocarNaViatura (source) local Jogador = getElementData(source, "TS:Abordando") if Jogador then local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end local viatura = VeiculoPolicial[source] if VeiculoPolicial[source] then triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial te colocou na viatura !", "info") attachElements (Jogador, viatura, 0.2, -1.5, 0, 0,0,90) setPedAnimation(Jogador, "ped", "CAR_dead_LHS", false, false) local RotVX, RotVY, RotVZ = getElementRotation(viatura) setElementRotation(Jogador, RotVX, RotVY, RotVZ + 65) end end end addEvent ( "TS:ColocarNaViatura", true ) addEventHandler ( "TS:ColocarNaViatura", root, ColocarNaViatura) function RemoverNaViatura (source) local Jogador = getElementData( source,"TS:Abordando") if Jogador then local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end local viatura = VeiculoPolicial[source] if VeiculoPolicial[source] then triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial te removeu da viatura !", "info") detachElements (Jogador, viatura) setPedAnimation(Jogador,nil) local PosX, PosY, PosZ = getElementPosition(Jogador) setElementPosition(Jogador, PosX, PosY, PosZ + 2) end end end addEvent ( "TS:RemoverNaViatura", true ) addEventHandler ( "TS:RemoverNaViatura", root, RemoverNaViatura) function ApreenderArmas (source) local Jogador = getElementData( source,"TS:Abordando") if Jogador then local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial removeu todas as suas armas!", "info") takeAllWeapons(Jogador) end end addEvent ( "TS:ApreenderArmas", true ) addEventHandler ( "TS:ApreenderArmas", root, ApreenderArmas) function ApreenderPorte (source) local Jogador = getElementData( source,"TS:Abordando") if Jogador then local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end if getElementData(Jogador, "AirNewSCR_Porte_de_Armas") == "Sim" then triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial revogou seu porte de armas!", "info") setElementData(Jogador, "AirNewSCR_Porte_de_Armas", nil) end end end addEvent ( "TS:ApreenderPorte", true ) addEventHandler ( "TS:ApreenderPorte", root, ApreenderPorte) function ApreenderDrogas (source) local Jogador = getElementData( source,"TS:Abordando") if Jogador then local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial apreendeu suas drogas!", "info") setElementData(Jogador, "TS:Maconha", 0) setElementData(Jogador, "TS:Cocaina", 0) setElementData(Jogador, "TS:Heroina", 0) setElementData(Jogador, "TS:Crack", 0) setElementData(Jogador, "TS:LSD", 0) end end addEvent ( "TS:ApreenderDrogas", true ) addEventHandler ( "TS:ApreenderDrogas", root, ApreenderDrogas) function AlterarFicha (source, Quantidade) local Jogador = getElementData( source, "TS:Abordando") if Jogador then local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end setPlayerWantedLevel(Jogador, Quantidade) triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial alterou a sua ficha criminal!", "info") end end addEvent ( "TS:AlterarFicha", true ) addEventHandler ( "TS:AlterarFicha", root, AlterarFicha) --------------------- Não Meche function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end
  7. Olá, boa noite tudo bem? Fiz desta maneira, imagino que seja isso que esteja procurando hehe. Testa e me avisa ai meu querido! local var = { comandos = {}, } addEventHandler("onResourceStart", root, function () var.comandos = {} local resourceTable = getResources() for _, resourceValue in ipairs(resourceTable) do local comandos = getCommandHandlers(resourceValue) for _, v in ipairs(comandos) do var.comandos.v = true end end end) addEventHandler("onPlayerCommand", getRootElement(), function (cmd) if not var.comandos.cmd then outputChatBox("[ERRO] Esse comando não existe. Digite: /Ajuda ou peça suporte a um Administrador.", source, 255, 0, 0) end end)
  8. Para isso você deve armazenar todos os objetos dentro de uma tabela, e depois entrar na tabela e remover todos os objetos que ali estão... local objetos = {} function createObjectCommand(thePlayer, commandName) if (thePlayer) then local x, y, z = getElementPosition(thePlayer) local theObject = createObject(1238, x, y, z - 0.50, 0, 0, 0) if (theObject) then table.insert(objetos, {theObject}) end end end addCommandHandler("cone", createObjectCommand) addCommandHandler("remover", function (thePlayer) if objetos and #objetos > 0 then for i, v in ipairs(objetos) do if v and isElement(v) then destroyElement(v) end end end end
  9. local vehiclesSirene = {} function apagar() if (vehiclesSirene[source]) and isElement(vehiclesSirene[source]) then destroyElement(vehiclesSirene[source]) end end addEvent("startSireSound2",true) addEventHandler("startSireSound2",root,apagar)
  10. Como você tentou fazer? nos mostre o código...
  11. Ou, pode tentar "burlar"... Coloque isso no arquivo shared, imagino que tenha e seja descompilado. _getRemoteRequestInfo = getRemoteRequestInfo function getRemoteRequestInfo(valor) if valor then return _getRemoteRequestInfo else return {} end end
  12. Não há dois mods que contém esse evento? e quantas vezes esse dbQuery está passando? pode ser que exista dois valores la...
  13. addEvent("N3xT.onAlgemar", true) addEvent("N3xT.onViatura", true) addEvent("N3xT.onAgarrar", true) addEvent("N3xT.onMultar", true) addEvent("N3xT.ItensPM", true) addEvent("N3xT.takeWeaponPM", true) local comando = "policial" addCommandHandler(comando, function (thePlayer, _, id) local id = tonumber(id) if id then local player = getPlayerByID(id) if player and isElement(player) then local conta = getPlayerAccount(thePlayer) if conta and not isGuestAccount(conta) then local acc = getAccountName(conta) if isObjectInACLGroup("user."..conta, aclGetGroup("Policial")) then triggerClientEvent(thePlayer, "N3xT.onPainelPolicial", resourceRoot, player) end end end end end) getPlayerByID = function (id) local pReturn = false for i, v in ipairs(getElementsByType("player")) do local idp = getElementData(v, "ID") or false if idp then if idp == tonumber(id) then pReturn = v end end end return pReturn end addEventHandler("N3xT.onAlgemar", root, function() local receiver = getElementData(source, "ReceiverPM") if (receiver) and not isPedInVehicle(receiver) then if not getElementData(receiver, "Algemado") then setElementData(receiver, "Algemado", true) message(source, "O jogador foi algemado.", "success") message(receiver, "Você foi algemado!", "info") else setElementData(receiver, "Algemado", nil) setPedAnimation(receiver, false) message(source, "O jogador foi desalgemado.", "success") message(receiver, "Você foi desalgemado.", "info") end end end ) local carros = {} function salvacarro(vei, assento, vitima) carros[source] = vei end addEventHandler("onPlayerVehicleEnter", root, salvacarro) addEventHandler("N3xT.onViatura", root, function() local receiver = getElementData(source, "ReceiverPM") local vtr = carros[source] if (receiver) and (vtr) then local vrx, vry, vrz = getElementRotation(vtr) local px, py, pz = getElementPosition(vtr) if not getElementData(receiver, "NaViatura") then if not isPedInVehicle(receiver) then setElementData(receiver, "NaViatura", true) message(source, "O jogador foi colocado na viatura.", "success") message(receiver, "Você foi colocado na viatura!", "info") attachElements(receiver, vtr, 0.2, -1.5, 0, 0,0,90) setPedAnimation(receiver, 'ped','CAR_dead_LHS') setElementRotation(receiver, vrx, vry, vrz + 83) end else setElementData(receiver, "NaViatura", nil) message(source, "O jogador foi retirado da viatura.", "success") message(receiver, "Você foi retirado da viatura!", "info") detachElements(receiver, getElementAttachedTo(receiver)) setElementPosition(receiver, px + 2, py + 2, pz) setPedAnimation(receiver) end end end ) addEventHandler("N3xT.onAgarrar", root, function() local receiver = getElementData(source, "ReceiverPM") if (receiver) and not isPedInVehicle(receiver) then if not (getElementData(receiver, "Agarrado") == true) then setElementData(receiver, "Agarrado", true) message(source, "O jogador foi agarrado.", "success") message(receiver, "Você foi agarrado!", "info") attachElements(receiver, source, 0, 1, 0) else setElementData(receiver, "Agarrado", nil) message(source, "O jogador foi desagarrado.", "success") message(receiver, "Você foi desagarrado!", "info") detachElements(receiver, source) end end end ) addEventHandler("N3xT.onMultar", root, function(motivo, valor) local receiver = getElementData(source, "ReceiverPM") if (receiver) and not isPedInVehicle(receiver) then local money = getPlayerMoney(receiver) if (money >= tonumber(valor)) then message(source, "A multa foi aplicada com sucesso.", "success") message(receiver, "Você foi multado no valor de #00ff7fR$"..valor.." #ffffffpelo motivo: #a9a9a9"..motivo.."#ffffff.", "info") takePlayerMoney(receiver, tonumber(valor)) else message(source, "O jogador não possuí o valor da multa!", "error") end end end ) addEventHandler("N3xT.ItensPM", root, function(value, item, quantia) local receiver = getElementData(source, "ReceiverPM") if (receiver) then local next = exports.n3xt_inventario if (value == 1) then local itemTable = next:getAllItens(receiver) triggerClientEvent(source, "N3xT.refreshGridItemPM", resourceRoot, itemTable) elseif (value == 2) then next:takeItemS(source, receiver, item, tonumber(quantia)) triggerClientEvent(source, "N3xT.setWindowPM", resourceRoot, 1) end end end ) addEventHandler("N3xT.takeWeaponPM", root, function(arma) local receiver = getElementData(source, "ReceiverPM") if (receiver) then local id = getWeaponIDFromName(arma) takeWeapon(receiver, id) triggerClientEvent(source, "N3xT.setWindowPM", resourceRoot, 1) message(source, "A arma foi retirada com sucesso.", "success") message(receiver, "Foi retirado de você a arma #00ff7f"..arma.."#ffffff.", "info") end end ) function message(player, message, type) triggerClientEvent(player, "N3xT.dxNotification", resourceRoot, message, type) end Tinha esquecido de um parentese... @Im_PlayerGTA
  14. Bom dia, teste: server-side addEvent("N3xT.onAlgemar", true) addEvent("N3xT.onViatura", true) addEvent("N3xT.onAgarrar", true) addEvent("N3xT.onMultar", true) addEvent("N3xT.ItensPM", true) addEvent("N3xT.takeWeaponPM", true) local comando = "policial" addCommandHandler(comando, function (thePlayer, _, id) local id = tonumber(id) if id then local player = getPlayerByID(id) if player and isElement(player) then local conta = getPlayerAccount(thePlayer) if conta and not isGuestAccount(conta) then local acc = getAccountName(conta) if isObjectInACLGroup("user."..conta, aclGetGroup("Policial")) then triggerClientEvent(thePlayer, "N3xT.onPainelPolicial", resourceRoot, player) end end end end end getPlayerByID = function (id) local pReturn = false for i, v in ipairs(getElementsByType("player")) do local idp = getElementData(v, "ID") or false if idp then if idp == tonumber(id) then pReturn = v end end end return pReturn end addEventHandler("N3xT.onAlgemar", root, function() local receiver = getElementData(source, "ReceiverPM") if (receiver) and not isPedInVehicle(receiver) then if not getElementData(receiver, "Algemado") then setElementData(receiver, "Algemado", true) message(source, "O jogador foi algemado.", "success") message(receiver, "Você foi algemado!", "info") else setElementData(receiver, "Algemado", nil) setPedAnimation(receiver, false) message(source, "O jogador foi desalgemado.", "success") message(receiver, "Você foi desalgemado.", "info") end end end ) local carros = {} function salvacarro(vei, assento, vitima) carros[source] = vei end addEventHandler("onPlayerVehicleEnter", root, salvacarro) addEventHandler("N3xT.onViatura", root, function() local receiver = getElementData(source, "ReceiverPM") local vtr = carros[source] if (receiver) and (vtr) then local vrx, vry, vrz = getElementRotation(vtr) local px, py, pz = getElementPosition(vtr) if not getElementData(receiver, "NaViatura") then if not isPedInVehicle(receiver) then setElementData(receiver, "NaViatura", true) message(source, "O jogador foi colocado na viatura.", "success") message(receiver, "Você foi colocado na viatura!", "info") attachElements(receiver, vtr, 0.2, -1.5, 0, 0,0,90) setPedAnimation(receiver, 'ped','CAR_dead_LHS') setElementRotation(receiver, vrx, vry, vrz + 83) end else setElementData(receiver, "NaViatura", nil) message(source, "O jogador foi retirado da viatura.", "success") message(receiver, "Você foi retirado da viatura!", "info") detachElements(receiver, getElementAttachedTo(receiver)) setElementPosition(receiver, px + 2, py + 2, pz) setPedAnimation(receiver) end end end ) addEventHandler("N3xT.onAgarrar", root, function() local receiver = getElementData(source, "ReceiverPM") if (receiver) and not isPedInVehicle(receiver) then if not (getElementData(receiver, "Agarrado") == true) then setElementData(receiver, "Agarrado", true) message(source, "O jogador foi agarrado.", "success") message(receiver, "Você foi agarrado!", "info") attachElements(receiver, source, 0, 1, 0) else setElementData(receiver, "Agarrado", nil) message(source, "O jogador foi desagarrado.", "success") message(receiver, "Você foi desagarrado!", "info") detachElements(receiver, source) end end end ) addEventHandler("N3xT.onMultar", root, function(motivo, valor) local receiver = getElementData(source, "ReceiverPM") if (receiver) and not isPedInVehicle(receiver) then local money = getPlayerMoney(receiver) if (money >= tonumber(valor)) then message(source, "A multa foi aplicada com sucesso.", "success") message(receiver, "Você foi multado no valor de #00ff7fR$"..valor.." #ffffffpelo motivo: #a9a9a9"..motivo.."#ffffff.", "info") takePlayerMoney(receiver, tonumber(valor)) else message(source, "O jogador não possuí o valor da multa!", "error") end end end ) addEventHandler("N3xT.ItensPM", root, function(value, item, quantia) local receiver = getElementData(source, "ReceiverPM") if (receiver) then local next = exports.n3xt_inventario if (value == 1) then local itemTable = next:getAllItens(receiver) triggerClientEvent(source, "N3xT.refreshGridItemPM", resourceRoot, itemTable) elseif (value == 2) then next:takeItemS(source, receiver, item, tonumber(quantia)) triggerClientEvent(source, "N3xT.setWindowPM", resourceRoot, 1) end end end ) addEventHandler("N3xT.takeWeaponPM", root, function(arma) local receiver = getElementData(source, "ReceiverPM") if (receiver) then local id = getWeaponIDFromName(arma) takeWeapon(receiver, id) triggerClientEvent(source, "N3xT.setWindowPM", resourceRoot, 1) message(source, "A arma foi retirada com sucesso.", "success") message(receiver, "Foi retirado de você a arma #00ff7f"..arma.."#ffffff.", "info") end end ) function message(player, message, type) triggerClientEvent(player, "N3xT.dxNotification", resourceRoot, message, type) end client-side addEvent("N3xT.onPainelPolicial", true) addEvent("N3xT.refreshGridItemPM", true) addEvent("N3xT.setWindowPM", true) local screen = {guiGetScreenSize()} local x, y = (screen[1]/1366), (screen[2]/768) local tecla = "Tab" -- Tecla para fechar o painel. local edit = { guiCreateEdit(x*516, y*309, x*314, y*29, "Motivo", false), guiCreateEdit(x*516, y*381, x*314, y*29, "Valor", false), guiCreateGridList(x*548, y*229, x*253, y*214, false), guiCreateGridList(x*672, y*335, x*130, y*120, false), } guiGridListAddColumn(edit[3], "Item", 0.5) guiGridListAddColumn(edit[3], "Quantidade", 0.4) guiGridListAddColumn(edit[4], "Armas na Mão", 0.8) for i = 1, #edit do guiSetVisible(edit, false) end local visible local pm = function() dxDrawRectangle(x*502, y*161, x*343, y*370, tocolor(0, 0, 0, 150), false) dxDrawRectangle(x*502, y*161, x*5, y*370, tocolor(255, 140, 0, 255), false) dxDrawRectangle(x*840, y*161, x*5, y*370, tocolor(255, 140, 0, 255), false) dxDrawImage(x*650, y*167, x*57, y*52, "policial.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("Pressione "..tecla.." para fechar", x*600, y*538, x*696, y*502, tocolor(255, 255, 255, 150), x*1.2, "arial", "left", "top", false, false, false, false, false) if (window == 1) then dxDrawRectangle(x*517, y*224, x*308, y*41, (isMouseInPosition(x*517, y*224, x*308, y*41) and tocolor(0, 0, 0, 200) or tocolor(0, 0, 0, 50)), false) dxDrawRectangle(x*517, y*275, x*308, y*41, (isMouseInPosition(x*517, y*275, x*308, y*41) and tocolor(0, 0, 0, 200) or tocolor(0, 0, 0, 50)), false) dxDrawRectangle(x*517, y*326, x*308, y*41, (isMouseInPosition(x*517, y*326, x*308, y*41) and tocolor(0, 0, 0, 200) or tocolor(0, 0, 0, 50)), false) dxDrawRectangle(x*517, y*377, x*308, y*41, (isMouseInPosition(x*517, y*377, x*308, y*41) and tocolor(0, 0, 0, 200) or tocolor(0, 0, 0, 50)), false) dxDrawRectangle(x*517, y*428, x*308, y*41, (isMouseInPosition(x*517, y*428, x*308, y*41) and tocolor(0, 0, 0, 200) or tocolor(0, 0, 0, 50)), false) dxDrawRectangle(x*517, y*479, x*308, y*41, (isMouseInPosition(x*517, y*479, x*308, y*41) and tocolor(0, 0, 0, 200) or tocolor(0, 0, 0, 50)), false) dxDrawRectangle(x*517, y*479, x*5, y*41, tocolor(255, 140, 0, 255), false) dxDrawRectangle(x*517, y*428, x*5, y*41, tocolor(255, 140, 0, 255), false) dxDrawRectangle(x*517, y*377, x*5, y*41, tocolor(255, 140, 0, 255), false) dxDrawRectangle(x*517, y*326, x*5, y*41, tocolor(255, 140, 0, 255), false) dxDrawRectangle(x*517, y*275, x*5, y*41, tocolor(255, 140, 0, 255), false) dxDrawRectangle(x*517, y*224, x*5, y*41, tocolor(255, 140, 0, 255), false) dxDrawRectangle(x*820, y*224, x*5, y*41, tocolor(255, 140, 0, 255), false) dxDrawRectangle(x*820, y*275, x*5, y*41, tocolor(255, 140, 0, 255), false) dxDrawRectangle(x*820, y*326, x*5, y*41, tocolor(255, 140, 0, 255), false) dxDrawRectangle(x*820, y*377, x*5, y*41, tocolor(255, 140, 0, 255), false) dxDrawRectangle(x*820, y*428, x*5, y*41, tocolor(255, 140, 0, 255), false) dxDrawRectangle(x*820, y*479, x*5, y*41, tocolor(255, 140, 0, 255), false) local receiver = getElementData(localPlayer, "ReceiverPM") if (receiver) then dxDrawText("Revistar", x*653, y*234, x*687, y*245, tocolor(255, 255, 255, 200), x*1.20, "default", "left", "top", false, false, false, false, false) if getElementData(receiver, "Agarrado") then dxDrawText("Desagarrar", x*653, y*284, x*687, y*295, tocolor(255, 255, 255, 200), x*1.20, "default", "left", "top", false, false, false, false, false) else dxDrawText("Agarrar", x*653, y*284, x*687, y*295, tocolor(255, 255, 255, 200), x*1.20, "default", "left", "top", false, false, false, false, false) end if getElementData(receiver, "Algemado") then dxDrawText("Desalgemar", x*649, y*335, x*687, y*347, tocolor(255, 255, 255, 200), x*1.20, "default", "left", "top", false, false, false, false, false) else dxDrawText("Algemar", x*649, y*335, x*687, y*347, tocolor(255, 255, 255, 200), x*1.20, "default", "left", "top", false, false, false, false, false) end dxDrawText("Remover/Ver Itens", x*615, y*386, x*668, y*398, tocolor(255, 255, 255, 200), x*1.20, "default", "left", "top", false, false, false, false, false) if getElementData(receiver, "NaViatura") then dxDrawText("Retirar da Viatura", x*618, y*437, x*659, y*449, tocolor(255, 255, 255, 200), x*1.20, "default", "left", "top", false, false, false, false, false) else dxDrawText("Colocar na Viatura", x*618, y*437, x*659, y*449, tocolor(255, 255, 255, 200), x*1.20, "default", "left", "top", false, false, false, false, false) end dxDrawText("Multar", x*658, y*488, x*696, y*502, tocolor(255, 255, 255, 200), x*1.20, "default", "left", "top", false, false, false, false, false) end elseif (window == 2) then local receiver = getElementData(localPlayer, "ReceiverPM") if (receiver) then local nome = getPlayerName(receiver) local id = getElementData(receiver, "ID") or "N/A" local idade = getElementData(receiver, "AirNew_RG_DataDeNascimento") or "N/A" local rg = getElementData(receiver, "AirNew_PossuiRG") or "Nao" local cnh_a = getElementData(receiver, "PravaA") local cnh_b = getElementData(receiver, "PravaB") local cnh_c = getElementData(receiver, "PravaC") local cnh_d = getElementData(receiver, "PravaD") if (cnh_a) and (cnh_a == true) then cnh_a = "#00ff00Sim" else cnh_a = "#ff0000Não" end if (cnh_b) and (cnh_b == true) then cnh_b = "#00ff00Sim" else cnh_b = "#ff0000Não" end if (cnh_c) and (cnh_c == true) then cnh_c = "#00ff00Sim" else cnh_c = "#ff0000Não" end if (cnh_d) and (cnh_d == true) then cnh_d = "#00ff00Sim" else cnh_d = "#ff0000Não" end dxDrawText(" Dados Pessoais\n\nID: #00ff7f"..id.."#ffffff\n\nNome: "..nome.." #ffffff\n\nIdade: #00ff7f"..idade.."#ffffff\n\nRG: #00ff7f"..rg.."#ffffff\n\nMoto(A): "..cnh_a.."#ffffff\nCarro (B): "..cnh_b.."#ffffff\nCamião (C): "..cnh_c.."#ffffff\nBus (D): "..cnh_d, x*530, y*230, x*729, y*258, tocolor(255, 255, 255, 200), x*1.2, "default", "left", "top", false, false, false, true, false) dxDrawRectangle(x*694, y*466, x*86, y*29, (isMouseInPosition(x*694, y*466, x*86, y*29) and tocolor(125, 38, 205, 200) or tocolor(0, 0, 0, 150)), false) dxDrawText("Retirar", x*716, y*469, x*751, y*480, tocolor(255, 255, 255, 255), x*1.20, "default", "left", "top", false, false, false, false, false) end elseif (window == 3) then local receiver = getElementData(localPlayer, "ReceiverPM") if (receiver) then dxDrawRectangle(x*636, y*472, x*89, y*29, (isMouseInPosition(x*636, y*472, x*89, y*29) and tocolor(125, 38, 205, 200) or tocolor(0, 0, 0, 150)), false) dxDrawText("Pegar", x*662, y*475, x*697, y*487, tocolor(255, 255, 255, 255), x*1.20, "default", "left", "top", false, false, false, false, false) end elseif (window == 4) then local receiver = getElementData(localPlayer, "ReceiverPM") if (receiver) then dxDrawText("Preencha o motivo da Multa.", x*579, y*283, x*639, y*299, tocolor(255, 255, 255, 255), x*1.20, "default", "left", "top", false, false, false, false, false) dxDrawText("Preencha o valor da Multa.", x*590, y*358, x*650, y*374, tocolor(255, 255, 255, 255), x*1.20, "default", "left", "top", false, false, false, false, false) dxDrawRectangle(x*620, y*460, x*116, y*34, (isMouseInPosition(x*620, y*460, x*116, y*34) and tocolor(125, 38, 205, 200) or tocolor(0, 0, 0, 150)), false) dxDrawText("Multar", x*658, y*466, x*718, y*482, tocolor(255, 255, 255, 255), x*1.20, "default", "left", "top", false, false, false, false, false) end end end addEventHandler("N3xT.onPainelPolicial", root, function(click) if (visible ~= true) then addEventHandler("onClientRender", root, pm) showCursor(true) playSoundFrontEnd(20) setElementData(localPlayer, "ReceiverPM", click) visible = true window = 1 end end ) bindKey(tecla, "down", function() if (visible == true) then removeEventHandler("onClientRender", root, pm) showCursor(false) setElementData(localPlayer, "ReceiverPM", nil) playSoundFrontEnd(8) visible = false for i = 1, #edit do guiSetVisible(edit, false) end end end ) addEventHandler("onClientClick", root, function(button, state) if (button == "left") and (state == "down") then if (visible == true) then if (window == 1) then if isMouseInPosition(x*517, y*326, x*308, y*41) then -- Algemar. setTimer(function() triggerServerEvent("N3xT.onAlgemar", localPlayer) playSoundFrontEnd(1) end, 10, 1) elseif isMouseInPosition(x*517, y*428, x*308, y*41) then -- Colocar na viatura. setTimer(function() triggerServerEvent("N3xT.onViatura", localPlayer) playSoundFrontEnd(1) end, 10, 1) elseif isMouseInPosition(x*517, y*275, x*308, y*41) then -- Agarrar. setTimer(function() triggerServerEvent("N3xT.onAgarrar", localPlayer) playSoundFrontEnd(1) end, 10, 1) elseif isMouseInPosition(x*517, y*224, x*308, y*41) then -- Revistar. setTimer(function() window = 2 updateArmas() guiSetVisible(edit[4], true) playSoundFrontEnd(1) end, 10, 1) elseif isMouseInPosition(x*517, y*377, x*308, y*41) then -- Remover itens. setTimer(function() window = 3 triggerServerEvent("N3xT.ItensPM", localPlayer, 1) guiSetVisible(edit[3], true) playSoundFrontEnd(1) end, 10, 1) elseif isMouseInPosition(x*517, y*479, x*308, y*41) then -- Multar. setTimer(function() window = 4 guiSetVisible(edit[1], true) guiSetVisible(edit[2], true) playSoundFrontEnd(1) end, 10, 1) end end end end end ) function updateArmas() local receiver = getElementData(localPlayer, "ReceiverPM") if (receiver) then guiGridListClear(edit[4]) for _, v in ipairs(getPedWeapons(receiver)) do guiGridListAddRow(edit[4], getWeaponNameFromID(v)) end end end addEventHandler("onClientClick", root, function(button, state) if (button == "left") and (state == "down") then if (visible == true) then if (window == 2) then if isMouseInPosition(x*694, y*466, x*86, y*29) then if (guiGridListGetSelectedItem(edit[4]) ~= -1) then local arma = guiGridListGetItemText(edit[4], guiGridListGetSelectedItem(edit[4]), 1) triggerServerEvent("N3xT.takeWeaponPM", localPlayer, arma) else triggerEvent("N3xT.dxNotification", root, "Selecione uma arma!", "error") end end elseif (window == 3) then if isMouseInPosition(x*636, y*472, x*89, y*29) then if (guiGridListGetSelectedItem(edit[3]) ~= -1) then local item = guiGridListGetItemText(edit[3], guiGridListGetSelectedItem(edit[3]), 1) local quantia = guiGridListGetItemText(edit[3], guiGridListGetSelectedItem(edit[3]), 2) triggerServerEvent("N3xT.ItensPM", localPlayer, 2, item, quantia) else triggerEvent("N3xT.dxNotification", root, "Selecione um item!", "error") end end elseif (window == 4) then if isMouseInPosition(x*620, y*460, x*116, y*34) then local motivo = guiGetText(edit[1]) local valor = guiGetText(edit[2]) if (motivo ~= "Motivo") and (motivo ~= "") then if tonumber(valor) and (tonumber(valor) >= 1) then triggerServerEvent("N3xT.onMultar", localPlayer, motivo, valor) else triggerEvent("N3xT.dxNotification", root, "Coloque um valor válido!", "error") end else triggerEvent("N3xT.dxNotification", root, "Coloque um motivo válido!", "error") end end end end end end ) addEventHandler("N3xT.refreshGridItemPM", root, function(itable) if (type(itable) == "table") then guiGridListClear(edit[3]) for _, v in ipairs(itable) do guiGridListAddRow(edit[3], v[1], v[2]) end end end ) addEventHandler("N3xT.setWindowPM", root, function(value) window = value for i = 1, #edit do guiSetVisible(edit, false) end end ) addEventHandler("onClientRender", root, function() local receiver = getElementData(localPlayer, "ReceiverPM") if (receiver) then if (visible == true) then local x, y, z = getElementPosition(localPlayer) local px, py, pz = getElementPosition(receiver) if (getDistanceBetweenPoints3D(x, y, z, px, py, pz) > 3) then removeEventHandler("onClientRender", root, pm) showCursor(false) setElementData(localPlayer, "ReceiverPM", nil) playSoundFrontEnd(8) visible = false for i = 1, #edit do guiSetVisible(edit, false) end end end end end ) addEventHandler("onClientRender", root, function() for k, v in ipairs(getElementsByType("player")) do if getElementData(v, "Algemado") then local k, anim = getPedAnimation(v) if (anim ~= "gift_give") then setPedAnimation(v, "kissing", "gift_give", 500, true, false, false, true) end setPedAnimationProgress(v, 'gift_give', 0.10) end end end ) addEventHandler("onClientKey", root, function(button) if (button) then if (getElementData(localPlayer, "Algemado") == true) or (getElementData(localPlayer, "NaViatura") == true) then cancelEvent() end end end ) function getPedWeapons(ped) local playerWeapons = {} if ped and isElement(ped) and getElementType(ped) == "ped" or getElementType(ped) == "player" then for i=2,9 do local wep = getPedWeapon(ped,i) if wep and wep ~= 0 then table.insert(playerWeapons,wep) end end else return false end return playerWeapons end function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) ) end @Im_PlayerGTA
  15. Olá! Qual o lado client do seu mod? por aqui ja consigo fazer, mas ai retornaria erro do click... me manda o lado client que faço
×
×
  • Create New...