Jump to content

Search the Community

Showing results for tags 'ajuda'.

  • 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. Então Queria saber se tem como me ajudar, tipo o player toma um tiro mais na cabeça mais inves de morrer ela toma uma quantidade de dano tipo dei um tiro ela tomou 30 de dano entende
  2. Eu jogava em uma cidade muito boa, porém por uns motivos ai ela nunca mais foi a mesma. Há um tempinho eu e meu amigo começamos a tentar criar uma cidade nova. Então que me deparo com o mesmo inventario daquela cidade, tem rota, montagem arma, bau, conce, detran etc sóq nao tem 3 coisas basicas pro rp, revistar/saquear, radinho, sistema dinheiro sujo. Se alguem pirar de me ajudar mano fico mt agradecido de vdd, caso alguem queira o inventario tbm eu libero pra vcs Meu dc qlr coisa; brbugadao
  3. To criando um sistema sono pro meu servidor Como eu nao entendo praticamente nada de scripting, estou indo por tutoriais e logica, até o momento criei uma linha de codigo onde vc dorme e teoricamente te congelaria e colocaria uma imagem na sua tela escrita, voce dormiu Peguei base de um sistema de fome Open que achei por ai. O timer ocorre o freeze funciona, creio que quando eu setar a animação tambem, porém a imagem nao tem outras coisas que queria adicionar como um /dormir em markers para recuperar sono completo. O countdown do sistema esta baixo para testes server.lua ---------------------------------------------------------------- connection = dbConnect('sqlite', 'dados.sqlite') dbExec(connection, 'CREATE TABLE IF NOT EXISTS fs (conta, sono)') outputDebugString("Script iniciado com sucesso!", 3) addEventHandler ( "onPlayerLogin", root, function ( _, acc ) setTimer ( Carregar_FS, 50, 1, acc ) end ) function Carregar_FS(conta) if not isGuestAccount(conta) then if conta then local result = dbPoll(dbQuery(connection, 'SELECT * FROM fs WHERE conta = ?', getAccountName(conta)), - 1) local player = getAccountPlayer(conta) if #result ~= 0 then local sono = result[1]['sono'] setElementData(player, "sono", tonumber(sono)) else setElementData(player, "sono", tonumber(100)) end end end end function Iniciar_FS_Resource(res) if res == getThisResource() then for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if not isGuestAccount(acc) then Carregar_FS(acc) end end end end addEventHandler("onResourceStart", getRootElement(), Iniciar_FS_Resource ) function Salvar_FS(conta) if conta then local sono = getElementData(source, "sono") or 100 local result = dbPoll(dbQuery(connection, 'SELECT * FROM fs WHERE conta = ?', getAccountName(conta)), - 1) if #result ~= 0 then dbExec(connection, 'UPDATE fs SET sono=? WHERE conta=?', sono, getAccountName(conta)) else dbExec(connection, 'INSERT INTO fs (conta, sono) VALUES(?, ?)', getAccountName(conta), sono) end end end function checksonoCount() for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if not isGuestAccount(acc) then local sono = getElementData(player,"sono") or 0 setElementData(player, "sono", sono -1) if sono <= 10 then exports["n3xt_dxmessages"]:addBox(player, "Você precisa dormir.", "info") end if sono <= 0 then setElementData(player,"sono",1) setElementFrozen(player, true) triggerClientEvent(player, "exibirEfeitoVisual", resourceRoot, "SonoSystem/img/efeito.png") setPedAnimation(player, "BED", "BED_Loop_A", -1, true, false, false, false) setTimer(function() setElementFrozen(player, false) -- Descongela o jogador triggerClientEvent(player, "removerEfeitoVisual", resourceRoot) setPedAnimation(player, false) end, 100, 0) end end end end setTimer(checksonoCount,100,0) function Desligar_FS(res) if res == getThisResource() then for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount (player) if not isGuestAccount(acc) then Salvar_FS(acc) end end end end addEventHandler("onResourceStop", getRootElement(), Desligar_FS) function Sair_Servidor(quitType) local acc = getPlayerAccount(source) if not isGuestAccount(acc) then if acc then Salvar_FS(acc) end end end addEventHandler("onPlayerQuit", getRootElement(), Sair_Servidor) --------------------------------- Fim --------------------- client.lua -------------------------------------------------- local screenWidth, screenHeight = guiGetScreenSize() local renderEventHandler function exibirEfeitoVisual(path) if not path then return end local textura = dxCreateTexture(path) if not textura then return end renderEventHandler = addEventHandler("onClientRender", root, function() local playerScreenW, playerScreenH = guiGetScreenSize() local imageW, imageH = 200, 200 local x = (playerScreenW - imageW) / 2 local y = (playerScreenH - imageH) / 2 dxDrawImage(x, y, imageW, imageH, textura) end) end addEvent("exibirEfeitoVisual", true) addEventHandler("exibirEfeitoVisual", resourceRoot, function(path) exibirEfeitoVisual("SonoSystem/img/" .. path) end) function removerEfeitoVisual() if renderEventHandler then removeEventHandler("onClientRender", root, renderEventHandler) renderEventHandler = nil end end addEvent("removerEfeitoVisual", true) addEventHandler("removerEfeitoVisual", resourceRoot, removerEfeitoVisual)
  4. 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 )
  5. um script da o seguinte erro [servidor]\[servidor]\[Scripts]\[AtivarVip\caioS.Lua:14: <min_mtaversion> section in the meta.xml is incorrect or missing (expected at least server 1.5.4-9.11413 becayse 'formFields' is begin used Script aki local url = "https://discordapp.com/api/webhooks/1133572830953476227/ja3_b-h9pOGeJIxAcLJfc2FQQWUOUtXbR-614F93FwhTM-b4mSg96oLjyp2DNfRCoNsb" ---- Coloque o link da sua webhook entre as "aspas" -------- --> --> --> --> --> "LOGS" nao mexa aqui <-- <-- <-- <-- <-- function messageDiscord(message, link) sendOptions = { queueName = "dcq", connectionAttempts = 3, connectTimeout = 5000, formFields = { content=""..message.."" }, } fetchRemote(link, sendOptions, function () return end) end --> --> --> --> --> LOGS <-- <-- <-- <-- <-- function messageS(player, message, tipo) exports['FR_DxMessages']:addBox(player, message, tipo) ----------- altere para sua infobox----- end function RegisterEvent(event, ...) addEvent(event, true) addEventHandler(event, ...) end addEventHandler('onResourceStart', getResourceRootElement(getThisResource()), function () connection = dbConnect('sqlite', 'dados.sqlite') dbExec(connection, 'create table if not exists key (key, vip, dias)') dbExec(connection, 'create table if not exists keyPoints (key, amount)') dbExec(connection, 'create table if not exists vips (conta, vip, tempo)') end ) setTimer( function ( ) local logins = dbPoll(dbQuery(connection, 'select * from vips'), - 1) if (#logins ~= 0) then for i, v in ipairs(logins) do if (v['tempo'] < 11000) then aclGroupRemoveObject(aclGetGroup(v['vip']), 'user.'..v['conta']) dbExec(connection, 'delete from vips where conta = ? and vip = ?', v['conta'], v['vip']) else dbExec(connection, 'update vips set tempo = ? where conta = ? and vip = ?', (tonumber(v['tempo']) - 10000), v['conta'], v['vip']) end end end end , 10000, 0) function getPlayerAdmin (player) for i,v in ipairs(config.acl) do if isObjectInACLGroup('user.'..getAccountName(getPlayerAccount(player)), aclGetGroup(v)) then return true end end return false end function getVipExists (vip) vips = {'Omega', 'Sigma', 'Epsylon', 'Alpha'} for i,v in ipairs(vips) do if (v == vip) then return true end end return false end addCommandHandler('gerarkey', function(player, _, vip, dias) if getPlayerAdmin(player) then if (vip) and (dias) then if getVipExists(vip) then local seconds = (dias * 86400000) local key = gerarKey() local keys = dbPoll(dbQuery(connection, 'select * from key where key = ?', key), - 1) if (#keys == 0) then dbExec(connection, 'insert into key (key, vip, dias) values(?, ?, ?)', tostring(key), tostring(vip), tonumber(seconds)) triggerClientEvent(player, 'copyKey', player, tostring(key)) messageS(player, 'Você gerou uma key com o vip ' .. vip .. ' por '..dias..' dias.', 'success') messageDiscord(">>> ⇌--------------------⇌\n**Key gerada**\n**Vip:**`".. vip .."`\n**Dias:**`".. dias .."`\n**key:**||".. key .."||\n⇌--------------------⇌ ", ""..url.."") messageS(player, 'A key foi copiada, utilize (ctrl + v) para colar.', 'info') else messageS(player, 'Ocorreu um erro inesperado na hora de criar a key, tente novamente em alguns segundos.', 'success') end else messageS(player, 'Você precisa digitar algum dos vips atuais.', 'error') end end end end ) addCommandHandler('gerarpontos', function(player, _, amount) if getPlayerAdmin(player) then if tonumber(amount) then local key = gerarKey() local keys = dbPoll(dbQuery(connection, 'select * from keyPoints where key = ?', key), - 1) if (#keys == 0) then dbExec(connection, 'insert into keyPoints (key, amount) values(?, ?)', tostring(key), tonumber(amount)) triggerClientEvent(player, 'copyKey', player, tostring(key)) messageS(player, 'Você gerou uma key com ' .. amount .. ' vpoints.', 'success') messageDiscord(">>> ⇌--------------------⇌\n**Moedas Geradas**\n**Moedas:**`"..amount.."` \n**key:**||".. key .."||\n⇌--------------------⇌ ", ""..url.."") messageS(player, 'A key foi copiada, utilize (ctrl + v) para colar.', 'info') else messageS(player, 'Esta key já existe.', 'info') end end end end ) addCommandHandler('usarpontos', function (player, _, key) if key then local keys = dbPoll(dbQuery(connection, 'select * from keyPoints where key = ?', key), - 1) if (#keys ~= 0) then setElementData(player, 'moneycoins', (getElementData(player, 'moneycoins') or 0) + tonumber(keys[1]['amount'])) for i, v in ipairs(getElementsByType('player')) do triggerClientEvent(v, 'Caio.onDrawTextAtivado2', v, keys[1]['amount'], getPlayerName(player)) end messageS(player, 'Você ativou a key e recebeu ' .. keys[1]['amount'] .. ' de vPoints', 'success') dbExec(connection, 'delete from keyPoints where key = ?', key) else messageS(player, 'Esta key não existe ou já foi utilizada.', 'info') end else outputChatBox('Syntax error: /usarpontos [Key]') end end ) addCommandHandler('usarkey', function (player, _, key) if (key) then local keys = dbPoll(dbQuery(connection, 'select * from key where key = ?', key), - 1) if (#keys ~= 0) and (type(keys) == 'table') then local dados = dbPoll(dbQuery(connection, 'select * from vips where conta = ? and vip = ?', getAccountName(getPlayerAccount(player)), keys[1]['vip']), - 1) if (#dados == 0) then dbExec(connection, 'insert into vips (conta, vip, tempo) values(?, ?, ?)', getAccountName(getPlayerAccount(player)), keys[1]['vip'], keys[1]['dias']) aclGroupAddObject(aclGetGroup(keys[1]['vip']), 'user.'..getAccountName(getPlayerAccount(player))) messageS(player, 'Você utilizou a key e recebeu um vip '..keys[1]['vip']..' por '..(keys[1]['dias'] / 86400000)..' dias.', 'success') for i,v in ipairs(getElementsByType('player')) do triggerClientEvent(v, 'Caio.onDrawTextAtivado', v, keys[1]['vip'], getPlayerName(player)) end givePlayerMoney(player, (config[tostring(keys[1]['vip'])] or 0)) dbExec(connection, 'delete from key where key = ?', key) else messageS(player, 'Você já possui esse vip.', 'warning') end else messageS(player, 'Esta key não existe', 'warning') end else messageS(player, 'Você precisa digitar a key', 'warning') end end ) addCommandHandler('gerenciador', function (player) if getPlayerAdmin(player) then triggerClientEvent(player, 'Caio.onOpenGerenciar', player) local vips = dbPoll(dbQuery(connection, 'select * from vips'), - 1) local keys = dbPoll(dbQuery(connection, 'select * from key'), - 1) if (keys ~= 0) then for i,v in ipairs(keys) do triggerClientEvent(player, 'Caio.onInsertTableKey', player, v['key'], v['vip'], math.floor(v['dias'] / 86400000)) end end if (vips ~= 0) then for i,v in ipairs(vips) do triggerClientEvent(player, 'Caio.onInsertTableVip', player, v['conta'], v['vip'], math.floor(v['tempo'] / 86400000)) end end end end ) RegisterEvent('Caio.onRemoveKey', root, function (player, key, index) if (key) and (index) then local keys = dbPoll(dbQuery(connection, 'select * from key where key = ?', key), - 1) if (#keys ~= 0) and (type(keys) == 'table') then dbExec(connection, 'delete from key where key = ?', key) messageS(player, 'Você deletou com sucesso esta key.', 'success') messageDiscord(">>> ⇌--------------------⇌\n**Key Excluida**\n**Key:**`"..key.."`\n⇌--------------------⇌", ""..url.."") triggerClientEvent(player, 'Caio.onOpenGerenciar', player) else messageS(player, 'Ocorreu um erro ao remover esta key.', 'error') end end end ) RegisterEvent('Caio.onRemoveVip', root, function (player, login, vip, index) if (login) and (vip) then local result = dbPoll(dbQuery(connection, 'select * from vips where conta = ? and vip = ?', tostring(login), tostring(vip)), - 1) if (#result ~= 0) then aclGroupRemoveObject(aclGetGroup(tostring(vip)), 'user.'..tostring(login)) dbExec(connection, 'delete from vips where conta = ? and vip = ?', tostring(login), tostring(vip)) messageS(player, 'Você removeu o vip '..vip..' do usuário '..login..'.', 'success') messageDiscord(">>> ⇌--------------------⇌\n**Vip removido**\n**Login:** `"..login.."`\n**Vip:**`"..vip.."`\n⇌--------------------⇌ ", ""..url.."") triggerClientEvent(player, 'Caio.onOpenGerenciar', player) else messageS(player, 'Ocorreu um erro na hora de remover o vip.', 'error') end end end ) function gerarKey() letters = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} local sas = '' for i = 1, 10 do sas = sas .. letters[math.random(1, #letters)] end return sas end https://imgur.com/78DOMQj
  6. queria por em meu servidor 2 empregos que usam acl uber e mecanico ambos estao localizados na msm agencia consegui fazer com 1 porem quando tento adicionar outro nao funciona Scrip abaixo --[[ ><><><><><><><><><><><><><><><><><><><>< >< Pegar Trabalho >< ><><><><><><><><><><><><><><><><><><><>< --]] function Pegar_Emprego (source, Trab, Level, Hab) local Trabalho = getElementData ( source, "Emprego" ) or "Desempregado" local Habilicao = getElementData ( source, "DNL:Categoria("..Hab..")") local Level_Player = tonumber(getElementData(source, "Level")) or 0 if Level_Player >= tonumber(Level) then if Trabalho == Trab then triggerClientEvent(source, "addNotification", root, "INFO: Você Já Trabalha Como "..Trab.."", "info") return end if Habilicao == false then triggerClientEvent(source, "addNotification", root, "Erro: Você Não Tem Habilitação ("..Hab..") e Não Pode Trabalhar Como ("..Trab..")", "erro") return end setElementData ( source, "Emprego", Trab ) triggerClientEvent(source, "addNotification", root, "INFO: Você Agora Trabalha de "..Trab.."", "info") else triggerClientEvent(source, "addNotification", root, "Erro: Seu Level é Muito Baixo e Você Não Pode Trabalhar Como "..Trab.."", "erro") end end addEvent("DNL:Pegar_Emprego", true) addEventHandler("DNL:Pegar_Emprego", root, Pegar_Emprego) function Pegar_Emprego (playerSource) local accName = getAccountName ( getPlayerAccount ( playerSource ) ) -- get his account name local Emprego = getElementData ( playerSource, "Emprego" ) if Emprego == "Mecanico" then aclGroupAddObject (aclGetGroup("Mecanico"), "user."..accName) outputChatBox ("Parabéns! Agora você está trabalhando de Mecanico!", playerSource, 0, 255, 0,true) outputChatBox ("Va para o T marcado no mapa proximo a DP!", playerSource, 0, 255, 0,true) end end addEvent("DNL:Pegar_Emprego", true) addEventHandler("DNL:Pegar_Emprego", root, Pegar_Emprego) function Sair_ACL (playerSource) local accName = getAccountName ( getPlayerAccount ( playerSource ) ) -- get his account name if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Mecanico" ) ) then -- Does he have access to Admin functions? aclGroupRemoveObject (aclGetGroup("Mecanico"), "user."..accName) outputChatBox ("Você não está trabalhando de Mecanico!", playerSource, 0, 255, 0,true) end end addEvent("DNL:Pedir_Demissao", true) addEventHandler("DNL:Pedir_Demissao", root, Sair_ACL) addEvent("DNL:Pegar_Emprego", true) addEventHandler("DNL:Pegar_Emprego", root, Pegar_Emprego) function Pegar_Emprego (playerSource) local accName = getAccountName ( getPlayerAccount ( playerSource ) ) -- get his account name local Emprego = getElementData ( playerSource, "Emprego" ) if Emprego == "Uber" then aclGroupAddObject (aclGetGroup("Uber"), "user."..accName) outputChatBox ("Parabéns! Agora você está trabalhando de Uber!", playerSource, 0, 255, 0,true) end end addEvent("DNL:Pegar_Emprego", true) addEventHandler("DNL:Pegar_Emprego", root, Pegar_Emprego) function Sair_ACL (playerSource) local accName = getAccountName ( getPlayerAccount ( playerSource ) ) -- get his account name if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Uber" ) ) then -- Does he have access to Admin functions? aclGroupRemoveObject (aclGetGroup("Uber"), "user."..accName) outputChatBox ("Você não está trabalhando de Uber!", playerSource, 0, 255, 0,true) end end addEvent("DNL:Pedir_Demissao", true) addEventHandler("DNL:Pedir_Demissao", root, Sair_ACL) --[[ ><><><><><><><><><><><><><><><><><><><>< >< Demissao Trabalho >< ><><><><><><><><><><><><><><><><><><><>< --]] function Pedir_Demissao (source) local Trabalho = getElementData ( source, "Emprego" ) or "Desempregado" if Trabalho == "Desempregado" then triggerClientEvent(source, "addNotification", root, "Erro: Você não está empregado para se demitir.", "erro") return end setElementData ( source, "Emprego", "Desempregado" ) triggerClientEvent(source, "addNotification", root, "Sucesso: Você Se Demitiu Do Emprego de "..Trabalho.."", "sucesso") end addEvent("DNL:Pedir_Demissao", true) addEventHandler("DNL:Pedir_Demissao", root, Pedir_Demissao)
  7. EU SIMPLESMENTE GOSTARIA QUE QUEM TIVESSE NAS ACLS VIPS [ DIAMANTE, OURO, PRATA, BRONZE ] TIVESSE MAIS SLOTS NA GARAGEM O SCRIPT É ASSIM createEventHandler ("MST.onPlayerBuyVehicle", getRootElement (), function (player, selecionado, cor_1, cor_2, cor_3, cor_4) if selecionado then local accName = getAccountName (getPlayerAccount (player)) local result = dbPoll (dbQuery (db, "SELECT * FROM Veiculos WHERE Conta = ? AND Modelo = ?", accName, selecionado.model), -1) if #result == 0 then if getAllPlayerVehicles (player) >= config.gerais.veiculosmax then --eu sei q é aqui q impede que o jogador compre mais carros message (player, "Você já possui a quantidade máxima de veículos", "error") return end local money = getPlayerMoney (player) if money >= selecionado.price then local id = NovoID () local cor = cor_1..", "..cor_2..", "..cor_3..", "..cor_4 local t_1, t_2, t_3, t_4, t_5, t_6, t_7, t_8, t_9, t_10, t_11, t_12, t_13, t_14, t_15 = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 local tunning = t_1..", "..t_2..", "..t_3..", "..t_4..", "..t_5..", "..t_6..", "..t_7..", "..t_8..", "..t_9..", "..t_10..", "..t_11..", "..t_12..", "..t_13..", "..t_14..", "..t_15 dbExec (db, "INSERT INTO Veiculos VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", accName, id, selecionado.name, selecionado.model, "Guardado", cor, tunning, "Não", 0, "SemPlaca", selecionado.price, 1000, 100) message (player, "Você comprou o veículo "..selecionado.name.." por R$"..convertNumber(selecionado.price)..",00.", "success") takePlayerMoney (player, selecionado.price) triggerClientEvent (player, "MST.onPlayerCloseEvents", player) else message (player, "Você não possui dinheiro suficiente.", "error") end else message (player, "Você já possui esse veículo.", "error") end else message (player, "Selecione algum veículo da lista.", "error") end end) --aqui é a função a cima q verifica os carros q o jogador tem na garagem function getAllPlayerVehicles (player) local accName = getAccountName (getPlayerAccount (player)) local result = dbPoll (dbQuery (db, "SELECT * FROM Veiculos WHERE Conta = ?", accName), -1) return #result end --aqui e no arquivo de configuração config = { gerais = { veiculosmax = 2, -- Veículos Máximos que o Jogador vai poder ter na Garagem. elementfuel = "Gasolina", -- Element Data de Gasolina do seu Servidor. elementid = "ID", -- Element Data de ID do seu Servidor. infobox = "addBox", -- Evento da sua Infobox. distancia = 30, -- Distancia do Player e do Veículo. (Guardar Veículo) velocitymax = 400, -- Velocidade Máximas de todos os Veículos. acls = {"Console"}, -- ACL's Administradoras do seu Servidor. },
  8. Oii, eu jogo MTA, pelo notebook, mas estou enfrentando um problema muito chato, na maioria dos servidores em scripts de, WhatsApp, loja de roupas e etc, simplesmente as teclas pedidas no jogo não funcionam, e eu ja verifiquei se era meu teclado, as teclas dentro do MTA, mudei a resolução e nada resolve, alguem pro favor me ajuda.
  9. alguem consegue me ajudar, tentei fazer um codigo como se fosse um botão que iria aumentar a quantidade que você vai "comprar" mas ele só adicona o item 1 vez e eu queria que adicionasse 1 vez a cada click que o player fizer alguem tem alguma ideia de como me ajudar? Codigo: shop = { prodAtual = 0, adc = 1, novosProdutos = 0 } function compra(button, state) if shpPainel == true then if isMouseInPosition(screenW * 0.6453, screenH * 0.3516, screenW * 0.0445, screenH * 0.0645) then if (button == "left") then if (state == "down") then shop.novosProdutos = (shop.prodAtual + shop.adc) print(shop.novosProdutos) return (shop.novosProdutos) end end end end end addEventHandler("onClientClick", root, compra)
  10. Fala pessoal, estou com um problema, eu coloquei o Butoon_Sair para sair do PAINEL GUI, mas se eu apertar em qualquer lugar da WINDOW, ela FECHA quando deveria fechar somente com o butoon_sair Esse é o: client.lua ----------------------------------------------------------------------------WINDOW local Janela_Agencia_Emprego = guiCreateWindow(0.22, 0.07, 0.54, 0.80, "", true) guiWindowSetMovable(Janela_Agencia_Emprego, false) guiWindowSetSizable(Janela_Agencia_Emprego, false) guiSetAlpha(Janela_Agencia_Emprego, 1.00) guiSetProperty(Janela_Agencia_Emprego, "CaptionColour", "FF1B0743") local Label_Top = guiCreateLabel(0.29, 0.11, 0.40, 0.09, "AGENCIA DE EMPREGO", true, Janela_Agencia_Emprego) guiSetFont(Label_Top, "clear-normal") guiLabelSetHorizontalAlign(Label_Top, "center", false) guiLabelSetVerticalAlign(Label_Top, "center") ----------------------------------------------------------------------------BUTOON local Butoon_Catador = guiCreateButton(0.01, 0.26, 0.27, 0.10, "CATADOR", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Catador, "NormalTextColour", "FFFFFFFF") local Butoon_Jornal = guiCreateButton(0.71, 0.26, 0.27, 0.10, "ENTREGADOR DE JORNAL", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Jornal, "NormalTextColour", "FFFFFFFF") local Butoon_Pedreiro = guiCreateButton(0.01, 0.38, 0.27, 0.10, "PEDREIRO", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Pedreiro, "NormalTextColour", "FFFFFFFF") local Butoon_Pescador = guiCreateButton(0.71, 0.38, 0.27, 0.10, "PESCADOR", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Pescador, "NormalTextColour", "FFFFFFFF") local Butoon_MotoBoy = guiCreateButton(0.01, 0.49, 0.27, 0.10, "MOTO BOY", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_MotoBoy, "NormalTextColour", "FFFFFFFF") local Butoon_Gas = guiCreateButton(0.71, 0.49, 0.27, 0.10, "ENTREGADOR DE GÁS", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Gas, "NormalTextColour", "FFFFFFFF") local Butoon_Leite = guiCreateButton(0.01, 0.61, 0.27, 0.10, "ENTRAGADOR DE LEITE", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Leite, "NormalTextColour", "FFFFFFFF") local Butoon_Eletricista = guiCreateButton(0.71, 0.61, 0.27, 0.10, "ELETRICISTA", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Eletricista, "NormalTextColour", "FFFFFFFF") local Butoon_Caminhoneiro = guiCreateButton(0.01, 0.73, 0.27, 0.10, "CAMINHONEIRO", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Caminhoneiro, "NormalTextColour", "FFFFFFFF") local Butoon_Minerador = guiCreateButton(0.71, 0.73, 0.27, 0.10, "MINERADOR", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Minerador, "NormalTextColour", "FFFFFFFF") local Butoon_Sair = guiCreateButton(10, 532, 719, 59, "SAIR", false, Janela_Agencia_Emprego) guiSetProperty(Butoon_Sair, "NormalTextColour", "FFFFFFFF") guiSetVisible(Janela_Agencia_Emprego, false) ----------------------------------------------------------------------------COMANDOS local function Abrir_Painel() if not guiGetVisible(Janela_Agencia_Emprego) then guiSetVisible(Janela_Agencia_Emprego, true) showCursor(true) else guiSetVisible(Janela_Agencia_Emprego, false) showCursor(false) end end addEvent("Abrir_Painel", true) addEventHandler("Abrir_Painel", root, Abrir_Painel) ----------------------------------------------------------------------------FUNÇOES addEventHandler("onClientGUIClick", Butoon_Sair, function(tecla) if tecla == "left" then guiSetVisible(Janela_Agencia_Emprego, false) showCursor(false) end end)
  11. Bom Minha duvida é a seguinte estou tentando obter os dados salvo da data-base, que eu fiz para treinar mas a questão e que no final só consigo retornar table não o valor dentro dela local db = dbConnect("sqlite","db/savesystem.db") function loaddb() dbExec(db,"CREATE TABLE IF NOT EXISTS SaveSystem(Account TEXT, Serial TEXT, Money REAL, POS TEXT, Skin TEXT )") print("DATA BASE CRIADA") end addEventHandler("onResourceStart",getRootElement(getThisResource()),loaddb) addEventHandler("onPlayerQuit",root,function() local result = dbPoll(dbQuery(db,"SELECT * FROM SaveSystem WHERE Account = ?",getAccountName(getPlayerAccount(source))),-1) if #result < 1 then local posx, posy,posz = getElementPosition(source) local skin = getElementModel(source) local serial = getPlayerSerial(source) local money = getPlayerMoney(source) local acc = getAccountName(getPlayerAccount(source)) local pos = {posx,posy,posz} dbExec(db,"INSERT INTO SaveSystem(Account,Serial,Money,POS,Skin) VALUES(?,?,?,?,?)",acc,serial,money,toJSON(pos),skin) print("DATA BASE INSERIU") else local posx, posy,posz = getElementPosition(source) local skin = getElementModel(source) local serial = getPlayerSerial(source) local money = getPlayerMoney(source) local acc = getAccountName(getPlayerAccount(source)) local pos = {posx,posy,posz} dbExec(db,"UPDATE SaveSystem SET Account=?,Serial=?,Money=?,POS=?,Skin=?",acc,serial,money,toJSON(pos),skin) print("DATA ATUALIZOU") end end) addEventHandler("onPlayerLogin",root,function() local result = dbPoll(dbQuery(db,"SELECT * FROM SaveSystem WHERE Account = ?",getAccountName(getPlayerAccount(source))),-1) if #result > 0 then setPlayerMoney(source,result[3]["SaveSystem"] ) --setPlayerMoney(source,dbPoll(dbQuery(db,"SELECT * FROM SaveSystem WHERE Money = ?",-1))) tentei dessa forma mas retorna table tb else return print("N tem info") end end)
  12. Olá estou com um problema com este resource de Painel de Sirene, o problema é o seguinte eu tenho markers no servidor para criar os veiculos que tenhem esse painel e tambem tem markers para os destruir, porem quando alguem destroi o veiculo com a sirene ou buzina ligada ela fica em loop sem parar ou seja o veiculo é deletado mas ela fica ali tocando Já tentei de todas as formas não consigo arrumar isso alguém pode ajudar? Client-side --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local sx,sy = guiGetScreenSize() local screenW,screenH = guiGetScreenSize() local resW, resH = 1280, 720 local x, y = (screenW/resW), (screenH/resH) function dxsirenepainelsprp () local theVehicle = getPedOccupiedVehicle ( localPlayer ) if ( theVehicle ) then if getPedOccupiedVehicleSeat(localPlayer) == 1 or getPedOccupiedVehicleSeat(localPlayer) == 0 then if ( getElementModel ( theVehicle ) == 436 ) or ( getElementModel ( theVehicle ) == 490 ) or ( getElementModel ( theVehicle ) == 404 ) then dxDrawRectangle(screenW * 0.5477, screenH * 0.8151, screenW * 0.2350, screenH * 0.1471, tocolor(0, 0, 0, 255), false) dxDrawText("Painel Sirene", screenW * 0.3377, screenH * 0.8151, screenW * 0.9927, screenH * 0.8411, tocolor(255, 140, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false) if getElementData ( theVehicle, "vtrgiroflex" ) == false then dxDrawRectangle(screenW * 0.5550, screenH * 0.8867, screenW * 0.0637, screenH * 0.0417, tocolor(9, 9, 9, 180), false) else dxDrawRectangle(screenW * 0.5550, screenH * 0.8867, screenW * 0.0637, screenH * 0.0417, tocolor(255, 140, 0, 255), false) end if getElementData ( theVehicle, "vtrsirene" ) == false then dxDrawRectangle(screenW * 0.6319, screenH * 0.8867, screenW * 0.0637, screenH * 0.0417, tocolor(9, 9, 9, 180), false) else dxDrawRectangle(screenW * 0.6319, screenH * 0.8867, screenW * 0.0637, screenH * 0.0417, tocolor(255, 140, 0, 255), false) end if getElementData ( theVehicle, "vtrbuzina" ) == false then dxDrawRectangle(screenW * 0.7117, screenH * 0.8867, screenW * 0.0637, screenH * 0.0417, tocolor(9, 9, 9, 180), false) else dxDrawRectangle(screenW * 0.7117, screenH * 0.8867, screenW * 0.0637, screenH * 0.0417, tocolor(255, 140, 0, 255), false) end dxDrawText("1", screenW * 0.3468, screenH * 0.8672, screenW * 0.8287, screenH * 0.8867, tocolor(255, 140, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false) dxDrawText("2", screenW * 0.4212, screenH * 0.8672, screenW * 0.9056, screenH * 0.8867, tocolor(255, 140, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false) dxDrawText("3", screenW * 0.5023, screenH * 0.8672, screenW * 0.9854, screenH * 0.8867, tocolor(255, 140, 0, 255), 1.00, "sans", "center", "center", false, false, false, false, false) dxDrawText("Giroflex", screenW * 0.3500, screenH * 0.8932, screenW * 0.8214, screenH * 0.9206, tocolor(255, 255, 255, 255), 1.00, "sans", "center", "center", false, false, false, false, false) dxDrawText("Sirene", screenW * 0.4322, screenH * 0.8932, screenW * 0.8953, screenH * 0.9206, tocolor(255, 255, 255, 255), 1.00, "sans", "center", "center", false, false, false, false, false) dxDrawText("Buzina", screenW * 0.5103, screenH * 0.8932, screenW * 0.9780, screenH * 0.9206, tocolor(255, 255, 255, 255), 1.00, "sans", "center", "center", false, false, false, false, false) end end end end addEventHandler ( "onClientRender", getRootElement (), dxsirenepainelsprp ) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local vehiclesSirenes = {} addEvent("startSireneSound",true) addEventHandler("startSireneSound",root, function() local theVehicle = getPedOccupiedVehicle ( localPlayer ) if ( theVehicle ) then if(vehiclesSirenes[source])then destroyElement(vehiclesSirenes[source]) vehiclesSirenes[source] = nil setElementData(theVehicle, "vtrsirene", false) else setElementData(theVehicle, "vtrsirene", true) vehiclesSirenes[source] = playSound3D( "sirene.mp3", 0,0,0, true ) setSoundMaxDistance(vehiclesSirenes[source], 150 ) setSoundVolume (vehiclesSirenes[source], 0.1) attachElements (vehiclesSirenes[source], source, 0, 0, 0 ) end end end) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local vehiclesSirene3 = {} addEvent("startSireneSound3",true) addEventHandler("startSireneSound3",root, function() local theVehicle = getPedOccupiedVehicle ( localPlayer ) if ( theVehicle ) then if(vehiclesSirene3[source])then destroyElement(vehiclesSirene3[source]) vehiclesSirene3[source] = nil setElementData(theVehicle, "vtrbuzina", false) else setElementData(theVehicle, "vtrbuzina", true) vehiclesSirene3[source] = playSound3D( "horn.mp3", 0,0,0, true ) setSoundMaxDistance(vehiclesSirene3[source], 100 ) setSoundVolume (vehiclesSirene3[source], 1.0) attachElements (vehiclesSirene3[source], source, 0, 0, 0 ) end end end) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- Emergency Lights resource by vovo4ka -- please, do not remove copyright -- Edited by #FurkanOzulus [OzulusTR] -- Special Thanks, vovo4ka for the this script :) local strobo_interval = 5 -- strobo light freq. 10 = 0.5 sec local is_strobo_enabled = enable -- enable/disable stroboscopic lights mode -- lamps local flash_interval = 2 -- flash freq -- led blink mode local blink_interval = 20 -- blink interval local blink_duration = 2 -- 1..blink_interval local car_lights_table = { -- Enforcer [427] = {["mode"]="lamp", [1]={["pos"]={0.45, 1.1, 1.42}, ["color"]={255,0,0}, ["size"]=0.2, ["phase"]=10.0}, [2]={["pos"]={-0.45, 1.1, 1.42}, ["color"]={255,0,0}, ["size"]=0.2, ["phase"]=10.0}, [3]={["pos"]={0.22, 1.1, 1.42}, ["color"]={255,0,0}, ["size"]=0.2, ["phase"]=0.0}, [4]={["pos"]={-0.22, 1.1, 1.42}, ["color"]={255,0,0}, ["size"]=0.2, ["phase"]=0.0}, [5]={["pos"]={-1.18, 0.1, 0.94}, ["color"]={255,0,0}, ["size"]=0.1, ["phase"]=0.0}, [6]={["pos"]={-1.18, -1.63, 0.94}, ["color"]={255,0,0}, ["size"]=0.1, ["phase"]=5.0}, [7]={["pos"]={-1.18, -3.37, 0.94}, ["color"]={255,0,0}, ["size"]=0.1, ["phase"]=10.0}, [8]={["pos"]={1.18, 0.1, 0.94}, ["color"]={255,0,0}, ["size"]=0.1, ["phase"]=0.0}, [9]={["pos"]={1.18, -1.63, 0.94}, ["color"]={255,0,0}, ["size"]=0.1, ["phase"]=5.0}, [10]={["pos"]={1.18, -3.37, 0.94}, ["color"]={255,0,0}, ["size"]=0.1, ["phase"]=10.0} }, -- Elegant PassatVtr -- Police Speed [436] = {["mode"]="led", [1]={["pos"]={-0.5,-0.1, 0.8}, ["color"]={255,0,0}, ["size"]=0.25, ["phase"]=0.0}, [2]={["pos"]={0.5, -0.1, 0.8}, ["color"]={255,0,0}, ["size"]=0.25, ["phase"]=0.0}, [3]={["pos"]={-0.1, 0.1, 0.8}, ["color"]={255,0,0}, ["size"]=0.25, ["phase"]=0.0}, [4]={["pos"]={0.1, 0.1, 0.8}, ["color"]={255,0,0}, ["size"]=0.25, ["phase"]=0.0}, [5]={["pos"]={-0.6, -0.25, 0.8}, ["color"]={255,0,0}, ["size"]=0.25, ["phase"]=0.0}, [6]={["pos"]={0.6, -0.25, 0.8}, ["color"]={255,0,0}, ["size"]=0.25, ["phase"]=0.0}, [7]={["pos"]={-0.2,0, 0.8}, ["color"]={255,0,0}, ["size"]=0.25, ["phase"]=0.0}, [8]={["pos"]={0.2, 0, 0.8}, ["color"]={255,0,0}, ["size"]=0.25, ["phase"]=0.0}, -- [17]={["pos"]={-0.5,-0.1, 0.8}, ["color"]={0,0,255}, ["size"]=0.25, ["phase"]=10.0}, [18]={["pos"]={0.5, -0.1, 0.8}, ["color"]={0,0,255}, ["size"]=0.25, ["phase"]=10.0}, [19]={["pos"]={-0.1, 0.1, 0.8}, ["color"]={0,0,255}, ["size"]=0.25, ["phase"]=10.0}, [199]={["pos"]={0.1, 0.1, 0.8}, ["color"]={0,0,255}, ["size"]=0.25, ["phase"]=10.0}, [188]={["pos"]={-0.6, -0.25, 0.8}, ["color"]={0,0,255}, ["size"]=0.25, ["phase"]=10.0}, [166]={["pos"]={0.6, -0.25, 0.8}, ["color"]={0,0,255}, ["size"]=0.25, ["phase"]=10.0}, [177]={["pos"]={-0.2,0, 0.8}, ["color"]={0,0,255}, ["size"]=0.25, ["phase"]=10.0}, [155]={["pos"]={0.2, 0, 0.8}, ["color"]={0,0,255}, ["size"]=0.25, ["phase"]=10.0}, --=-=-=-- [40]={["pos"]={-0.77, 2.10, 0.10}, ["color"]={255,0,0}, ["size"]=0.1, ["phase"]=1.0}, [41]={["pos"]={0.77, 2.10, 0.10}, ["color"]={255,0,0}, ["size"]=0.1, ["phase"]=1.0}, [42]={["pos"]={-0.6, 2.26, 0.10}, ["color"]={0,0,255}, ["size"]=0.1, ["phase"]=0.0}, [43]={["pos"]={0.6, 2.26, 0.10}, ["color"]={0,0,255}, ["size"]=0.1, ["phase"]=0.0}, ----frente^ }, -- radio patrulha [404] = {["mode"]="led", [1]={["pos"]={-0.5,-0.1, 1.0}, ["color"]={255,0,0}, ["size"]=0.25, ["phase"]=0.0}, [2]={["pos"]={0.5, -0.1, 1.0}, ["color"]={255,0,0}, ["size"]=0.25, ["phase"]=0.0}, [3]={["pos"]={-0.1, 0.1, 1.0}, ["color"]={255,0,0}, ["size"]=0.25, ["phase"]=0.0}, [4]={["pos"]={0.1, 0.1, 1.0}, ["color"]={255,0,0}, ["size"]=0.25, ["phase"]=0.0}, [5]={["pos"]={-0.6, -0.25, 1.0}, ["color"]={255,0,0}, ["size"]=0.25, ["phase"]=0.0}, [6]={["pos"]={0.6, -0.25, 1.0}, ["color"]={255,0,0}, ["size"]=0.25, ["phase"]=0.0}, [7]={["pos"]={-0.2,0, 1.0}, ["color"]={255,0,0}, ["size"]=0.25, ["phase"]=0.0}, [8]={["pos"]={0.2, 0, 1.0}, ["color"]={255,0,0}, ["size"]=0.25, ["phase"]=0.0}, -- [17]={["pos"]={-0.5,-0.1, 1.0}, ["color"]={0,0,255}, ["size"]=0.25, ["phase"]=10.0}, [18]={["pos"]={0.5, -0.1, 1.0}, ["color"]={0,0,255}, ["size"]=0.25, ["phase"]=10.0}, [19]={["pos"]={-0.1, 0.1, 1.0}, ["color"]={0,0,255}, ["size"]=0.25, ["phase"]=10.0}, [199]={["pos"]={0.1, 0.1, 1.0}, ["color"]={0,0,255}, ["size"]=0.25, ["phase"]=10.0}, [188]={["pos"]={-0.6, -0.25, 1.0}, ["color"]={0,0,255}, ["size"]=0.25, ["phase"]=10.0}, [166]={["pos"]={0.6, -0.25, 1.0}, ["color"]={0,0,255}, ["size"]=0.25, ["phase"]=10.0}, [177]={["pos"]={-0.2,0, 1.0}, ["color"]={0,0,255}, ["size"]=0.25, ["phase"]=10.0}, [155]={["pos"]={0.2, 0, 1.0}, ["color"]={0,0,255}, ["size"]=0.25, ["phase"]=10.0}, --=-=-=-- [40]={["pos"]={-0.77, 2.16, -0.36}, ["color"]={255,0,0}, ["size"]=0.1, ["phase"]=1.0}, [41]={["pos"]={0.77, 2.16, -0.36}, ["color"]={255,0,0}, ["size"]=0.1, ["phase"]=1.0}, [42]={["pos"]={-0.6, 2.36, -0.36}, ["color"]={0,0,255}, ["size"]=0.1, ["phase"]=0.0}, [43]={["pos"]={0.6, 2.36, -0.36}, ["color"]={0,0,255}, ["size"]=0.1, ["phase"]=0.0}, ----frente^ }, --------=========--------- -- FBI Rancher [490] = {["mode"]="lamp", [1]={["pos"]={0, 0.2, 0.9}, ["color"]={255,0,0}, ["size"]=0.4, ["phase"]=5.0}, [2]={["pos"]={0.4, 0, 0.9}, ["color"]={255,0,0}, ["size"]=0.4, ["phase"]=0.0}, [3]={["pos"]={-0.4, 0, 0.9}, ["color"]={255,0,0}, ["size"]=0.4, ["phase"]=15.0}, [4]={["pos"]={0.55, -0.2, 0.9}, ["color"]={255,0,0}, ["size"]=0.4, ["phase"]=7.0}, [5]={["pos"]={-0.55, -0.2, 0.9}, ["color"]={255,0,0}, ["size"]=0.4, ["phase"]=20.0} }, -- since 0.8 there are no default lights position, because only emergency and pre-defined vehicles can use lights --["default"] = {["mode"]="lamp", [1]={["pos"]={0.5, 0, 0.8}, ["color"]={255,0,0}, ["size"]=0.25, ["phase"]=0.0}, [2]={["pos"]={-0.5, 0, 0.8}, ["color"]={0,0,255}, ["size"]=0.25, ["phase"]=10.0}} } -- do not modify -------------------------------------------- local vehicles = {} local timers = {} local base_freq = 50 -- freq of timer for light change ------------------------------------------------------------- function release_vehicle(vehicle) if (isElement(vehicle)) then if (is_strobo_enabled) then setVehicleOverrideLights ( vehicle, 0) setVehicleLightState ( vehicle, 0, 1 ) setVehicleLightState ( vehicle, 1, 1 ) setVehicleLightState ( vehicle, 2, 1 ) setVehicleLightState ( vehicle, 3, 1 ) end end if (vehicles[vehicle]~=nil) then -- release the markers for key, value in pairs(vehicles[vehicle]["flist"]) do destroyElement (value["m"]) end setElementData(vehicle, "vtrgiroflex", false) vehicles[vehicle] = nil end if (timers[vehicle]~=nil) then -- kill the strobo timer killTimer(timers[vehicle]) timers[vehicle] = nil if (isElement(vehicle)) then if (getElementData( vehicle, "emerlights_source")==getPlayerName(getLocalPlayer())) then triggerEvent ( "onPlayerEmergencyLightStateChange", getRootElement(), 0 ) end end end end function checkForAbility(vehicle) local veh_model = getElementModel ( vehicle ) if (car_lights_table[veh_model]==nil)or(getElementData( vehicle, "emerlights_enabled" )=="false") then return false end return true end function strobo_state_update (vehicle) -- check for valid vehicle if (isElement(vehicle)) then if (vehicles[vehicle]==nil) then -- check for disallowing to use lights -- its enabled by default if (checkForAbility(vehicle)==false) then release_vehicle(vehicle) return end local veh_model = getElementModel ( vehicle ) --if (car_lights_table[veh_model]==nil) then --veh_model = "default" --end setElementData( vehicle, "emerlights_source", src, false) if (src==getPlayerName(getLocalPlayer())) then triggerEvent ( "onPlayerEmergencyLightStateChange", getRootElement(), 1 ) end -- init state variable vehicles[vehicle] = {} vehicles[vehicle]["lstate"] = 0 -- strobo lights state vehicles[vehicle]["fstate"] = 0 -- flash light state vehicles[vehicle]["flist"] = {} -- flash lights list (marker ids) -- create flash lights local mode = car_lights_table[veh_model]["mode"] if (mode==nil) then mode = "lamp" end local coeff = 0 if (mode=="lamp") then coeff = 3.141592654/10.0 else coeff = blink_interval/20.0 end vehicles[vehicle]["fmode"] = mode for light_id, light_desc in pairs(car_lights_table[veh_model]) do if (light_id~="mode") then vehicles[vehicle]["flist"][light_id] = {} vehicles[vehicle]["flist"][light_id]["m"] = createMarker( 0.0001, 0.0001, 0.0001, "corona", light_desc["size"], light_desc["color"][1], light_desc["color"][2], light_desc["color"][3], 100) vehicles[vehicle]["flist"][light_id]["p"] = light_desc["phase"]*coeff attachElements ( vehicles[vehicle]["flist"][light_id]["m"], vehicle, light_desc["pos"][1], light_desc["pos"][2], light_desc["pos"][3] ) end end end -- strobo light if (is_strobo_enabled) then setVehicleOverrideLights ( vehicle, 2) if (vehicles[vehicle]["lstate"]<strobo_interval) then setVehicleLightState ( vehicle, 0, 1 ) setVehicleLightState ( vehicle, 1, 0 ) setVehicleLightState ( vehicle, 2, 0 ) setVehicleLightState ( vehicle, 3, 1 ) else setVehicleLightState ( vehicle, 0, 0 ) setVehicleLightState ( vehicle, 1, 1 ) setVehicleLightState ( vehicle, 2, 1 ) setVehicleLightState ( vehicle, 3, 0 ) end if (vehicles[vehicle]["lstate"]>=strobo_interval*2) then vehicles[vehicle]["lstate"] = 0 else vehicles[vehicle]["lstate"] = vehicles[vehicle]["lstate"] + 1 end end -- flash light if (vehicles[vehicle]["fmode"]=="lamp") then -- lamp mode local tmp_fstate = vehicles[vehicle]["fstate"] for key, value in pairs(vehicles[vehicle]["flist"]) do local R, G, B, A = getMarkerColor( value["m"] ) setMarkerColor(value["m"], R, G, B, (math.sin(tmp_fstate+value["p"])+1.0)*128.0) end vehicles[vehicle]["fstate"] = vehicles[vehicle]["fstate"] + flash_interval else -- led mode local tmp_fstate = vehicles[vehicle]["fstate"] for key, value in pairs(vehicles[vehicle]["flist"]) do local R, G, B, A = getMarkerColor(value["m"]) -- blinking mode local tmp_val = tmp_fstate+value["p"] if (tmp_val>blink_interval) then tmp_val = tmp_val - blink_interval end if ((tmp_val>=0)and(tmp_val<blink_duration))or((tmp_val>=blink_duration+1)and(tmp_val<blink_duration*2+1)) then setMarkerColor(value["m"], R, G, B, 255) else setMarkerColor(value["m"], R, G, B, 0) end end vehicles[vehicle]["fstate"] = vehicles[vehicle]["fstate"] + 1 if (vehicles[vehicle]["fstate"]>blink_interval) then vehicles[vehicle]["fstate"] = vehicles[vehicle]["fstate"] - blink_interval end end else -- if vehicle is no more exists release_vehicle(vehicle) end end function isStroboLightsOn (vehicle_id) if (timers[vehicle_id]) then return 1 else return 0 end end function setStroboLightsOn(vehicle_id, value) if ( vehicle_id ) then if (value==nil) then if (isStroboLightsOn(vehicle_id)==1) then value = 0 else value = 1 end; end; if (value==0) then if (timers[vehicle_id]) then release_vehicle(vehicle_id) end end if (value==1) then if (timers[vehicle_id]) then release_vehicle(vehicle_id) end -- create strobo timer timers[vehicle_id] = setTimer ( strobo_state_update, base_freq, 0, vehicle_id ) end end end -- only local effect function enableStroboLightsMode(source, value) if (value=="0")or(value=="false") then is_strobo_enabled = false --outputConsole("Stroboscopic mode disabled") else if (value=="1")or(value=="true") then is_strobo_enabled = true --outputChatBox("Stroboscopic mode enabled") else --outputChatBox("Usage: strobo 0 or strobo 1 for disable/enable stroboscopic lights mode") end end end addCommandHandler("strobo", enableStroboLightsMode) -- triggered by server function setEmerlightsState(value, state) local player = getPlayerFromName ( value ) local vehicle = getPedOccupiedVehicle(player) if (vehicle) then setStroboLightsOn(vehicle, state) end end addEvent("setEmerlights", true) addEventHandler("setEmerlights", getRootElement(), setEmerlightsState) function requestEmerlights() -- check for driver playerVehicle = getPedOccupiedVehicle (getLocalPlayer()) -- get the player's vehicle if (playerVehicle) then -- if player is not a driver if getPedOccupiedVehicleSeat(localPlayer) == 1 or getPedOccupiedVehicleSeat(localPlayer) == 0 then -- sync setElementData(playerVehicle, "vtrgiroflex", true) triggerServerEvent("requestEmerlightChangeState", getLocalPlayer(), 1-isStroboLightsOn(getPedOccupiedVehicle(getLocalPlayer()))) else -- not able to use lights for this vehicle --outputChatBox("unknown car!") end end end addCommandHandler("Strobo Light On", requestEmerlights)--stroboLightOn) bindKey("1", "down", "Strobo Light On") addEvent("onPlayerEmergencyLightStateChange") Server-Side --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local viaturas = { [436]=true,[490]=true,[404]=true } function Sirene1(player,thePlayer,seat) local vehicle = getPedOccupiedVehicle(player) if(vehicle and viaturas[getElementModel(vehicle)])then if getPedOccupiedVehicleSeat(player) == 1 or getPedOccupiedVehicleSeat(player) == 0 then triggerClientEvent("startSireneSound",vehicle) setElementData(vehicle, "SireneTocando1", true) end end end function onResStart1() for index, player in ipairs(getElementsByType("player")) do bindKey(player, "2", "down", Sirene1) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onResStart1) function onPlayerJoin1() bindKey(source, "2", "down", Sirene1) end addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoin1) function cleanAll1(player) for index, player in ipairs(getElementsByType("player")) do unbindKey(player, "2", "down", Sirene1) end end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), cleanAll1) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local viaturas3 = { [436]=true,[490]=true,[404]=true } function Sireneamb2(player,seat) local vehicle = getPedOccupiedVehicle(player) if(vehicle and viaturas3[getElementModel(vehicle)])then if getPedOccupiedVehicleSeat(player) == 1 or getPedOccupiedVehicleSeat(player) == 0 then triggerClientEvent("startSireneSound3",vehicle) setElementData(vehicle, "SireneTocando2", true) end end end function onResStart3() for index, player in ipairs(getElementsByType("player")) do bindKey(player, "3", "both", Sireneamb2) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onResStart3) function onPlayerJoin3() bindKey(source, "3", "both", Sireneamb2) end addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoin3) function cleanAll3(player) for index, player in ipairs(getElementsByType("player")) do unbindKey(player, "3", "both", Sireneamb2) end end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), cleanAll3) addEventHandler("onElementDestroy", getResourceRootElement(getThisResource()), function () local viaturas3 = { [436]=true,[490]=true,[404]=true } local vehicle = getPedOccupiedVehicle(player) if(vehicle and viaturas3[getElementModel(vehicle)])then for index, player in ipairs(getElementsByType("player")) do unbindKey(player, "3", "both", Sireneamb2) unbindKey(player, "2", "down", Sirene1) if (getElementData(vehicle, "SireneTocando1") == true) then setElementData(vehicle, "SireneTocando1", false) triggerClientEvent("startSireneSound",vehicle) end if (getElementData(vehicle, "SireneTocando2") == true) then setElementData(vehicle, "SireneTocando2", false) triggerClientEvent("startSireneSound3",vehicle) end end end end) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function onPlayerRequestEmerlight(value) triggerClientEvent(getRootElement(), "setEmerlights", getRootElement(), getPlayerName(source), value) end addEvent("requestEmerlightChangeState", true) addEventHandler("requestEmerlightChangeState", getRootElement(), onPlayerRequestEmerlight) --> Furkan Özulus <--
  13. BOM ESTE É O CLIENT.LUA do meu painel, quando do o /painel ele aparece e o cursor tbm, mas quando repito o comando " para fechar " só o cursor sai, e o painel fica Painel_On = false local function Painel_Agencia() Janela_Agencia_Emprego = guiCreateWindow(0.22, 0.07, 0.54, 0.80, "", true) guiWindowSetMovable(Janela_Agencia_Emprego, false) guiWindowSetSizable(Janela_Agencia_Emprego, false) guiSetAlpha(Janela_Agencia_Emprego, 1.00) guiSetProperty(Janela_Agencia_Emprego, "CaptionColour", "FF1B0743") Label_Top = guiCreateLabel(0.29, 0.11, 0.40, 0.09, "AGENCIA DE EMPREGO", true, Janela_Agencia_Emprego) guiSetFont(Label_Top, "clear-normal") guiLabelSetHorizontalAlign(Label_Top, "center", false) guiLabelSetVerticalAlign(Label_Top, "center") Butoon_Catador = guiCreateButton(0.01, 0.26, 0.27, 0.10, "CATADOR", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Catador, "NormalTextColour", "FFFFFFFF") Butoon_Jornal = guiCreateButton(0.71, 0.26, 0.27, 0.10, "ENTREGADOR DE JORNAL", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Jornal, "NormalTextColour", "FFFFFFFF") Butoon_Pedreiro = guiCreateButton(0.01, 0.38, 0.27, 0.10, "PEDREIRO", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Pedreiro, "NormalTextColour", "FFFFFFFF") Butoon_Pescador = guiCreateButton(0.71, 0.38, 0.27, 0.10, "PESCADOR", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Pescador, "NormalTextColour", "FFFFFFFF") Butoon_MotoBoy = guiCreateButton(0.01, 0.49, 0.27, 0.10, "MOTO BOY", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_MotoBoy, "NormalTextColour", "FFFFFFFF") Butoon_Gas = guiCreateButton(0.71, 0.49, 0.27, 0.10, "ENTREGADOR DE GÁS", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Gas, "NormalTextColour", "FFFFFFFF") Butoon_Leite = guiCreateButton(0.01, 0.61, 0.27, 0.10, "ENTRAGADOR DE LEITE", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Leite, "NormalTextColour", "FFFFFFFF") Butoon_Eletricista = guiCreateButton(0.71, 0.61, 0.27, 0.10, "ELETRICISTA", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Eletricista, "NormalTextColour", "FFFFFFFF") Butoon_Caminhoneiro = guiCreateButton(0.01, 0.73, 0.27, 0.10, "CAMINHONEIRO", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Caminhoneiro, "NormalTextColour", "FFFFFFFF") Butoon_Minerador = guiCreateButton(0.71, 0.73, 0.27, 0.10, "MINERADOR", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Minerador, "NormalTextColour", "FFFFFFFF") Butoon_Sair = guiCreateButton(10, 532, 719, 59, "SAIR", false, Janela_Agencia_Emprego) guiSetProperty(Butoon_Sair, "NormalTextColour", "FFFFFFFF") end addCommandHandler("painel", function() if Painel_On == false then addEventHandler("onClientRender",getRootElement(),Painel_Agencia) Painel_On = true showCursor(true) else removeEventHandler("onClientRender", getRootElement(), Painel_Agencia) Painel_On = false showCursor(false) end end)
  14. -- Gostaria de Inserir uma Custom marker nessa parte do '' Markers" createMarker... com exports -- exports["TB_marker"]:createMarker("door", Vector3 {x, y, z-0.3}) @Shady1 @Burak5312 function createEvent(name, func) addEvent(name, true); addEventHandler(name, root, func); end --\Utils local spawns = createElement ("KK:onScriptMarkerCorp") local propriedades = { } function getPlayerACLGroup (elemento, acl) if aclGetGroup (acl) then local accName = getAccountName (getPlayerAccount (elemento)) if isObjectInACLGroup ("user." ..accName, aclGetGroup (acl)) then return true else return false end else return false end end for i,v in pairs(global['Markers']) do marker = createMarker( v.posx, v.posy, v.posz -1, "cylinder", 1.5, 0, 159, 255, 50) setElementParent(marker, spawns) propriedades[marker] = {acl = global["Markers"][i].acl}
  15. local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1336), (screenH/768) function dxMaconha() exports["Blur"]:dxDrawBluredRectangle(screenW * 0.0000, screenH * 0.0013, screenW * 1.0000, screenH * 0.9987, tocolor(255, 255, 255, 150)) dxDrawImage(screenW * 0.0000, screenH * 0.0013, screenW * 1.0000, screenH * 0.9987, "files/efeito.png", 0, 0, 0, tocolor(0, 254, 6, 255), false) end function UsarMaconha(player) sound = playSound( "files/reggae_music.mp3", true ) addEventHandler ( "onClientRender", root, dxMaconha ) setPedControlState(player, "walk", true) setWindVelocity(100, 100, 0) setCameraShakeLevel(255) setGameSpeed(0.5) setTimer(function() stopSound( sound ) resetWindVelocity() setCameraShakeLevel(1) setGameSpeed(1) removeEventHandler ( "onClientRender", root, dxMaconha ) end,player*4000,1) end addEvent("TB:UsarMaconha", true) addEventHandler ("TB:UsarMaconha", root, UsarMaconha ) function onClientResourceStart() setPedWalkingStyle(player, 0) stopSound( sound ) resetWindVelocity() setCameraShakeLevel(1) setGameSpeed(1) removeEventHandler ( "onClientRender", root, dxMaconha ) end addEventHandler("onClientResourceStart",resourceRoot, onClientResourceStart) -- ERROS -- [RPINV]\CzInventory\cTeoBeack.lua30: Bad Argument @'SetPedWalkingStyle' [Expected element at argument 1, got nil]
  16. function toggleInvisibility(thePlayer) if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup ("Staff")) then local enabled = getElementData(Player, "ID") if (enabled == true) then setElementAlpha(Player, 0) setElementData(Player, "reconx", false) outputChatBox (" -> Escondeu O ID", thePlayer) setElementData(Player, "invisible", false) elseif (enabled == false or enabled == nil) then setElementAlpha(Player, 0) setElementData(Player, "reconx", true) outputChatBox (" -> Mostrou O ID", thePlayer) setElementData(Player, "invisible", true) else end outputChatBox ("Acesso negado", thePlayer) else end end addCommandHandler("IDV", toggleInvisibility)
  17. eu fiz um sistema de /pro, so que quando o player morre ele continua com o pro, eu ja tentei desativar com o evento "onPlayerWasted" mas nao funciona. function godCommand(player) local conta = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Staff" ) ) then if getElementData(player,"onProt") then setElementData(player,"onProt",false) setElementModel(player, 0) outputChatBox("O staff "..getPlayerName(player).." esta OFF",root,255,255,0,true) else setElementData(player,"onProt",true) setElementModel(player, 10) outputChatBox("O staff "..getPlayerName(player).." esta ON",root,255,255,0,true) end end end addCommandHandler("pro",godCommand) eu queria colocar o onProt no false quando o player morrer.
  18. Olá pessoal, gostaria de algumas dicas de como posso vincular um site com mta. por ex: um sistema de vip que o comprador faça o pagamento pelo site e seja enviado algum tipo de código de ativação automatica. ou até mesmo o jogador ter acesso alguma informação do servidor passado pelo site ex: money, item, etc. Obrigado
  19. Estamos com um sistema de gasolina muito bom, conseguimos resolver alguns bugs do mesmo, porém há um problema que não estamos conseguindo resolver! o ERRO é que quando um jogador vai abastecer, a mensagem acaba aparecendo para todos os outros que estão dentro de algum veículo mas que não estão abastecendo! Se puderem nos ajudar, agradeceríamos muito! PS: esse sistema não é nosso, apenas pegamos no MTA Brasil e estamos fazendo ajustes para usá-lo !
  20. Estou tentando por o addcommandhandler mas não consigo de forma nenhuma, se alguém tiver a solução para algum dos 3 scripts a baixo me avisa fznd o favor estou tentando abrir painel DX por comando ao em vez de por bindkey porem não consigo, já tentei de vários jeitos e formas porem nn vai, já pesquisei aqui no fórum, no YouTube porem nn vai function Pdx ( ) dxDrawRectangle(504, 197, 314, 397, tocolor(255, 0, 0, 100), false) dxDrawRectangle(554, 238, 218, 72, tocolor(255, 255, 255, 255), false) dxDrawRectangle(554, 347, 218, 72, tocolor(255, 255, 255, 255), false) dxDrawRectangle(554, 455, 218, 72, tocolor(255, 255, 255, 255), false) end function abrir (_,state) if painel == false then showCursor(true) addEventHandler("onClientRender", root, Pdx) painel = true else showCursor(false) removeEventHandler("onClientRender", root, Pdx) painel = false end end addCommandHandler("disappear", abrir) addCommandHandler("v", abrir) tabem tentei fazer uma versão para uma bussola: --2017 ~ Mark Gyori https://markgyori.eu/ --Contact: [email protected] local sx, sy = guiGetScreenSize() local top = 30 local font1 = dxCreateFont("font.otf", 11) local font2 = dxCreateFont("font.otf", 10) local exibir_bulssola = false local cords = { {0, "N"}, {15, 15}, {30, 30}, {45, "NE"}, {60, 60}, {75, 75}, {90, "E"}, {105, 105}, {120, 120}, {135, "SE"}, {150, 150}, {165, 165}, {170, "S"}, {195, 195}, {210, 210}, {225, "SW"}, {240, 240}, {255, 255}, {270, "W"}, {285, 285}, {300, 300}, {315, "NW"}, {330, 330}, {345, 345} } function draw ( ) local show = 15 local center = math.ceil(show / 2) - 1 local _, _, r = getElementRotation(getCamera()) local pos = math.floor(r / 15) local slotwidth = 40 local smooth = ((r - (pos * 15)) / 15) * slotwidth local left = sx / 2 - ((show + 2) * slotwidth)/2 for i=1, show do local id = i + pos - center if(id > #cords)then id = id - #cords end if(id <= 0)then id = #cords - math.abs(id) end if(cords[id])then local alpha = (tonumber(cords[id][2]) or 0 > 0) and 175 or 255 if(i < center)then alpha = alpha * (i/center) end if(i > center)then alpha = alpha * ((show-i)/center) end dxDrawRectangle(left + slotwidth * i - smooth + (slotwidth / 2 - 1) + 1, top + 10 + 1, 2, 10, tocolor(0, 0, 0, alpha * 0.5)) dxDrawRectangle(left + slotwidth * i - smooth + (slotwidth / 2 - 1), top + 10, 2, 10, tocolor(255, 255, 255, alpha)) dxDrawText(cords[id][2], left + slotwidth * i - smooth + 1, top + 20, left + slotwidth * (i+1) - smooth + 2, top + 40, tocolor(0, 0, 0, alpha * 0.5), 1, font2, "center", "center") dxDrawText(cords[id][2], left + slotwidth * i - smooth, top + 20, left + slotwidth * (i+1) - smooth, top + 40, tocolor(255, 255, 255, alpha), 1, font2, "center", "center") end end dxDrawText("➤", left + 4, top + 26 + 2, left + ((show + 3) * slotwidth) + 30, 0, tocolor(0, 0, 0, 160), 1, font1, "center", "top", false, false, false, false, false, 90) dxDrawText("➤", left, top + 26, left + ((show + 3) * slotwidth) + 30, 0, tocolor(255, 255, 255, 255), 1, font1, "center", "top", false, false, false, false, false, 90) end addCommandHandler("m1", function() if exibir_bulssola = false then addEventHandler("onClientRender", getRootElement(), draw) exibir_bulssola = true else removeEventHandler("onClientRender", getRootElement(), draw) exibir_bulssola = false end end) --->--->--->---> (inclusive tentei mudar a direção a qual ele gira não consegui se alguém souber como avisa)<---<---<---<--- e também tentei para ativar e desativar primeira pessoa na arma através de comando: function zoomarma (thePlayer) setWeaponProperty ( 30 , "poor" , "flag_aim_1st_person" , true ) setWeaponProperty ( 30 , "std" , "flag_aim_1st_person" , true ) setWeaponProperty ( 30 , "pro" , "flag_aim_1st_person" , true ) end addCommandHandeler ("m1", zoomarma ) esse addCommandHandeler não funciona de jeito nenhum
  21. Boa noite/dia/tarde Eu estou tendo problemas com o dxDrawTextOnElement Preciso que o client procure os players que tenham o elementData (EmServico) e desenhe uma imagem em cima desses players
  22. Olá, meu objetivo com este script é desativar algumas "binds" presentes no jogo quando o player entrar no server, e depois, reativa-las quando o player sair.. . Entre tanto, não consegui faze-lo.. Desde já obrigado pela a ajuda! function DesativarComandosJogo (key, keyState, command) unbindKey (localPlayer, "v", down, change_camera) unbindKey (localPlayer, "e", down, next_weapon) unbindKey (localPlayer, "num_enter", down, next_weapon) unbindKey (localPlayer, "q", down, previous_weapon) unbindKey (localPlayer, "num_dec", down, previous_weapon) unbindKey (localPlayer, "e", down, vehicle_look_left ) unbindKey (localPlayer, "q", down, vehicle_look_right ) unbindKey (localPlayer, "mouse3", down, vehicle_look_behind ) end addEventHandler("onClientPlayerJoin", getRootElement(), DesativarComandosJogo) function ReativarComandosJogo (key, keyState, command) bindKey (localPlayer, "v", down, change_camera) bindKey (localPlayer, "e", down, next_weapon) bindKey (localPlayer, "num_enter", down, next_weapon) bindKey (localPlayer, "q", down, previous_weapon) bindKey (localPlayer, "num_dec", down, previous_weapon) bindKey (localPlayer, "e", down, vehicle_look_left ) bindKey (localPlayer, "q", down, vehicle_look_right ) bindKey (localPlayer, "mouse3", down, vehicle_look_behind ) end addEventHandler("onClientPlayerExit", getRootElement(), ReativarComandosJogo)
  23. Olá, meu objetivo com este script é simplesmente desligar todos os veículos que estão no server quando o script for iniciado, não somente o do player local, mas de todos no server.. Entre tanto, não consegui faze-lo.. Desde já obrigado pela a ajuda! function resetarVeiculos () for i,v in pairs(getElementsByType("vehicle")) do if i and getVehicleEngineState (i) == true then setVehicleEngineState (i, false ) setVehicleOverrideLights (i, 1) else return false end end end addEventHandler("onResourceStart", resourceRoot, resetarVeiculos)
×
×
  • Create New...