Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/04/20 in all areas

  1. ué exemplo de config.Lua config = { id = 500; } exemplo do arquivo compilado: function getConfigId() return config.id end print(getConfigId()) -- ou print(config.id)
    2 points
  2. Você deveria prestar mais atenção nos avisos da Wiki sobre o triggerServerEvent. Aviso: Você deveria usar a variável global client no lado server em vez de passar o localPlayer como parâmetro ou source. Se não, falsificação de evento (passando outro jogador em vez do localPlayer) seria possível. Mais informações no addEventHandler -- client-side triggerServerEvent ("habilitacao.tipob", localPlayer) -- localPlayer será o source do evento. -- server-side function tipo_b () local carro = createVehicle (555, -2064.5, -83, 35) setVehicleColor (carro, 255, 255, 255) warpPedIntoVehicle (source, carro) -- também daria pra utilizar client em vez de source. end addEvent ("habilitacao.tipob", true) addEventHandler ("habilitacao.tipob", root, tipo_b)
    2 points
  3. Apenas saiba que é melhor. Não tem motivo para quebrar a cabeça com isso. Não temos como informar o quão melhor é usar tabelas. Vc precisaria fazer testes por si só com uma altíssima taxa de dados para poder observar mudanças perceptivas na performance para só então poder comparar.
    2 points
  4. Opa, para você receber esse evento no server-side (no caso), você precisar utilizar as seguintes funções. addEvent("Nome do seu Evento", true) addEventHandler("Nome do seu Evento", getRootElement(), nome da sua função ) --/> Exemplo : -- client-side function select () local row = guiGridListGetSelectedItem(gridlist) if row == 1 then cMoney = getPlayerMoney() if (cMoney < 1500) then outputChatBox("Yes") triggerServerEvent("habilitacao.tipob", resourceRoot, localPlayer) --/> AQUI else outputChatBox("Você não tem dinheiro suficiente para adquirir essa habilitação!", 255, 0, 0) end end end -- server-side function tipo_b ( player ) local carro = createVehicle( 555, -2064.5, -83, 35 ) setVehicleColor( carro, 255, 255, 255) warpPedIntoVehicle( player, carro ) end addEvent("habilitacao.tipob", true) --/> AQUI addEventHandler("habilitacao.tipob", getRootElement(), tipo_b) --/> AQUI
    2 points
  5. https://github.com/Vadya963/50pSublimeText3Package download from here you can read how to install it below
    1 point
  6. I have burnt the last 3 brain cells I have left and am probably doing something terribly wrong. I will come back to this tomorrow. Thanks for your help @IIYAMA.
    1 point
  7. ياخي اذاي thePed الي هو المفروض تحط مكانه التعريف بتاع الاعب مو الو تعريف ياخي امال الوحه تفتح لمين لا الجني ؟؟؟ + اطرح كودك كامل غير كدا ما حد راح يساعدك
    1 point
  8. This code from onPlayerCommand's wiki page, I just edited and put the command name check inside it. Hmm, looks like unnecessary.
    1 point
  9. good job , good resources , good ideas . but Zombie gamemode dead !
    1 point
  10. Crie uma pasta organizacional (com colchetes que nem a pasta [admin], [gamemodes], etc) por exemplo uma pasta chamada [autostart]. (os colchetes servem para o MTA saber que a pasta contém outros resources, sem o colchetes ele considera a pasta como um resource. Depois de criar a pasta [autostart] (ela tem que estar na raiz da sua pasta resources, ela não pode estar dentro de outra [pasta]), crie um resource qualquer e coloque-o em qualquer lugar exceto dentro da pasta [autostart]. Eu colocaria dentro da pasta [admin] por exemplo. Esse resource qualquer será responsável por ativar todos os resources que estiverem dentro da pasta [autostart] (por esse motivo, ele não pode estar dentro dela, pois é inútil ele tentar ativar a si mesmo). Este resource precisará de permissão admin para poder ativar os demais resources, portanto coloque-o na ACL Group Admin. Este resource deve ter um server.Lua e um meta.xml. No meta.xml, vc precisa declarar o server.Lua e também informar ao MTA que este resource deve ser iniciado por último. Caso contrário ele vai tentar iniciar resources que nem foram carregados ainda e dará erro. O meta.xml deve ficar tipo assim: <meta> <info author="LordHenry" version="1.0.0" name="Auto Start Resources" description="Inicia automaticamente os resources que estiverem na [pasta] definida." type="script" /> <script src="server.Lua" type="server" /> <download_priority_group>-2</download_priority_group> </meta> E o server.Lua deve ficar assim: addEventHandler ("onResourceStart", resourceRoot, function () -- Ativa essa função quando este resource iniciar. for i, res in ipairs (getResources()) do -- Para cada resource do servidor, faça: if (getResourceOrganizationalPath (res) == "[autostart]") then -- Se o resource está dentro da pasta [autostart], então: startResource (res, true) -- Inicia o resource de maneira persistente (ele não vai desligar caso este resource seja desligado) end end end) Pronto.
    1 point
  11. Edite o DFF e o TXD do veículo colocando a imagem do emoji.png Você vai precisar mapear o UV dessa textura usando um programa de modelagem 3D (como o Blender, 3DS Max ou zModeler). Depois vc importa esse DFF e TXD para o MTA, substituindo o veículo original por este. Vc vai precisar das funções: engineLoadTXD engineImportTXD engineLoadDFF engineReplaceModel
    1 point
  12. O link informado é de um vídeo sobre CEGUI e não sobre o GUI Editor.
    1 point
  13. Aqui está o erro, os três primeiros argumentos não condiz com a posição desejada do texto resultando em um não aparecimento do texto mediante a verificação de distancia if getDistanceBetweenPoints3D(0 , 0, 4 + 5, x, y, z) < 10 then Desta forma, deve solucionar o problema: local pX,pY,pZ = 1007.8150024414, -1993.7969970703, 13.155365943909 function texto() local x,y,z = getElementPosition( source ) if getDistanceBetweenPoints3D(pX, pY, pZ, x, y, z) < 10 then local coords = {getScreenFromWorldPosition(pX,pY,pZ)} if coords[1] and coords[2] then dxDrawText("teste", coords[1], coords[2], coords[1], coords[2], tocolor(0, 5, 254, 255), 4.00, "sans", "center", "center", false, false, false, false, false) end end end addEventHandler("onClientRender", root,texto)
    1 point
  14. Fiz algumas correções, e adicione o blip apenas no local. local tiro = true --/> Alterado local Acl = "Console" function tiro_localizar ( ) local x, y, z = getElementPosition(source) local loc = getZoneName ( x, y, z ) local city = getZoneName ( x, y, z, true ) for i, player in ipairs (getElementsByType ("player")) do if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (player)), aclGetGroup (Acl)) then if tiro == true then tiro = false --/> Movido exports.Res_dxmessages:outputDx(player, "Denuncia de Tiros Em "..loc.." ("..city..")", "info") local blip = createBlip( x, y, z, 30, 1, 255, 255, 255, 255, 0, 65535, player) setTimer ( function( ) destroyElement(blip) tiro = true --/> Movido end, 60000, 1) end end end end addEventHandler ("onPlayerWeaponFire", root, tiro_localizar )
    1 point
  15. إمتحانات الثانوية العامة
    1 point
  16. - سيتم إغلاق جميع الحسابات الخاصة بي و إعادة فتحها بعد 28\7\2020 - Thanks For All
    1 point
  17. ضيف صورة ب ملف فاضي وسوي ملف xml وسوي ريستارت لل guieditor
    1 point
  18. 1 point
  19. لأ , اصلا الكود الي عطيتك اياه انت لازم تكمله ! , لانه مش كامل
    1 point
  20. شوف في طريقة , Image = guiCreateStaticImage ( ) for _ , _v in ipairs ( { 'gui-button' , 'gui-lable' } ) do for _ , v in ipairs ( getElementsByType ( _v ) ) do guiSetProperty -- 'AlwaysInTop' end end
    1 point
  21. Hello, We, the eXo-Reallife team, would like to release a module that is also used on our server. It is a pathfinding module developed by Jusonex and StiviK. The module uses the A * algorithm. (https://en.wikipedia.org/wiki/A*_search_algorithm) We use this for our GPS: Why did we develop a module for this and did not simply write a script? This has a very simple reason. The module calculates the routes in your own threads, which has the advantage that it is much faster than a script, and secondly, you can calculate how much routes as you want side by side. This will not cause any lags etc.! What are the features of the module? The module can load several graphs / nodes side by side The module calculates the routes in its own threads Very useful API functions (such as findNodeAt or getNodeNeighbors) What are the main features? int loadPathGraph (String pathToGraphFile) This function loads the graph from the given file and returns a GraphId which you need for all other functions. If something does not work, false is returned. bool findShortestPathBetween (int graphId, float startX, float startY, float startZ, float endX, float endY, float endZ, function callback) This function finds the shortest route between the points. (Unfortunately, no vectors can be handed over!) The callback function is called when the calculation is finished. As an argument, either a table is returned that contains all nodes, or false if no route is found. bool unloadPathGraph (int graphId) You can use this function if you no longer need and want to unload the graph, it returns true if everything is fine, false if an error has occurred. You will find all the other functions that are included in our documentation. Why is the eXo team releasing all this? Well, that has the simple reason, we want to share our work with others and not just keep it for us! We hope we can enrich you with it and vlt. Even help! Where can I download the module? The whole module is open-source and can be viewed in our GitHub organization. It's released under the MIT License. GitHub organization: https://github.com/eXo-MTA Repository: https://github.com/eXo-MTA/ml_pathfind Download the module (Windows / Linux): https://github.com/eXo-MTA/ml_pathfind/releases Nodes of all roads in SA: https://github.com/eXo-MTA/ml_pathfind/blob/master/test/sa_nodes.json If you find any mistakes or suggestions, you can simply create a new issue and we will look into it. So now that's it, have fun with the module! - StiviK and the eXo-Reallife team (Original thread in German: https://www.mta-sa.org/thread/36365-release-mta-sa-pathfinding-module/?postID=407938#post407938)
    1 point
×
×
  • Create New...