Jump to content

Search the Community

Showing results for 'algemar'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

  1. Ou você pode setar rotação nos braços do jogador algemado em vez de setar uma animação. Dai é só ficar chamando todo frame enquanto ele estiver com elementData de algemado. -- Client-side: function setCuffed(thePlayer) -- Função que seta a "animação" de algemado. -- Left setElementBoneRotation(thePlayer, 32, 26.574, 61.3375, 59.2065) setElementBoneRotation(thePlayer, 33, 27.844, 15.364, 46.406) setElementBoneRotation(thePlayer, 34, -81.0185, 342.875, 326.118) -- Right setElementBoneRotation(thePlayer, 22, 338.839, 53.4935, 298.452) setElementBoneRotation(thePlayer, 23, 307.687, 22.11, 313.594) setElementBoneRotation(thePlayer, 24, 96.0475, 357.883, 56.739) updateElementRpHAnim(thePlayer) -- Aplica as rotações nos ossos do thePlayer neste frame. end addEventHandler("onClientPedsProcessed", root, function() -- Chama essa função a cada frame, quando os personagens são processados. for _,player in pairs(getElementsByType("player", root, true)) do -- Para cada jogador próximo, faça: if getElementData(player, "algemado") then -- Se o jogador está com a elementData "algemado" então: setCuffed(player) -- Seta a animação de algemado nele durante 1 frame. end end end) -- Server-side: addCommandHandler("algemar", function(theCop, cmd, name) -- Comando que vai algemar/desalgemar alguém. Use /algemar NomeDoPlayer if not isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(theCop)), aclGetGroup ("Policia")) then -- Se quem executou o comando não está na ACL Group "Policia", então: outputChatBox("Acesso negado. Você precisa ser um policial para usar este comando.", theCop, 255, 50, 50) return -- Cancela a execução dessa função aqui e nem lê o resto. end if not name then -- Se não foi declarado nada depois do /algemar, então: outputChatBox("Erro: É necessário informar o nome do jogador a ser algemado/desalgemado.", theCop, 255, 50, 50) return end local thePlayer = getPlayerFromName(name) if thePlayer then -- Se existe o jogador com o nome informado, então: (o nome precisa ser exato, incluindo códigos de cores) if getPedOccupiedVehicle(thePlayer) then -- Não permite algemar/desalgemar jogadores que estão em veículos. outputChatBox("Erro: Este jogador está em um veículo, não é possível algemar/desalgemar ele.", theCop, 255, 50, 50) return end if getElementData(thePlayer, "algemado") then -- Se o jogador já tem a data de algemado, então: setElementData(thePlayer, "algemado", false) -- Remove a data dele, parando a animação de algemado dele. disenableControls(thePlayer, true) -- Habilita os controles do jogador. outputChatBox("Você desalgemou o jogador "..name, theCop, 255, 255, 0) else -- Se o jogador não tem a data de algemado, então: setElementData(thePlayer, "algemado", true) -- Coloca a data nele, a animação de algemado será aplicada nele. disenableControls(thePlayer, false) -- Desabilita os controles do jogador. setPedWeaponSlot (thePlayer, 0) -- Coloca o slot de arma desarmado no jogador. Para ele não ficar segurando armas enquanto algemado. outputChatBox("Você algemou o jogador "..name, theCop, 255, 255, 0) end else -- Se não existe um jogador com o nome informado (ou o nome informado não é exato), então: outputChatBox("Erro: Jogador não encontrado: "..name, theCop, 255, 50, 50) end end) function disenableControls(thePlayer, state) -- Função que ativa/desativa alguns controles específicos do jogador, pra n ficar repetindo código. local controls = {"fire", "action", "jump", "sprint", "aim_weapon", "next_weapon", "previous_weapon", "enter_exit"} for _,ctrl in pairs (controls) do -- Para cada controle da lista, faça: toggleControl (thePlayer, ctrl, state) -- Ativa/desativa o controle. end end
  2. Meu /algemar não ta funcionando não oq ouve nele se alguem poder dar um helpzinho Ligo o resource so que não acontece nada quando uso o /algemar coloquei o comando dele pra /a e coloquei o if isObjectInACLGroup("user."..accountname, aclGetGroup("BOPE")) or if isObjectInACLGroup("user."..accountname, aclGetGroup("PMRJ")) then function setPedAnimationSpeed(player,anim,speed) triggerClientEvent(player, "animSped", player, player,anim,speed) end function setCuffPlayer(player) setPedAnimation(player, nil) setPedAnimation(player,'ped', 'pass_Smoke_in_car', 0, true, true, true) setTimer(setPedAnimationSpeed,60,1,player, 'pass_Smoke_in_car', 0) local x, y, z = getElementPosition(player) local box = createObject(364, x, y, z) exports.bone_attach:attachElementToBone(box, player, 12, 0,0,0, 0,40,-10) setElementCollisionsEnabled(box, false) setElementData(player,'cuffOb', box) toggleControl(player, 'jump', false) setTimer(function(player) if getElementData(player,'cuff') and getElementData(player,'cuff') == true then toggleControl(player, 'fire', false) end end,60,0,player) toggleControl(player, 'crouch', false) end function cuff(hit,_,name) local player = getPlayerFromName(name) local x,y,z = getElementPosition(player) local x1,y1,z1 = getElementPosition(hit) if getDistanceBetweenPoints3D(x1,y1,z1,x,y,z) <= 20 then if not getElementData(player,'cuff') or getElementData(player,'cuff') ~= true then if isPedInVehicle(player) then setControlState(player,'enter_exit',true) setTimer(setCuffPlayer,2800,1,player) setElementData(player,'cuff', true) else setCuffPlayer(player) setElementData(player,'cuff', true) end outputChatBox(' '..getPlayerName(hit)..'#ff0000 Algemou você',player,255,255,255,true) else removeElementData(player,'cuff') destroyElement(getElementData(player,'cuffOb')) removeElementData(player, 'cuff') toggleControl(player, 'jump', true) toggleControl(player, 'crouch', true) toggleControl(player, 'fire', true) setPedAnimation(player, 'ped', 'pass_Smoke_in_car', 0, false, false, false, false) outputChatBox(' '..getPlayerName(hit)..'#008800 Soltou suas algemas',player,255,255,255,true) end else outputChatBox("Você está longe demais!",hit,255,0,0,true) end end if isObjectInACLGroup("user."..accountname, aclGetGroup("BOPE")) or if isObjectInACLGroup("user."..accountname, aclGetGroup("PMRJ")) then addCommandHandler('a',cuff) addEventHandler('onPlayerQuit', root,function() if getElementData(source,'cuff') == true then destroyElement(getElementData(source,'cuffOb')) removeElementData(source, 'cuff') end end) addEventHandler('onPlayerWasted',root,function() if getElementData(source,'cuff') == true then destroyElement(getElementData(source,'cuffOb')) removeElementData(source, 'cuff') end end) addEventHandler('onVehicleStartEnter', getRootElement(), function(player, seat) if getElementData(player,'cuff') == true then if seat ~= 0 then destroyElement(getElementData(player,'cuffOb')) else cancelEvent() outputChatBox('Você não pode dirigir você tem algemas!',player,255,0,0) end end end) setTimer(function() for _,player in ipairs(getElementsByType("player")) do if getElementData(player,'cuff') == true then if isPedInWater(player) then setTimer(function(player) if isPedInWater(player) then killPed(player) end end,5000,1,player) end end end end,1000,0) addEventHandler('onVehicleExit', getRootElement(), function(player, seat) if getElementData(player,'cuff') == true then setCuffPlayer(player) end end)
  3. Bom o /algemar ele trava o jogador + o chat não da pra apertar a tecla T então queria pedir ajuda pra alguem que saiba resolver pra mim Codigo 1 - function setPedAnimationSpeed (player, anim, speed) triggerClientEvent (player, "animSped", player, player, anim, speed) end function setCuffPlayer (player) setPedAnimation (player, nil) setPedAnimation (player, 'ped', 'pass_Smoke_in_car', 0, true, true, true) setTimer (setPedAnimationSpeed, 60, 1, player, 'pass_Smoke_in_car', 0) local x, y, z = getElementPosition (player) local box = createObject(364, x, y, z) exports.bone_attach:attachElementToBone (box, player, 12, 0,0,0, 0,40,-10) setElementCollisionsEnabled (box, false) setElementData (player,'cuffOb', box) toggleControl (player, 'jump', false) setTimer(function (player) if (getElementData (player, 'cuff') and getElementData (player, 'cuff') == true) then toggleControl (player, 'fire', false) end end, 60, 0, player) toggleControl (player, 'crouch', false) end function cuff (thePlayer, cmd, nick) if (isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup ("BOPE")) or isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup ("PMRJ"))) then local nickJogador = getPlayerFromPartialName (nick) if (nickJogador) then local x, y, z = getElementPosition (thePlayer) local x1, y1, z1 = getElementPosition (nickJogador) if (getDistanceBetweenPoints3D (x1, y1, z1, x, y, z) <= 20) then if not (getElementData (nickJogador, 'cuff')) then -- if isPedInVehicle (nickJogador) then -- setControlState (nickJogador, 'enter_exit', true) -- setTimer (setCuffPlayer, 2800, 1, nickJogador) -- setElementData (nickJogador, 'cuff', true) -- else setCuffPlayer (nickJogador) setElementData (nickJogador, 'cuff', true) toggleAllControls (nickJogador, false) outputChatBox (getPlayerName(thePlayer)..'#ff0000 Algemou você agora você não pode se mover', nickJogador, 255, 255, 255, true) -- end else removeElementData (nickJogador, 'cuff') destroyElement (getElementData (nickJogador, 'cuffOb')) removeElementData (nickJogador, 'cuff') toggleAllControls (nickJogador, true) setPedAnimation (nickJogador, 'ped', 'pass_Smoke_in_car', 0, false, false, false, false) outputChatBox (getPlayerName(thePlayer)..'#008800 Soltou suas algemas e agora você esta livre', nickJogador, 255, 255, 255, true) end else outputChatBox ("O jogador estã longe demais se aproxime!", thePlayer, 255, 0, 0) end else outputChatBox ("Nenhum jogador com esse nick foi encontrado!", thePlayer, 255, 0, 0) end else outputChatBox ("Você não tem acesso a esse comando!", thePlayer, 255, 0, 0) end end addCommandHandler ('a', cuff) addEventHandler ('onPlayerQuit', root, function () if (getElementData (source, 'cuff') == true) then destroyElement(getElementData(source, 'cuffOb')) removeElementData (source, 'cuff') end end) addEventHandler ('onPlayerWasted', root, function () if (getElementData (source, 'cuff') == true) then destroyElement(getElementData(source, 'cuffOb')) removeElementData (source, 'cuff') end end) addEventHandler ('onVehicleStartEnter', getRootElement(), function (player, seat) if (getElementData (player, 'cuff') == true) then if (seat ~= 0) then destroyElement(getElementData(player, 'cuffOb')) else cancelEvent () outputChatBox ('Você não pode dirigir você tem algemas!', player, 255, 0, 0) end end end) setTimer(function () for _, player in ipairs(getElementsByType("player")) do if (getElementData (player, 'cuff') == true) then if isElementInWater(player) then setTimer(function(player) if isElementInWater(player) then killPed (player) end end, 5000, 1, player) end end end end, 1000, 0) addEventHandler ('onVehicleExit', getRootElement(), function (player, seat) if (getElementData (player, 'cuff') == true) then setCuffPlayer (player) end end) 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 Codigo - 2 addEventHandler ( 'onClientResourceStart', getResourceRootElement(getThisResource()), function() txd = engineLoadTXD('cuff.txd',364) engineImportTXD(txd,364) dff = engineLoadDFF('cuff.dff',364) engineReplaceModel(dff,364) end) function animSped(player,anim, speed) setPedAnimationSpeed(player,anim, speed) setPedAnimationProgress(player, 'pass_Smoke_in_car', 0) toggleControl('fire', false) end addEvent("animSped", true) addEventHandler( "animSped", root, animSped)
  4. Bom eu peguei um script de /algemar na internet só que o pessoal esta reclamando que os policiais estão algemando de longe então eu pensei em criar um script de algemar com cassetete alguém poderia me falar como eu posso fazer isso?
  5. Ola boa tarde sou novo na area de script estou enfrentando problemas com o painel policial alguem pode me ajudar a resolver quando eu revisto uma pessoa apenas aparece a cnh e não as armas que a pessoa tem vou colar o script logo a baixo --[[ =========================================================== # 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 for slot = 0, 12 do local Armamento = getPedWeapon ( Jogador, slot ) if Armamento > 0 then local NomeDaArma = getWeaponNameFromID ( Armamento ) outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem "..NomeDaArma.."!",source,255,0,0,true) end 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
  6. @Blaack Ainda Não pegou o problema pode ser no sever? --[[ =========================================================== # 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. 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
  8. --[[ =========================================================== # 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 for slot = 0, 12 do local Armamento = getPedWeapon ( Jogador, slot ) if Armamento > 0 then local NomeDaArma = getWeaponNameFromID ( Armamento ) outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem "..NomeDaArma.."!",source,255,0,0,true) end 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
  9. Recentemente abaixei um mod da internet cujo a funçao dele e interação policial na hora de algemar prender esses trem porem nao e possivel ver a CNH pelo painel ja mudei o SetElementData O GetElementData Modifiquei acl coloquei na acl adm mas sem sucesso ja tentei contatar o dono do mod peço facebook porem sem exito --[[ =========================================================== # Minha página: https://www.facebook.com/TioSteinScripter/# # ╔════╗╔══╗╔═══╗ ╔═══╗╔════╗╔═══╗╔══╗╔═╗─╔╗ # # ║╔╗╔╗║╚╣─╝║╔═╗║ ║╔═╗║║╔╗╔╗║║╔══╝╚╣─╝║║╚╗║║ # # ╚╝║║╚╝─║║─║║─║║ ║╚══╗╚╝║║╚╝║╚══╗─║║─║╔╗╚╝║ # # ──║║───║║─║║─║║ ╚══╗║──║║──║╔══╝─║║─║║╚╗║║ # # ──║║──╔╣─╗║╚═╝║ ║╚═╝║──║║──║╚══╗╔╣─╗║║─║║║ # # ──╚╝──╚══╝╚═══╝ ╚═══╝──╚╝──╚═══╝╚══╝╚╝─╚═╝ # =========================================================== --]] Comando = "policial" ACL = "Policial" CorPainel = tocolor(225, 0, 0, 252) NomeDoServidor = "Brasil Mundo Avançado" ------------- Nome que você quer que apareça no painel ElementDataBanco = "TS:Banco" -------------- Element Data Do Banco, o mesmo da HUD ElementDataPorteDeArmas = "TS:PorteDeArmas" -------------- Element Data Do Porte de armas ElementHab1 = "DNL:Categoria(B)" ------------------- Element Data Habilitação Carro CaractereHab1 = "Sim" -------------- Se é "Sim" ou true ElementHab1 = "DNL:TestePratico" ------------------- Element Data Habilitação Carreta CaractereHab1 = "Sim" -------------- Se é "Sim" ou true ElementHab2 = "DNL:Categoria(A" ------------------- Element Data Habilitação Moto CaractereHab2 = "Sim" -------------- Se é "Sim" ou true ElementHab3 = "DNL:Categoria(C)" ------------------- Element Data Habilitação Caminhao CaractereHab3 = "Sim" -------------- Se é "Sim" ou true ElementHab3 = "DNL:Categoria(D)" ------------------- Element Data Habilitação Caminhao CaractereHab3 = "Sim" -------------- Se é "Sim" ou true ElementHab4 = "DNL:Categoria(E)" ------------------- Element Data Habilitação Caminhao CaractereHab4 = "Sim" -------------- Se é "Sim" ou true ElementHab5 = "DNL:TestePratico" ------------------- Element Data Habilitação Carreta CaractereHab5 = "Sim" -------------- Se é "Sim" ou true ElementRG = "ID" ------------------- Element Data RG ElementDataNascimento = "TS:DataDeNascimento" ------------------- Element Data de nascimento TiposDeMulta = { {"Infração Gravíssima", 5000}, ------------- Motivo da multa, Valor da multa {"Infração Grave", 4000}, ------------- Motivo da multa, Valor da multa {"Infração Média", 3000}, ------------- Motivo da multa, Valor da multa {"Infração Leve", 2000}, ------------- Motivo da multa, Valor da multa } e aki A CNH Entrar = createMarker(1111.70715, -1796.76624, 16.59375 -1, "cylinder", 1.2, 0, 255, 0, 90) Blip = createBlipAttachedTo ( Entrar, 36 ) setBlipVisibleDistance(Blip, 150) Sair = createMarker(-2026.97485, -104.28124, 1035.17188 -1, "cylinder", 1.2, 0, 255, 0, 90) setElementInterior(Sair, 3) Marker_Categoria = createMarker(-2033.13196, -117.45327, 1035.17188 -1, "cylinder", 1.2, 0, 255, 0, 90) setElementInterior(Marker_Categoria, 3) Marker_Multas = createMarker(-2031.19666, -115.17245, 1035.17188 -1, "cylinder", 1.2, 0, 255, 0, 90) setElementInterior(Marker_Multas, 3) function Entrar_Detran (source) setElementInterior(source, 3) setElementPosition(source, -2029.55017, -105.98931, 1035.17188) setElementDimension(source, 0) end addEventHandler("onMarkerHit", Entrar, Entrar_Detran) function Sair_Detran (source) setElementInterior(source, 0) setElementPosition(source, 1109.35291, -1796.64258, 16.59375) setElementDimension(source, 0) end addEventHandler("onMarkerHit", Sair, Sair_Detran) function Abrir_Prova(source) local account = getPlayerAccount (source) if isGuestAccount (account) then outputChatBox ( "#ff0000✘ #ffffffDetran #ff0000✘➺ #FFFFFFVocê não pode Fazer Prova Deslogado!", source, 255,255,255,true) return end if isElementWithinMarker(source, Marker_Categoria) then triggerClientEvent(source,"DNL:AbrirCategorias",source) end end addEventHandler( "onMarkerHit", Marker_Categoria, Abrir_Prova ) function PagarMultas(source) local account = getPlayerAccount (source) if isGuestAccount (account) then outputChatBox ( "#ff0000✘ #ffffffDetran #ff0000✘➺ #FFFFFFVocê não pode Pagar Multas Deslogado!", source, 255,255,255,true) return end if isElementWithinMarker(source, Marker_Multas) then triggerClientEvent(source,"DNL:Abrir_Multas",source) end end addEventHandler( "onMarkerHit", Marker_Multas, PagarMultas ) -------- Carregar_Dados -------- function Carregar_Dados () local Account = getPlayerAccount(source) local HabilitacaoA = getAccountData (Account, "DNL:Categoria(A)") local HabilitacaoB = getAccountData (Account, "DNL:Categoria(B)") local HabilitacaoC = getAccountData (Account, "DNL:Categoria(C)") local HabilitacaoD = getAccountData (Account, "DNL:Categoria(D)") local HabilitacaoE = getAccountData (Account, "DNL:Categoria(E)") setElementData(source, "DNL:Categoria(A)", HabilitacaoA) setElementData(source, "DNL:Categoria(B)", HabilitacaoB) setElementData(source, "DNL:Categoria(C)", HabilitacaoC) setElementData(source, "DNL:Categoria(D)", HabilitacaoD) setElementData(source, "DNL:Categoria(E)", HabilitacaoE) end addEventHandler("onPlayerLogin", root, Carregar_Dados) function carteira (source, cmd, pname) local accountname = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..accountname, aclGetGroup("Everyone")) then -- Grupo permitido a usar o comando local Player_2 = getPlayerFromPartialName(pname) if isElement(Player_2) then local Account = getPlayerAccount(Player_2) setElementData(Player_2, "DNL:Categoria(A)", true) setAccountData ( Account, "DNL:Categoria(A)", true) setElementData(Player_2, "DNL:Categoria(B)", true) setAccountData ( Account, "DNL:Categoria(B)", true) setElementData(Player_2, "DNL:Categoria(C)", true) setAccountData ( Account, "DNL:Categoria(C)", true) setElementData(Player_2, "DNL:Categoria(D)", true) setAccountData ( Account, "DNL:Categoria(D)", true) setElementData(Player_2, "DNL:Categoria(E)", true) setAccountData ( Account, "DNL:Categoria(E)", true) else outputChatBox ( "#ff0000✘ #ffffffERRO #ff0000✘➺ #ffffff O Jogador(a) Não Foi Encontrado!", source, 255,255,255,true) end else outputChatBox ( "#ff0000✘ #ffffffERRO #ff0000✘➺ #FFFFFFVocê não tem permissão para utilizar este comando!", source, 255,255,255,true) end end addCommandHandler("carteira", carteira) -------------------------------------------------------------------- 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 -------------------------------------------------------------------- Outra parte do Script --[[ ===================================== --]] -- = CATEGORIA A = -- --[[ ===================================== --]] function CNHMoto (source, seat) if getElementData( source, "DNL:TestePratico", true ) then return end if getElementData(source, "DNL:Categoria(A)", true) then return end local temp = getPedOccupiedVehicle(source) if (getElementModel (temp) == 581) or (getElementModel (temp) == 462) or (getElementModel (temp) == 521) or (getElementModel (temp) == 463) or (getElementModel (temp) == 522) or (getElementModel (temp) == 461) or (getElementModel (temp) == 448) or (getElementModel (temp) == 468) or (getElementModel (temp) == 586) or (getElementModel (temp) == 523) then -- if getVehicleOccupant(temp,0) then if seat == 0 then triggerClientEvent(source,"CNH:AlertaMoto",source) end end end addEventHandler ( "onVehicleEnter", root, CNHMoto ) --[[ ===================================== --]] -- = CATEGORIA B = -- --[[ ===================================== --]] function CNHCarro (source, seat) if getElementData( source, "DNL:TestePratico", true ) then return end if getElementData(source, "DNL:Categoria(B)", true) then return end local temp = getPedOccupiedVehicle(source) if (getElementModel (temp) == 602) or (getElementModel (temp) == 496) or (getElementModel (temp) == 525) or (getElementModel (temp) == 401) or (getElementModel (temp) == 518) or (getElementModel (temp) == 527) or (getElementModel (temp) == 589) or (getElementModel (temp) == 419) or (getElementModel (temp) == 587) or (getElementModel (temp) == 533) or (getElementModel (temp) == 526) or (getElementModel (temp) == 474) or (getElementModel (temp) == 545) or (getElementModel (temp) == 517) or (getElementModel (temp) == 410) or (getElementModel (temp) == 600) or (getElementModel (temp) == 436) or (getElementModel (temp) == 439) or (getElementModel (temp) == 549) or (getElementModel (temp) == 491) or (getElementModel (temp) == 445) or (getElementModel (temp) == 604) or (getElementModel (temp) == 507) or (getElementModel (temp) == 585) or (getElementModel (temp) == 466) or (getElementModel (temp) == 492) or (getElementModel (temp) == 546) or (getElementModel (temp) == 551) or (getElementModel (temp) == 516) or (getElementModel (temp) == 467) or (getElementModel (temp) == 426) or (getElementModel (temp) == 547) or (getElementModel (temp) == 405) or (getElementModel (temp) == 580) or (getElementModel (temp) == 409) or (getElementModel (temp) == 550) or (getElementModel (temp) == 566) or (getElementModel (temp) == 540) or (getElementModel (temp) == 421) or (getElementModel (temp) == 529) or (getElementModel (temp) == 485) or (getElementModel (temp) == 438) or (getElementModel (temp) == 574) or (getElementModel (temp) == 420) or (getElementModel (temp) == 490) or (getElementModel (temp) == 470) or (getElementModel (temp) == 596) or (getElementModel (temp) == 598) or (getElementModel (temp) == 599) or (getElementModel (temp) == 597) or (getElementModel (temp) == 531) or (getElementModel (temp) == 536) or (getElementModel (temp) == 575) or (getElementModel (temp) == 534) or (getElementModel (temp) == 567) or (getElementModel (temp) == 535) or (getElementModel (temp) == 576) or (getElementModel (temp) == 429) or (getElementModel (temp) == 541) or (getElementModel (temp) == 415) or (getElementModel (temp) == 480) or (getElementModel (temp) == 562) or (getElementModel (temp) == 565) or (getElementModel (temp) == 434) or (getElementModel (temp) == 494) or (getElementModel (temp) == 502) or (getElementModel (temp) == 503) or (getElementModel (temp) == 411) or (getElementModel (temp) == 559) or (getElementModel (temp) == 561) or (getElementModel (temp) == 560) or (getElementModel (temp) == 506) or (getElementModel (temp) == 451) or (getElementModel (temp) == 558) or (getElementModel (temp) == 555) or (getElementModel (temp) == 477) or (getElementModel (temp) == 568) or (getElementModel (temp) == 424) or (getElementModel (temp) == 504) or (getElementModel (temp) == 457) or (getElementModel (temp) == 483) or (getElementModel (temp) == 571) or (getElementModel (temp) == 500) or (getElementModel (temp) == 444) or (getElementModel (temp) == 556) or (getElementModel (temp) == 557) or (getElementModel (temp) == 471) or (getElementModel (temp) == 495) or (getElementModel (temp) == 539) or (getElementModel (temp) == 459) or (getElementModel (temp) == 422) or (getElementModel (temp) == 482) or (getElementModel (temp) == 605) or (getElementModel (temp) == 530) or (getElementModel (temp) == 418) or (getElementModel (temp) == 572) or (getElementModel (temp) == 582) or (getElementModel (temp) == 413) or (getElementModel (temp) == 440) or (getElementModel (temp) == 543) or (getElementModel (temp) == 583) or (getElementModel (temp) == 554) or (getElementModel (temp) == 579) or (getElementModel (temp) == 400) or (getElementModel (temp) == 404) or (getElementModel (temp) == 489) or (getElementModel (temp) == 505) or (getElementModel (temp) == 479) or (getElementModel (temp) == 422) or (getElementModel (temp) == 458) or (getElementModel (temp) == 402) then --if getVehicleOccupant(temp,0) then if seat == 0 then triggerClientEvent(source,"CNH:AlertaCar",source) end end end addEventHandler ( "onVehicleEnter", root, CNHCarro ) --[[ ===================================== --]] -- = CATEGORIA C = -- --[[ ===================================== --]] function CNHCaminhao (source, seat) if getElementData( source, "DNL:TestePratico", true ) then return end if getElementData(source, "DNL:Categoria(C)", true) then return end local temp = getPedOccupiedVehicle(source) if (getElementModel (temp) == 408) or (getElementModel (temp) == 552) or (getElementModel (temp) == 416) or (getElementModel (temp) == 433) or (getElementModel (temp) == 427) or (getElementModel (temp) == 528) or (getElementModel (temp) == 407) or (getElementModel (temp) == 544) or (getElementModel (temp) == 601) or (getElementModel (temp) == 428) or (getElementModel (temp) == 499) or (getElementModel (temp) == 609) or (getElementModel (temp) == 498) or (getElementModel (temp) == 524) or (getElementModel (temp) == 532) or (getElementModel (temp) == 578) or (getElementModel (temp) == 486) or (getElementModel (temp) == 406) or (getElementModel (temp) == 573) or (getElementModel (temp) == 455) or (getElementModel (temp) == 588) or (getElementModel (temp) == 423) or (getElementModel (temp) == 414) or (getElementModel (temp) == 443) or (getElementModel (temp) == 456) or (getElementModel (temp) == 478) or (getElementModel (temp) == 508) or (getElementModel (temp) == 431) or (getElementModel (temp) == 437) then if seat == 0 then triggerClientEvent(source,"CNH:AlertaCAM",source) end end end addEventHandler ( "onVehicleEnter", root, CNHCaminhao ) --[[ ===================================== --]] -- = CATEGORIA D = -- --[[ ===================================== --]] function CNHCarreta (source, seat) if getElementData( source, "DNL:TestePratico", true ) then return end if getElementData(source, "DNL:Categoria(D)", true) then return end local temp = getPedOccupiedVehicle(source) if (getElementModel (temp) == 403) or (getElementModel (temp) == 515) or (getElementModel (temp) == 514) then if seat == 0 then triggerClientEvent(source,"CNH:AlertaCARRETA",source) end end end addEventHandler ( "onVehicleEnter", root, CNHCarreta ) --[[ ===================================== --]] -- = CATEGORIA E = -- --[[ ===================================== --]] function CNHHeli (source, seat) if getElementData( source, "DNL:TestePratico", true ) then return end if getElementData(source, "DNL:Categoria(E)", true) then return end local temp = getPedOccupiedVehicle(source) if (getElementModel (temp) == 548) or (getElementModel (temp) == 425) or (getElementModel (temp) == 417) or (getElementModel (temp) == 487) or (getElementModel (temp) == 488) or (getElementModel (temp) == 497) or (getElementModel (temp) == 563) or (getElementModel (temp) == 447) or (getElementModel (temp) == 469) then if seat == 0 then triggerClientEvent(source,"CNH:AlertaHeli",source) end end end addEventHandler ( "onVehicleEnter", root, CNHHeli ) --[[ ===================================== --]] -- = REMOVER CNH = -- --[[ ===================================== --]] function RemCNH (source, seat) if seat == 0 then triggerClientEvent(source,"CNH:AlertaMoto_Off",source) triggerClientEvent(source,"CNH:AlertaCar_Off",source) triggerClientEvent(source,"CNH:AlertaCAM_Off",source) triggerClientEvent(source,"CNH:AlertaCARRETA_Off",source) triggerClientEvent(source,"CNH:AlertaHeli_Off",source) end end addEventHandler ( "onVehicleExit", root, RemCNH )
  10. 1. Indentação do código esta incorreta. 2. Basta usar a função IsObjectInACLGroup Então o código ficaria desta forma: function algemar(player, command, p) local acc = getPlayerAccount (player) if isObjectInACLGroup ( "user." ..getAccountName(acc), aclGetGroup ("algemar")) then local job = getElementData(player, 'ocupacao') or "Nenhum" if (job == "Policial") then if p then local target = getPlayerFromName(p) or getPlayerFromPartialName(p) if target and target ~= player then local px, py, pz = getElementPosition(player) local tx, ty, tz = getElementPosition(target) if getDistanceBetweenPoints3D(px, py, pz, tx, ty, tz) < 4 then if command == "algemar" then setElementData(target,"algemado",true) triggerClientEvent("algemaAdd", target) triggerClientEvent(target,"onClientPlayerAlgemado",resourceRoot,20000) setElementFrozen(target, true) setPedAnimation(player, "GANG", "prtial_gngtlkA", false, false) setTimer(function() setPedAnimation(player, false) end, 3000, 1, player, source) timer[target] = setTimer(desalgemar, 20000, 1, target) elseif command == "desalgemar" then local dataAlgemado = getElementData(target, "algemado") if (not dataAlgemado) then return outputChatBox("#FF0000ERROR: #FFFFFFEste jogador não está algemado", player, 255, 255, 255, true) end desalgemar(target) end else outputChatBox("#FF0000ERROR: #FFFFFFChegue mais perto do jogador", player, 255, 255, 255, true) end else outputChatBox("#FF0000ERROR: #FFFFFFVocê não pode algemar a si mesmo", player, 255, 255, 255, true) end else outputChatBox("#FF0000ERROR: #FFFFFFDigite /algemar <nick> ou /desalgemar <nick>", player, 255, 255, 255, true) end end else outputChatBox("#FF0000ERROR: #FFFFFFVocê não esta na ACL 'algemar'", player, 255, 255, 255, true) end end addCommandHandler("algemar", algemar)
  11. Preciso de ajuda nesse scritp, deixando bem claro que nao entendo a linguagem, mas não tenho condições de pagar alguem pra fazer isso.. Por isso que pesso ajuda de vocês humildemente... È um script policial de revistar, ta tudo funcionando perfeitamente, mas unico problema que eu estou tendo, é que quando eu revisto alguem, não aparece a arma que a pessoa esta portando entende? vou deixar aqui o Serve.lua ------------ Variaveis Comando = "policial" 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,"Habilitacoes:Carros") == true then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Tem Habilitação para Carros!",source,255,0,0,true) else outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Não tem Habilitação de Carros",source,255,0,0,true) end if getElementData(Jogador,"Habilitacoes:Motos") == true then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Tem Habilitação para Motos!",source,255,0,0,true) else outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Não tem Habilitação de Motos!",source,255,0,0,true) end if getElementData(Jogador,"Habilitacoes:Caminhoes") == true then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Tem Habilitação para Caminhões!",source,255,0,0,true) else outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Não tem Habilitação de Caminhão!",source,255,0,0,true) end if getElementData(Jogador,"Habilitacoes:Carretas") == true then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Tem Habilitação para Carretas!",source,255,0,0,true) else outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Não tem Habilitação de Carretas!",source,255,0,0,true) end if getElementData(Jogador,"Habilitacoes:Helicopteros") == true then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Tem Habilitação para Helicopteros!",source,255,0,0,true) else outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Não tem Habilitação de Helicopteros!",source,255,0,0,true) end local Quantidade = getElementData(source, "TS:"..Droga_Selecionada.."") or 0 for slot = 0, 12 do local Armas = getPedWeapon (Jogador, slot) local Municao = getPedTotalAmmo (Jogador, slot) if Armas > 0 then if Municao > 0 then weapon_nome = getWeaponNameFromID (Armas) outputChatBox ("* "..weapon_nome.." #3a3a3a»#25e014 "..Municao.." Bala(s)!", source,255,255,255,true) end end 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, "TS:PorteDeArmas") == "Sim" then triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial revogou seu porte de armas!", "info") setElementData(Jogador, "TS:PorteDeArmas", 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 Por favor, ficarei muito agradecido, sou novo aqui na comunidade, se eu tiver postando em lugar errado, pode remover sem problema, desculpem qualquer coisa !
  12. server triggered clientside event notify, but event is not added clientside I need help with this error, I'm trying a command but when I run this error, someone help me!!! Client: local sound = nil function uiEfeito() exports["Blur"]:dxDrawBluredRectangle(x*0, y*0, x*1366, y*768, tocolor(255, 255, 255, 150)) dxDrawImage(x*0, y*0, x*1366, y*768, "files/gfx/others/efeito.png", 0, 0, 0, tocolor(0, 254, 6, 255), false) end addEvent("worth:fumar:maconha", true) addEventHandler("worth:fumar:maconha", getRootElement(), function() sound = playSound("files/sfx/efeito.mp3", true) setRainLevel(5) addEventHandler("onClientRender", getRootElement(), uiEfeito) setPedControlState(localPlayer, "walk", true) setWindVelocity(100, 100, 0) setCameraShakeLevel(255) setGameSpeed(0.5) setTimer(function() setRainLevel(0) stopSound(sound) resetWindVelocity() setCameraShakeLevel(1) setGameSpeed(1) removeEventHandler("onClientRender", getRootElement(), uiEfeito) end, 33000, 1) end) Server: local algemados = {} local fumando = {} local utilizando = {} local maconhado = {} -- Global mascaras = {} jbl = {} --=-=-=-=-=-=-=-=-=-=-=-=-=-=- [ EVENTO ] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-- addEvent("use:item:worth:inventario", true) addEventHandler("use:item:worth:inventario", getRootElement(), function(player, item, quantidade) local itemInfos = getItemInfos(item) if (itemInfos) then if (itemInfos.outros.evento == "worth:beber") then local sede = (getElementData(player, config["Elements"].Sede) or 0) if (sede < 100) then if not (utilizando[player]) then utilizando[player] = true takeItem(player, item, 1) setElementData(player, config["Elements"].Sede, sede+itemInfos.outros.enche) setPedAnimation(player, "VENDING", "VEND_Drink_P", 4000, false, false, false, false) sendMessageServer(player, "Você bebeu 1x "..itemInfos.nome.."!", "success") triggerClientEvent(player, "worth:play:sound:client", player, "files/sfx/bebendo.mp3") setTimer(function() utilizando[player] = false end, 4000, 1, player) else sendMessageServer(player, "Aguarde para usar este item!", "info") end else sendMessageServer(player, "Você não está com sede!", "error") end elseif (itemInfos.outros.evento == "worth:comer") then local fome = (getElementData(player, config["Elements"].Fome) or 0) if (fome < 100) then if not (utilizando[player]) then utilizando[player] = true takeItem(player, item, 1) setElementData(player, config["Elements"].Fome, fome+itemInfos.outros.enche) setPedAnimation(player, "VENDING", "vend_eat1_P", 4000, false, false, false, false) sendMessageServer(player, "Você comeu 1x "..itemInfos.nome.."!", "success") triggerClientEvent(player, "worth:play:sound:client", player, "files/sfx/comendo.mp3") setTimer(function() utilizando[player] = false end, 4000, 1, player) else sendMessageServer(player, "Aguarde para usar este item!", "info") end else sendMessageServer(player, "Você não está com fome!", "error") end elseif (itemInfos.outros.evento == "worth:arma") then local arma_equip1 = getElementData(player, "llotus:arma:equip:1") or false local arma_equip2 = getElementData(player, "llotus:arma:equip:2") or false for i, v in ipairs(config["Outros"]["Weapons_Primary"]) do if (v[1] == item) then if (arma_equip1 == false) then takeItem(player, item, 1) setElementData(player, "llotus:arma:equip:1", {item, v[2]}) giveWeapon(player, v[2], 1) sendMessageServer(player, "Você equipou a sua arma primaria!", "success") triggerClientEvent(player, "worth:play:sound:client", player, "files/sfx/reload.mp3") else sendMessageServer(player, "Você já tem 1 arma primaria equipada!", "error") end end end for i, v in ipairs(config["Outros"]["Weapons_Secundary"]) do if (v[1] == item) then if (arma_equip2 == false) then takeItem(player, item, 1) setElementData(player, "llotus:arma:equip:2", {item, v[2]}) giveWeapon(player, v[2], 1) sendMessageServer(player, "Você equipou a sua arma secundaria!", "success") triggerClientEvent(player, "worth:play:sound:client", player, "files/sfx/reload.mp3") else sendMessageServer(player, "Você já tem 1 arma secundaria equipada!", "error") end end end elseif (itemInfos.outros.evento == "worth:munição") then local arma_equip1 = getElementData(player, "llotus:arma:equip:1") or false local arma_equip2 = getElementData(player, "llotus:arma:equip:2") or false for i, v in pairs(config["Outros"]["Ammo_Weapons"]) do if (i == item) then for index, arma in pairs(v) do if (arma_equip1) and (arma == arma_equip1[1]) then setElementData(player, "llotus:ammo:equip:1", item) takeItem(player, item, quantidade) giveWeapon(player, arma_equip1[2], quantidade) reloadPedWeapon(player) sendMessageServer(player, "Você recarregou sua arma!", "success") triggerClientEvent(player, "worth:play:sound:client", player, "files/sfx/reload.mp3") end if (arma_equip2) and (arma == arma_equip2[1]) then setElementData(player, "llotus:ammo:equip:2", item) takeItem(player, item, quantidade) giveWeapon(player, arma_equip2[2], quantidade) reloadPedWeapon(player) sendMessageServer(player, "Você recarregou sua arma!", "success") triggerClientEvent(player, "worth:play:sound:client", player, "files/sfx/reload.mp3") end end end end elseif (itemInfos.outros.evento == "worth:colete") then local colete = getPedArmor(player) if (colete <= 80) then takeItem(player, item, 1) setPedArmor(player, 100) sendMessageServer(player, "Você equipou o seu colete!", "success") else sendMessageServer(player, "Você já tem 1 colete bom equipado!", "error") end elseif (itemInfos.outros.evento == "worth:algemar") then local target = getNearestPlayer(player, 2) if (target) then if not (algemados[target]) then algemados[target] = true setElementFrozen(target, true) toggleAllControls(target, false) setPedAnimation(target, "GRAVEYARD", "mrnM_loop", -1, true, false, false, false) takeItem(player, item, 1) sendMessageServer(player, "Você algemou o cidadão!", "success") sendMessageServer(target, "Você foi algemado!", "info") else sendMessageServer(player, "Este cidadão já está algemado!", "error") end else sendMessageServer(player, "Chegue mais perto do cidadão para algema-lo!", "error") end elseif (itemInfos.outros.evento == "worth:desalgemar") then local target = getNearestPlayer(player, 2) if (target) then if (algemados[target]) then algemados[target] = false setElementFrozen(target, false) toggleAllControls(target, true) giveItem(player, "Algemas", 1) setPedAnimation(target, nil) sendMessageServer(player, "Você desalgemou o cidadão!", "success") sendMessageServer(target, "Você foi desalgemado!", "info") else sendMessageServer(player, "Este cidadão não está algemado!", "error") end else sendMessageServer(player, "Chegue mais perto do cidadão para algema-lo!", "error") end elseif (itemInfos.outros.evento == "worth:analgesico") then local vida = getElementHealth(player) if (vida < 100) then takeItem(player, item, 1) setElementHealth(player, vida+10) sendMessageServer(player, "Você usou 1x "..itemInfos.nome.."!", "success") else sendMessageServer(player, "Você já esta com sua saude boa!", "error") end elseif (itemInfos.outros.evento == "worth:bandagem") then local vida = getElementHealth(player) if (vida < 100) then takeItem(player, item, 1) setElementHealth(player, vida+20) sendMessageServer(player, "Você usou 1x "..itemInfos.nome.."!", "success") else sendMessageServer(player, "Você já esta com sua saude boa!", "error") end elseif (itemInfos.outros.evento == "worth:cigarro") then local isqueiro = getItem(player, "Isqueiro") if (isqueiro and isqueiro >= 1) then local vida = getElementHealth(player) if (vida-5 > 20) then if not (fumando[player]) then fumando[player] = true takeItem(player, item, 1) setElementHealth(player, vida-5) setPedAnimation(player, "GANGS", "smkcig_prtl_F", 8000, false, false, false, false) sendMessageServer(player, "Você fumou 1x "..itemInfos.nome.."!", "success") triggerClientEvent(player, "worth:play:sound:client", player, "files/sfx/fumando.mp3") setTimer(function() fumando[player] = false end, 8000, 1, player) else sendMessageServer(player, "Aguarde para fumar novamente!", "info") end else sendMessageServer(player, "Você está com a saúde baixa!", "error") end else sendMessageServer(player, "Você precisa ter um isqueiro para fumar!", "error") end elseif (itemInfos.outros.evento == "worth:kitreparo") then if not (isPedInVehicle(player)) then local vehicle = getNearestVehicle(player, 3) if (vehicle) then local health = getElementHealth(vehicle) if (health < 900) then takeItem(player, item, 1) fixVehicle(vehicle) sendMessageServer(player, "Você concertou o veiculo!", "success") else sendMessageServer(player, "Veiculo não está danificado!", "error") end else sendMessageServer(player, "Você está longe de mais de um veiculo!", "error") end else sendMessageServer(player, "Você não pode está dentro de um veiculo!", "error") end elseif (itemInfos.outros.evento == "worth:maço") then if (getSpaceItem(player, "Cigarro", 20)) then takeItem(player, item, 1) giveItem(player, "Cigarro", 20) sendMessageServer(player, "Você abriu 1x "..itemInfos.nome.."!", "success") else sendMessageServer(player, "Você não tem espaço para cigarros!", "error") end elseif (itemInfos.outros.evento == "worth:kitmedico") then local vida = getElementHealth(player) if (vida < 100) then takeItem(player, item, 1) setElementHealth(player, 100) sendMessageServer(player, "Você usou 1x "..itemInfos.nome.."!", "success") else sendMessageServer(player, "Você já esta com sua saude boa!", "error") end elseif (itemInfos.outros.evento == "worth:mochila") then local pesoAtual, pesoMaximo = getSpace(player) if not (pesoMaximo == itemInfos.outros.pesoSuportado) then if (pesoAtual <= itemInfos.outros.pesoSuportado) then inventarios[player]["Dados"].pesoMaximo = itemInfos.outros.pesoSuportado updateClientInventory(player) takeItem(player, item, 1) sendMessageServer(player, "Você colocou 1x "..itemInfos.nome.."!", "success") else sendMessageServer(player, "Você não pode por está mochila, ela é muito pequena para oque você esta carregando!", "error") end else sendMessageServer(player, "Você já está usando esta mochila!", "error") end elseif (itemInfos.outros.evento == "worth:nitro") then local parafusadeira = getItem(player, "Parafusadeira") if (parafusadeira and parafusadeira >= 1) then if not (isPedInVehicle(player)) then local vehicle = getNearestVehicle(player, 3) if (vehicle) then takeItem(player, item, 1) setElementFrozen(player, true) setPedAnimation(player, "BOMBER", "BOM_Plant", 3000, false, false, false, false) sendMessageServer(player, "Você começou a instalar o nitro!", "info") setTimer(function(player, vehicle) addVehicleUpgrade(vehicle, "1010") setPedAnimation(player, nil) setElementFrozen(player, false) sendMessageServer(player, "Você instalou o nitro no seu veiculo!", "success") end, 3000, 1, player, vehicle) else sendMessageServer(player, "Você está longe de mais de um veiculo!", "error") end else sendMessageServer(player, "Você não pode está dentro de um veiculo!", "error") end else sendMessageServer(player, "Você precisa ter uma parafusadeira!", "error") end elseif (itemInfos.outros.evento == "worth:bolar") then local dichavador = getItem(player, "Dichavador") if (dichavador and dichavador >= 1) then local seda = getItem(player, "Seda") if (seda and seda >= 1) then local maconha = getItem(player, "Maconha") if (maconha and maconha >= 1) then takeItem(player, "Seda", 1) takeItem(player, "Maconha", 1) giveItem(player, "CigarroMaconha", 1) sendMessageServer(player, "Você bolou um baseado!", "success") else sendMessageServer(player, "Você precisa ter uma maconha!", "error") end else sendMessageServer(player, "Você precisa ter uma seda!", "error") end else sendMessageServer(player, "Você precisa ter um dichavador!", "error") end elseif (itemInfos.outros.evento == "worth:moeda") then local random = math.random(1, 100) if (random > 50) then outputChatBox(getPlayerName(player).." jogou a moeda e deu cara!", root, 255, 255, 255, false) else outputChatBox(getPlayerName(player).." jogou a moeda e deu coroa!", root, 255, 255, 255, false) end elseif (itemInfos.outros.evento == "worth:caixaseda") then if (getSpaceItem(player, "Seda", 10)) then takeItem(player, item, 1) giveItem(player, "Seda", 10) sendMessageServer(player, "Você abriu 1x "..itemInfos.nome.."!", "success") else sendMessageServer(player, "Você não tem espaço para sedas!", "error") end elseif (itemInfos.outros.evento == "worth:dado") then local x, y, z = getElementPosition(player) local random = math.random(1, 6) for i, v in ipairs(getElementsByType("player")) do local x2, y2, z2 = getElementPosition(v) local distancia = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if (distancia <= 5) then outputChatBox(getPlayerName(player).." jogou o dado e caiu "..random.." !", v, 255, 255, 255, false) end end elseif (itemInfos.outros.evento == "worth:pegar:jbl") then if (playerInAclTable(player, itemInfos.outros.acls)) then if not (jbl[player]) then local dim = getElementDimension(player) jbl[player] = createObject(2226,0,0,0) setElementDimension(jbl[player], dim) setObjectScale(jbl[player], 0.95) exports.bone_attach:attachElementToBone(jbl[player], player, 12, 0, 0, 0.4, 0, 180, 0) sendMessageServer(player, "Você pegou a JBL!", "success") else exports.bone_attach:detachElementFromBone(jbl[player], player) if (isElement(jbl[player])) then destroyElement(jbl[player]) end triggerClientEvent(root, "worth:parar:musica:jbl", root, player, jbl[player]) jbl[player] = nil sendMessageServer(player, "Você guardou a JBL!", "success") end else sendMessageServer(player, "Você não tem permissão para usar este item!", "error") end elseif (itemInfos.outros.evento == "worth:textura:jbl") then if (playerInAclTable(player, itemInfos.outros.acls)) then if (jbl[player]) then triggerEvent("worth:server:aplicar:textura", player, jbl[player], itemInfos.outros.textureID) sendMessageServer(player, "Você aplicou a textura na JBL!", "success") else sendMessageServer(player, "Você não tem uma JBL em mãos!", "error") end else sendMessageServer(player, "Você não tem permissão para usar este item!", "error") end elseif (itemInfos.outros.evento == "worth:cigarromaconha") then local isqueiro = getItem(player, "Isqueiro") if (isqueiro and isqueiro >= 1) then if not (maconhado[player]) then maconhado[player] = true triggerClientEvent(player, "worth:fumar:maconha", player) takeItem(player, item, 1) setTimer(function() maconhado[player] = false end, 33000, 1, player) else sendMessageServer(player, "Aguarde para fumar maconha novamente!", "info") end else sendMessageServer(player, "Você precisa de um isqueiro para fumar maconha!", "error") end elseif (itemInfos.outros.evento == "worth:mascaras") then if not (getElementData(player, "worth:mascara:equipada")) then setElementData(player, "worth:mascara:equipada", item) local mascara_vestida = getElementData(player, "worth:mascara:equipada") sendMessageServer(player, "Você vestiu a mascara "..itemInfos.nome.." !", "success") mascaras[player] = createObject(itemInfos.outros.idObject, 0, 0, 0, 0, 0, 0) takeItem(player, item, 1) if (mascara_vestida == "Cachorro") then exports["bone_attach"]:attachElementToBone(mascaras[player], player, 1, 0, 0.02, -0.55, 0, 0, 90) elseif (mascara_vestida == "Palhaco") then exports["bone_attach"]:attachElementToBone(mascaras[player], player, 1, 0, 0.02, -0.55, 0, 0, 90) elseif (mascara_vestida == "Samurai") then exports["bone_attach"]:attachElementToBone(mascaras[player], player, 1, 0, 0.02, -0.55, 0, 0, 90) elseif (mascara_vestida == "Bandana") then exports["bone_attach"]:attachElementToBone(mascaras[player], player, 1, 0, 0.02, -0.58, 0, 0, 90) elseif (mascara_vestida == "Dogao") then exports["bone_attach"]:attachElementToBone(mascaras[player], player, 1, 0, 0.02, -0.55, 0, 0, 90) elseif (mascara_vestida == "Macaco") then exports["bone_attach"]:attachElementToBone(mascaras[player], player, 1, 0, 0.01, -0.55, 0, 0, 90) elseif (mascara_vestida == "Bandido") then exports["bone_attach"]:attachElementToBone(mascaras[player], player, 1, 0, 0.02, -0.55, 0, 0, 90) end else sendMessageServer(player, "Você já tem uma mascara vestida!", "error") end end end end)
  13. O 1 erro no debugscript [ ERROR: Server triggered clientside event L:iniciou_Comando, but event is not added clientside ] 2 erro no mesmo script [ ERROR: Loading script failed: PL_PainelRevistar\Client.Lua:86:')' expected near "Peso:" serverside 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, "PorteDeArmas") or "Não possui" local Wanted = getPlayerWantedLevel(cliente) local Dinheiro = getPlayerMoney(cliente) local Level = getElementData(cliente, "Level") 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:PorteDeArmas",Porte) setElementData(source, "Suspeito:Wanted",Wanted) setElementData(source, "Suspeito:Dinheiro",Dinheiro) setElementData(source, "Suspeito:Level",Level) 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("abordar",AbrirPainel) function VCNH() local CNH = getElementData(cliente, "Habilitação") or "Não" outputChatBox("#0064c8»#ffffff Possui habilitação: #0064c8"..CNH, 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) givePlayerMoney(source,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 = getVehicleID ( theVehicle ) if 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 Clientside 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" dxDrawRectangle(screenW * 0.6950, screenH * 0.4333, screenW * 0.1875, screenH * 0.0467, tocolor(0, 0, 0, 208), false) dxDrawLine(screenW * 0.6950, screenH * 0.4800, screenW * 0.8825, screenH * 0.4800, tocolor(79, 144, 241, 208), 2, false) dxDrawText("Sistema Policial", screenW * 0.6925, screenH * 0.4333, screenW * 0.8812, screenH * 0.4800, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.6937, screenH * 0.4800, screenW * 0.1875, screenH * 0.0467, Cor1, false) dxDrawText("Nome: " ..IdRevistado, screenW * 0.6925, screenH * 0.4800, screenW * 0.8812, screenH * 0.5267, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.6937, screenH * 0.5267, screenW * 0.1875, screenH * 0.0467,Cor2, false) dxDrawText("Identidade", screenW * 0.6937, screenH * 0.5267, screenW * 0.8825, screenH * 0.5733, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.6937, screenH * 0.5733, screenW * 0.1875, screenH * 0.0467, Cor3, false) dxDrawText("Checar CNH", screenW * 0.6937, screenH * 0.5733, screenW * 0.8825, screenH * 0.6200, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.6937, screenH * 0.6200, screenW * 0.1875, screenH * 0.0467, Cor4, false) dxDrawRectangle(screenW * 0.6937, screenH * 0.6667, screenW * 0.1875, screenH * 0.0467, Cor5, false) dxDrawRectangle(screenW * 0.6937, screenH * 0.7133, screenW * 0.1875, screenH * 0.0467, Cor6, false) dxDrawRectangle(screenW * 0.6937, screenH * 0.7600, screenW * 0.1875, screenH * 0.0467, Cor7, false) dxDrawText("Multar", screenW * 0.6925, screenH * 0.6200, screenW * 0.8812, screenH * 0.6667, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, false) dxDrawText("Algemar", screenW * 0.6925, screenH * 0.6667, screenW * 0.8812, screenH * 0.7133, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, false) dxDrawText("Revistar", screenW * 0.6925, screenH * 0.7133, screenW * 0.8812, screenH * 0.7600, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, false) dxDrawText("Apreender drogas", screenW * 0.6925, screenH * 0.7600, screenW * 0.8812, screenH * 0.8067, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.6937, screenH * 0.8067, screenW * 0.1875, screenH * 0.0467, Cor8, false) dxDrawText("Apreender armas", screenW * 0.6937, screenH * 0.8067, screenW * 0.8825, screenH * 0.8533, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.6937, screenH * 0.8533, screenW * 0.1875, screenH * 0.0467, Cor9, false) dxDrawText("Prender", screenW * 0.6937, screenH * 0.8533, screenW * 0.8825, screenH * 0.9000, tocolor(255, 255, 255, 255), 0.90, "clear", "center", "center", false, false, false, false, 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) Cor9 = tocolor(30, 30, 30, 255) if isCursorOnElement(screenW * 0.6937, screenH * 0.4800, screenW * 0.1875, screenH * 0.0467) then Cor1 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.6937, screenH * 0.5267, screenW * 0.1875, screenH * 0.0467) then Cor2 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.6937, screenH * 0.5733, screenW * 0.1875, screenH * 0.0467) then Cor3 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.6937, screenH * 0.6200, screenW * 0.1875, screenH * 0.0467) then Cor4 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.6937, screenH * 0.6667, screenW * 0.1875, screenH * 0.0467) then Cor5 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.6937, screenH * 0.7133, screenW * 0.1875, screenH * 0.0467) then Cor6 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.6937, screenH * 0.7600, screenW * 0.1875, screenH * 0.0467) then Cor7 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.6937, screenH * 0.8067, screenW * 0.1875, screenH * 0.0467) then Cor7 = tocolor(0, 100, 200, 255) end if isCursorOnElement(screenW * 0.6937, screenH * 0.8533, screenW * 0.1875, screenH * 0.0467) 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:PorteDeArmas")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, "Suspeito:ID")or "0" local DinheiroSujo =getElementData(localPlayer, "Suspeito:DinheiroSujo")or "0" dxDrawRectangle(screenW * 0.3787, screenH * 0.2700, screenW * 0.2225, screenH * 0.0400, tocolor(0, 0, 0, 222), false) dxDrawLine(screenW * 0.3787, screenH * 0.3100, screenW * 0.6000, screenH * 0.3083, tocolor(79, 144, 241, 208), 2, false) dxDrawText("Dados Do Cidadão", screenW * 0.3775, screenH * 0.2650, screenW * 0.6000, screenH * 0.3117, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.3787, screenH * 0.3117, screenW * 0.2213, screenH * 0.2833, tocolor(0, 0, 0, 203), false) dxDrawText("Idade:"..Idade.."|" "Peso:"..Peso, screenW * 0.3787, screenH * 0.3100, screenW * 0.6012, screenH * 0.3567, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false) dxDrawLine(screenW * 0.3775, screenH * 0.3583, screenW * 0.5988, screenH * 0.3567, tocolor(79, 144, 241, 208), 2, false) dxDrawText("ID:"..ID.. "|" "Level:"..Level, screenW * 0.3775, screenH * 0.3567, screenW * 0.6000, screenH * 0.4033, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false) dxDrawLine(screenW * 0.3775, screenH * 0.4050, screenW * 0.5988, screenH * 0.4033, tocolor(79, 144, 241, 208), 2, false) dxDrawLine(screenW * 0.3775, screenH * 0.4517, screenW * 0.5988, screenH * 0.4500, tocolor(79, 144, 241, 208), 2, false) dxDrawText("Porte De Armas: "..Porte, screenW * 0.3775, screenH * 0.4033, screenW * 0.6000, screenH * 0.4500, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false) dxDrawText("Mandatos: "..Wanted, screenW * 0.3775, screenH * 0.4517, screenW * 0.6000, screenH * 0.4983, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false) dxDrawLine(screenW * 0.3775, screenH * 0.5000, screenW * 0.5988, screenH * 0.4983, tocolor(79, 144, 241, 208), 2, false) dxDrawLine(screenW * 0.3775, screenH * 0.5483, screenW * 0.5988, screenH * 0.5467, tocolor(79, 144, 241, 208), 2, false) dxDrawText("Dinheiro Sujo: "..DinheiroSujo, screenW * 0.3787, screenH * 0.5000, screenW * 0.6012, screenH * 0.5467, tocolor(255, 255, 255, 255), 1.00, "clear", "center", "center", false, false, false, false, false) dxDrawText("Dinheiro Limpo: "..Dinheiro, screenW * 0.3787, screenH * 0.5483, screenW * 0.6012, screenH * 0.5950, tocolor(255, 255, 255, 255), 1.00, "clear", "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 Vi a linha 86 e não consegui encontrar o erro... E sobre o "Iniciou_Evento" eu não manjo mt de script, pelo que parece precisa adicionar isso no clientside, porém não sei como... Poderiam me ajudar?
  14. 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
  15. Eu queria colocar uma distancia para prender o alvo, está prendendo de muito longe e não achei nenhuma referencia a distancia nesse código e tambem tirar ter que escrever 2 vezes algemar, pra fazer a animação de algemado ex: escrevo /algemar fulano, ele toma um freeze e fica correndo no mesmo lugar consegue mirar e tals ai quando escrevo /algemar fulano dnv ele faz a animação de estar algemado. 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 algemar_jogador ( thePlayer, _, nick ) if nick then if getPlayerFromPartialName ( nick ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Policia") ) then -- Acl Pra Quem Pode Usar o Comando local player_a_ser_algemado = getPlayerFromPartialName ( nick ) local nick_do_jogador = getPlayerName ( player_a_ser_algemado ) local nick_do_policial = getPlayerName ( thePlayer ) setElementData(player_a_ser_algemado,"algemado", nick_do_jogador) -- Elemento Data setPedAnimation( player_a_ser_algemado, "GRAVEYARD", "mrnM_loop", -1, true, false, false, false) -- Animação de algemar setElementFrozen( player_a_ser_algemado, true ) -- Freezar jogador toggleControl(player_a_ser_algemado, "fire", false) -- retirar função de atirar outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1O #ffffff"..nick_do_jogador.." #c1c1c1Foi #ff0000Algemado #c1c1c1Pelo #ff0000Policial "..nick_do_policial.."", root, 255, 255, 255, true) -- Chat Box outputChatBox("#000000[#ff0000POLICIA#000000] #ff0000Voce #c1c1c1Foi #ff0000Algemado#c1c1c1! ", player_a_ser_algemado, 255, 255, 255, true) -- Chat Box end else outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1Você nao tem permissao a este comando!", thePlayer, 255, 255, 255, true) -- Se voce nao for da acl nao tera permissao a este comando end end end addCommandHandler("algemar", algemar_jogador) function algemar_jogador ( thePlayer, _, nick ) if nick then if getPlayerFromPartialName ( nick ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "ComandosPolicia") ) then local player_a_ser_desalgemado = getPlayerFromPartialName ( nick ) local nick_do_jogador = getPlayerName ( player_a_ser_desalgemado ) local nick_do_policial = getPlayerName ( thePlayer ) if getElementData (player_a_ser_desalgemado, "algemado") then -- vai verificar se o jogador estiver com os algemas setPedAnimation( player_a_ser_desalgemado ) -- desativara animaçao setElementFrozen( player_a_ser_desalgemado, false ) -- desativara o freeze toggleControl(player_a_ser_desalgemado, "fire", true ) -- ativara a função de atirar outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1O #ffffff"..nick_do_jogador.." #c1c1c1Foi #ff0000Desalgemado #c1c1c1Pelo #ff0000Policial "..nick_do_policial.."", root, 255, 255, 255, true) -- Chat Box outputChatBox("#000000[#ff0000POLICIA#000000] #ff0000Voce #c1c1c1Foi #ff0000Desalgemado#c1c1c1! ", player_a_ser_desalgemado, 255, 255, 255, true) -- Chat Box removeElementData ( player_a_ser_desalgemado, "algemado" ) -- remover algemar else outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1O #FF0000Suspeito #c1c1c1Nao #c1c1c1Foi #ff0000Algemado #c1c1c1Para Executar Este Comando! ",thePlayer, 255, 255, 255, true) -- chat box se o jogador nao estiver algemado end else outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1Você nao tem permissao a este comando!", thePlayer, 255, 255, 255, true) -- Acl Pra Quem Pode Usar o Comando end end end end addCommandHandler("desalgemar", algemar_jogador)
  16. function algemar(player, command, p) local acc = getPlayerAccount(player) local job = getElementData(player, 'ocupacao') or "Nenhum" if (job == "Policial") then if p then local target = getPlayerFromName(p) or getPlayerFromPartialName(p) if target and target ~= player then local px, py, pz = getElementPosition(player) local tx, ty, tz = getElementPosition(target) if getDistanceBetweenPoints3D(px, py, pz, tx, ty, tz) < 4 then if command == "algemar" then setElementData(target,"algemado",true) triggerClientEvent("algemaAdd", target) triggerClientEvent(target,"onClientPlayerAlgemado",resourceRoot,20000) setElementFrozen(target, true) setPedAnimation(player, "GANG", "prtial_gngtlkA", false, false) setTimer(function() setPedAnimation(player, false) end, 3000, 1, player, source) timer[target] = setTimer(desalgemar, 20000, 1, target) elseif command == "desalgemar" then local dataAlgemado = getElementData(target, "algemado") if (not dataAlgemado) then return outputChatBox("#FF0000ERROR: #FFFFFFEste jogador não está algemado", player, 255, 255, 255, true) end desalgemar(target) end else outputChatBox("#FF0000ERROR: #FFFFFFChegue mais perto do jogador", player, 255, 255, 255, true) end else outputChatBox("#FF0000ERROR: #FFFFFFVocê não pode algemar a si mesmo", player, 255, 255, 255, true) end else outputChatBox("#FF0000ERROR: #FFFFFFDigite /algemar <nick> ou /desalgemar <nick>", player, 255, 255, 255, true) end end end addCommandHandler("algemar", algemar)
  17. Perdão, mandei todo porque realmente nao sei qual parte esta errado, irei mandar o Client.lua, vou mandar todo, porque eu realmente nao sei onde esta incorreto.. Espero que me compreenda e possa me ajudar, estou precisando muito local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1366), (screenH/768) local dxfont0_icons = dxCreateFont("font/icons.ttf", x*12) local dxfont1_icons = dxCreateFont("font/icons.ttf", x*9) local dxfont2_icons = dxCreateFont("font/icons.ttf", x*10) local AlterarFicha = createElement("TS:AlterarFicha") painel = false painel2 = false painel3 = false painel4 = false --[[ ><><><><><><><><><><><><><><><><><><><>< >< Painel Inicial >< ><><><><><><><><><><><><><><><><><><><>< --]] function PainelFicha () local Jogador = getElementData(localPlayer, "TS:Abordando") exports["Ad-Blur"]:dxDrawBluredRectangle(screenW * 0.3272, screenH * 0.2734, screenW * 0.2914, screenH * 0.1979, tocolor(255, 255, 255, 230)) dxDrawRectangle(screenW * 0.3272, screenH * 0.2734, screenW * 0.2914, screenH * 0.1980, tocolor(0, 0, 0, 160), false) dxDrawRectangle(screenW * 0.3272, screenH * 0.2734, screenW * 0.2914, screenH * 0.0400, tocolor(0, 0, 0, 180), false) dxDrawLine(screenW * 0.3272, screenH * 0.3177, screenW * 0.6186, screenH * 0.3177, tocolor(0, 60, 160, 255), 2, true) dxDrawText("Ficha Criminal", screenW * 0.4341, screenH * 0.2786, screenW * 0.5212, screenH * 0.3047, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) dxDrawText("Pressione enter para alterar e backspace para voltar", screenW * 0.3580, screenH * 0.3255, screenW * 0.6040, screenH * 0.3490, tocolor(255, 255, 255, 255), 1.00, dxfont2_icons, "left", "top", false, false, false, false, false) dxDrawText("Ficha atual do jogador : "..getPlayerWantedLevel(Jogador), screenW * 0.3346, screenH * 0.3568, screenW * 0.4473, screenH * 0.3802, tocolor(255, 255, 255, 255), 1.00, dxfont2_icons, "left", "top", false, false, false, false, false) dxDrawEditBox("Quantidade Estrelas", screenW * 0.4034, screenH * 0.4036, screenW * 0.1442, screenH * 0.0443, false, 1, AlterarFicha) end function PainelDrogas () local Jogador = getElementData(localPlayer, "TS:Abordando") local Maconha = getElementData(Jogador, "TS:Maconha") or 0 local Cocaina = getElementData(Jogador, "TS:Cocaina") or 0 local Heroina = getElementData(Jogador, "TS:Heroina") or 0 local Crack = getElementData(Jogador, "TS:Crack") or 0 local LSD = getElementData(Jogador, "TS:LSD") or 0 exports["Ad-Blur"]:dxDrawBluredRectangle(screenW * 0.3258, screenH * 0.0208, screenW * 0.3492, screenH * 0.2096, tocolor(255, 255, 255, 230)) dxDrawRectangle(screenW * 0.3258, screenH * 0.0208, screenW * 0.3492, screenH * 0.2096, tocolor(0, 0, 0, 155), false) dxDrawRectangle(screenW * 0.3258, screenH * 0.0208, screenW * 0.3492, screenH * 0.0534, tocolor(0, 0, 0, 155), false) dxDrawLine(screenW * 0.3258, screenH * 0.0742, screenW * 0.6750, screenH * 0.0742, tocolor(255, 0, 0, 255), 3, false) dxDrawText("Advanced ", screenW * 0.4495, screenH * 0.0299, screenW * 0.5512, screenH * 0.0573, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) dxDrawText("Maconha : "..Maconha, screenW * 0.3367, screenH * 0.0872, screenW * 0.4107, screenH * 0.1185, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) dxDrawText("Cocaina : "..Cocaina, screenW * 0.4422, screenH * 0.0872, screenW * 0.5161, screenH * 0.1185, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, true, false, false) dxDrawText("Heroina : "..Heroina, screenW * 0.5447, screenH * 0.0872, screenW * 0.6186, screenH * 0.1185, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, true, false, false) dxDrawText("Crack : "..Crack, screenW * 0.3367, screenH * 0.1315, screenW * 0.4107, screenH * 0.1628, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) dxDrawText("LSD : "..LSD, screenW * 0.4422, screenH * 0.1315, screenW * 0.5161, screenH * 0.1628, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) dxDrawText("Pressione enter para apreender e backspace para voltar", screenW * 0.3441, screenH * 0.1966, screenW * 0.6552, screenH * 0.2227, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) end function PainelDados () local Jogador = getElementData(localPlayer, "TS:Abordando") local AirNew_Scripter_NomeCompleto = getElementData ( localPlayer, "AirNew_RG_NomeCompleto" ) or "Erro Desconhecido, Contate um Administrador (03)" local AirNew_Scripter_DataDeNascimento = getElementData ( localPlayer, "AirNew_RG_DataDeNascimento" ) or "Erro Desconhecido, Contate um Administrador (04)" local PorteArmas = getElementData(Jogador, "TS:PorteDeArmas") or "Não" local RegistroGeral = getElementData(Jogador, "ID") or "Error" exports["Ad-Blur"]:dxDrawBluredRectangle(screenW * 0.3272, screenH * 0.2734, screenW * 0.2914, screenH * 0.3464, tocolor(255, 255, 255, 230)) dxDrawRectangle(screenW * 0.3272, screenH * 0.2734, screenW * 0.2914, screenH * 0.3464, tocolor(0, 0, 0, 180), false) dxDrawRectangle(screenW * 0.3272, screenH * 0.2734, screenW * 0.2914, screenH * 0.0443, tocolor(0, 0, 0, 205), false) dxDrawLine(screenW * 0.3272, screenH * 0.3177, screenW * 0.6186, screenH * 0.3177, tocolor(244, 0, 0, 254), 3, true) dxDrawText("Dados pessoais", screenW * 0.4341, screenH * 0.2786, screenW * 0.5212, screenH * 0.3047, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) dxDrawText("Qualquer informação vazada será cobrada de você !", screenW * 0.3529, screenH * 0.3255, screenW * 0.5981, screenH * 0.3503, tocolor(255, 255, 255, 255), 1.00, dxfont2_icons, "left", "top", false, false, false, false, false) dxDrawText("Nome Completo : "..AirNew_Scripter_NomeCompleto, screenW * 0.3346, screenH * 0.3659, screenW * 0.4378, screenH * 0.3958, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, true, false) dxDrawText("Data De Nascimento : "..AirNew_Scripter_DataDeNascimento, screenW * 0.3346, screenH * 0.4089, screenW * 0.5256, screenH * 0.4336, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, true, false) dxDrawText("Apelido : "..getPlayerName(Jogador), screenW * 0.3346, screenH * 0.4466, screenW * 0.5015, screenH * 0.4714, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, true, false) dxDrawText("Porte De Armas : "..PorteArmas, screenW * 0.3346, screenH * 0.4844, screenW * 0.5015, screenH * 0.5091, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, true, false) dxDrawText("CPF : "..RegistroGeral, screenW * 0.3346, screenH * 0.5221, screenW * 0.5015, screenH * 0.5469, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, true, false) dxDrawText("Para voltar pressione backspace", screenW * 0.3734, screenH * 0.5898, screenW * 0.5783, screenH * 0.6146, tocolor(255, 255, 255, 255), 1.00, dxfont2_icons, "left", "top", false, false, false, true, false) end function PainelPolicial () local ParteSelecionada = getElementData(localPlayer, "TS:PartePainel") or 1 local Jogador = getElementData(localPlayer, "TS:Abordando") exports["Ad-Blur"]:dxDrawBluredRectangle(screenW * 0.0139, screenH * 0.2500, screenW * 0.2042, screenH * 0.4453, tocolor(255, 255, 255, 230)) dxDrawRectangle(screenW * 0.0139, screenH * 0.2500, screenW * 0.2042, screenH * 0.4453, tocolor(0, 0, 0, 100), false) dxDrawRectangle(screenW * 0.0139, screenH * 0.2500, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 185), false) dxDrawLine(screenW * 0.0139, screenH * 0.2943, screenW * 0.2182, screenH * 0.2943, tocolor(244, 0, 0, 254), 3, true) dxDrawText("Sistema Policial", screenW * 0.0732, screenH * 0.2552, screenW * 0.1603, screenH * 0.2813, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) if ParteSelecionada == 1 then dxDrawRectangle(screenW * 0.0139, screenH * 0.2969, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false) if getElementData(Jogador, "TS:Algemado") == true then dxDrawText("Desalgemar", screenW * 0.0849, screenH * 0.3047, screenW * 0.1515, screenH * 0.3359, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) else dxDrawText("Algemar", screenW * 0.0937, screenH * 0.3047, screenW * 0.1406, screenH * 0.3281, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) end else dxDrawRectangle(screenW * 0.0139, screenH * 0.2969, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 100), false) if getElementData(Jogador, "TS:Algemado") == true then dxDrawText("Desalgemar", screenW * 0.0849, screenH * 0.3047, screenW * 0.1515, screenH * 0.3359, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) else dxDrawText("Algemar", screenW * 0.0937, screenH * 0.3047, screenW * 0.1406, screenH * 0.3281, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) end end if ParteSelecionada == 2 then dxDrawRectangle(screenW * 0.0139, screenH * 0.3411, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false) dxDrawText("Revistar", screenW * 0.0922, screenH * 0.3490, screenW * 0.1391, screenH * 0.3724, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) else dxDrawRectangle(screenW * 0.0139, screenH * 0.3411, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 185), false) dxDrawText("Revistar", screenW * 0.0922, screenH * 0.3490, screenW * 0.1391, screenH * 0.3724, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) end if ParteSelecionada == 3 then dxDrawRectangle(screenW * 0.0139, screenH * 0.3854, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false) dxDrawText("Dados Pessoais", screenW * 0.0710, screenH * 0.3906, screenW * 0.1625, screenH * 0.4193, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) else dxDrawRectangle(screenW * 0.0139, screenH * 0.3854, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 100), false) dxDrawText("Dados Pessoais", screenW * 0.0710, screenH * 0.3906, screenW * 0.1625, screenH * 0.4193, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) end if ParteSelecionada == 4 then dxDrawRectangle(screenW * 0.0139, screenH * 0.4297, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false) dxDrawText("Ficha Criminal", screenW * 0.0783, screenH * 0.4349, screenW * 0.1589, screenH * 0.4635, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) else dxDrawRectangle(screenW * 0.0139, screenH * 0.4297, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 185), false) dxDrawText("Ficha Criminal", screenW * 0.0783, screenH * 0.4349, screenW * 0.1589, screenH * 0.4635, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) end if ParteSelecionada == 5 then dxDrawRectangle(screenW * 0.0139, screenH * 0.4740, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false) dxDrawText("Colocar na viatura", screenW * 0.0652, screenH * 0.4792, screenW * 0.1662, screenH * 0.5078, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) else dxDrawRectangle(screenW * 0.0139, screenH * 0.4740, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 100), false) dxDrawText("Colocar na viatura", screenW * 0.0652, screenH * 0.4792, screenW * 0.1662, screenH * 0.5078, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) end if ParteSelecionada == 6 then dxDrawRectangle(screenW * 0.0139, screenH * 0.5182, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false) dxDrawText("Remover da viatura", screenW * 0.0615, screenH * 0.5247, screenW * 0.1698, screenH * 0.5547, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) else dxDrawRectangle(screenW * 0.0139, screenH * 0.5182, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 185), false) dxDrawText("Remover da viatura", screenW * 0.0615, screenH * 0.5247, screenW * 0.1698, screenH * 0.5547, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) end if ParteSelecionada == 7 then dxDrawRectangle(screenW * 0.0139, screenH * 0.5625, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false) dxDrawText("Apreender Armas", screenW * 0.0688, screenH * 0.5677, screenW * 0.1662, screenH * 0.5938, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) else dxDrawRectangle(screenW * 0.0139, screenH * 0.5625, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 100), false) dxDrawText("Apreender Armas", screenW * 0.0688, screenH * 0.5677, screenW * 0.1662, screenH * 0.5938, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) end if ParteSelecionada == 8 then dxDrawRectangle(screenW * 0.0139, screenH * 0.6068, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false) dxDrawText("Revogar Porte", screenW * 0.0761, screenH * 0.6120, screenW * 0.1552, screenH * 0.6380, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) else dxDrawRectangle(screenW * 0.0139, screenH * 0.6068, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 185), false) dxDrawText("Revogar Porte", screenW * 0.0761, screenH * 0.6120, screenW * 0.1552, screenH * 0.6380, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) end if ParteSelecionada == 9 then dxDrawRectangle(screenW * 0.0139, screenH * 0.6511, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false) dxDrawText("Verificar Drogas", screenW * 0.0666, screenH * 0.6549, screenW * 0.1574, screenH * 0.6849, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) else dxDrawRectangle(screenW * 0.0139, screenH * 0.6511, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 100), false) dxDrawText("Verificar Drogas", screenW * 0.0666, screenH * 0.6549, screenW * 0.1574, screenH * 0.6849, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) end dxDrawText("↑ - ↓ - Mover | Enter - Selecionar | Backspace - Voltar", screenW * 0.0139, screenH * 0.6952, screenW * 0.2445, screenH * 0.6771, tocolor(255, 255, 255, 255), 1.00, dxfont1_icons, "left", "top", false, false, false, false, false) end --[[ ><><><><><><><><><><><><><><><><><><><>< >< Configurações N Altere >< ><><><><><><><><><><><><><><><><><><><>< --]] function convertTime(ms) local min = math.floor ( ms/60000 ) local sec = math.floor( (ms/1000)%60 ) return min, sec end function AbrirPolicial () if painel == false then addEventHandler ( "onClientRender", root, PainelPolicial ) painel = true playSoundFrontEnd ( 43 ) setElementData(localPlayer, "TS:PartePainel", 0) else removeEventHandler ( "onClientRender", root, PainelPolicial ) painel = false playSoundFrontEnd ( 43 ) end end addEvent ("TS:AbrirPolicial", true) addEventHandler ("TS:AbrirPolicial", getRootElement(), AbrirPolicial) function AbrirDados () if painel2 == false then addEventHandler ( "onClientRender", root, PainelDados ) painel2 = true playSoundFrontEnd ( 43 ) setElementData(localPlayer, "TS:PartePainel", 3) setElementData(localPlayer, "TS:AbaPainel", "Dados") else setElementData(localPlayer, "TS:AbaPainel", nil) removeEventHandler ( "onClientRender", root, PainelDados ) painel2 = false playSoundFrontEnd ( 43 ) end end function AbrirDrogas () if painel4 == false then addEventHandler ( "onClientRender", root, PainelDrogas ) painel4 = true playSoundFrontEnd ( 43 ) setElementData(localPlayer, "TS:PartePainel", 9) setElementData(localPlayer, "TS:AbaPainel", "Drogas") else setElementData(localPlayer, "TS:AbaPainel", nil) removeEventHandler ( "onClientRender", root, PainelDrogas ) painel4 = false playSoundFrontEnd ( 43 ) end end function AbrirFicha () if painel3 == false then addEventHandler ( "onClientRender", root, PainelFicha ) painel3 = true playSoundFrontEnd ( 43 ) setElementData(localPlayer, "TS:PartePainel", 4) setElementData(localPlayer, "TS:AbaPainel", "Ficha") setElementData(AlterarFicha, "state", true) else setElementData(AlterarFicha, "state", false) setElementData(localPlayer, "TS:AbaPainel", nil) removeEventHandler ( "onClientRender", root, PainelFicha ) painel3 = false playSoundFrontEnd ( 43 ) end end function MudarAba (button, press) local Aba = getElementData(localPlayer, "TS:PartePainel") or 0 if painel == true then if press then if getElementData(localPlayer, "TS:AbaPainel") == "Dados" or getElementData(localPlayer, "TS:AbaPainel") == "Ficha" then return end if button == "arrow_d" then if Aba == 0 then setElementData(localPlayer, "TS:PartePainel", 1) playSoundFrontEnd ( 43 ) elseif Aba == 1 then setElementData(localPlayer, "TS:PartePainel", 2) playSoundFrontEnd ( 43 ) elseif Aba == 2 then setElementData(localPlayer, "TS:PartePainel", 3) playSoundFrontEnd ( 43 ) elseif Aba == 3 then setElementData(localPlayer, "TS:PartePainel", 4) playSoundFrontEnd ( 43 ) elseif Aba == 4 then setElementData(localPlayer, "TS:PartePainel", 5) playSoundFrontEnd ( 43 ) elseif Aba == 5 then setElementData(localPlayer, "TS:PartePainel", 6) playSoundFrontEnd ( 43 ) elseif Aba == 6 then setElementData(localPlayer, "TS:PartePainel", 7) playSoundFrontEnd ( 43 ) elseif Aba == 7 then setElementData(localPlayer, "TS:PartePainel", 8) playSoundFrontEnd ( 43 ) elseif Aba == 8 then setElementData(localPlayer, "TS:PartePainel", 9) playSoundFrontEnd ( 43 ) elseif Aba == 9 then setElementData(localPlayer, "TS:PartePainel", 1) playSoundFrontEnd ( 43 ) end elseif button == "arrow_u" then if Aba == 9 then setElementData(localPlayer, "TS:PartePainel", 8) playSoundFrontEnd ( 43 ) elseif Aba == 8 then setElementData(localPlayer, "TS:PartePainel", 7) playSoundFrontEnd ( 43 ) elseif Aba == 7 then setElementData(localPlayer, "TS:PartePainel", 6) playSoundFrontEnd ( 43 ) elseif Aba == 6 then setElementData(localPlayer, "TS:PartePainel", 5) playSoundFrontEnd ( 43 ) elseif Aba == 5 then setElementData(localPlayer, "TS:PartePainel", 4) playSoundFrontEnd ( 43 ) elseif Aba == 4 then setElementData(localPlayer, "TS:PartePainel", 3) playSoundFrontEnd ( 43 ) elseif Aba == 3 then setElementData(localPlayer, "TS:PartePainel", 2) playSoundFrontEnd ( 43 ) elseif Aba == 2 then setElementData(localPlayer, "TS:PartePainel", 1) playSoundFrontEnd ( 43 ) elseif Aba == 1 then setElementData(localPlayer, "TS:PartePainel", 9) playSoundFrontEnd ( 43 ) end end end end end addEventHandler ("onClientKey", root, MudarAba ) function ExecutarFuncao (_,state) if painel == true then if state == "down" then if getElementData(localPlayer, "TS:AbaPainel") == "Ficha" then local getMudarFicha = tonumber(getElementData(AlterarFicha, "text")) if type(getMudarFicha) == "number" then triggerServerEvent( 'TS:AlterarFicha', getLocalPlayer(), localPlayer, getMudarFicha) end end if getElementData(localPlayer, "TS:AbaPainel") == "Drogas" then triggerServerEvent( 'TS:ApreenderDrogas', getLocalPlayer(), localPlayer) end local Aba = getElementData(localPlayer, "TS:PartePainel") or 0 if Aba == 1 then triggerServerEvent( 'TS:Algemar', getLocalPlayer(), localPlayer) elseif Aba == 2 then triggerServerEvent( 'TS:Revistar', getLocalPlayer(), localPlayer) elseif Aba == 3 then AbrirDados () elseif Aba == 4 then AbrirFicha () elseif Aba == 5 then triggerServerEvent( 'TS:ColocarNaViatura', getLocalPlayer(), localPlayer) elseif Aba == 6 then triggerServerEvent( 'TS:RemoverNaViatura', getLocalPlayer(), localPlayer) elseif Aba == 7 then triggerServerEvent( 'TS:ApreenderArmas', getLocalPlayer(), localPlayer) elseif Aba == 8 then triggerServerEvent( 'TS:ApreenderPorte', getLocalPlayer(), localPlayer) elseif Aba == 9 then AbrirDrogas() end end end end bindKey("enter", "down", ExecutarFuncao) function FecharPainel (_,state) if painel == true then if state == "down" then if getElementData(localPlayer, "TS:AbaPainel") == "Dados" then AbrirDados () elseif getElementData(localPlayer, "TS:AbaPainel") == "Ficha" then AbrirFicha () elseif getElementData(localPlayer, "TS:AbaPainel") == "Drogas" then AbrirDrogas() else triggerServerEvent( 'TS:FecharPolicial', getLocalPlayer(), localPlayer) AbrirPolicial() setElementData(localPlayer, "TS:Abordando", nil) end end end end bindKey("backspace", "down", FecharPainel) 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
  18. 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
  19. Olá penso que seja isso daqui Na pasta apenas tem MainS.lua (primeiro que mandei) e MainC.lua (esse que tou mandando agora) Muito obrigado pela ajuda! 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("onClientClick", root, function(button, state, _, _, _, _, _, click) if (button == "left") and (state == "down") then if isElement(click) and (getElementType(click) == "player") then if not isPedInVehicle(localPlayer) then local x, y, z = getElementPosition(localPlayer) local px, py, pz = getElementPosition(click) if (getDistanceBetweenPoints3D(x, y, z, px, py, pz) <= 3) then if not isPedInVehicle(click) and (click ~= localPlayer) then triggerServerEvent("N3xT.onClickPolicial", localPlayer, click) end end end 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
  20. Olá. Tenho interesse no assunto de RPG em MTA. Até hoje não vi nenhum servidor RPG (de verdade) Brasileiro, apenas gringos e mesmo assim não achei grande coisa comparado ao servidor de RPG do SAMP. (não sei se posso citar o nome dele.) Tenho um servidor local cuja ideia também era pra ser RPG, mas enfrento diversas dificuldades em desenvolver pois não tenho como fazer testes com mais de um jogador. Realmente concordo que atualmente os RPGs do MTA são uma espécie de Freeroam com empregos e nada mais, não são realmente RPGs. Se conseguíssemos criar um servidor de RPG de verdade e que funcione sem problemas, com certeza seria exclusividade Brasileira, uma vez que não existem servidores de MTA assim Brasileiros. A sua ideia é interessante, a maioria delas já existem no servidor de RPG do SAMP. Alguns comentários que tenho: Creio que este não seja o caminho ideal. Você pode colocar os valores das coisas comparadas ao mundo real. (veículos normais custando em torno de 50 mil e veículos esportivos em torno de 500 mil). Os empregos devem gerar uma renda baixa para garantir que os jogadores não fiquem ricos com tanta facilidade ou sem esforço. Digamos que os empregos em que o jogador ganha ao completar determinada tarefa rendam em média até 5 mil reais, esse valor pode ser maior ou menor dependendo do level necessário para trabalhar nesse emprego. É necessário ter um excelente balanceamento nesta parte, pois seria terrível empregos de level alto que gerem uma renda miserável ou que empregos de level baixo que rendam demais. Creio que usar o Serial do jogador já serve. Mas caso o seu objetivo seja impedir que os jogadores tenham mais de uma conta (o que no fim das contas sempre é burlável), você pode definir que o jogador só pode ter 1 login por Serial e, caso o serial já tenha sido usado para criar uma conta, não pode usar para criar outra mesmo se for em outro IP. Além disso, você pode definir cada IP a seu respectivo serial, impedindo que outro IP faça login em uma conta criada neste Serial (impedir troca de contas entre jogadores) Resumindo: O jogador cria uma conta e faz login nela pela primeira vez. O servidor então salva o Serial e o IP em que essa conta foi criada. Essa conta não pode ser acessada por outro Serial e nem por outro IP mesmo se souber o login e senha. (recuperação de conta em casos de perda do computador podem ser feitas somente via e-mail, o e-mail deve ser obrigatório ao criar a conta. O jogador deve informar o Serial ou IP em que conectava antes, para poder registrar o novo Serial na conta.) Além disso, as contas podem ser apagadas automaticamente após 6 meses sem atividade. (liberando casas compradas e tudo mais) A ideia de perder o veículo é arriscada, seria interessante existir a profissão de Guincho, que pode rebocar o veículo explodido para uma garagem Pay'N'Spray que irá recuperar o veículo por um custo moderado (poderia ser uma porcentagem do valor do veículo, sugiro uns 30%). Uma punição severa deverá ser aplicada ao jogador que explodiu o veículo (exceto se o jogador que explodiu estiver trabalhando como Terrorista ou algo do gênero). Veículos com certeza devem ficar indestrutíveis enquanto não estiverem sendo ocupados, impedindo que o jogador perca seu veículo que foi explodido enquanto ele estava offline. É frustrante perder tudo ao morrer, é claro que deve haver um custo no hospital, sugiro que seja baseado no level do jogador. (500 X level). Assim os jogadores de level baixo não perdem todas as suas economias pagando uma fortuna no hospital e os jogadores de level alto perdem uma quantidade grande, fazendo com que evitem serem mortos. O ideal seria a necessidade de ter determinado level para poder usar tal arma, impedindo que jogadores novatos usem armas muito fortes pra zoar. ------------------------------------------------------------------- Algumas sugestões: O jogador pode ficar jogando sem conta, mas nada será salvo e ele poderá upar até no máximo level 5 (5 horas de jogo). Inclusive seria interessante deixar uma marca da água no canto da tela escrito "NÃO REGISTRADO" para fazer o jogador sentir a necessidade de criar uma conta. O interessante disso é que nem sempre o jogador que aparece, fica no servidor. As vezes ele quer apenas conhecer e ver como funciona sem nenhum compromisso de jogar. Criar uma conta seria perda de tempo para ele. Tutorial inicial obrigatório para todos os jogadores novos após criarem a conta. O tutorial não seria o velho texto chato de sempre, seria com animação e exemplos. Tudo explicado também por voz para ficar mais intuitivo. Regras de fácil acesso, podem ser lidas usando /regras em que aparece na tela uma janela com todas elas. A existência de regras específicas para cada profissão. Acessadas com /regrasprof (o servidor verifica qual profissão o jogador está e mostra as regras daquela profissão para ele.) A existência de uma equipe para investigar e punir policiais (corregedores). Estes por sua vez podem (ou não) serem membros da Staff, eles podem dar prisão Administrativa aos jogadores policiais que abusarem do poder. A prisão Administrativa não pode ser paga com fiança e a pena demora várias horas. Diferente da prisão comum dos policiais, que demoram no máximo 6 minutos (1 minuto por estrela) e podem ser pagas com fiança. (quanto mais alto o level do jogador preso, mais cara é a fiança. Cada jogador vai possuir um ID que varia dependendo da ordem de entrada no servidor. Ex: Existem 10 jogadores no servidor, todos com seus IDs do 1 ao 10. Então entra mais um jogador, este será o ID 11. Depois o jogador de ID 6 desloga e sai do servidor. O próximo jogador que entrar ficará com o ID 6 e assim por diante. Os IDs servem para mencionar o jogador no lugar de seu nick, servem para qualquer coisa. Exemplo: Em vez de usar /msg NickDoPlayer Texto para mandar uma mensagem privada a ele, pode usar /msg IDDoPlayer Texto. Os IDs aparecem antes dos nicks dos jogadores no scoreboard do TAB. Ex: (4)NickDoPlayer. Todo o dinheiro arrecadado com impostos de casas e veículos, dinheiro arrecadado com fianças, são utilizados para pagar os salários dos empregos level baixo em que o jogador não tem tarefas a cumprir. (recebem um salário fixo a cada hora de jogo). O jogador deve pagar imposto sobre sua casa (caso tenha uma), o imposto é cobrado a cada hora também, uma porcentagem baseada no valor do imóvel. (10%) e o mesmo ocorre com o veículo. O jogador pode acumular até 12 impostos atrasados, ao acumular o 13º, perde a casa e/ou o veículo cujo imposto atrasou demais. (o tempo de cobrança não passa enquanto o jogador está offline, na verdade ele é cobrado a cada vez que o jogador passa de level.) Ser possível o dono de casa convidar outros jogadores para morar em sua casa como inquilinos. O valor do aluguel é combinado entre eles. (o aluguel é debitado da conta do inquilino automaticamente cada vez que ele upar de level, caso não tenha saldo suficiente, acumula aluguel atrasado até 12 e perde a permissão de morar automaticamente ao atrasar o 13º aluguel. O dono da casa recebe uma notificação toda vez que algum morador de sua casa atrasa o aluguel. Podendo expulsar antes o inquilino, se desejar.) O dono da casa pode permitir ou restringir uma série de permissões ao inquilino, como por exemplo: Permissão de deixar a casa aberta para qualquer um entrar, permissão de guardar armas, comidas e bebidas na casa. (há um limite máximo dependendo da casa, casas mais caras tem mais espaço). O dono da casa ainda pode definir um sub-dono para sua casa, este tem permissão para tudo, não paga aluguel pois também é dono, pode tirar e colocar novos inquilinos exceto vender a casa. (existe um número máximo de moradores que cada casa pode ter, dependendo do preço da casa.) As casas teriam um preço muito variado, desde 50 mil até 10 milhões. As casas oferecem comida e bebida de graça aos moradores, basta usar /comer ou /beber na cozinha para encher sua barra de fome e sede. Também podem usar /dormir em um sofá ou cama. Jogadores podem usar /deitar para dormir em qualquer lugar, mas demora muito mais do que se fosse fazer uma cama de uma casa (cerca de 70% mais demorado). Os jogadores podem morrer de fome e sede, caso o jogador zere a barra de sono, o personagem desmaia e dorme automaticamente onde estiver (como se estivesse usado o /deitar) e só acorda quando a barra atingir a metade, podendo ser atacado e roubado se estiver em um lugar desprotegido. (se estiver dirigindo, perde o controle do veículo e dorme dentro dele.) Algumas regras que pensei logo de cara envolvendo policiais. Policiais podem atribuir níveis de procurado a jogadores por qualquer motivo. /procurar NickDoJogador Motivo (o motivo deve estar nas regras dos policiais, caso contrário o policial pode ser punido pelos Corregedores por motivo indevido no uso de comando. Cada vez que um policial usa um comando em outro jogador /algemar /prender /revistar, etc. Aparece uma notificação no chat dos Corregedores, informando algo do tipo: *O policial '(5)JogadorPlayer' algemou '(3)PlayerName'. (Motivo: dsfsdkfs) Policiais não podem algemar jogadores que não estão com pelo menos 2 níveis de procurado. Caso o façam e o jogador tirar print, o policial será punido pelos Corregedores. Policiais não podem algemar fora da viatura. Se o policial algemar um jogador a pé ou dentro de um veículo que não é viatura, poderá ser punido por abuso de poder, isso serve para facilitar um pouco a vida dos bandidos, que podem correr para lugares inacessíveis de viatura como interiores. Policiais ganham bônus se prenderem um jogador que está com profissão criminosa. Policiais não são procurados se matarem um jogador que está com profissão criminosa. Policiais não podem fazer blitz em zonas de segurança. (áreas verdes) Policiais não podem fazer qualquer procedimento perto de spawn de profissões criminosas. (Exemplo: revistar, algemar, colocar na viatura nem prender jogadores que nascem nas fazendas de maconha após pegarem profissão de traficante.) Todos os comandos de policial só funcionam se estiver a uma distância máxima do jogador procurado. (Sugiro uns 10 metros para /revistar, /algemar, /colocarvtr e /prender. E uns 30 metros para usar o /perseguir e o /procurar) Todos os comandos possíveis de policial. /revistar Nick/ID. Revista o jogador informado, para saber quantos níveis de procurado ele possui. Funciona em qualquer um. /procurar Nick/ID Motivo. Adiciona 1 estrela de procurado ao jogador informado. Só pode ser usado novamente depois de 1 minuto. Funciona em qualquer um, exceto em outros policiais. /algemar Nick/ID Motivo. Algema o jogador, tira ele de seu veículo caso ele esteja e dá Freeze nele. De maneira que ele não caia caso seja algemado no ar. Funciona em qualquer um inclusive policiais. É ilegal se usar em alguém que não está procurado. /colocarvtr Nick/ID. Coloca o jogador no porta-malas da sua viatura, só funciona se o jogador estiver algemado e se você estiver dentro de uma viatura. O jogador não consegue sair até ser levado para a DP. O policial tem 3 minutos para levar o procurado para a DP, caso contrário o procurado poderá escapar. /prender Nick/ID. Encaminha o jogador algemado para a cela da prisão. Este comando funciona em qualquer lugar, não é necessário levar o jogador até a DP para usar esse comando, útil para casos em que o policial está com pressa. Mas não recebe bônus caso o jogador seja criminoso. /executarprisao Nick/ID. Encaminha o jogador algemado que está dentro da sua viatura para a cela da prisão. Só funciona na frente de uma DP. Gera bônus em caso do jogador ter profissão criminosa. /perseguir Nick/ID. Usado para mandar uma mensagem de 'Pare' na tela do jogador procurado. Útil quando os policiais estão atrás de um suspeito que está fugindo de veículo, solicitando que ele encoste o veículo e se renda. /bafometro Nick/ID. Solicita o jogador a fazer o teste do bafômetro, ele pode /aceitar ou /recusar. Indica se o jogador está ou não alcoolizado. O jogador fica alcoolizado se beber qualquer bebida com alcool, a duração do alcool depende de quantas doses o jogador tomou. (sugiro 3 minutos por dose.) O jogador desmaia ao beber 10 doses. Enquanto está alcoolizado, o jogador fica com a tela balançando e o jogador anda no estilo bêbado. /tirarveiculo Nick/ID Motivo. Apreende o veículo do jogador por tempo indeterminado até que ele pague a fiança do veículo. (sugiro 40% do valor do veículo) O veículo apreendido não pode ser usado até sua fiança ser paga para recuperar o veículo. /desarmar Nick/ID Motivo. Remove todas as armas do jogador. Só pode ser usado caso o jogador esteja usando armas sem ter porte de armas ou se as armas forem contrabandeadas. (não foram compradas na Ammu-Nation, foram compradas de traficantes por preço mais baixo). /documentos Nick/ID. Verifica os documentos do jogador, se ele tem porte de armas ou não, se tem carteira de motorista. Caso o jogador esteja sem porte de armas e tenha armas, o policial pode usar o /desarmar para tirar as armas e pode /tirarveiculo se o jogador estiver sem carteira de motorista. (se o carro for público, ou seja, encontrado nos lugares públicos do mapa, apenas respawna o veículo.) O policial pode então dar /procurar no jogador. /blitz. Cria um tapete de pregos na posição e rotação do policial. Jogadores que passarem com veículo terão os pneus estourados e poderão ser /procurados por furar bloqueio policial. /destruirblitz. Destrói o tapete de pregos (só pode criar 1 tapete por policial), usado para permitir a passagem dos jogadores depois que foram revistados na operação da blitz. /rp Texto. Manda uma mensagem para todos os jogadores que possuem uma profissão de policial. Sistema complexo de clãs, cada clã pode ter no máximo 50 membros. Os clãs podem ter uma base (caso algum líder ou sub-líder compre) com spawn de armas, vida e colete. Podem ter carros na base. (também comprados pelos líderes e sub-líderes ou até mesmo pelos comandantes). Os clãs possuem uma contagem de Kills/Death para estabelecer um Rank de Clãs. Os membros do clã podem realizar ataques contra zonas de outros clãs. (igual o sistema de dominar territórios) Os membros do clã recebem uma quantidade de bônus em dinheiro dependendo do número de territórios que seu clã domina a cada hora de jogo. Mas diferente do salário das profissões que se recebe no momento em que o jogador upa de level, esse bônus se ganha a cada hora do servidor, o pagamento continua sendo feito a todos os membros a cada hora ao mesmo tempo, os membros que estiverem offline não recebem. Cada clã só pode comprar 1 base apenas. Existem bases mais caras e mais baratas. O clã pode ter a base comprada por outro clã caso fique sem territórios, o dinheiro gasto para comprar a base de outro clã vai para os impostos. Sugiro fazer os territórios em San Fierro pra não ficar padrão ao jogo normal. Sistema bancário avançado, com função de transferir valores para outros jogadores. Útil para casos onde os membros devem ajudar os líderes do clã a comprar uma base, depositando valores na conta do líder que vai realizar a compra. Jogadores devem dropar o dinheiro do bolso quando morrem. (O valor que estiver aparecendo no HUD quando morreu, para isso é recomendado que os jogadores sempre depositem sua grana no banco para não haver grandes perdas ao morrer, ainda sim será necessário pagar o hospital usando a grana do banco.) Obrigatório o servidor possuir um fórum no site, para os jogadores poderem fazer novas sugestões, denúncias, perguntas, reports de bugs e tudo mais. Ideias todos nós temos, colocar em prática não é o problema, realizá-las sim é o problema. Caso queira ver como funciona o servidor de SAMP, eu fiz uma série nele faz um tempo.
  21. ----------------------------------------------------------------------------------------------------------------------------------------- inventario = {} timerStart = {} gates = {} boxes = {} acao = {} item = {} arma = {} capacete = {} maleta = {} mascara = {} som = {} flor = {} tempo = {} cigarro = {} algemado = {} algemando = {} blip = {} curado = {} timerAlgema = {} bau = {} ----------------------------------------------------------------------------------------------------------------------------------------- for i, v in pairs(GatePositions) do gates[i] = createObject(GatePositions[i][2], GatePositions[i][3], GatePositions[i][4], GatePositions[i][5], 0, 0, GatePositions[i][11]) end for i, v in pairs(BoxPositions) do boxes[i] = createObject(1227, BoxPositions[i][3], BoxPositions[i][4], BoxPositions[i][5]-0.2, BoxPositions[i][6], BoxPositions[i][7], BoxPositions[i][8]) setElementData(boxes[i], "IsBox", BoxPositions[i][1]) bau[BoxPositions[i][1]] = {} setElementInterior(boxes[i], BoxPositions[i][9]) setElementDimension(boxes[i], BoxPositions[i][10]) end ----------------------------------------------------------------------------------------------------------------------------------------- function giveItem(playerSource, commandName, id, item, qntd) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("Admin")) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("Vice-Presidente")) then if not qntd then return exports._infobox:addNotification(playerSource, "Utilice: /giveitem ID ITEM CANTIDAD", "error") end for i, v in pairs(getElementsByType("player")) do if getElementData(v, "ID") == tonumber(id) then if GiveAndTakeAndGetItem("give", v, item, qntd) then exports._infobox:addNotification(playerSource, "Diste "..qntd.."x '"..(realName[item][1]).."' Para el jugador "..getPlayerName(v), "success") exports._infobox:addNotification(v, "Recibiste "..qntd.."x '"..(realName[item][1]).."' del Admin "..getPlayerName(playerSource), "info") local name = getPlayerName(playerSource) local ID1 = getElementData(playerSource, "ID") or "N/A" local name2 = getPlayerName(v) local ID2 = getElementData(v, "ID") or "N/A" exports["[MOD]Logs"]:CreateLog("[INVENTARIO]\nStaff: "..name.." ["..ID1.."]\nJugador: "..name2.." ["..ID2.."]\nItem: "..item.."\nCantidad: "..qntd.."\nOperación: Give") else exports._infobox:addNotification(playerSource, "El Jugador no tiene espacio en la mochila o dicho articulo no existe", "error") end end end end end addCommandHandler("giveitem", giveItem) ----------------------------------------------------------------------------------------------------------------------------------------- function takeItem(playerSource, commandName, id, item, qntd) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("Admin")) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("Vice-Presidente")) then if not id then return exports._infobox:addNotification(playerSource, "Utilice: /takeitem ID ITEM", "error") end for i, v in pairs(getElementsByType("player")) do if getElementData(v, "ID") == tonumber(id) then if (qntd) then if GiveAndTakeAndGetItem("take", v, item, tonumber(qntd)) then exports._infobox:addNotification(playerSource, "Removiste "..qntd.."x '"..(realName[item][1]).."' del inventario del jugador "..getPlayerName(v), "success") exports._infobox:addNotification(v, "El Admin "..getPlayerName(playerSource).." removió "..qntd.."x '"..(realName[item][1]).."' de tu inventario", "warning") local name = getPlayerName(playerSource) local ID1 = getElementData(playerSource, "ID") or "N/A" local name2 = getPlayerName(v) local ID2 = getElementData(v, "ID") or "N/A" exports["[MOD]Logs"]:CreateLog("[INVENTARIO]\nStaff: "..name.." ["..ID1.."]\nJugador: "..name2.." ["..ID2.."]\nItem: "..item.."\nCantidad: "..qntd.."\nOperación: Take") else exports._infobox:addNotification(playerSource, "El jugador no posee "..qntd.."x este item en su mochila o el item informado no existe", "error") end else if GiveAndTakeAndGetItem("take", v, item, "all") then exports._infobox:addNotification(playerSource, "Removiste todo '"..(realName[item][1]).."' del inventario del jugador "..getPlayerName(v), "success") exports._infobox:addNotification(v, "El Admin "..getPlayerName(playerSource).." removió el item '"..(realName[item][1]).."' de tu inventario", "warning") local name = getPlayerName(playerSource) local ID1 = getElementData(playerSource, "ID") or "N/A" local name2 = getPlayerName(v) local ID2 = getElementData(v, "ID") or "N/A" exports["[MOD]Logs"]:CreateLog("[INVENTARIO]\nStaff: "..name.." ["..ID1.."]\nJugador: "..name2.." ["..ID2.."]\nItem: "..item.."\nCantidad: All\nOperación: Take") else exports._infobox:addNotification(playerSource, "El jugador no posee este item en su mochila o el item informado no existe", "error") end end end end end end addCommandHandler("takeitem", takeItem) ----------------------------------------------------------------------------------------------------------------------------------------- function resetInv(playerSource, commandName, id) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("Admin")) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("Vice-Presidente")) then if not id then return exports._infobox:addNotification(playerSource, "Utilice: /takeitem ID ITEM", "error") end for i, v in pairs(getElementsByType("player")) do if getElementData(v, "ID") == tonumber(id) then for index = #inventario[v], 1, -1 do local item = inventario[v][index][1] if not itensCantRemoved[item] then GiveAndTakeAndGetItem("take", v, item, "all") end end exports._infobox:addNotification(playerSource, "Reiniciaste el Inventario del Jugador "..getPlayerName(v), "success") exports._infobox:addNotification(v, "El Admin "..getPlayerName(playerSource).." reinicio su inventario", "warning") local name = getPlayerName(playerSource) local ID1 = getElementData(playerSource, "ID") or "N/A" local name2 = getPlayerName(v) local ID2 = getElementData(v, "ID") or "N/A" exports["[MOD]Logs"]:CreateLog("[INVENTARIO]\nStaff: "..name.." ["..ID1.."]\nJugador: "..name2.." ["..ID2.."]\nOperación: Reset") end end end end addCommandHandler("resetinv", resetInv) ----------------------------------------------------------------------------------------------------------------------------------------- function GiveAndTakeAndGetItem(tipo, playerSource, item, qntd) if realName[item] then if tipo == "give" then local peso = 0 local maxPeso = 30 for i, v in pairs(pesoItens) do for index, value in pairs(inventario[playerSource]) do if inventario[playerSource][index][1] == i then peso = peso + (pesoItens[i][1] * inventario[playerSource][index][2]) end end end if getElementData(playerSource, "ouro") then maxPeso = 30 elseif getElementData(playerSource, "platina") then maxPeso = 40 elseif getElementData(playerSource, "diamante") then maxPeso = 50 else maxPeso = 25 end if (peso + (pesoItens[item][1] * qntd)) <= maxPeso then local count = false for i, v in pairs(inventario[playerSource]) do if inventario[playerSource][i][1] == item then count = true end end if count then for i, v in pairs(inventario[playerSource]) do if inventario[playerSource][i][1] == item then inventario[playerSource][i][2] = inventario[playerSource][i][2] + tonumber(qntd) triggerClientEvent(playerSource, "refresh", resourceRoot, inventario[playerSource]) return true end end else if #inventario[playerSource] < 30 then local edit = {item, tonumber(qntd)} table.insert(inventario[playerSource], edit) triggerClientEvent(playerSource, "refresh", resourceRoot, inventario[playerSource]) return true else return false end end else return false end elseif tipo == "take" then for i, v in pairs(inventario[playerSource]) do if inventario[playerSource][i][1] == item then if tostring(qntd) == "all" then table.remove(inventario[playerSource], i) removeItem(playerSource, item) else if inventario[playerSource][i][2] >= tonumber(qntd) then inventario[playerSource][i][2] = inventario[playerSource][i][2] - tonumber(qntd) else return false end end if inventario[playerSource][i] then if inventario[playerSource][i][2] <= 0 then table.remove(inventario[playerSource], i) removeItem(playerSource, item) end end triggerClientEvent(playerSource, "refresh", resourceRoot, inventario[playerSource]) return true end end elseif tipo == "get" then for i, v in pairs(inventario[playerSource]) do if inventario[playerSource][i][1] == item then if inventario[playerSource][i][2] > 0 then return inventario[playerSource][i][2] else return 0 end end end return 0 end end end function formatItens(table, type) TableItens = table if #TableItens ~= 0 then if type == "bau" then for i,v in ipairs(TableItens) do local Item = v.Item local Quantidade = v.Quantidade TableItens[i].Nome = realName[Item][1] TableItens[i].Peso = pesoItens[Item][1] end else for i,v in ipairs(TableItens) do local Item = v[1] local Quantidade = v[2] TableItens[i][3] = realName[Item][1] TableItens[i][4] = pesoItens[Item][1] end end end return TableItens end function getItensPlayer(player) return (inventario[player] and formatItens(inventario[player]) or {}) end ----------------------------------------------------------------------------------------------------------------------------------------- function use(playerSource, itemUsed) if itemUsed == "suco" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end local x, y, z = getElementPosition(playerSource) item[playerSource] = createObject(1544, x, y, z) acao[playerSource] = setTimer(function() end, 3000, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setElementDimension(item[playerSource], dim) setElementInterior(item[playerSource], int) setPedAnimation(playerSource, "VENDING", "VEND_Drink2_P", 3000, false, true, false, false, _, true) PlaySound3D(playerSource, "drink", 15) exports.bone_attach:attachElementToBone(item[playerSource], playerSource, 11, -0.26, -0.05, 0.14, 34, 108, 4) setTimer(function() destroyElement(item[playerSource]) item[playerSource] = nil local random = math.random(5, 10) local sede = getElementData(playerSource, "sede") or 0 setElementData(playerSource, "sede", sede + random) if getElementData(playerSource, "sede") > 100 then setElementData(playerSource, "sede", 100) end end, 3000, 1) end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "refrigerante" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end local x, y, z = getElementPosition(playerSource) item[playerSource] = createObject(2601, x, y, z) acao[playerSource] = setTimer(function() end, 3000, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setObjectScale(item[playerSource], 0.9) setElementDimension(item[playerSource], dim) setElementInterior(item[playerSource], int) setPedAnimation(playerSource, "VENDING", "VEND_Drink2_P", 3000, false, true, false, false, _, true) PlaySound3D(playerSource, "drink", 15) exports.bone_attach:attachElementToBone(item[playerSource], playerSource, 11, -0.01, 0.04, 0.06, 46, 110, -14) setTimer(function() destroyElement(item[playerSource]) item[playerSource] = nil local random = math.random(20, 35) local sede = getElementData(playerSource, "sede") or 0 setElementData(playerSource, "sede", sede + random) if getElementData(playerSource, "sede") > 100 then setElementData(playerSource, "sede", 100) end end, 3000, 1) end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "whisky" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end local x, y, z = getElementPosition(playerSource) item[playerSource] = createObject(1520, x, y, z) acao[playerSource] = setTimer(function() end, 3000, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setElementDimension(item[playerSource], dim) setElementInterior(item[playerSource], int) setPedAnimation(playerSource, "VENDING", "VEND_Drink2_P", 3000, false, true, false, false, _, true) PlaySound3D(playerSource, "drink", 15) exports.bone_attach:attachElementToBone(item[playerSource], playerSource, 11, -0.25, 0.01, 0.11, 44, 100, -4) setTimer(function() destroyElement(item[playerSource]) item[playerSource] = nil local random = math.random(25, 30) local sede = getElementData(playerSource, "sede") or 0 setElementData(playerSource, "sede", sede + random) if getElementData(playerSource, "sede") > 100 then setElementData(playerSource, "sede", 100) end end, 3000, 1) end else-- exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") -- end elseif itemUsed == "leite2" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end local x, y, z = getElementPosition(playerSource) item[playerSource] = createObject(1484, x, y, z) acao[playerSource] = setTimer(function() end, 3000, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setElementDimension(item[playerSource], dim) setElementInterior(item[playerSource], int) setPedAnimation(playerSource, "VENDING", "VEND_Drink2_P", 3000, false, true, false, false, _, true) PlaySound3D(playerSource, "drink", 15) exports.bone_attach:attachElementToBone(item[playerSource], playerSource, 11, -0.01, -0.02, 0.13, 22, 132, 12) setTimer(function() destroyElement(item[playerSource]) item[playerSource] = nil local sede = getElementData(playerSource, "sede") or 0 setElementData(playerSource, "sede", sede + 50) if getElementData(playerSource, "sede") > 100 then setElementData(playerSource, "sede", 100) end end, 3000, 1) end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "redbull" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end local x, y, z = getElementPosition(playerSource) item[playerSource] = createObject(2601, x, y, z) acao[playerSource] = setTimer(function() end, 3000, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setObjectScale(item[playerSource], 0.9) setElementDimension(item[playerSource], dim) setElementInterior(item[playerSource], int) setPedAnimation(playerSource, "VENDING", "VEND_Drink2_P", 3000, false, true, false, false, _, true) PlaySound3D(playerSource, "drink", 15) exports.bone_attach:attachElementToBone(item[playerSource], playerSource, 11, -0.01, 0.04, 0.06, 46, 110, -14) setTimer(function() destroyElement(item[playerSource]) item[playerSource] = nil local random = math.random(50, 60) local sede = getElementData(playerSource, "Energy") or 0 setElementData(playerSource, "Energy", sede + random) if getElementData(playerSource, "Energy") > 100 then setElementData(playerSource, "Energy", 100) end end, 3000, 1) end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "monster" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end local x, y, z = getElementPosition(playerSource) item[playerSource] = createObject(2601, x, y, z) acao[playerSource] = setTimer(function() end, 3000, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setObjectScale(item[playerSource], 0.9) setElementDimension(item[playerSource], dim) setElementInterior(item[playerSource], int) setPedAnimation(playerSource, "VENDING", "VEND_Drink2_P", 3000, false, true, false, false, _, true) PlaySound3D(playerSource, "drink", 15) exports.bone_attach:attachElementToBone(item[playerSource], playerSource, 11, -0.01, 0.04, 0.06, 46, 110, -14) setTimer(function() destroyElement(item[playerSource]) item[playerSource] = nil local random = math.random(10, 15) local sede = getElementData(playerSource, "Energy") or 0 setElementData(playerSource, "Energy", sede + random) if getElementData(playerSource, "Energy") > 100 then setElementData(playerSource, "Energy", 100) end end, 3000, 1) end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "whisky" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end local x, y, z = getElementPosition(playerSource) item[playerSource] = createObject(1520, x, y, z) acao[playerSource] = setTimer(function() end, 3000, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setElementDimension(item[playerSource], dim) setElementInterior(item[playerSource], int) setPedAnimation(playerSource, "VENDING", "VEND_Drink2_P", 3000, false, true, false, false, _, true) PlaySound3D(playerSource, "drink", 15) exports.bone_attach:attachElementToBone(item[playerSource], playerSource, 11, -0.25, 0.01, 0.11, 44, 100, -4) setTimer(function() destroyElement(item[playerSource]) item[playerSource] = nil local random = math.random(25, 30) local sede = getElementData(playerSource, "sede") or 0 setElementData(playerSource, "sede", sede + random) if getElementData(playerSource, "sede") > 100 then setElementData(playerSource, "sede", 100) end end, 3000, 1) end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "leite2" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end local x, y, z = getElementPosition(playerSource) item[playerSource] = createObject(1484, x, y, z) acao[playerSource] = setTimer(function() end, 3000, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setElementDimension(item[playerSource], dim) setElementInterior(item[playerSource], int) setPedAnimation(playerSource, "VENDING", "VEND_Drink2_P", 3000, false, true, false, false, _, true) PlaySound3D(playerSource, "drink", 15) exports.bone_attach:attachElementToBone(item[playerSource], playerSource, 11, -0.01, -0.02, 0.13, 22, 132, 12) setTimer(function() destroyElement(item[playerSource]) item[playerSource] = nil local sede = getElementData(playerSource, "sede") or 0 setElementData(playerSource, "sede", sede + 50) if getElementData(playerSource, "sede") > 100 then setElementData(playerSource, "sede", 100) end end, 3000, 1) end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "burrito" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end local x, y, z = getElementPosition(playerSource) item[playerSource] = createObject(2769, x, y, z) acao[playerSource] = setTimer(function() end, 5000, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setElementDimension(item[playerSource], dim) setElementInterior(item[playerSource], int) setPedAnimation(playerSource, "FOOD", "EAT_Burger", 5000, false, true, false, false, _, true) PlaySound3D(playerSource, "eat", 15) exports.bone_attach:attachElementToBone(item[playerSource], playerSource, 12, 0.06, 0.03, 0.02, 50, 74, -88) setTimer(function() destroyElement(item[playerSource]) item[playerSource] = nil local random = math.random(5, 10) local hunger = getElementData(playerSource, "hunger") or 0 local fezes = getElementData(playerSource, "fezes") or 0 setElementData(playerSource, "hunger", hunger + random) setElementData(playerSource, "fezes", fezes + random) if getElementData(playerSource, "fezes") > 100 then setElementData(playerSource, "fezes", 100) end if getElementData(playerSource, "hunger") > 100 then setElementData(playerSource, "hunger", 100) setPedStat(playerSource, 21, getPedStat(playerSource, 21) + 100) end end, 5000, 1) end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "pizza" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end local x, y, z = getElementPosition(playerSource) item[playerSource] = createObject(2702, x, y, z) acao[playerSource] = setTimer(function() end, 5000, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setObjectScale(item[playerSource], 0.8) setElementDimension(item[playerSource], dim) setElementInterior(item[playerSource], int) setPedAnimation(playerSource, "FOOD", "EAT_Pizza", 5000, false, true, false, false, _, true) PlaySound3D(playerSource, "eat", 15) exports.bone_attach:attachElementToBone(item[playerSource], playerSource, 12, -3.4694469519536e-18, 0.08, 0.05, -6, 251.5, 10) setTimer(function() destroyElement(item[playerSource]) item[playerSource] = nil local random = math.random(30, 45) local hunger = getElementData(playerSource, "hunger") or 0 local fezes = getElementData(playerSource, "fezes") or 0 setElementData(playerSource, "hunger", hunger + random) setElementData(playerSource, "fezes", fezes + random) if getElementData(playerSource, "fezes") > 100 then setElementData(playerSource, "fezes", 100) end if getElementData(playerSource, "hunger") > 100 then setElementData(playerSource, "hunger", 100) setPedStat(playerSource, 21, getPedStat(playerSource, 21) + 150) end end, 5000, 1) end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "hamburguer" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end local x, y, z = getElementPosition(playerSource) item[playerSource] = createObject(2703, x, y, z) acao[playerSource] = setTimer(function() end, 5000, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setElementDimension(item[playerSource], dim) setElementInterior(item[playerSource], int) setPedAnimation(playerSource, "FOOD", "EAT_Burger", 5000, false, true, false, false, _, true) PlaySound3D(playerSource, "eat", 15) exports.bone_attach:attachElementToBone(item[playerSource], playerSource, 12, -0.02, 0.06, 0.05, -14, 8, -18) setTimer(function() destroyElement(item[playerSource]) item[playerSource] = nil local random = math.random(25, 30) local hunger = getElementData(playerSource, "hunger") or 0 local fezes = getElementData(playerSource, "fezes") or 0 setElementData(playerSource, "hunger", hunger + random) setElementData(playerSource, "fezes", fezes + random) if getElementData(playerSource, "fezes") > 100 then setElementData(playerSource, "fezes", 100) end if getElementData(playerSource, "hunger") > 100 then setElementData(playerSource, "hunger", 100) setPedStat(playerSource, 21, getPedStat(playerSource, 21) + 200) end end, 5000, 1) end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "corda" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end triggerClientEvent(playerSource, "progressBar", playerSource, 1000) acao[playerSource] = setTimer(function() exports["[MOD]Gang"]:algemar(playerSource) end, 1000, 1) --triggerClientEvent(playerSource, "MST.Notify",playerSource, "success", "Você segurou e amarrou") end else exports._infobox:addNotification(playerSource, "inventario", "error", "No tienes "..realName[itemUsed][1].." en tu inventario", 5) end elseif itemUsed == "medatickets" then local moedas = getElementData(source,"moneycoins") or 0 if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end acao[playerSource] = setTimer(function() end, 3000, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) local random = math.random(1, 3) local moedas = getElementData(playerSource, "moneycoins") or 0 setElementData(playerSource, "moneycoins", moedas + random) exports._infobox:addNotification(playerSource, "Has intercambiado Medatickets por Medcoins a tu billetera", "success", "tienes mas "..random.." Diamantes en tu cuenta", 8) end else exports._infobox:addNotification(playerSource, "inventario", "error", "No tienes "..realName[itemUsed][1].." en tu inventario", 5) end elseif itemUsed == "cartao123" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end acao[playerSource] = setTimer(function() end, 1000, 1) exports._infobox:addNotification(playerSource, "ve a PigPen no le digas a nadie (Corazón en el mapa)", "success", "", 8) end end elseif itemUsed == "vip1" then if getElementData(playerSource, "ouro") == false then if getElementData(playerSource, "platina") == false then if getElementData(playerSource, "diamante") == false then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end acao[playerSource] = setTimer(function() end, 1000, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) setElementData(playerSource, "ouro", true) exports._infobox:addNotification(playerSource, "VIP", "success", "Eres un nuevo VIP ORO por 30 dias", 5) if GiveAndTakeAndGetItem("get", playerSource, "ouros1") == 0 then exports["[MOD]Inventario"]:GiveAndTakeAndGetItem("give", playerSource, "ouros1", 1) end end end end else exports._infobox:addNotification(playerSource, "inventario", "error", "No tienes "..realName[itemUsed][1].." en tu inventario", 5) end end elseif itemUsed == "vip2" then if not getElementData(playerSource, "platina") then if not getElementData(playerSource, "diamante") then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end acao[playerSource] = setTimer(function() end, 1000, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) setElementData(playerSource, "ouro", false) setElementData(playerSource, "platina", true) exports._infobox:addNotification(playerSource, "VIP", "success", "Eres un nuevo Platinum VIP por 30 días", 5) if GiveAndTakeAndGetItem("get", playerSource, "platinas1" or "ouros1") == 0 then exports["[MOD]Inventario"]:GiveAndTakeAndGetItem("give", playerSource, "ouros1", 1) exports["[MOD]Inventario"]:GiveAndTakeAndGetItem("give", playerSource, "platinas1", 1) end end end end else exports._infobox:addNotification(playerSource, "inventario", "error", "No tienes "..realName[itemUsed][1].." en tu inventario", 5) end elseif itemUsed == "vip3" then if getElementData(playerSource, "diamante") == false then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end acao[playerSource] = setTimer(function() end, 1000, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) setElementData(playerSource, "ouro", false) setElementData(playerSource, "platina", false) setElementData(playerSource, "diamante", true) exports._infobox:addNotification(playerSource, "VIP", "success", "Eres un nuevo Diamond VIP por 30 días", 5) if GiveAndTakeAndGetItem("get", playerSource, "diamantes1" or "platinas1" or "ouros1") == 0 then exports["[MOD]Inventario"]:GiveAndTakeAndGetItem("give", playerSource, "ouros1", 1) exports["[MOD]Inventario"]:GiveAndTakeAndGetItem("give", playerSource, "platinas1", 1) exports["[MOD]Inventario"]:GiveAndTakeAndGetItem("give", playerSource, "diamantes1", 1) end end else exports._infobox:addNotification(playerSource, "inventario", "error", "No tienes "..realName[itemUsed][1].." en tu inventario", 5) end end ------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- elseif itemUsed == "adesivogrunge" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end triggerClientEvent(playerSource, "progressBar", playerSource, 2000) acao[playerSource] = setTimer(function() exports._infobox:addNotification(playerSource, "La pegatina ha sido aplicada", "info", "has colocado la pegatina al arma!", 5) exports['paintjob_weapons']:loadWeaponSkin(playerSource, 29, "padrao") -- MP5 exports['paintjob_weapons']:loadWeaponSkin(playerSource, 23, "padrao") -- Five exports['paintjob_weapons']:loadWeaponSkin(playerSource, 30, "padrao") -- AK exports['paintjob_weapons']:loadWeaponSkin(playerSource, 31, "padrao") -- M4 exports['paintjob_weapons']:loadWeaponSkin(playerSource, 32, "padrao") -- UZI exports['paintjob_weapons']:loadWeaponSkin(playerSource, 4, "padrao") -- KARAMBIT end, 2000, 1) end else exports._infobox:addNotification(playerSource, "inventario", "error", "No posees "..realName[itemUsed][1].." En tu inventario", 5) end elseif itemUsed == "dangerak" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end triggerClientEvent(playerSource, "progressBar", playerSource, 2000) acao[playerSource] = setTimer(function() exports._infobox:addNotification(playerSource, "La pegatina ha sido aplicada", "info", "has colocado la pegatina al arma!", 5) exports['paintjob_weapons']:loadWeaponSkin(playerSource, 30, "danger") -- AK end, 2000, 1) end else exports.a_infobox:addNotification(playerSource, "inventario", "error", "No posees "..realName[itemUsed][1].." En tu inventario", 5) end elseif itemUsed == "dangerm4" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end triggerClientEvent(playerSource, "progressBar", playerSource, 2000) acao[playerSource] = setTimer(function() exports.a_infobox:addNotification(playerSource, "La pegatina ha sido aplicada", "info", "has colocado la pegatina al arma!", 5) exports['paintjob_weapons']:loadWeaponSkin(playerSource, 31, "danger") -- M4 end, 2000, 1) end else exports._infobox:addNotification(playerSource, "inventario", "error", "No posees "..realName[itemUsed][1].." En tu inventario", 5) end elseif itemUsed == "dangermp5" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end triggerClientEvent(playerSource, "progressBar", playerSource, 2000) acao[playerSource] = setTimer(function() exports._infobox:addNotification(playerSource, "La pegatina ha sido aplicada", "info", "has colocado la pegatina al arma!", 5) exports['paintjob_weapons']:loadWeaponSkin(playerSource, 29, "danger") -- MP5 end, 2000, 1) end else exports._infobox:addNotification(playerSource, "inventario", "error", "No posees "..realName[itemUsed][1].." En tu inventario", 5) end elseif itemUsed == "dangerfive" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end triggerClientEvent(playerSource, "progressBar", playerSource, 2000) acao[playerSource] = setTimer(function() exports._infobox:addNotification(playerSource, "La pegatina ha sido aplicada", "info", "has colocado la pegatina al arma!", 5) exports['paintjob_weapons']:loadWeaponSkin(playerSource, 23, "danger") -- Five end, 2000, 1) end else exports._infobox:addNotification(playerSource, "inventario", "error", "No posees "..realName[itemUsed][1].." En tu inventario", 5) end elseif itemUsed == "dangerkarambit" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end triggerClientEvent(playerSource, "progressBar", playerSource, 2000) acao[playerSource] = setTimer(function() exports._infobox:addNotification(playerSource, "La pegatina ha sido aplicada", "info", "has colocado la pegatina al arma!", 5) exports['paintjob_weapons']:loadWeaponSkin(playerSource, 4, "danger") -- KARAMBIT end, 2000, 1) end else exports._infobox:addNotification(playerSource, "inventario", "error", "No posees "..realName[itemUsed][1].." En tu inventario", 5) end elseif itemUsed == "dangeruzi" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end triggerClientEvent(playerSource, "progressBar", playerSource, 2000) acao[playerSource] = setTimer(function() exports._infobox:addNotification(playerSource, "La pegatina ha sido aplicada", "info", "has colocado la pegatina al arma!", 5) exports['paintjob_weapons']:loadWeaponSkin(playerSource, 32, "danger") -- UZI end, 2000, 1) end else exports._infobox:addNotification(playerSource, "inventario", "error", "No posees "..realName[itemUsed][1].." En tu inventario", 5) end elseif itemUsed == "ouros1" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end triggerClientEvent(playerSource, "progressBar", playerSource, 2000) acao[playerSource] = setTimer(function() exports._infobox:addNotification(playerSource, "La pegatina ha sido aplicada", "info", "has colocado la pegatina al arma!", 5) exports['paintjob_weapons']:loadWeaponSkin(playerSource, 29, "os1") -- MP5 exports['paintjob_weapons']:loadWeaponSkin(playerSource, 23, "os1") -- Five exports['paintjob_weapons']:loadWeaponSkin(playerSource, 30, "os1") -- AK exports['paintjob_weapons']:loadWeaponSkin(playerSource, 31, "os1") -- M4 exports['paintjob_weapons']:loadWeaponSkin(playerSource, 32, "os1") -- UZI exports['paintjob_weapons']:loadWeaponSkin(playerSource, 4, "os1") -- KARAMBIT end, 2000, 1) end else exports._infobox:addNotification(playerSource, "inventario", "error", "No posees "..realName[itemUsed][1].." En tu inventario", 5) end elseif itemUsed == "platinas1" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end triggerClientEvent(playerSource, "progressBar", playerSource, 2000) acao[playerSource] = setTimer(function() exports._infobox:addNotification(playerSource, "La pegatina ha sido aplicada", "info", "has colocado la pegatina al arma!", 5) exports['paintjob_weapons']:loadWeaponSkin(playerSource, 29, "ps1") -- MP5 exports['paintjob_weapons']:loadWeaponSkin(playerSource, 23, "ps1") -- Five exports['paintjob_weapons']:loadWeaponSkin(playerSource, 30, "ps1") -- AK exports['paintjob_weapons']:loadWeaponSkin(playerSource, 31, "ps1") -- M4 exports['paintjob_weapons']:loadWeaponSkin(playerSource, 32, "ps1") -- M4 exports['paintjob_weapons']:loadWeaponSkin(playerSource, 4, "ps1") -- KARAMBIT end, 2000, 1) end else exports._infobox:addNotification(playerSource, "inventario", "error", "No posees "..realName[itemUsed][1].." En tu inventario", 5) end elseif itemUsed == "diamantes1" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end triggerClientEvent(playerSource, "progressBar", playerSource, 2000) acao[playerSource] = setTimer(function() exports._infobox:addNotification(playerSource, "La pegatina ha sido aplicada", "info", "has colocado la pegatina al arma!", 5) exports['paintjob_weapons']:loadWeaponSkin(playerSource, 29, "ds1") -- MP5 exports['paintjob_weapons']:loadWeaponSkin(playerSource, 23, "ds1") -- Five exports['paintjob_weapons']:loadWeaponSkin(playerSource, 30, "ds1") -- AK exports['paintjob_weapons']:loadWeaponSkin(playerSource, 31, "ds1") -- M4 exports['paintjob_weapons']:loadWeaponSkin(playerSource, 32, "ds1") -- M4 exports['paintjob_weapons']:loadWeaponSkin(playerSource, 4, "ds1") -- KARAMBIT end, 2000, 1) end else exports._infobox:addNotification(playerSource, "inventario", "error", "No posees "..realName[itemUsed][1].." En tu inventario", 5) end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ elseif itemUsed == "colete" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if getPedArmor(playerSource) < 100 then acao[playerSource] = setTimer(function() end, 2300, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) setPedAnimation(playerSource, "POLICE", "plc_drgbst_01", 2300, false, true, false, false, _, true) setTimer(function() setPedArmor(playerSource, 100) end, 2300, 1) else exports._infobox:addNotification(playerSource, "Ya estas usando un '"..realName[itemUsed][1].."'", "error") end end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "faca" or itemUsed == "picareta" or itemUsed == "cutelo" or itemUsed == "taco" or itemUsed == "cassetete" or itemUsed == "pa" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if not arma[playerSource] then setPedAnimation(playerSource, "BUDDY", "buddy_reload", 500, false, true, false, false, _, true) arma[playerSource] = itemUsed giveWeapon(playerSource, weapons[itemUsed][1], 1, true) PlaySound3D(playerSource, "put", 15) toggleControl(playerSource, "next_weapon", false) toggleControl(playerSource, "previous_weapon", false) else if arma[playerSource] == itemUsed then arma[playerSource] = nil takeWeapon(playerSource, weapons[itemUsed][1]) PlaySound3D(playerSource, "put", 15) toggleControl(playerSource, "next_weapon", true) toggleControl(playerSource, "previous_weapon", true) else exports._infobox:addNotification(playerSource, "Ya tienes un arma en las manos", "error") end end end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "taser" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if not arma[playerSource] then arma[playerSource] = itemUsed giveWeapon(playerSource, weapons[itemUsed][1], 30, true) PlaySound3D(playerSource, "pick", 15) setPedAnimation(playerSource, "BUDDY", "buddy_reload", 1300, false, true, false, false, _, true) toggleControl(playerSource, "next_weapon", false) toggleControl(playerSource, "previous_weapon", false) else if arma[playerSource] == itemUsed then arma[playerSource] = nil takeWeapon(playerSource, weapons[itemUsed][1]) PlaySound3D(playerSource, "put", 15) toggleControl(playerSource, "next_weapon", true) toggleControl(playerSource, "previous_weapon", true) else exports._infobox:addNotification(playerSource, "Ya tienes un arma en las manos", "error") end end end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "glock" or itemUsed == "deagle" or itemUsed == "escopeta" or itemUsed == "tec9" or itemUsed == "mp5" or itemUsed == "ak47" or itemUsed == "m4a1" or itemUsed == "awm" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if not arma[playerSource] then local ammo = GiveAndTakeAndGetItem("get", playerSource, weapons[itemUsed][2]) or 0 if ammo > 0 then giveWeapon(playerSource, weapons[itemUsed][1], ammo + 1, true) GiveAndTakeAndGetItem("take", playerSource, weapons[itemUsed][2], "all") else giveWeapon(playerSource, weapons[itemUsed][1], 1, true) end setControlState(playerSource, "fire", false) setControlState(playerSource, "action", false) PlaySound3D(playerSource, "pick", 15) arma[playerSource] = itemUsed setPedAnimation(playerSource, "BUDDY", "buddy_reload", 1300, false, true, false, false, _, true) toggleControl(playerSource, "next_weapon", false) toggleControl(playerSource, "previous_weapon", false) else if arma[playerSource] == itemUsed then local ammo = getPedTotalAmmo(playerSource, weapons[itemUsed][3]) or 0 if ammo > 1 then GiveAndTakeAndGetItem("give", playerSource, weapons[itemUsed][2], ammo - 1) end PlaySound3D(playerSource, "put", 15) takeWeapon(playerSource, weapons[itemUsed][1]) arma[playerSource] = nil toggleControl(playerSource, "next_weapon", true) toggleControl(playerSource, "previous_weapon", true) else exports._infobox:addNotification(playerSource, "Ya tienes un arma en las manos", "error") end end end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "kit_reparo" or itemUsed == "gasolina" or itemUsed == "pneu" or itemUsed == "lockpick" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then exports._infobox:addNotification(playerSource, "Clic y arrastralo '"..realName[itemUsed][1].."' hacia un vehiculo proximo para usarlo.", "info") else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "algema" or itemUsed == "kitmedico" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then exports._infobox:addNotification(playerSource, "Clic y arrastralo '"..realName[itemUsed][1].."' en un jugador próximo para usarlo.", "info") else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "chaves" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then exports._infobox:addNotification(playerSource, "Clic y arrastralo a '"..realName[itemUsed][1].."' una puerta o portón proximo para abrirlo.", "info") else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "drill" or itemUsed == "dinamite" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then exports._infobox:addNotification(playerSource, "Clic y arrastralo '"..realName[itemUsed][1].."' en una puerta proxima para usarlo.", "info") else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "llavesauto" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then exports._infobox:addNotification(playerSource, "Clic y arrastralo a '"..realName[itemUsed][1].."' a tu vehiculo para abrirlo.", "info") else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "pendrive" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then exports._infobox:addNotification(playerSource, "Clic y arrastralo '"..realName[itemUsed][1].."' en un panel de control proximo para usarlo.", "info") else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "celular" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then exports._infobox:addNotification(playerSource, "Presione la tecla 'F1' Para usar '"..realName[itemUsed][1].."'", "info") else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "dado" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then local random = math.random(1, 4) if random ~= 2 then local random2 = math.random(1, 6) for i, v in pairs(getElementsByType("player")) do local x1, y1, z1 = getElementPosition(playerSource) local x2, y2, z2 = getElementPosition(v) if getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2) <= 10 then outputChatBox("[DADO]:#FFFFFF "..random2, v, 30, 144, 255, true) end end else exports._infobox:addNotification(playerSource, "Los dados cayeron lejos y usted los perdió", "error") GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "radinho" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then PlaySound3D(playerSource, "radio-toggle", 15) if not getElementData(playerSource, "Radinho") then setElementData(playerSource, "Radinho", true) else setElementData(playerSource, "Radinho", false) end end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "presente" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) local random = math.random(1, 6) for i, v in ipairs(tablePresente) do if i == random then if tablePresente[i][1] ~= 5000 and tablePresente[i][1] ~= 20000 then GiveAndTakeAndGetItem("give", playerSource, tablePresente[i][1], 1) exports._infobox:addNotification(playerSource, "Abriste un regalo VIP y ganaste un '"..realName[tablePresente[i][1]][1].."'", "success") else givePlayerMoney(playerSource, tablePresente[i][1]) exports._infobox:addNotification(playerSource, "Abriste un regalo VIP y ganaste $"..tablePresente[i][1], "money") end end end end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "capacete" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then acao[playerSource] = setTimer(function() end, 800, 1) if isElement(capacete[playerSource]) then setPedAnimation(playerSource, "goggles", "goggles_put_on", 800, false, true, false, false, _, true) setTimer(function() destroyElement(capacete[playerSource]) capacete[playerSource] = nil setElementData(playerSource, "Capacete", false) end, 800, 1) else setPedAnimation(playerSource, "goggles", "goggles_put_on", 800, false, true, false, false, _, true) setTimer(function() local x, y, z = getElementPosition(playerSource) capacete[playerSource] = createObject(1937, x, y, z) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setElementInterior(capacete[playerSource], int) setElementDimension(capacete[playerSource], dim) setElementData(playerSource, "Capacete", true) exports.bone_attach:attachElementToBone(capacete[playerSource], playerSource, 1, 0, 0.026, 0, 0, 270, 0) end, 800, 1) end end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "mochila1" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then acao[playerSource] = setTimer(function() end, 800, 1) if isElement(capacete[playerSource]) then setPedAnimation(playerSource, "goggles", "goggles_put_on", 800, false, true, false, false, _, true) setTimer(function() destroyElement(capacete[playerSource]) capacete[playerSource] = nil setElementData(playerSource, "Capacete", false) end, 800, 1) else setPedAnimation(playerSource, "goggles", "goggles_put_on", 800, false, true, false, false, _, true) setTimer(function() local x, y, z = getElementPosition(playerSource) capacete[playerSource] = createObject(1945, x, y, z) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setElementInterior(capacete[playerSource], int) setElementDimension(capacete[playerSource], dim) setElementData(playerSource, "Capacete", true) exports.bone_attach:attachElementToBone(capacete[playerSource], playerSource, 3, 0, -0.17, 0.07, 0, 0, 0) end, 800, 1) end end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "mochila2" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then acao[playerSource] = setTimer(function() end, 800, 1) if isElement(capacete[playerSource]) then setPedAnimation(playerSource, "goggles", "goggles_put_on", 800, false, true, false, false, _, true) setTimer(function() destroyElement(capacete[playerSource]) capacete[playerSource] = nil setElementData(playerSource, "mochila", false) end, 800, 1) else setPedAnimation(playerSource, "goggles", "goggles_put_on", 800, false, true, false, false, _, true) setTimer(function() local x, y, z = getElementPosition(playerSource) capacete[playerSource] = createObject(1948, x, y, z) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setElementInterior(capacete[playerSource], int) setElementDimension(capacete[playerSource], dim) setElementData(playerSource, "mochila", true) exports.bone_attach:attachElementToBone(capacete[playerSource], playerSource, 3, 0, -0.005, -0.18, 0, 0, 90) end, 800, 1) end end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "mochila3" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then acao[playerSource] = setTimer(function() end, 800, 1) if isElement(capacete[playerSource]) then setPedAnimation(playerSource, "goggles", "goggles_put_on", 800, false, true, false, false, _, true) setTimer(function() destroyElement(capacete[playerSource]) capacete[playerSource] = nil setElementData(playerSource, "mochila", false) end, 800, 1) else setPedAnimation(playerSource, "goggles", "goggles_put_on", 800, false, true, false, false, _, true) setTimer(function() local x, y, z = getElementPosition(playerSource) capacete[playerSource] = createObject(1949, x, y, z) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setElementInterior(capacete[playerSource], int) setElementDimension(capacete[playerSource], dim) setElementData(playerSource, "mochila", true) exports.bone_attach:attachElementToBone(capacete[playerSource], playerSource, 3, 0, -0.17, 0.07, 0, 0, 0) end, 800, 1) end end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "porco" or itemUsed == "criatura" or itemUsed == "capeta" or itemUsed == "caveira" or itemUsed == "macaco" or itemUsed == "cavalo" or itemUsed == "touro" or itemUsed == "sacola" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then acao[playerSource] = setTimer(function() end, 800, 1) if isElement(mascara[playerSource]) then setPedAnimation(playerSource, "goggles", "goggles_put_on", 800, false, true, false, false, _, true) setTimer(function() destroyElement(mascara[playerSource]) mascara[playerSource] = nil end, 800, 1) else setPedAnimation(playerSource, "goggles", "goggles_put_on", 800, false, true, false, false, _, true) setTimer(function() local x, y, z = getElementPosition(playerSource) mascara[playerSource] = createObject(masks[itemUsed][1], x, y, z) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setElementInterior(mascara[playerSource], int) setElementDimension(mascara[playerSource], dim) exports.bone_attach:attachElementToBone(mascara[playerSource], playerSource, 1, -0.003, 0, -0.6, 0, 0, 90) end, 800, 1) end end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "som" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(som[playerSource]) then destroyElement(som[playerSource]) som[playerSource] = nil else setPedAnimation(playerSource, "BUDDY", "buddy_reload", 500, false, true, false, false, _, true) setTimer(function() local x, y, z = getElementPosition(playerSource) som[playerSource] = createObject(2226, x, y, z) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setElementInterior(som[playerSource], int) setElementDimension(som[playerSource], dim) exports.bone_attach:attachElementToBone(som[playerSource], playerSource, 11, 0, 0, 0.4, 180, 0, 180) end, 500, 1) end end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "maleta" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(maleta[playerSource]) then destroyElement(maleta[playerSource]) maleta[playerSource] = nil else setPedAnimation(playerSource, "BUDDY", "buddy_reload", 500, false, true, false, false, _, true) setTimer(function() local x, y, z = getElementPosition(playerSource) maleta[playerSource] = createObject(1210, x, y, z) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) setElementInterior(maleta[playerSource], int) setElementDimension(maleta[playerSource], dim) exports.bone_attach:attachElementToBone(maleta[playerSource], playerSource, 11, -3.4694469519536e-18, 0.095, 0.3, -6, -184, 0) end, 500, 1) end end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "flor" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then if isElement(flor[playerSource]) then destroyElement(flor[playerSource]) flor[playerSource] = nil else setPedAnimation(playerSource, "BUDDY", "buddy_reload", 500, false, true, false, false, _, true) setTimer(function() local x, y, z = getElementPosition(playerSource) local dim = getElementDimension(playerSource) local int = getElementInterior(playerSource) flor[playerSource] = createObject(325, x, y, z) setElementInterior(flor[playerSource], int) setElementDimension(flor[playerSource], dim) exports.bone_attach:attachElementToBone(flor[playerSource], playerSource, 12, 0, 0, 0, 0, 270, 0) end, 500, 1) end end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "bandagem" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isTimer(acao[playerSource]) then acao[playerSource] = setTimer(function() end, 5000, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) setPedAnimation(playerSource, "BOMBER", "BOM_Plant_Loop", 5000, true, false, false, false, _, true) setTimer(function() local health = getElementHealth(playerSource) setElementHealth(playerSource, health + 20) setPedAnimation(playerSource, nil) end, 5000, 1) end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "cigarro" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if GiveAndTakeAndGetItem("get", playerSource, "isqueiro") >= 1 then if not isTimer(acao[playerSource]) then if not isElement(cigarro[playerSource]) then local x, y, z = getElementPosition(playerSource) local int = getElementInterior(playerSource) local dim = getElementDimension(playerSource) cigarro[playerSource] = createObject(1485, x, y, z) setElementInterior(cigarro[playerSource], int) setElementDimension(cigarro[playerSource], dim) acao[playerSource] = setTimer(function() end, 7000, 1) GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) setPedAnimation(playerSource, "GANGS", "smkcig_prtl", 7000, false, true, false, false, _, true) exports.bone_attach:attachElementToBone(cigarro[playerSource], playerSource, 12, -0.03, 0.06, 0.04, 30, -50, -24) local random = math.random(1, 10) if random == 1 then GiveAndTakeAndGetItem("take", playerSource, "isqueiro", 1) end setTimer(function() exports._infobox:addNotification(playerSource, "Presione 'X' para fumar", "info") bindKey(playerSource, "x", "down", fumarCigarro) setTimer(function() destroyElement(cigarro[playerSource]) cigarro[playerSource] = nil unbindKey(playerSource, "x", "down", fumarCigarro) end, 60000*3, 1) end, 7000, 1) else exports._infobox:addNotification(playerSource, "Ya estas fumando un cigarro", "error") end end else exports._infobox:addNotification(playerSource, "No posees 'Mechero' en tu inventario", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "adrenalina" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then GiveAndTakeAndGetItem("take", playerSource, itemUsed, 1) setPedAnimation(playerSource, "BOMBER", "BOM_Plant_Loop", 10000, true, false, false, false, _, true) setTimer(function() if isTimer(acao[playerSource]) then killTimer(acao[playerSource]) end setElementFrozen(playerSource, false) setElementHealth(playerSource, 100) setPedArmor(playerSource, 100) setPedAnimation(playerSource, nil) toggleAllControls(playerSource, true) if getElementData(playerSource, "Desmaiado") then triggerEvent("Desmaiado", root, playerSource, false) end local name = getPlayerName(playerSource) local ID1 = getElementData(playerSource, "ID") or "N/A" exports["[MOD]Logs"]:CreateLog("[INVENTARIO]\nJugador: "..name.." ["..ID1.."]\nAcción: Usó el item 'Inyección de Adrenalina'") for _, players in pairs(getElementsByType("player")) do if players ~= playerSource then local x, y, z = getElementPosition(playerSource) local x2, y2, z2 = getElementPosition(players) if getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) <= 30 then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" outputChatBox("[INFO]:#FFFFFF El jugador "..name.."#FFFFFF ("..id..") usó una '"..realName[itemUsed][1].."'", players, 30, 144, 255, true) end end end end, 10000, 1) else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "identidade" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" exports._infobox:addNotification(playerSource, "[IDENTIDAD] • Nombre: '"..name.."', Nº: '"..id.."'", "info") else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "cnha" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" local categoria = getElementData(playerSource, "CNHA") or "A" exports._infobox:addNotification(playerSource, "[LICENCIA] • Nombre: '"..name.."', Nº: '"..id.."', categoria: '"..categoria.."'", "info") else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "cnhb" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" local categoria = getElementData(playerSource, "CNHB") or "B" exports._infobox:addNotification(playerSource, "[LICENCIA] • Nombre: '"..name.."', Nº: '"..id.."', categoria: '"..categoria.."'", "info") else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "cnhc" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" local categoria = getElementData(playerSource, "CNHC") or "C" exports._infobox:addNotification(playerSource, "[LICENCIA] • Nombre: '"..name.."', Nº: '"..id.."', categoria: '"..categoria.."'", "info") else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "cnhd" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" local categoria = getElementData(playerSource, "CNHD") or "D" exports._infobox:addNotification(playerSource, "[LICENCIA] • Nombre: '"..name.."', Nº: '"..id.."', categoria: '"..categoria.."'", "info") else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "cnhaero" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" local categoria = getElementData(playerSource, "CNHE") or "E" exports._infobox:addNotification(playerSource, "[LICENCIA] • Nombre: '"..name.."', Nº: '"..id.."', categoria: '"..categoria.."'", "info") else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "porte" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" exports._infobox:addNotification(playerSource, "[PORTE DE ARMA] • Nombre: '"..name.."', Nº: '"..id.."', situación: 'Válido'", "info") else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end elseif itemUsed == "distintivo" then if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" exports._infobox:addNotification(playerSource, "[Placa Policial] • Nombre: '"..name.."', Nº: '"..id.."', situación: 'Válido'", "info") else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemUsed][1].."' en tu inventario", "error") end end end addEvent("Use", true) addEventHandler("Use", resourceRoot, use) ----------------------------------------------------------------------------------------------------------------------------------------- function trade(tipo, arg2, arg3, arg4) if tipo == "make" then --tipo, source, player, tabela setElementData(arg3, "Trading", arg4) exports._infobox:addNotification(arg3, "Recibiste una propuesta de venta, abre el inventario para Aceptar o Rechazar", "info") triggerClientEvent(arg3, "refreshTrading", resourceRoot) elseif tipo == "accept" then --tipo, source, tabela removeElementData(arg2, "Trading") if GiveAndTakeAndGetItem("get", arg3[1][1], arg3[2][1]) >= arg3[3][1] then if arg3[4][1] > 0 then if getPlayerMoney(arg2) >= arg3[4][1] then if GiveAndTakeAndGetItem("give", arg2, arg3[2][1], arg3[3][1]) then if GiveAndTakeAndGetItem("take", arg3[1][1], arg3[2][1], arg3[3][1]) then takePlayerMoney(arg2, arg3[4][1]) givePlayerMoney(arg3[1][1], arg3[4][1]) exports._infobox:addNotification(arg2, "Aceptaste el comercio y pagaste $"..arg3[4][1], "money") exports._infobox:addNotification(arg3[1][1], "El jugador aceptó comerciar contigo e Recibiste $"..arg3[4][1], "money") local name = getPlayerName(arg2) local ID1 = getElementData(arg2, "ID") or "N/A" local name2 = getPlayerName(arg3[1][1]) local ID2 = getElementData(arg3[1][1], "ID") or "N/A" exports["[MOD]Logs"]:CreateLog("[INVENTARIO]\nVendedor: "..name2.." ["..ID2.."]\nComprador: "..name.." ["..ID1.."]\nItem: "..arg3[2][1].."\nCantidad: "..arg3[3][1].."\nValor: $"..arg3[4][1]) else exports._infobox:addNotification(arg2, "El jugador no posee el item en su mochila", "error") exports._infobox:addNotification(arg3[1][1], "No tienes el item en tu mochila", "error") end else exports._infobox:addNotification(arg2, "No tienes espacio en la mochila", "error") exports._infobox:addNotification(arg3[1][1], "El comprador no tiene espacio en la mochila", "error") end else exports._infobox:addNotification(arg2, "No tienes dinero suficiente", "error") exports._infobox:addNotification(arg3[1][1], "El comprador no tiene dinero suficiente", "error") end else if GiveAndTakeAndGetItem("give", arg2, arg3[2][1], arg3[3][1]) then if GiveAndTakeAndGetItem("take", arg3[1][1], arg3[2][1], arg3[3][1]) then exports._infobox:addNotification(arg2, "Aceptaste comerciar con el jugador", "success") exports._infobox:addNotification(arg3[1][1], "El jugador aceptó comerciar contigo", "success") local name = getPlayerName(arg2) local ID1 = getElementData(arg2, "ID") or "N/A" local name2 = getPlayerName(arg3[1][1]) local ID2 = getElementData(arg3[1][1], "ID") or "N/A" exports["[MOD]Logs"]:CreateLog("[INVENTARIO]\nVendedor: "..name2.." ["..ID2.."]\nComprador: "..name.." ["..ID1.."]\nItem: "..arg3[2][1].."\nCantidad: "..arg3[3][1].."\nValor: $0") else exports._infobox:addNotification(arg2, "El jugador no posee el item en su mochila", "error") exports._infobox:addNotification(arg3[1][1], "No tienes el item en tu mochila", "error") end else exports._infobox:addNotification(arg2, "No tienes espacio en la mochila", "error") exports._infobox:addNotification(arg3[1][1], "El comprador no tiene espacio en la mochila", "error") end end else exports._infobox:addNotification(arg2, "El jugador no posee el item en su mochila", "error") exports._infobox:addNotification(arg3[1][1], "No tienes el item en tu mochila", "error") end elseif tipo == "decline" then --tipo, source, tabela removeElementData(arg2, "Trading") exports._infobox:addNotification(arg2, "Rechazaste comerciar con el jugador", "success") exports._infobox:addNotification(arg3[1][1], "El comprador rechazó comerciar contigo", "error") elseif tipo == "distance" then --tipo, source, tabela removeElementData(arg2, "Trading") exports._infobox:addNotification(arg2, "No se puede aceptar comerciar por que estas lejos del vendedor", "error") exports._infobox:addNotification(arg3[1][1], "No se puede aceptar comerciar por que estas lejos del comprador", "error") end end addEvent("Trade", true) addEventHandler("Trade", resourceRoot, trade) ----------------------------------------------------------------------------------------------------------------------------------------- function action(playerSource, clickedWorld, itemActioned) if itemActioned == "chaves" and getElementType(clickedWorld) == "object" then if GiveAndTakeAndGetItem("get", playerSource, itemActioned) >= 1 then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 10 then for i, v in pairs(gates) do if v == clickedWorld then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup(GatePositions[i][1])) then if GatePositions[i][10] == "closed" then moveObject(clickedWorld, GatePositions[i][9], GatePositions[i][6], GatePositions[i][7], GatePositions[i][8]) GatePositions[i][10] = "opened" tempo[clickedWorld] = setTimer(function() moveObject(clickedWorld, GatePositions[i][9], GatePositions[i][3], GatePositions[i][4], GatePositions[i][5]) GatePositions[i][10] = "closed" end, 10000, 1) elseif GatePositions[i][10] == "opened" then moveObject(clickedWorld, GatePositions[i][9], GatePositions[i][3], GatePositions[i][4], GatePositions[i][5]) GatePositions[i][10] = "closed" if isTimer(tempo[clickedWorld]) then killTimer(tempo[clickedWorld]) end end else exports._infobox:addNotification(playerSource, "No tienes llaves de ese portón (No tienes permisos)", "error") end end end else exports._infobox:addNotification(playerSource, "Estas muy lejos del protón", "error") end end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end elseif itemActioned == "kit_reparo" and getElementType(clickedWorld) == "vehicle" then if GiveAndTakeAndGetItem("get", playerSource, itemActioned) >= 1 then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 3 then local counter = 0 for seat, player in pairs(getVehicleOccupants(clickedWorld)) do counter = counter + 1 end if counter < 1 then if not getElementData(clickedWorld, "Engine") then if getElementHealth(clickedWorld) < 1000 then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("Mecanico")) then acao[playerSource] = setTimer(function() end, 14000, 1) if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end local x, y, z = getElementPosition(playerSource) item[playerSource] = createObject(1938, x, y, z - 0.65, 0, 90, 0) setElementCollisionsEnabled(item[playerSource], false) PlaySound3D(playerSource, "repair", "all") GiveAndTakeAndGetItem("take", playerSource, itemActioned, 1) triggerClientEvent(playerSource, "progressBar", playerSource, 14000) setElementFrozen(playerSource, true) setElementFrozen(clickedWorld, true) local _, _, rot = getElementRotation(playerSource) setElementRotation(playerSource, _, _, rot + 180) setPedAnimation(playerSource, "CAR", "fixn_car_loop", 14000, true, false, false, false, _, true) setTimer(function() destroyElement(item[playerSource]) item[playerSource] = nil fixVehicle(clickedWorld) setVehicleDamageProof(clickedWorld, false) setElementFrozen(clickedWorld, false) setElementFrozen(playerSource, false) local exp = math.random(expRepair1, expRepair2) if getElementData(playerSource, "VIP") then local xp = (exp + (exp/4)) triggerEvent("GiveExp", playerSource, playerSource, xp) else triggerEvent("GiveExp", playerSource, playerSource, exp) end exports._infobox:addNotification(playerSource, "Reparaste el Automovil ", "success") end, 14000, 1) end else exports._infobox:addNotification(playerSource, "El vehiculo no tiene ningun daño para ser reparado", "error") end else exports._infobox:addNotification(playerSource, "El vehiculo necesita estar apagado para ser reparado", "error") end else exports._infobox:addNotification(playerSource, "No debe haber nadie en el vehiculo para poder ser reparado", "error") end else exports._infobox:addNotification(playerSource, "Estas muy lejos del vehiculo", "error") end end else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para usar '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end -------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------- elseif itemActioned == "llavesauto" and getElementType(clickedWorld) == "vehicle" then if GiveAndTakeAndGetItem("get", playerSource, itemActioned) >= 1 then if not isPedInVehicle(playerSource) then local veiculo = getElementData(playerSource, "Vehicle:Owner") if veiculo then if getElementData(veiculo, "Player:Owner") == source then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 10 then if not getElementData(clickedWorld, "engine") then local trancar = getElementData(clickedWorld, "Vehicle:Owner") outputChatBox(" ", source) outputChatBox("• Veículo destrancado", source) for i, players in ipairs(getElementsByType("player")) do local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 35 then triggerClientEvent(players, "lockBikeSound", players, veiculo) setVehicleOverrideLights(veiculo, 2) setTimer(setVehicleOverrideLights, 300, 1, veiculo, 1) end end end end else setElementData(veiculo, "Locked", true) outputChatBox(" ", source) outputChatBox("• Veículo trancado", source) for i, players in ipairs(getElementsByType("player")) do local x, y, z = getElementPosition(players) local ex, ey, ez = getElementPosition(veiculo) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 35 then triggerClientEvent(players, "lockBikeSound", players, veiculo) setTimer(triggerClientEvent, 600, 1, players, "lockBikeSound", players, veiculo) setVehicleOverrideLights(veiculo, 2) setTimer(setVehicleOverrideLights, 300, 1, veiculo, 1) setTimer(setVehicleOverrideLights, 600, 1, veiculo, 2) setTimer(setVehicleOverrideLights, 900, 1, veiculo, 1) end end end else exports._infobox:addNotification(source, "No posees las llaves de ningun vehiculo", "error") end else exports._infobox:addNotification(source, "No posees las llaves de ningun vehiculo", "error") end end end -------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------- elseif itemActioned == "pneu" and getElementType(clickedWorld) == "vehicle" then if GiveAndTakeAndGetItem("get", playerSource, itemActioned) >= 1 then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 3 then local counter = 0 for seat, player in pairs(getVehicleOccupants(clickedWorld)) do counter = counter + 1 end if counter < 1 then if not getElementData(clickedWorld, "Engine") then local r1, r2, r3, r4 = getVehicleWheelStates(clickedWorld) if r1 ~= 0 or r2 ~= 0 or r3 ~= 0 or r4 ~= 0 then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("Mecanico")) then acao[playerSource] = setTimer(function() end, 14000, 1) if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end local x, y, z = getElementPosition(playerSource) item[playerSource] = createObject(1025, x, y, z - 0.85, 0, 90, 0) setObjectScale(item[playerSource], 0.8) setElementCollisionsEnabled(item[playerSource], false) PlaySound3D(playerSource, "repair", 100) GiveAndTakeAndGetItem("take", playerSource, itemActioned, 1) triggerClientEvent(playerSource, "progressBar", playerSource, 14000) setElementFrozen(playerSource, true) setElementFrozen(clickedWorld, true) local _, _, rot = getElementRotation(playerSource) setElementRotation(playerSource, _, _, rot + 180) setPedAnimation(playerSource, "CAR", "fixn_car_loop", 14000, true, false, false, false, _, true) setTimer(function() destroyElement(item[playerSource]) item[playerSource] = nil setVehicleWheelStates(clickedWorld, 0, 0, 0, 0) setElementFrozen(clickedWorld, false) setElementFrozen(playerSource, false) local exp = math.random(expPneu1, expPneu2) if getElementData(playerSource, "VIP") then local xp = (exp + (exp/4)) triggerEvent("GiveExp", playerSource, playerSource, xp) else triggerEvent("GiveExp", playerSource, playerSource, exp) end exports._infobox:addNotification(playerSource, "Cambiaste las llantas del vehiculo", "success") end, 14000, 1) end else exports._infobox:addNotification(playerSource, "El vehiculo no presenta ninguna llanta desinflada", "error") end else exports._infobox:addNotification(playerSource, "El vehiculo necesita estar apagado para poder cambiar la llanta", "error") end else exports._infobox:addNotification(playerSource, "El vehiculo necesita estar vacio para poder cambiar la llanta", "error") end else exports._infobox:addNotification(playerSource, "Estas muy lejos del vehiculo", "error") end end else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para usar '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end elseif itemActioned == "gasolina" and getElementType(clickedWorld) == "vehicle" then if GiveAndTakeAndGetItem("get", playerSource, itemActioned) >= 1 then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 3 then local counter = 0 for seat, player in pairs(getVehicleOccupants(clickedWorld)) do counter = counter + 1 end if counter < 1 then if not getElementData(clickedWorld, "Engine") then local gas = getElementData(clickedWorld, "Gasolina") or 0 if gas < 100 then acao[playerSource] = setTimer(function() end, 15000, 1) if isElement(item[playerSource]) then destroyElement(item[playerSource]) item[playerSource] = nil end local x, y, z = getElementPosition(playerSource) item[playerSource] = createObject(1650, x, y, z) GiveAndTakeAndGetItem("take", playerSource, itemActioned, 1) triggerClientEvent(playerSource, "progressBar", playerSource, 15000) setElementFrozen(playerSource, true) setElementFrozen(clickedWorld, true) setPedAnimation(playerSource, "CASINO", "Slot_Plyr", -1, true, false, false, false) setTimer(setPedAnimationSpeed, 700, 1, playerSource, "Slot_Plyr", 0) exports.bone_attach:attachElementToBone(item[playerSource], playerSource, 12, -0.01, 0.15, 0.05, -48, 62, 140) setTimer(function() setPedAnimation(playerSource, nil) destroyElement(item[playerSource]) item[playerSource] = nil setElementData(clickedWorld, "Gasolina", 100) setElementFrozen(clickedWorld, false) setElementFrozen(playerSource, false) exports._infobox:addNotification(playerSource, "Llenaste el tanque del vehiculo", "success") end, 15000, 1) else exports._infobox:addNotification(playerSource, "El vehiculo ya tiene el tanque lleno", "error") end else exports._infobox:addNotification(playerSource, "El vehiculo requiere estar apagado para poder llenarlo", "error") end else exports._infobox:addNotification(playerSource, "El vehiculo requiere estar sin pasajeros para poder llenarlo", "error") end else exports._infobox:addNotification(playerSource, "Estas muy lejos del vehiculo", "error") end end else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para usar '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end elseif itemActioned == "algema" and getElementType(clickedWorld) == "player" then if GiveAndTakeAndGetItem("get", playerSource, itemActioned) >= 1 then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 1.5 then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup(ACL_PM)) then if not algemado[clickedWorld] then if isElement(item[clickedWorld]) then destroyElement(item[clickedWorld]) item[clickedWorld] = nil end local x, y, z = getElementPosition(clickedWorld) item[clickedWorld] = createObject(331, x, y, z) setObjectScale(item[clickedWorld], 1.2) acao[clickedWorld] = setTimer(function() end, 60000*30, 1) GiveAndTakeAndGetItem("take", playerSource, itemActioned, 1) GiveAndTakeAndGetItem("give", playerSource, "chaves", 1) setPedAnimation(playerSource, "CASINO", "dealone", 1000, true, false, false, false, _, true) setPedAnimation(clickedWorld, "GANGS","prtial_gngtlkA", 1, false, false, false, true, _, true) setTimer(function() setPedAnimationSpeed(clickedWorld, "prtial_gngtlkA", 0) setTimer(function() setPedAnimationProgress(clickedWorld, "prtial_gngtlkA", 0.2) end, 500, 1) end, 800, 1) toggleControl(clickedWorld, "sprint", false) toggleControl(clickedWorld, "walk", false) toggleControl(clickedWorld, "jump", false) toggleControl(clickedWorld, "fire", false) toggleControl(clickedWorld, "action", false) toggleControl(clickedWorld, "crouch", false) toggleControl(clickedWorld, "aim_weapon", false) toggleControl(clickedWorld, "enter_exit", false) setControlState(clickedWorld, "walk", true) algemado[clickedWorld] = playerSource algemando[playerSource] = clickedWorld exports._infobox:addNotification(playerSource, "Esposaste a un supuesto criminal. Usa tus llaves para soltarlo nuevamente", "success") exports._infobox:addNotification(clickedWorld, "Você foi algemado pelo policial "..getPlayerName(playerSource), "warning") exports.bone_attach:attachElementToBone(item[clickedWorld], clickedWorld, 12, 0.09, 0.03, 0.14, -30, 126, -86) timerAlgema[clickedWorld] = setTimer(function() setPedAnimation(clickedWorld, "GANGS","prtial_gngtlkA", 1, false, false, false, true, _, true) setPedAnimationSpeed(clickedWorld, "prtial_gngtlkA", 0) setPedAnimationProgress(clickedWorld, "prtial_gngtlkA", 0.2) end, 500, 0) else exports._infobox:addNotification(playerSource, "Si objetivo ya esta esposado", "error") end end else exports._infobox:addNotification(playerSource, "Estas muy lejos de tu objetivo", "error") end end else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para usar a '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end elseif itemActioned == "chaves" and getElementType(clickedWorld) == "player" then if GiveAndTakeAndGetItem("get", playerSource, itemActioned) >= 1 then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 1.5 then if algemado[clickedWorld] then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup(ACL_PM)) then if isElement(item[clickedWorld]) then destroyElement(item[clickedWorld]) item[clickedWorld] = nil end if isTimer(acao[clickedWorld]) then killTimer(acao[clickedWorld]) end if isTimer(timerAlgema[clickedWorld]) then killTimer(timerAlgema[clickedWorld]) timerAlgema[clickedWorld] = nil end GiveAndTakeAndGetItem("take", playerSource, itemActioned, 1) GiveAndTakeAndGetItem("give", playerSource, "algema", 1) setPedAnimation(clickedWorld, "CASINO", "dealone", -1, false) setTimer(setPedAnimation, 50, 1, clickedWorld, nil) toggleAllControls(clickedWorld, true) setControlState(clickedWorld, "walk", false) exports._infobox:addNotification(playerSource, "Le quitaste las esposas a el criminal", "success") exports._infobox:addNotification(clickedWorld, "El policia "..getPlayerName(playerSource).."#FFFFFF te quitó las esposas", "info") local pm = algemado[clickedWorld] algemando[pm] = nil algemado[clickedWorld] = nil end end end end else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para usar as '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end elseif itemActioned == "kitmedico" and getElementType(clickedWorld) == "player" then if GiveAndTakeAndGetItem("get", playerSource, itemActioned) >= 1 then if not isPedInVehicle(playerSource) and not isPedInVehicle(clickedWorld) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 1.5 then if getElementData(clickedWorld, "Desmaiado") then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("Medico")) then acao[playerSource] = setTimer(function() end, 20000, 1) setElementFrozen(playerSource, true) GiveAndTakeAndGetItem("take", playerSource, itemActioned, 1) setPedAnimation(playerSource, "MEDIC", "CPR", 20000, true, false, false, false, _, true) triggerClientEvent(playerSource, "progressBar", playerSource, 20000) setTimer(function() triggerEvent("Desmaiado", root, clickedWorld, false) setElementFrozen(playerSource, false) if isTimer(acao[clickedWorld]) then killTimer(acao[clickedWorld]) end exports._infobox:addNotification(playerSource, "Has reanimado a un Ciudadano "..getPlayerName(clickedWorld), "success") exports._infobox:addNotification(clickedWorld, "Fuiste reanimado (RSP) por un paramedico", "info") local name = getPlayerName(playerSource) local ID1 = getElementData(playerSource, "ID") or "N/A" local name2 = getPlayerName(clickedWorld) local ID2 = getElementData(clickedWorld, "ID") or "N/A" exports["[MOD]Logs"]:CreateLog("[INVENTARIO]\nEMERGENCIAS: "..name.." ["..ID1.."]\nPaciente: "..name2.." ["..ID2.."]") if curado[playerSource] ~= clickedWorld then local money = math.random(moneySamu1, moneySamu2) givePlayerMoney(playerSource, money) exports._infobox:addNotification(playerSource, "Recibiste "..money.." pesos", "money") local exp = math.random(expSamu1, expSamu2) if getElementData(playerSource, "VIP") then local xp = (exp + (exp/4)) triggerEvent("GiveExp", playerSource, playerSource, xp) else triggerEvent("GiveExp", playerSource, playerSource, exp) end end curado[playerSource] = clickedWorld end, 20000, 1) end else exports._infobox:addNotification(playerSource, "Este ciudadano no requiere ser auxiliado", "error") end else exports._infobox:addNotification(playerSource, "Estas muy lejos del ciudadano indicado", "error") end end else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para usar '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end elseif itemActioned == "lockpick" and getElementType(clickedWorld) == "vehicle" then if GiveAndTakeAndGetItem("get", playerSource, itemActioned) >= 1 then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 2.5 then local counter = 0 for seat, player in pairs(getVehicleOccupants(clickedWorld)) do counter = counter + 1 end if counter < 1 then if getElementData(clickedWorld, "Locked") then acao[playerSource] = setTimer(function() end, 90000, 1) GiveAndTakeAndGetItem("take", playerSource, itemActioned, 1) PlaySound3D(playerSource, "vehicle-alarm", "all") setElementFrozen(playerSource, true) setElementFrozen(clickedWorld, true) setPedAnimation(playerSource, "CAMERA", "piccrch_take", 90000, true, false, false, false, _, true) triggerClientEvent(playerSource, "progressBar", playerSource, 90000) blip[clickedWorld] = createBlipAttachedTo(clickedWorld, 36) setElementVisibleTo(blip[clickedWorld], root, false) for _, players in pairs(getElementsByType("player")) do if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(players)), aclGetGroup(ACL_PM)) then exports._infobox:addNotification(players, "[ESTACIÓN]: Reporte de robo de vehículo en curso, el lugar de ocurrencia fue indicado en su GPS", "warning") setElementVisibleTo(blip[clickedWorld], players, true) end end setTimer(function() setPedAnimation(playerSource, nil) setElementFrozen(playerSource, false) setElementFrozen(clickedWorld, false) destroyElement(blip[clickedWorld]) blip[clickedWorld] = nil local random = math.random(1, 2) if random == 1 then setElementData(clickedWorld, "Locked", false) setVehicleLocked(clickedWorld, false) exports._infobox:addNotification(playerSource, "¿Conseguiste forzar el vehículo", "success") local name = getPlayerName(playerSource) local ID1 = getElementData(playerSource, "ID") or "N/A" local model = getElementModel(clickedWorld) exports["[MOD]Logs"]:CreateLog("[INVENTARIO]\nCriminal: "..name.." ["..ID1.."]\nVehiculo: "..model) else exports._infobox:addNotification(playerSource, "No conseguiste forzar el vehiculo", "error") end end, 90000, 1) else exports._infobox:addNotification(playerSource, "Este vehiculo ya esta desbloqueado", "error") end else exports._infobox:addNotification(playerSource, "El vehiculo requiere estar vacio para poder ser forzado", "error") end else exports._infobox:addNotification(playerSource, "Estas muy lejos del vehiculo", "error") end end else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para usar '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end elseif itemActioned == "porte" and getElementType(clickedWorld) == "player" then if GiveAndTakeAndGetItem("get", playerSource, itemActioned) >= 1 then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 1.5 then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" exports._infobox:addNotification(clickedWorld, "[PORTE DE ARMA] • Nombre: '"..name.."', Nº: '"..id.."', situación: 'Válido'", "info") exports._infobox:addNotification(playerSource, "Mostraste '"..realName[itemActioned][1].."' para "..getPlayerName(clickedWorld), "success") end end else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para mostar su '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end elseif itemActioned == "cnha" and getElementType(clickedWorld) == "player" then if GiveAndTakeAndGetItem("get", playerSource, itemActioned) >= 1 then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 1.5 then if getElementData(playerSource, "license:moto") then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" local categoria = getElementData(playerSource, "CNHA") or "A" exports._infobox:addNotification(clickedWorld, "[Licencia] • Nombre: '"..name.."', Nº: '"..id.."', categoria: '"..categoria.."'", "info") exports._infobox:addNotification(playerSource, "Mostraste '"..realName[itemActioned][1].."' para "..getPlayerName(clickedWorld), "success") end end end else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para mostar su '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end elseif itemActioned == "cnhb" and getElementType(clickedWorld) == "player" then if GiveAndTakeAndGetItem("get", playerSource, itemActioned) >= 1 then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 1.5 then if getElementData(playerSource, "license:auto") then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" local categoria = getElementData(playerSource, "CNHB") or "B" exports._infobox:addNotification(clickedWorld, "[Licencia] • Nombre: '"..name.."', Nº: '"..id.."', categoria: '"..categoria.."'", "info") exports._infobox:addNotification(playerSource, "Mostraste '"..realName[itemActioned][1].."' para "..getPlayerName(clickedWorld), "success") end end end else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para mostar su '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end elseif itemUsed == "cnhc" and getElementType(clickedWorld) == "player" then if not clickedWorld then exports._infobox:addNotification(playerSource, "inventario", "error", "Não tem niguem priximo a você", 5) return end if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 1.5 then if getElementData(playerSource, "license:gruz") then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" local categoria = getElementData(playerSource, "CNHC") or "C" exports._infobox:addNotification(clickedWorld, "[Licencia] • Nombre: '"..name.."', Nº: '"..id.."', categoria: '"..categoria.."'", "info") exports._infobox:addNotification(playerSource, "Mostraste '"..realName[itemActioned][1].."' para "..getPlayerName(clickedWorld), "success") end end end else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para mostar su '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end elseif itemUsed == "cnhd" and getElementType(clickedWorld) == "player" then if not clickedWorld then exports._infobox:addNotification(playerSource, "inventario", "error", "Não tem niguem priximo a você", 5) return end if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 1.5 then if getElementData(playerSource, "license:pass") then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" local categoria = getElementData(playerSource, "CNHD") or "D" exports._infobox:addNotification(clickedWorld, "[Licencia] • Nombre: '"..name.."', Nº: '"..id.."', categoria: '"..categoria.."'", "info") exports._infobox:addNotification(playerSource, "Mostraste '"..realName[itemActioned][1].."' para "..getPlayerName(clickedWorld), "success") end end end else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para mostar su '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end elseif itemUsed == "cnhaero" and getElementType(clickedWorld) == "player" then if not clickedWorld then exports._infobox:addNotification(playerSource, "inventario", "error", "Não tem niguem priximo a você", 5) return end if GiveAndTakeAndGetItem("get", playerSource, itemUsed) >= 1 then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 1.5 then if getElementData(playerSource, "license:air") then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" local categoria = getElementData(playerSource, "CNHE") or "E" exports._infobox:addNotification(clickedWorld, "[Licencia] • Nombre: '"..name.."', Nº: '"..id.."', categoria: '"..categoria.."'", "info") exports._infobox:addNotification(playerSource, "Mostraste '"..realName[itemActioned][1].."' para "..getPlayerName(clickedWorld), "success") end end end else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para mostar su '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end ------------------------------------------------------------------------------------------------------------- elseif itemActioned == "identidade" and getElementType(clickedWorld) == "player" then --Comienza if GiveAndTakeAndGetItem("get", playerSource, itemActioned) >= 1 then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 1.5 then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" local wanted = getPlayerWantedLevel(playerSource) exports._infobox:addNotification(clickedWorld, "[IDENTIDAD] • Nombre: '"..name.."', Nº: '"..id.."', Antecedentes Penales: '"..wanted.."'", "info") exports._infobox:addNotification(playerSource, "Mostraste '"..realName[itemActioned][1].."' para "..getPlayerName(clickedWorld), "success") end end --Termina else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para mostar su '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end elseif itemActioned == "distintivo" and getElementType(clickedWorld) == "player" then if GiveAndTakeAndGetItem("get", playerSource, itemActioned) >= 1 then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 1.5 then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" exports._infobox:addNotification(clickedWorld, "[Placa Policial] • Nombre: '"..name.."', Nº: '"..id.."', situación: 'Válido'", "info") exports._infobox:addNotification(playerSource, "Mostraste '"..realName[itemActioned][1].."' para "..getPlayerName(clickedWorld), "success") end end else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para mostar su '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end -- ----------------------------------------------------------------------- elseif itemActioned == "dinamite" and getElementType(clickedWorld) == "object" then if GiveAndTakeAndGetItem("get", playerSource, itemActioned) >= 1 then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 1.5 then if getElementData(clickedWorld, "Bank:Gate1") then triggerEvent("Banco:Iniciar", root, playerSource) end end end else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para usar '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end elseif itemActioned == "pendrive" and getElementType(clickedWorld) == "object" then if GiveAndTakeAndGetItem("get", playerSource, itemActioned) >= 1 then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 1.5 then if getElementData(clickedWorld, "Bank:Pass") then triggerEvent("Banco:Hackear", root, playerSource) end end end else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para usar '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end elseif itemActioned == "drill" and getElementType(clickedWorld) == "object" then if GiveAndTakeAndGetItem("get", playerSource, itemActioned) >= 1 then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(clickedWorld) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 1.5 then if getElementData(clickedWorld, "Bank:Gate3") then triggerEvent("Banco:Furadeira", root, playerSource) end end end else exports._infobox:addNotification(playerSource, "Necesitas estar fuera del vehiculo para usar '"..realName[itemActioned][1].."'", "error") end else exports._infobox:addNotification(playerSource, "No posees '"..realName[itemActioned][1].."' en tu inventario", "error") end end end addEvent("Action", true) addEventHandler("Action", resourceRoot, action) ----------------------------------------------------------------------------------------------------------------------------------------- function trash(playerSource, item, qntd) if GiveAndTakeAndGetItem("get", playerSource, item) >= qntd then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then acao[playerSource] = setTimer(function() end, 1300, 1) setPedAnimation(playerSource, "POLICE", "CopTraf_Away", 1300, true, false, false, false, _, true) setTimer(function() PlaySound3D(playerSource, "trash", 20) GiveAndTakeAndGetItem("take", playerSource, item, qntd) exports._infobox:addNotification(playerSource, "Has desechado "..qntd.."x '"..realName[item][1].."'", "success") local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" exports["[MOD]Logs"]:CreateLog("[INVENTARIO]\nJugador: "..name.." ["..id.."]\nItem: "..item.."\nCantidad: "..qntd.."\nAcción: Desechó basura") for _, players in pairs(getElementsByType("player")) do if players ~= playerSource then local x, y, z = getElementPosition(playerSource) local x2, y2, z2 = getElementPosition(players) if getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) <= 30 then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" outputChatBox("[INFO]:#FFFFFF El jugador #FFFF00"..name.."#FFFFFF ("..id..") Desechó "..qntd.."x '"..realName[item][1].."' en una papelera cercana a usted.", players, 30, 144, 255, true) end end end end, 1300, 1) end end else exports._infobox:addNotification(playerSource, "No posees la cantidad indicada de este item", "error") end end addEvent("Trash", true) addEventHandler("Trash", resourceRoot, trash) ----------------------------------------------------------------------------------------------------------------------------------------- function box(estado, playerSource, gang, item, qntd) if estado == "guardar" then for i, v in pairs(BoxPositions) do if BoxPositions[i][1] == gang then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup(BoxPositions[i][2])) then if GiveAndTakeAndGetItem("get", playerSource, item) >= qntd then if not isPedInVehicle(playerSource) then if not isTimer(acao[playerSource]) then acao[playerSource] = setTimer(function() end, 1300, 1) setPedAnimation(playerSource, "POLICE", "CopTraf_Away", 1300, true, false, false, false, _, true) setTimer(function() PlaySound3D(playerSource, "trash", 20) GiveAndTakeAndGetItem("take", playerSource, item, qntd) exports._infobox:addNotification(playerSource, "Guardaste "..qntd.."x '"..realName[item][1].."'", "success") local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" exports["[MOD]Logs"]:CreateLog("[INVENTARIO]\nJugador: "..name.." ["..id.."]\nItem: "..item.."\nCantidad: "..qntd.."\nBaul: "..gang.."\nAcción: "..estado) for _, players in pairs(getElementsByType("player")) do if players ~= playerSource then local x, y, z = getElementPosition(playerSource) local x2, y2, z2 = getElementPosition(players) if getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) <= 30 then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" outputChatBox("[INFO]:#FFFFFF El jugador #FFFF00"..name.."#FFFFFF ("..id..") guardo "..qntd.."x '"..realName[item][1].."' cercano a usted.", players, 30, 144, 255, true) end end end if bau[gang][item] then bau[gang][item][1] = bau[gang][item][1] + tonumber(qntd) else bau[gang][item] = {} bau[gang][item][1] = tonumber(qntd) end end, 1300, 1) end end else exports._infobox:addNotification(playerSource, "No posees la cantidad indicada de este item", "error") end end end end elseif estado == "pegar" then for i, v in pairs(BoxPositions) do if BoxPositions[i][1] == gang then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup(BoxPositions[i][2])) then if bau[gang][item] then if bau[gang][item][1] >= qntd then if GiveAndTakeAndGetItem("give", playerSource, item, qntd) then bau[gang][item][1] = bau[gang][item][1] - qntd if bau[gang][item][1] <= 0 then bau[gang][item] = nil end exports._infobox:addNotification(playerSource, "Colocaste "..qntd.."x '"..realName[item][1].."'", "success") local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" exports["[MOD]Logs"]:CreateLog("[INVENTARIO]\nJugador: "..name.." ["..id.."]\nItem: "..item.."\nCantidad: "..qntd.."\nBaul: "..gang.."\nAcción: "..estado) for _, players in pairs(getElementsByType("player")) do if players ~= playerSource then local x, y, z = getElementPosition(playerSource) local x2, y2, z2 = getElementPosition(players) if getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) <= 30 then local name = getPlayerName(playerSource) local id = getElementData(playerSource, "ID") or "N/A" outputChatBox("[INFO]:#FFFFFF El jugador #FFFF00"..name.."#FFFFFF ("..id..") puso "..qntd.."x '"..realName[item][1].."' en un baul cercano a ti.", players, 30, 144, 255, true) end end end else exports._infobox:addNotification(playerSource, "No tienes capacidad en la mochila para sacar este item", "error") end else exports._infobox:addNotification(playerSource, "El baul no posee la cantidad indicada de este item", "error") end else exports._infobox:addNotification(playerSource, "El baul no posee este item", "error") end end end end end end addEvent("Box", true) addEventHandler("Box", resourceRoot, box) ----------------------------------------------------------------------------------------------------------------------------------------- function click(button, state, playerSource) if button == "left" and state == "down" then if getElementType(source) == "object" then if getElementModel(source) == 1227 then for i, v in pairs(boxes) do if v == source then local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(source) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= 1.5 then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup(BoxPositions[i][2])) then local gangBox = BoxPositions[i][1] triggerClientEvent(playerSource, "RenderBox", resourceRoot, bau[gangBox], gangBox) end end end end end end end end addEventHandler("onElementClicked", root, click) ----------------------------------------------------------------------------------------------------------------------------------------- function fumarCigarro(source) if isElement(cigarro[source]) then if not isTimer(acao[source]) then acao[source] = setTimer(function() end, 7000, 1) setPedAnimation(source, "GANGS", "smkcig_prtl", 7000, false, true, false, false, _, true) end end end ----------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------- function onLogin(_, account) if not isGuestAccount(account) then timerStart[source] = setTimer(function(source) inventario[source] = {} if getAccountData(account, "Inventario") then local itens = fromJSON(getAccountData(account, "Inventario")) for index, value in pairs(itens) do if realName[itens[index][1]] then table.insert(inventario[source], value) end end end triggerClientEvent(source, "refresh", resourceRoot, inventario[source]) end, 10000, 1, source) end end addEventHandler("onPlayerLogin", root, onLogin) ----------------------------------------------------------------------------------------------------------------------------------------- function onQuit() local account = getPlayerAccount(source) if not isGuestAccount(account) then if not isTimer(timerStart[source]) then local itens = toJSON(inventario[source]) setAccountData(account, "Inventario", itens) takeAllWeapons(source) acao[source] = nil arma[source] = nil algemado[source] = nil algemando[source] = nil curado[source] = nil inventario[source] = nil if isTimer(timerAlgema[source]) then killTimer(timerAlgema[source]) timerAlgema[source] = nil end if isElement(item[source]) then destroyElement(item[source]) item[source] = nil end if isElement(capacete[source]) then destroyElement(capacete[source]) capacete[source] = nil setElementData(source, "Capacete", false) end if isElement(mascara[source]) then destroyElement(mascara[source]) mascara[source] = nil end if isElement(maleta[source]) then destroyElement(maleta[source]) maleta[source] = nil end if isElement(som[source]) then destroyElement(som[source]) som[source] = nil end if isElement(flor[source]) then destroyElement(flor[source]) flor[source] = nil end if isElement(cigarro[source]) then destroyElement(cigarro[source]) cigarro[source] = nil end if isElement(item[source]) then destroyElement(item[source]) item[source] = nil end if isElement(item[source]) then destroyElement(item[source]) item[source] = nil end if isElement(item[source]) then destroyElement(item[source]) item[source] = nil end end end end addEventHandler("onPlayerQuit", root, onQuit) ----------------------------------------------------------------------------------------------------------------------------------------- function onStart() for i, players in pairs(getElementsByType("player")) do timerStart[players] = setTimer(function() local account = getPlayerAccount(players) if not isGuestAccount(account) then inventario[players] = {} if getAccountData(account, "Inventario") then local itens = fromJSON(getAccountData(account, "Inventario")) for index, value in pairs(itens) do if realName[itens[index][1]] then table.insert(inventario[players], value) end end end triggerClientEvent(players, "refresh", resourceRoot, inventario[players]) end end, 10000, 1) end for i, v in pairs(bau) do local data = executeSQLQuery("SELECT * FROM Baú WHERE gang = ?", i) if data and type(data) == "table" and #data ~= 0 then data[1].valor = fromJSON(data[1].valor) for index, value in pairs(data[1].valor) do bau[i][index] = {} bau[i][index][1] = data[1].valor[index][1] end end end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onStart) ----------------------------------------------------------------------------------------------------------------------------------------- function onStop() for i, players in pairs(getElementsByType("player")) do local account = getPlayerAccount(players) if not isGuestAccount(account) then if not isTimer(timerStart[players]) then local itens = toJSON(inventario[players]) setAccountData(account, "Inventario", itens) end end end executeSQLQuery("CREATE TABLE IF NOT EXISTS Baú (gang TEXT, valor TEXT)") for i, v in pairs(bau) do executeSQLQuery("DELETE FROM Baú WHERE gang = ?", i) executeSQLQuery("INSERT INTO Baú (gang, valor) VALUES (?, ?)", i, toJSON(bau[i])) end end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), onStop) ----------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------- function Refresh(playerSource) local int = getElementInterior(playerSource) local dim = getElementDimension(playerSource) if isElement(item[playerSource]) then setElementInterior(item[playerSource], int) setElementDimension(item[playerSource], dim) end if isElement(capacete[playerSource]) then setElementInterior(capacete[playerSource], int) setElementDimension(capacete[playerSource], dim) end if isElement(mascara[playerSource]) then setElementInterior(mascara[playerSource], int) setElementDimension(mascara[playerSource], dim) end if isElement(maleta[playerSource]) then setElementInterior(maleta[playerSource], int) setElementDimension(maleta[playerSource], dim) end if isElement(som[playerSource]) then setElementInterior(som[playerSource], int) setElementDimension(som[playerSource], dim) end if isElement(flor[playerSource]) then setElementInterior(flor[playerSource], int) setElementDimension(flor[playerSource], dim) end if isElement(cigarro[playerSource]) then setElementInterior(cigarro[playerSource], int) setElementDimension(cigarro[playerSource], dim) end end addEvent("RefreshBoneAttach", true) addEventHandler("RefreshBoneAttach", root, Refresh) ----------------------------------------------------------------------------------------------------------------------------------------- function PlaySound3D(playerSource, som, distance) if distance == "all" then triggerClientEvent(root, "playSound", resourceRoot, som, playerSource) else for i, players in pairs(getElementsByType("player")) do local x, y, z = getElementPosition(playerSource) local ex, ey, ez = getElementPosition(players) if getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) <= distance then triggerClientEvent(players, "playSound", resourceRoot, som, playerSource) end end end end ----------------------------------------------------------------------------------------------------------------------------------------- function onWasted() if not getElementData(source, "Staff") then for index = #inventario[source], 1, -1 do local item = inventario[source][index][1] if not itensCantRemoved[item] then GiveAndTakeAndGetItem("take", source, item, "all") end end end takeAllWeapons(source) curado[source] = nil acao[source] = nil arma[source] = nil if isElement(cigarro[source]) then destroyElement(cigarro[source]) cigarro[source] = nil unbindKey(source, "x", "down", fumarCigarro) end if algemado[source] then destroyElement(item[source]) item[source] = nil killTimer(timerAlgema[source]) timerAlgema[source] = nil setControlState(source, "walk", false) end if algemando[source] then algemando[source] = nil end end addEventHandler("onPlayerWasted", root, onWasted) ----------------------------------------------------------------------------------------------------------------------------------------- function removeItem(playerSource, item) if item == "radinho" then setElementData(playerSource, "Radinho", false) elseif item == "porco" or item == "criatura" or item == "capeta" or item == "caveira" or item == "macaco" or item == "cavalo" or item == "touro" or item == "sacola" then destroyElement(mascara[playerSource]) mascara[playerSource] = nil elseif item == "maleta" then destroyElement(maleta[playerSource]) maleta[playerSource] = nil elseif item == "capacete" then destroyElement(capacete[playerSource]) capacete[playerSource] = nil setElementData(playerSource, "Capacete", false) elseif item == "som" then destroyElement(som[playerSource]) som[playerSource] = nil elseif item == "flor" then destroyElement(flor[playerSource]) flor[playerSource] = nil else if arma[playerSource] == item then local ammo = getPedTotalAmmo(playerSource, weapons[item][3]) or 0 if ammo > 1 then GiveAndTakeAndGetItem("give", playerSource, weapons[item][2], ammo - 1) end arma[playerSource] = nil takeWeapon(playerSource, weapons[item][1]) end end end
  22. Estou tendo um problema muito anti-RP no meu server vou tentar explicar, uso um menu de animações no F4 só que tem um problema. Quando uma pessoa toma um taser, ativa uma animação que ele fica deitado no chão ou quando uma pessoa é algemada ativa outra animação que ele fica algemado, ai que está o problema, se a pessoa usar o painel de animações do F4 ele simplesmente cancela qualquer animação tanto de ser preso ou de tomar um taser ai eu estou tentando fazer adicionar uma função no script do taser e de algemar que ele não consiga user nenhum F do F1 ao F12 eu fiz um script mas estou errando em alguma coisa que não sei oq é -------- SCRIPT ORIGINAL PARA CANCELAR OS F'S addEventHandler("onClientKey", root, function (button, press) if getElementData(getLocalPlayer(),"preso") then if button == "F1" or button == "F2" or button == "F3" or button == "F4" or button == "F5" or button == "F6" or button == "F7" or button == "F9" or button == "F10" or button == "F11" or button == "F12" or button == "t" then cancelEvent() end end end ) -------- ElementData do script de Algemar setElementData(player_a_ser_algemado,"algemado", nick_do_jogador) -------- tentei implementar no script de algemar local screenW,screenH = guiGetScreenSize() -- Função de Reposicionar Largura e altura da tela local resW, resH = 1280, 720 -- Largura e altura da tela local x, y = (resW/screenW),(resH/screenH) -- juntar dois elementos em x, y local tempo, valor = 500, 60 -- Tempo de carregamento local startTick local pBarCurWidth, pBarWidth = 0, 368 -- largura e altura do dx addEvent("doShowDXProgressBar", true) -- Ativar um evento personalizado addEventHandler("doShowDXProgressBar", root, function() startTick = getTickCount() -- Começar contagem if addEventHandler("onClientRender", root, renderDXProgressBar) then -- se executar essa função fara alguma coisa, no caso n tera nada caso queira usar para desbugar script end end ) function renderDXProgressBar() local now = getTickCount() if (now - startTick) >= tempo then -- Aumentar a largura da barra pBarCurWidth = pBarCurWidth + valor startTick = getTickCount() if pBarCurWidth > pBarWidth then -- Barra de progresso cheia pBarCurWidth = pBarWidth removeEventHandler("onClientRender", root, renderDXProgressBar) startTick = nil end end dxDrawRectangle(x*354, y*312, pBarWidth, 38, tocolor(0, 0, 0, 255), false) dxDrawRectangle(x*358, y*316, pBarCurWidth, 29, tocolor(189, 0, 0, 255), false) dxDrawText( tostring( math.ceil((pBarCurWidth * 100) / pBarWidth) ).." %", x*358, y*316, (x*358) + pBarWidth, (y*316) + 29, tocolor(255,255,255), 2) end addEventHandler("onClientKey", root, function (button, press) if getElementData(player_a_ser_algemado,"algemado") then if button == "F1" or button == "F2" or button == "F3" or button == "F4" or button == "F5" or button == "F6" or button == "F7" or button == "F9" or button == "F10" or button == "F11" or button == "F12" or button == "t" then cancelEvent() end end end )
  23. C0DE

    Algemar

    ------------------------------------------------ ------ Sistema de Policia ------ ------ By:#ROBSON ------ ------------------------------------------------ ------ Colaboração: ------ ------ #DR.VOODKA ------ ------ [B]lack ------ ------ #[S]wag ------ ------ New Age ------ ------ DNL291 ------ ------------------------------------------------ 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 revistar_jogador ( thePlayer, comando, nick ) if nick then if getPlayerFromPartialName ( nick ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Policia") ) then -- Acl Pra Quem Pode Usar o Comando local player_a_ser_revistado = getPlayerFromPartialName ( nick ) local nick_do_jogador = getPlayerName ( player_a_ser_revistado ) local nick_do_policial = getPlayerName ( thePlayer ) local estrelas_de_procurado = getPlayerWantedLevel ( player_a_ser_revistado ) local policiax, policiay, policiaz = getElementPosition ( thePlayer ) -- Encontrar posição do policial local revistadox, revistadoy, revistadoz = getElementPosition ( player_a_ser_revistado ) -- Encontrar posição de quem sera revistado local dist = getDistanceBetweenPoints3D ( policiax, policiay, policiaz, revistadox, revistadoy, revistadoz ) -- Calcular a distancia entre os dois elementos if ( dist > 335 ) then -- se a distancia for 335 executara a função a seguir outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1Chegue Mais Perto Do Jogador Pra Executar Este Comando!", thePlayer, 255, 255, 255, true) -- Chat Box elseif ( dist < 334 )then -- Caso ao contrario a distancia for 334 executara a função a seguir setPedAnimation( thePlayer, "POLICE", "plc_drgbst_01", 3100, true, false, false, false) outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1O #ff0000Policial #ffffff"..nick_do_policial.." #c1c1c1esta #ff0000Revistando #c1c1c1o #ff0000Suspeito "..nick_do_jogador.."", root, 255, 255, 255, true) -- Chat Box setTimer ( function() outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1Nivel de #ff0000Procurado #c1c1c1do #ff0000Suspeito#c1c1c1:"..estrelas_de_procurado.."", thePlayer, 255, 255, 255, true) -- Nivel de procurado do jogador end, 3390, 1 ) triggerClientEvent(thePlayer, "doShowDXProgressBar", thePlayer) -- Chamar evento do client end else outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1Você nao tem permissao a este comando!", thePlayer, 255, 255, 255, true) -- Se voce nao for da acl voce nao tera permissao a este comando end end end end addCommandHandler ( "revistar", revistar_jogador ) function algemar_jogador ( thePlayer, _, nick ) if nick then if getPlayerFromPartialName ( nick ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Policia") ) then -- Acl Pra Quem Pode Usar o Comando local player_a_ser_algemado = getPlayerFromPartialName ( nick ) local nick_do_jogador = getPlayerName ( player_a_ser_algemado ) local nick_do_policial = getPlayerName ( thePlayer ) setElementData(player_a_ser_algemado,"algemado", nick_do_jogador) -- Elemento Data setPedAnimation( player_a_ser_algemado, "GRAVEYARD", "mrnM_loop", -1, true, false, false, false) -- Animação de algemar setElementFrozen( player_a_ser_algemado, true ) -- Freezar jogador toggleControl(player_a_ser_algemado, "fire", false) -- retirar função de atirar outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1O #ffffff"..nick_do_jogador.." #c1c1c1Foi #ff0000Algemado #c1c1c1Pelo #ff0000Policial "..nick_do_policial.."", root, 255, 255, 255, true) -- Chat Box outputChatBox("#000000[#ff0000POLICIA#000000] #ff0000Voce #c1c1c1Foi #ff0000Algemado#c1c1c1! ", player_a_ser_algemado, 255, 255, 255, true) -- Chat Box end else outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1Você nao tem permissao a este comando!", thePlayer, 255, 255, 255, true) -- Se voce nao for da acl nao tera permissao a este comando end end end addCommandHandler("algemar", algemar_jogador) function algemar_jogador ( thePlayer, _, nick ) if nick then if getPlayerFromPartialName ( nick ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Policia") ) then local player_a_ser_desalgemado = getPlayerFromPartialName ( nick ) local nick_do_jogador = getPlayerName ( player_a_ser_desalgemado ) local nick_do_policial = getPlayerName ( thePlayer ) if getElementData (player_a_ser_desalgemado, "algemado") then -- vai verificar se o jogador estiver com os algemas setPedAnimation( player_a_ser_desalgemado ) -- desativara animaçao setElementFrozen( player_a_ser_desalgemado, false ) -- desativara o freeze toggleControl(player_a_ser_desalgemado, "fire", true ) -- ativara a função de atirar outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1O #ffffff"..nick_do_jogador.." #c1c1c1Foi #ff0000Desalgemado #c1c1c1Pelo #ff0000Policial "..nick_do_policial.."", root, 255, 255, 255, true) -- Chat Box outputChatBox("#000000[#ff0000POLICIA#000000] #ff0000Voce #c1c1c1Foi #ff0000Desalgemado#c1c1c1! ", player_a_ser_desalgemado, 255, 255, 255, true) -- Chat Box removeElementData ( player_a_ser_desalgemado, "algemado" ) -- remover algemar else outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1O #FF0000Suspeito #c1c1c1Nao #c1c1c1Foi #ff0000Algemado #c1c1c1Para Executar Este Comando! ",thePlayer, 255, 255, 255, true) -- chat box se o jogador nao estiver algemado end else outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1Você nao tem permissao a este comando!", thePlayer, 255, 255, 255, true) -- Acl Pra Quem Pode Usar o Comando end end end end addCommandHandler("desalgemar", algemar_jogador)
  24. Opa rapaziada, tudo blz? bom minha dúvida é a seguinte, eu queria saber qual a forma do script /revistar trabalhar com outro script, por exemplo, quando ele revistar aparece as informações do outro script, no caso o script de habilitação, que quando o policial revistar, aparecer a licença de carro e moto e ver se ele tem ou não. ~~Server~~ ------------------------------------------------ ------ Sistema de Policia ------ ------ By:MrDante ------ ------------------------------------------------ ------ Colaboração: ------ ------ #DR.VOODKA ------ ------ [B]lack ------ ------ #[S]wag ------ ------ New Age ------ ------ DNL291 ------ ------------------------------------------------ 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 revistar_jogador ( thePlayer, comando, nick ) if nick then if getPlayerFromPartialName ( nick ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "ComandosPolicia") ) then -- Acl Pra Quem Pode Usar o Comando local player_a_ser_revistado = getPlayerFromPartialName ( nick ) local nick_do_jogador = getPlayerName ( player_a_ser_revistado ) local nick_do_policial = getPlayerName ( thePlayer ) local estrelas_de_procurado = getPlayerWantedLevel ( player_a_ser_revistado ) local policiax, policiay, policiaz = getElementPosition ( thePlayer ) -- Encontrar posição do policial local revistadox, revistadoy, revistadoz = getElementPosition ( player_a_ser_revistado ) -- Encontrar posição de quem sera revistado local dist = getDistanceBetweenPoints3D ( policiax, policiay, policiaz, revistadox, revistadoy, revistadoz ) -- Calcular a distancia entre os dois elementos if ( dist > 5 ) then -- se a distancia for 5 executara a função a seguir outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1Chegue Mais Perto Do Jogador Pra Executar Este Comando!", thePlayer, 255, 255, 255, true) -- Chat Box elseif ( dist < 4 )then -- Caso ao contrario a distancia for 4 executara a função a seguir setPedAnimation( thePlayer, "POLICE", "plc_drgbst_01", 3100, true, false, false, false) outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1O #ff0000Policial #ffffff"..nick_do_policial.." #c1c1c1esta #ff0000Revistando #c1c1c1o #ff0000Suspeito "..nick_do_jogador.."", root, 255, 255, 255, true) -- Chat Box setTimer ( function() outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1Nivel de #ff0000Procurado #c1c1c1do #ff0000Suspeito#c1c1c1:"..estrelas_de_procurado.."", thePlayer, 255, 255, 255, true) -- Nivel de procurado do jogador end, 3390, 1 ) triggerClientEvent(thePlayer, "doShowDXProgressBar", thePlayer) -- Chamar evento do client end else outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1Você nao tem permissao a este comando!", thePlayer, 255, 255, 255, true) -- Se voce nao for da acl voce nao tera permissao a este comando end end end end addCommandHandler ( "revistar", revistar_jogador ) function algemar_jogador ( thePlayer, _, nick ) if nick then if getPlayerFromPartialName ( nick ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "ComandosPolicia") ) then -- Acl Pra Quem Pode Usar o Comando local player_a_ser_algemado = getPlayerFromPartialName ( nick ) local nick_do_jogador = getPlayerName ( player_a_ser_algemado ) local nick_do_policial = getPlayerName ( thePlayer ) setElementData(player_a_ser_algemado,"algemado", nick_do_jogador) -- Elemento Data setPedAnimation( player_a_ser_algemado, "GRAVEYARD", "mrnM_loop", -1, true, false, false, false) -- Animação de algemar setElementFrozen( player_a_ser_algemado, true ) -- Freezar jogador toggleControl(player_a_ser_algemado, "fire", false) -- retirar função de atirar outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1O #ffffff"..nick_do_jogador.." #c1c1c1Foi #ff0000Algemado #c1c1c1Pelo #ff0000Policial "..nick_do_policial.."", root, 255, 255, 255, true) -- Chat Box outputChatBox("#000000[#ff0000POLICIA#000000] #ff0000Voce #c1c1c1Foi #ff0000Algemado#c1c1c1! ", player_a_ser_algemado, 255, 255, 255, true) -- Chat Box end else outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1Você nao tem permissao a este comando!", thePlayer, 255, 255, 255, true) -- Se voce nao for da acl nao tera permissao a este comando end end end addCommandHandler("algemar", algemar_jogador) function algemar_jogador ( thePlayer, _, nick ) if nick then if getPlayerFromPartialName ( nick ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "ComandosPolicia") ) then local player_a_ser_desalgemado = getPlayerFromPartialName ( nick ) local nick_do_jogador = getPlayerName ( player_a_ser_desalgemado ) local nick_do_policial = getPlayerName ( thePlayer ) if getElementData (player_a_ser_desalgemado, "algemado") then -- vai verificar se o jogador estiver com os algemas setPedAnimation( player_a_ser_desalgemado ) -- desativara animaçao setElementFrozen( player_a_ser_desalgemado, false ) -- desativara o freeze toggleControl(player_a_ser_desalgemado, "fire", true ) -- ativara a função de atirar outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1O #ffffff"..nick_do_jogador.." #c1c1c1Foi #ff0000Desalgemado #c1c1c1Pelo #ff0000Policial "..nick_do_policial.."", root, 255, 255, 255, true) -- Chat Box outputChatBox("#000000[#ff0000POLICIA#000000] #ff0000Voce #c1c1c1Foi #ff0000Desalgemado#c1c1c1! ", player_a_ser_desalgemado, 255, 255, 255, true) -- Chat Box removeElementData ( player_a_ser_desalgemado, "algemado" ) -- remover algemar else outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1O #FF0000Suspeito #c1c1c1Nao #c1c1c1Foi #ff0000Algemado #c1c1c1Para Executar Este Comando! ",thePlayer, 255, 255, 255, true) -- chat box se o jogador nao estiver algemado end else outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1Você nao tem permissao a este comando!", thePlayer, 255, 255, 255, true) -- Acl Pra Quem Pode Usar o Comando end end end end addCommandHandler("desalgemar", algemar_jogador) E o server do mod habilitação. function RobberUber (ThePlayer,seat) local id = getElementModel(source) if not getElementData(ThePlayer, "Habilitacoes:Motos", false) and seat == 0 then if id == 581 then cancelEvent() outputChatBox("ᴿ#00ff00ᴮ✘ #ffffffINFO #00ff00✘➺ [ #ffffffAuto Escola #00ff00] #ffffff - Você Não Tem Carteira Para Dirigir Motos",ThePlayer,255,255,255, true) outputChatBox("ᴿ#00ff00ᴮ✘ #ffffffINFO #00ff00✘➺ [ #ffffffAuto Escola #00ff00] #ffffff - Compre Uma Na AutoEscola No S Vermelho No F11",ThePlayer,255,255,255, true) end end end addEventHandler("onVehicleStartEnter",root, RobberUber)
  25. Ei quase esqueci sobre aquele script de algemar sabe ele ta com um erro no debug sim Quando uso /a apareçe isso ai Se poder ajudar tambem nessa parte kkkk sabe Eu tentei ate hj arrumar kk so q ficava dando ums erros no debug as vezes pouco erro as vezes algums esse aq e o seu q so apareçeu um erro no debug ao digitar o /a Codigo sem alterar nada apenas o setPedAnimationSpeed function setPedAnimationSpeed(player,anim,speed) setPedAnimation(player,anim,speed) end function setCuffPlayer(player) setPedAnimation(player, nil) setPedAnimation(player,'ped', 'pass_Smoke_in_car', 0, true, true, true) setTimer(setPedAnimationSpeed,60,1,player, 'pass_Smoke_in_car', 0) local x, y, z = getElementPosition(player) local box = createObject(364, x, y, z) exports.bone_attach:attachElementToBone(box, player, 12, 0,0,0, 0,40,-10) setElementCollisionsEnabled(box, false) setElementData(player,'cuffOb', box) toggleControl(player, 'jump', false) setTimer(function(player) if getElementData(player,'cuff') and getElementData(player,'cuff') == true then toggleControl(player, 'fire', false) end end,60,0,player) toggleControl(player, 'crouch', false) end local corpACLS = { -- NOME DAS ACLS Q PODEM ALGEMAR UMA PESSOA! "BOPE", "PMRJ", } function cuff(hit,_,name) local player = getPlayerFromName(name) local x,y,z = getElementPosition(player) local x1,y1,z1 = getElementPosition(hit) if isPlayerPermission(hit) then -- FUNÇÃO UTIL, BASICAMENTE VERIFICA SE O POLICIAL (hit) ESTA DENTRO DE UMA DAS ACL'S BOPE OU PMRJ! if getDistanceBetweenPoints3D(x1,y1,z1,x,y,z) <= 20 then if not getElementData(player,'cuff') or getElementData(player,'cuff') ~= true then if isPedInVehicle(player) then setControlState(player,'enter_exit',true) setTimer(setCuffPlayer,2800,1,player) setElementData(player,'cuff', true) else setCuffPlayer(player) setElementData(player,'cuff', true) end outputChatBox(' '..getPlayerName(hit)..'#ff0000 Algemou você',player,255,255,255,true) else removeElementData(player,'cuff') destroyElement(getElementData(player,'cuffOb')) removeElementData(player, 'cuff') toggleControl(player, 'jump', true) toggleControl(player, 'crouch', true) toggleControl(player, 'fire', true) setPedAnimation(player, 'ped', 'pass_Smoke_in_car', 0, false, false, false, false) outputChatBox(' '..getPlayerName(hit)..'#008800 Soltou suas algemas',player,255,255,255,true) end else outputChatBox("Você está longe demais!",hit,255,0,0,true) end end -- end do if ifPlayerPermission then end addCommandHandler('a',cuff) addEventHandler('onPlayerQuit', root,function() if getElementData(source,'cuff') == true then destroyElement(getElementData(source,'cuffOb')) removeElementData(source, 'cuff') end end) addEventHandler('onPlayerWasted',root,function() if getElementData(source,'cuff') == true then destroyElement(getElementData(source,'cuffOb')) removeElementData(source, 'cuff') end end) addEventHandler('onVehicleStartEnter', getRootElement(), function(player, seat) if getElementData(player,'cuff') == true then if seat ~= 0 then destroyElement(getElementData(player,'cuffOb')) else cancelEvent() outputChatBox('Você não pode dirigir você tem algemas!',player,255,0,0) end end end) setTimer(function() for _,player in ipairs(getElementsByType("player")) do if getElementData(player,'cuff') == true then if isPedInWater(player) then setTimer(function(player) if isPedInWater(player) then killPed(player) end end,5000,1,player) end end end end,1000,0) addEventHandler('onVehicleExit', getRootElement(), function(player, seat) if getElementData(player,'cuff') == true then setCuffPlayer(player) end end) -- ABAIXO UMA FUNÇÃO UTIL QUE FOI DEMONSTRADA por @MainSCR no seu outro post, deveria ter usado isto em vez da outra! function isPlayerPermission(thePlayer) -- faz um loop das acls declaradas na tabela e verifica se a acl do jogador é uma das acls declarada na tabela if isElement(thePlayer) and getElementType(thePlayer) == "player" then if isGuestAccount(getPlayerAccount(thePlayer)) then return end for _, group in ipairs(corpACLS) do if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup(group)) then -- preste atenção acima, ("user."..Nome da Conta , qual a acl )) return true end end end return false end Debugscript 3: ERRO:algemas/server.Lua:33: attempt to compare boolean with number
×
×
  • Create New...