Popular Content

Showing content with the highest reputation on 15/09/19 in all areas

  1. 1 point
    Multi Theft Auto: San Andreas 1.5.7 is released Today we are proud to announce the release of MTA:SA 1.5.7. You will receive an automatic update soon, but if you don't have MTA installed, you can get it from the home page. This is the final release to support Windows XP and Vista — if you still use Windows XP or Vista, upgrade Windows now. We are also looking for a web designer to help us create a new website! Statistics Multi Theft Auto: San Andreas turned 10 years old last week. Happy birthday! This is the 24th 1.x.x release 359 days since our last release 27 new functions 4 new events 117+ bug fixes and changes 540+ commits 30 contributors, of which 7 are new 64+ total contributors Download This release is backwards compatible with the older 1.5.x releases (1.5.6, 1.5.5, all the way to 1.5). However, if you would like to take advantage of all of these useful changes, you will need to go and download the update! Servers: binaries are available. Do not forget to update your default resources. Highlights This release includes many additions, improvements, and fixes: New drawing functions dxDrawPrimitive and dxDrawMaterialPrimitive Improved performance Fix swimming speed on higher FPS Skimmers can now lift off water at high FPS New events onClientWorldSound, onClientPedStep, onClientVehicleWeaponHit Surface property functions like engineSetSurfaceProperties and much more! Read the 1.5.7 release notes for a complete set of changes and more information about the improvements listed above. Watch or star our GitHub repository to keep on top of all the things we're working on. Important future script changes From 1.6 onwards we will be making at least the following changes: callRemote callbacks currently set the error code to nil when there is no error. In 1.6, to be consistent with fetchRemote, the error code reported will be 0. See GitHub #294. Since July 2016 if you provide an invalid string like "randomstring" when a function expects a number, the string will be treated as 0 and raise a script warning. In 1.6 this will be an error. You will still be able to provide strings containing numbers (e.g. "100" and "12.34"), this change only affects invalid strings. See GitHub #1043. When providing a width and height of (0, 0) to createBrowser or guiCreateBrowser you will encounter a script error instead of a warning. The warning was introduced Feb 2019. See GitHub #1069. Some functions expect only unsigned integers (positive numbers), and since Jan 2016 providing negative numbers would be a warning. This will now be an error. See GitHub #1070. Since Aug 2015, we replaced the custom mtalocal:// URL scheme with http://mta/resourceName/blah.html. This mtalocal:// URL scheme will now be removed. See GitHub #1071. This list is inconclusive and we may introduce more changes later. What's next? Multi Theft Auto depends on community input and contributions. To keep a project like MTA going we need LOTS of people. You can help in the following areas: Designing We are looking for a web designer to help us create a new website. Testing and bug reporting Whenever you encounter a bug or recognise a need for improvement, we can't fix it until you tell us your problem! We're continually working on new features and fixes for MTA, and this always needs testing. Join our Nightly release stream (Settings -> Advanced -> Update build type) and make sure you keep in touch with on Discord and report issues on GitHub. Programming If you know C++ you may be interested in helping improve Multi Theft Auto's client. Working on open-source software may seem scary, but the best way is to try! Read GitHub's open source guide, and then find an itch to scratch, or scratch your own! Documentation Documentation is important, but also time consuming. If you enjoy writing and have some knowledge of English, or you would like to translate the English version to your native language, you’re very welcome to do so. Just head over to our wiki, create an account, and start editing! Support Do you like people? Can you give calm and thought-out responses to users needing help? Then you can spend some time providing support to those who need it. Many answers can be found on our wiki, so make sure to take some time to read it. Then, either join our chat or forums (linked below), or simply help us sort out issues and answer questions on the GitHub repository. Translation Want to translate MTA to your own language? Awesome! Visit us on Pootle. As soon as your translation is approved, it will be pushed to our repository for use in future releases. Donations Keeping the MTA downloads, master server and websites alive costs money! If you want to help us sustain our financial expenses, please donate! Thank you! Thank you to the following community members for their donations this year: Arran, [RUS] Artem Smirnov, Atti, (SAUR)Castillo, CEKfile, .:CiBeR:., Dmi7ry, HACKER99, Malone, Nero, Nicolae Vlad, pentaflops, Platin, -ffs-Sniper, Tapleto-Hos Thank you very much to the following community members for their work towards this release: Addlibs, Arran, CrosRoad95, Dezash, Dutchman101, FileEx, forkerer, Haxardous, lex128, lopezloo, LopSided, Neproify, nonamenoname, ricksterhd123, samr46, StrixG, tederis, TheNormalnij, xerox8521, xLuxy and many others who contributed to our wiki and helped out with issues. (If your name is missing or you want to change your entry above, please let us know on Discord!) You could be on this list! We're always on the lookout for new contributors. Contribute on GitHub, and chat with us on Discord. We have channels for scripting, general support (bugs), mod development, and many more! Finally, please give a 👋 to our newest contributor @myonlake and our newest addition to the MTA team @botder! Hope you've had a great summer! — MTA Team
  2. 1 point
    Algerians and Tunisians are Arabs! Close this section!.
  3. 1 point
  4. 1 point
    Só seguir a mesma lógica que o outro tópico seu: https://forum.mtasa.com/topic/119979-ajuda-samu-por-id-script-id/ Vai precisar do sistema de ID no server e no seu script você coloca a função getPlayerID: 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 De resto é adicionar o parâmetro id no comando e verificações.
  5. 1 point
    That is line 5 for us. If table is higher than 0? OR If table item count is higher than 0? if #result > 0 then
  6. 1 point
    Não, Lua não tem o poder de detectar a linguagem humana e adivinhar as coisas. Fiz um código que explica os passos e deixei comentado -- especificar 'thePlayer' if isPlayerInACL( thePlayer, "Admin" ) then -- o jogador está no grupo outputChatBox( "Bem-vindo admin "..getPlayerName(thePlayer).."!", thePlayer ) else -- o jogador não está no grupo outputChatBox( "Você não é admin!", thePlayer ) end -- função que envia mensagem para os membros de um grupo function sendMessageForGroup( msg, playerWhoSend ) for _, player in ipairs(getPlayersInACLGroup("Admin")) do -- loop nos jogadores do grupo if player ~= playerWhoSend then -- verificar se o jogador é diferente do que enviou a msg outputChatBox( msg, player ) -- mostrar a mensagem ao jogador do grupo end end end -- exemplo: sendMessageForGroup( "Olá", getPlayerFromName("nome_do_player_que_enviou") )
  7. 1 point
    Exemplo: local time addEvent( "onServerCallAddSetTimer", true ) addEventHandler( "onServerCallAddSetTimer", root, function () time = setTimer(function() time = nil removeEventHandler( "onClientRender", root, renderTime ) end, 180000, 1) addEventHandler( "onClientRender", root, renderTime ) end ) function renderTime() local gDetails = getTimerDetails(time) if not gDetails then return end local remainingTime = secondsToTimeDesc( gDetails / 1000 ) dxDrawText( "Tempo de vida restante: "..tostring(remainingTime), left, top, right, bottom ) end function secondsToTimeDesc( seconds ) if seconds then local results = {} local sec = ( seconds %60 ) local min = math.floor ( ( seconds % 3600 ) /60 ) local hou = math.floor ( ( seconds % 86400 ) /3600 ) local day = math.floor ( seconds /86400 ) if day > 0 then table.insert( results, day .. ( day == 1 and " day" or " days" ) ) end if hou > 0 then table.insert( results, hou .. ( hou == 1 and " hour" or " hours" ) ) end if min > 0 then table.insert( results, min .. ( min == 1 and " minute" or " minutes" ) ) end if sec > 0 then table.insert( results, sec .. ( sec == 1 and " second" or " seconds" ) ) end return string.reverse ( table.concat ( results, ", " ):reverse():gsub(" ,", " dna ", 1 ) ) end return "" end
  8. 1 point
  9. 1 point
    You will need triggerClientEvent for that. exports only work on the same client/server-side. Server (resource 1) triggerClientEvent (source, "fill in eventName", source, itemValue) Client (resource 1) It is important to place the addEvent on the resource that is triggering, this reduces errors: "event isn't added" addEvent("fill in eventName", true) Client (resource 2) addEventHandler("fill in eventName", localPlayer, showPhoneFunction, false)
  10. 1 point
    localPlayer doesn't exist on serverside. It only exist on your own MTA san application, which is clientside. You need to define which player is going to receive the message on serverside. You wrote two times lang1. You forgot to write a fallback when no language is selected. local language = getElementData(source,"language") if not language or language == lang1 then outputChatBox("#FFFFFF "..nickA.. " #00CC40killed #FFFFFF ["..kills.."] #00CC40players!", source,255,0,0,true) elseif language == lang2 then outputChatBox("#FFFFFF "..nickA.. " #00CC40zabil #FFFFFF ["..kills.."] #00CC40hračov na CW!", source,255,0,0,true) end
  11. 1 point
    You could save it in to an XML file > clientside There is a resource that does that automatic for you: https://community.multitheftauto.com/index.php?p=resources&s=details&id=16187 Including a wiki guide: https://wiki.multitheftauto.com/wiki/XmlSaveData No need for saving such data in to a database, as the user wants to have this info when he joins and not when he logins.
  12. 1 point
    Não percebi erros, tente isto: function tele (thePlayer) if getPedOccupiedVehicle(thePlayer) then return outputChatBox ("#ff0000Você precisa sair do veículo para usar teleportes.", thePlayer, 255, 255, 255, true) end if getElementInterior(thePlayer) ~= 0 then return outputChatBox ("#ff0000Você precisa sair do interior para usar teleportes.", thePlayer, 255, 255, 255, true) end if (commando[thePlayer]) then return end fadeCamera(thePlayer, false, 0.5) setTimer( function(player) if isElement(player) then fadeCamera( player, true ) end end, 1000, 1, thePlayer ) setTimer( function(thePlayer) if (isElement(thePlayer)) then setElementPosition ( thePlayer, 260, -1780, 7 ) end end, tempo, 1, thePlayer) commando[thePlayer] = true setTimer( function(thePlayer) if (isElement(thePlayer)) then commando[thePlayer] = false end end, tempo*2, 1, thePlayer) end addCommandHandler ( "praia", tele )
  13. 1 point
    Another day We are waiting you guys
  14. 1 point
    Hello guys, A while ago I've been thinking "saving data is pretty annoying.. alot of lines, you are often doing it multiple times for different scripts." So I decided to make a resource as a central handler of data storing/loading. Now I want to share this resource to the community and hope that it will also help you save some time at scripting. The resource (including its functions) are added to the MTA Wiki which can be found here. What is xmlData? xmlData is a resource that provides 3 shared (so server- and client-side) exported functions for automated saving/loding/deleting of files: xmlSaveData (Wiki Page) xmlLoadData (Wiki Page) xmlDeleteData (Wiki Page) xmlSaveData require the data it should store to be a table and xmlLoadData will return the data as a table. These functions are exported function by the resource, so you need to call them. Example: local xml = exports.xmlData local tbl = {posX = 500, posY = 300, sizeX = 300, sizeY = 200} -- Saving xml:xmlSaveData("myFileName", tbl, false, true) -- This will save the file non-serverProtected but encrypted -- or you can do this xml:xmlSaveData("myFileName", tbl, 7) -- This will save the file serverProtected, encrypted, resourceProtected -- Loading local myTable = xml:xmlLoadData("myFileName", 7) -- This will attempt to load the data saved in highest security level -- Note: You need to load the data on the same security level as you saved it. Data security This resource also gives you ways to secure the data you want to store: Server protection -- If a file is server protected, only the server that has created it is able to read/modify it Encryption -- If a file is encrypted humans won't be able to read/modify it Resource Protection -- If a file is resource protected only a resource with the same name is able to read/modify it Combining these parameters will give you different levels of security for your file. For simplification you can instead of passing booleans just pass the security level you want to have (see the functions syntax please) 0 - No protection (any server, any resource or humans could read/modify) 1 - Very low protection (creator resource on any server or humans could read/modify) 2 - Very low protection (any resource on any server could read/modify, humans cant) 3 - Low protection (only creator resource on any server could read/modify, humans cant) 4 - Medium protection (any resource on the creator server or humans could read/modify) - Default setting if no 'security parameters' are given 5 - Medium protection (only creator resource on the creator server or humans could read/modify) 6 - High protection (any resource on the creator server could read/modify, humans cant) 7 - Very high protection (only creator resource on creator server could read/modify, humans cant) Other uses You can ofc use this script for example to save protected login data, but you can also use it in these ways for example: Cross-Resource communication: You could save a file called "settings" in resourceA and then load it in resourceB. Like this you have an easy way to make your server resources talk with each other without the need of events, exported functions and passing arguments. (if the file is not resourceProtected) Cross-Server communication: One step further could be that for example mapping script settings could be synchronized between different mapping servers (if the file is not serverProtected) Download The download for this resource can be found on the MTA Community page. Note: This resource does not require admin/any acl rank. I hope you like it and it will save you some work Sincerely, Ceeser
  15. 1 point
    Hey, i reworked mta community webpage. I apologize in advance for my bad english ❤️ Russia power!
  16. 1 point
    That's pretty rude. You do know that, he's just talking about his server and updates for it? That's what the topic was for.
  17. 1 point
    Vou citar alguns que na minha opinião são obrigatórios em um servidor RP: Sistema de fome, sede, sono. Sistema de prisão. Empregos (tanto honestos quanto criminosos). Sistemas de veículo (gasolina, velocímetro, seta, ré, radar de velocidade, trancar veículo, gps, etc). Sistema de casas. Lojas (skins, veículos, armas, roupas do CJ). Sistema de Level. Sistema de save/load Era mais fácil vc simplesmente entrar num servidor famoso de RP e estudar quais resources eles tem lá.