Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 30/11/24 in Posts

  1. Hello all. The holiday season is finally here, and we have prepared a more compact summary post for you than usual. Please read on to see, what we have been up to lately. GTA VI The upcoming year will bring us the next game from the Grand Theft Auto series - GTA VI. Planned to launch in Fall 2025 on consoles, it will likely arrive on PC as well, just some months later. The second trailer for GTA VI is also rumoured to be shown soon, with some elaborate fan theories backing these rumours. Will the game be good? Only the time will tell, but looking back, there was not a major GTA game release from Rockstar Games that was bad (for the sake of this argument, let's consider the Trilogy as a minor release ). That alone makes it worth to look forward to it, and it will be also nice to re-visit Vice City similar to how we did it with Liberty City and San Andreas. MTA Status and Updates Not much to report in regards of MTA - we have been focusing on improving various parts of our infrastructure, which is not immediately visible at first glance. Still, since there are many areas that need the attention, there is a lot of work involved. Thankfully, CiBeR, Botder, Lopsi, Dutchman and others have been looking into it. Thanks to the hard work done by our Helper - FileEX, we have also refreshed the Lua syntax highlighting system on our Wiki. For a long time it was unmaintained, causing many of the recent MTA scripting functions and events to be not correctly highlighted in the code snippet examples on the wiki. This has changed though, and it should be working much better now. We have been also tinkering with our #MTASpotlights hashtag on X / Twitter. We are still exploring this idea, but nonetheless, thank you for your submissions so far. If you would like to share some media that we could promote, you can do so on our Discord, just please make sure to read the guidelines beforehand. And, naturally, there have been additions to the mod's source code now and then, bringing in new scripting functions and bugfixes. Similarly, we have been pushing those as client updates for you, also now and then. Player Counts and Other Statistics Type Amount of players Date / Time Recent peak number of concurrent unique players 24,808 players 2024.12.22 (at 18.13 GMT) Highest recorded number of concurrent unique players 52,098 players 2020.04.02 (at 18.00 GMT) Recent number of daily unique players 95,445 players 2024.12.15 (Sunday) Highest recorded number of daily unique players 185,818 players 2018.02.03 (Saturday) Recent number of monthly unique players 478,736 players September, 2024 Highest recorded number of monthly unique players 805,903 players January, 2018 For a mod for a game that is nearly 20 years old now, these are fairly good numbers. Smaller than last year, but still impressive. We are glad that you are still with us. MTA:SA version or series Percentage of players using that version or series as of 24th of December, 2024 1.6.0 99.5% 1.5.9 0.4% <1.5.9 0.1% Also, as of 24th of December, 2024: there are over 90,000 members on our Discord server, we have got 13,790 followers on X/Twitter, 58,000 users follow our Facebook fanpage , and our Steam Community group has nearly 50,000 members. --- To end this post on a high note, we would like to take this moment to wish you all Happy Holidays and a Happy New Year. Enjoy the Season and take care. -MTA Team
    20 points
  2. Hello MTA players, I realised that I had to create this post because I got a lot of feedback, I stopped all my activities in MTA and I don't play MTA anymore because I had to make some changes in my life and change my life direction, I saw MTA in 2010 and I started playing, during this time I made very good friends, developers and players, so I would like to thank you all endlessly, 3 months ago I stopped all my activities in MTA, but I was still receiving a lot of message requests (for paid development or other issues) after that I gave everyone goodwill feedback, but I had to stop this because I was receiving a lot of messages from MTA servers and players, Anyway I have to say that I will miss all MTA players and developers, I will visit from time to time but I won't have much time for that, for some players who will try to contact me I have to say that I don't have a discord server and I don't answer private messages, I think you will be understanding and thanks for that... I have reached the end of my career in MTA. I have worked voluntarily on many servers and participated in numerous projects. I have sold all the projects I worked on, both paid and free, and I would like to announce that I will no longer be continuing my projects. I had a great time on many servers, and for that, I want to express my gratitude. Finally, I am deeply grateful to the valuable members of the MTA team, as they have helped me in many ways. Some of them include @Sarrum, @Vinyard, @Citizen, @IIYAMA, @AlexTMjugador, and myonlake (Patrik). I will miss you, guys!
    6 points
  3. Hey MTA community! I’m excited to release the latest version of the In-Game Lua Editor for MTA:SA, now with even more powerful features to enhance your development experience directly inside the game. What’s New in v3.0: Create Resources directly in the editor, with the ability to choose the folder (e.g., [ADMIN], [GAMEMODES]) for resource creation. Rename and Relocate Resources in one action, making resource management easier. Delete Resources with a confirmation dialog to avoid accidental deletions. Create and Edit HTML Files alongside Lua files, allowing you to handle both HTML and Lua resources directly in the game. Base Path System to restrict developers to specific folders, making it perfect for team organization and isolating workspaces. Function Blacklist: Automatically block dangerous functions like loadstring, setAccountPassword, removeAccount, and others for added security. In-Panel Notifications to give real-time feedback for every action performed in the editor. Security Enhancements: Full ACL Permission System to control access and operations. Activity Logs with SQLite tracking every create, edit, delete, and rename operation. Path Protection and additional security measures to prevent risky operations. Video Demo: Watch on YouTube Download: Download the Resource Here GitHub Repository: Visit the GitHub Repository How it Works: The In-Game Lua Editor allows you to browse, create, edit, and delete Lua and HTML files all in real-time directly inside MTA:SA. No need for external editors or FTP uploads, and no server restarts required. Installation Instructions: Download the resource and add it to your server. Grant "Admin" ACL permissions to the resource. Edit the permissionACL variable in editorS.lua with your admin group. Use the /editor command in-game to open the editor. Let me know your thoughts and feedback! This tool has saved me countless hours, and I hope it helps improve your development process as well. More updates and contributions coming soon! Developed by BranD - Trident Sky Company
    5 points
  4. Tired of San Andreas water that looks like someone spilled green paint and called it “good enough”? Meet this shader: water so realistic, you'll forget you're in a 22 year old game. Enjoy ripples, reflections, and surface waves that almost make you wish GTA had fishing. Boats finally look like they’re actually in the water not floating on radioactive soup. Best part? It’s fully customizable tweak the look, the color, the movement, or make the water as cursed as you want. Plus, it’s at least kind of optimized to run smoothly on hopefully most rigs, so you won’t need a NASA PC to enjoy the water. Just install it, and watch your players get distracted and drive off a pier. https://community.multitheftauto.com/index.php?p=resources&s=details&id=19007
    4 points
  5. 3 points
  6. -> develop and sell cheats for players to abuse in servers -> develop and sell anti-cheat for servers to defend from cheating players -> win-win with both sides
    3 points
  7. We are planning to open source Sphene around Q4 of 2025. I'd like to set some expectations: Sphene is still heavily in development, by no means will Sphene be something you can just run and enjoy on a server. While a lot of features have been added to Sphene, a lot of the storyline is not fully playable yet. There are still a lot of glitches, and missing functionality. You WILL run into major issues. We are working through some of the last hurdles that kept us from open sourcing the project. We will only provide support on getting Sphene to run to those with clear intent to help its development. By open sourcing the project later this year, we hope to accelerate its development. We hope to work together as a community to better understand how the underlying game code operates and how to implement missing functionality into Sphene. We look forward to working together with all of you!
    3 points
  8. This fan-made list features free, open-source, popular and reputable Multi Theft Auto resources containing Lua scripts that are not compiled or obfuscated. The goal is to provide a simple starting point for developers who want to learn from high quality code, reuse well maintained systems and contribute to projects that benefit the entire community. All resources included here are publicly available, actively used by players or servers, and shared with the intention of supporting collaboration, transparency and better development practices. Anyone is welcome to suggest additions or improvements so the list can stay accurate and useful for newcomers and experienced developers alike. The Multi Theft Auto server comes with a pack of official resources preinstalled. The full list of these default resources (and more information) is available on this MTA Wiki Article. Highlights: Map Editor Freeroam "play" gamemode Race gamemode Handling editor "hedit" Map fixes Scoreboard (TAB player list) Country of IP Address Admin Panel Performance Browser The list of the community/fan-made MTA resources is hosted on the following Google Spreadsheet for ease of maintenance and accessibility for everyone. https://docs.google.com/spreadsheets/d/1bbr-cXRvWQuyaNx0KtI2Imk4bD0UTWKxx0x8sh2FGKM/edit?usp=sharing Want to suggest a change or addition to that list? Reach out to us on the MTA Discord or here on the forums. It helps if you share your resource on #showroom (MTA Discord), community.multitheftauto.com, forums 'Resources' section, etc...
    2 points
  9. Sphene is now officially open source! https://github.com/sphene/sphene-mta Excited to work with all of you, to turn this highly experimental pile of trash into something beautiful! Remember, Sphene historically has been very experimental. Many different approaches were tried and researched and that has left a lot of experimental, legacy and unfinished code. It's not the most glamorous, but we're still proud of it! Together we'll refactor the legacy code, we'll finish the unfinished pieces and we'll work through all the large problems that are ahead of us. Repository wiki will be filled with information, and lists (current states of each mission, etc) in the coming days. REMEMBER! Sphene is NOT production ready. We will only help those who want to contribute to our development with setting up their local development versions.
    2 points
  10. I am working with Cursor. Which is a fork of Visual Studio Code modified with AI in mind. It is my daily driver. The free version should give you enough monthly requests to finish your script. An no this is not a stupid AI, it is a optimised version for coding after all. You can even choose which AI you want to use, but some advanced may be behind a paywall.
    2 points
  11. PARKING METER SCRIPT COMPATIBLE WITH THE NEWEST OWLGAMING VIDEO SHOWCASE INTERESTING FEATURES OF THIS SCRIPT: dxDraw UI – modern and user-friendly display (like a real parking meter). Hourly parking system – players can choose how many hours they want to park up to 24 hours (to prevent unrealistic over-parking) Dynamic price calculation – price is automatically calculated based on time. Active/expired parking check – players can extend their active parking or start a new one. Sound effects – confirmation, payment. and error sounds. MDC integration – all payments and parking data are stored and then shown in MDC. Multiple parking zones – you can add unlimited zones and meters via config file. PAYHIP LINK If you have any questions, feel free to text me on Discord! (fajlyp)
    2 points
  12. MTA:SA - Claire Anticheat Claire is a modular, lightweight anticheat resource for MTA:SA, designed to improve the integrity and fairness of servers. Its core philosophy is simple: organize detections into clean, independent modules, make them easy to configure, and build an open platform that others can expand and improve. Claire runs silently in the background, acting as a guardian layer — constantly monitoring player behavior, network conditions, and client-side integrity without interfering with gameplay or degrading performance. Its design favors discretion and precision, targeting cheats without disrupting legitimate users. If you're looking for a solid, customizable way to secure your MTA:SA server, try out Claire. Why does it matter? By being fully open-source, Claire gives server owners an accessible and transparent tool to detect common exploits and improve their server environment. But more than that, it invites collaboration. The idea is that, together — through testing, feedback, improvements, and shared knowledge — we can create a more solid, trustworthy anticheat resource that benefits the entire MTA community. Current features Claire currently includes over 20 independent detection modules, covering movement, combat, environment manipulation, network spoofing, and more. All detections are modular, configurable, and designed to operate silently in the background with minimal performance impact. False positives are rare thanks to tolerance-based logic, score systems, and heuristic analysis. Overall reliability across all modules is expected to be around 95%, all features are listed at our GitHub page. Contributing Claire is an open-source project — contributions are welcome! Feel free to contribute with PRs, reports, or suggestions at our GitHub page. You can also reach out to us on Discord. Download Download from MTA Community: latest release - 1.1.5 from 2025/04/22 Download from GitHub: latest release - 1.1.5 from 2025/04/22 Please check our GitHub page before downloading it, I'm open for suggestions.
    2 points
  13. Link: https://payhip.com/TheDarkQ
    2 points
  14. It is indeed a kind of attack. It means that the player is able execute clientside-code on demand. The attacker is triggering 'known generic events' which might be handled by the server. The ones that are unknown are in your logs, the ones that are known and trigger able are not. But that does not mean that the ones that did trigger didn't cause unwanted results. You might want to consider to restart the resources, just to make sure there is no memory leak. The event which AngelAlpha mentioned can indeed help with detecting that kind of attacks. As an extend you can also add a honeypot, which in this case are 'unkown' events for your server but know for other servers. When a player uses this kind of attack again, you can ban them automatic. You might want take a closer look at your logs for candidates (for example money related). There is also this event: https://wiki.multitheftauto.com/wiki/OnPlayerTriggerEventThreshold But be careful with automating things, always test these kind of stuff or you might accidentally nuke your own player base.
    2 points
  15. @Dadinho Só é possível mexer no chat nativo para você mesmo. Não é possível alterar via script. Caso queira, vá no menu ESC > Opções > Interface > Lá em baixo em Layout > Então vc tem acesso às opções de posição e tamanho dele, além de fonte.
    2 points
  16. Hello, when I reviewed your code I came across many issues, and I fixed them through testing. You can check again if you’d like. Let me tell you about the changes I made: The requested "proper zombie system" is now ready: Uses a single timer Controlled animations Smooth flow Performance optimized function findRotation(x1, y1, x2, y2) local t = -math.deg(math.atan2(x2 - x1, y2 - y1)) return t < 0 and t + 360 or t end local zombies = {} function createZombie(x, y, z, firstTarget) local zombie = createPed(0, x, y, z, 0, true) zombies[zombie] = { target = firstTarget, state = "spawning", lastAnimation = nil, spawnTime = getTickCount(), updateDelay = getTickCount() } setPedAnimation(zombie, "ped", "getup_front", 2000, false, true, true, false) setTimer(function() if isElement(zombie) and zombies[zombie] then zombies[zombie].state = "idle" end end, 2000, 1) end function setZombieAnimation(zombie, anim) if not isElement(zombie) or isPedDead(zombie) then return end local data = zombies[zombie] if not data then return end if data.lastAnimation == anim then return end setPedAnimation(zombie) if anim == "idle" then setPedAnimation(zombie, "ped", "WALK_drunk", -1, true, true, true, false) elseif anim == "chase" then setPedAnimation(zombie, "ped", "run_fatold", -1, true, true, true, false) elseif anim == "attack" then setPedAnimation(zombie, "medic", "cpr", -1, true, true, true, false) end data.lastAnimation = anim end function updateZombieState(zombie, data) if not isElement(zombie) or isPedDead(zombie) then zombies[zombie] = nil return end if not isElement(data.target) or isPedDead(data.target) then data.target = findNearestPlayer(zombie) if not data.target then data.state = "idle" return end end local tx, ty, tz = getElementPosition(data.target) local zx, zy, zz = getElementPosition(zombie) local distance = getDistanceBetweenPoints3D(tx, ty, tz, zx, zy, zz) setElementRotation(zombie, 0, 0, findRotation(zx, zy, tx, ty), "default", true) if distance <= 1.5 then if data.state ~= "attack" then data.state = "attack" setZombieAnimation(zombie, "attack") end elseif distance <= 50 then if data.state ~= "chase" then data.state = "chase" setZombieAnimation(zombie, "chase") end local angle = findRotation(zx, zy, tx, ty) local moveX = math.cos(math.rad(angle)) * 0.1 local moveY = math.sin(math.rad(angle)) * 0.1 setElementPosition(zombie, zx + moveX, zy + moveY, zz) else if data.state ~= "idle" then data.state = "idle" setZombieAnimation(zombie, "idle") end end end function findNearestPlayer(zombie) local nearestPlayer = nil local nearestDistance = math.huge local zx, zy, zz = getElementPosition(zombie) for _, player in ipairs(getElementsByType("player")) do if player ~= zombie and isElement(player) and not isPedDead(player) then local px, py, pz = getElementPosition(player) local distance = getDistanceBetweenPoints3D(zx, zy, zz, px, py, pz) if distance < nearestDistance then nearestDistance = distance nearestPlayer = player end end end return nearestPlayer end function updateZombies() for zombie, data in pairs(zombies) do if data.state == "spawning" then if getTickCount() - data.spawnTime > 2000 then data.state = "idle" setZombieAnimation(zombie, "idle") end else if getTickCount() - data.updateDelay > 100 then updateZombieState(zombie, data) data.updateDelay = getTickCount() end end end end local updateTimer = setTimer(updateZombies, 200, 0) addEventHandler("onClientElementDestroy", root, function() if zombies[source] then zombies[source] = nil end end) addCommandHandler("zombie", function() local x, y, z = getElementPosition(localPlayer) createZombie(x, y + 4, z, localPlayer) end)
    1 point
  17. I am the owner of the Tehran MTA server with IP 5.57.39.170. I wanted to register my MTA server on this account. If I need a license, let me know and I will send it to you.
    1 point
  18. # UPDATE * Added sounds when the player doesn't have enough money or when the purchase is done ( different sounds for both). * Dealers now have voices that are triggered when the the bag is opened or when the player can't buy the weapon. * The bag now remains open even when the transaction is failed.
    1 point
  19. Looks great, I can definitely say it’s a solid script. There are just a few small things that could make it even better if improved. For example, you could add a dialogue system with Arms Dealers, letting players buy weapons through that. Maybe also throw in some 3D sound effects when purchasing a weapon it’d give the whole thing a richer, more immersive feel.
    1 point
  20. good job, if you have a different problem please post it here or create a new topic and tag m
    1 point
  21. Is there any error on debug or F8? I dont understand why its not working
    1 point
  22. MTA:SA Lua Enums - TypeScript-inspired Enumerations for Lua Overview A lightweight, type-safe enumeration library for Multi Theft Auto: San Andreas, bringing TypeScript-like enum functionality to Lua. This library provides a clean, intuitive way to define and use enumerations in your MTA:SA scripts. Key Features Multiple Syntax Styles: Create enums using traditional function calls or with a more elegant syntax similar to TypeScript Global and Local Enums: Define global enums for application-wide constants or local enums for module-specific use Type Safety: Validate enum values and prevent modification after creation Auto-incrementing Values: Automatically assign sequential values to enum members Utility Methods: Easily convert between enum values and names with built-in helper functions Example Usage -- Global enum with string name and curly braces enum 'Direction' { NORTH = 1, EAST = 2, SOUTH = 3, WEST = 4 } -- Local enum with direct table assignment local HttpStatus = enum { OK = 200, NOT_FOUND = 404, SERVER_ERROR = 500 } -- Auto-incrementing values enum 'Size' { "SMALL", "MEDIUM", "LARGE" } -- Using enum values local direction = Direction.NORTH local status = HttpStatus.OK -- Get name from value local directionName = Direction.getName(1) -- Returns "NORTH" -- Check if value belongs to enum if HttpStatus(200) then -- 200 is a valid HttpStatus value end Why Use This Library? Clean Code: Eliminate magic numbers and strings with descriptive enum constants Error Prevention: Catch typos and invalid values at runtime Self-documenting: Make your code more readable and maintainable Flexibility: Choose the syntax style that best fits your coding preferences Lightweight: Minimal overhead with no external dependencies Installation Simply include the enum.lua file in your project and add it to your meta.xml: <script src="path/to/enum.lua" type="shared" cache="false" /> Check out the full source code at: https://github.com/norelockk/mtasa-lua-enums This library is perfect for MTA:SA developers looking to write cleaner, more maintainable code with proper type safety. Whether you're building a simple gamemode or a complex resource, these enums will help organize your constants and prevent common errors.
    1 point
  23. Shared\sdk\version.h #define MTASA_VERSION_MAJOR 1 #define MTASA_VERSION_MINOR 6 #define MTASA_VERSION_MAINTENANCE 0 #define MTASA_VERSION_TYPE VERSION_TYPE_CUSTOM #define MTASA_VERSION_BUILD 0 MTASA_VERSION_BUILD это то, что ты ищешь. Можно указать например #define MTASA_VERSION_BUILD 23088
    1 point
  24. function faroisd() local car = getPedOccupiedVehicle(source) -- get the car the player is in (could be false if not in one) if car and isElement(car) then if getVehicleOverrideLights(car) == 1 then setTimer(setVehicleOverrideLights, 100, 1, car, 2) else setTimer(setVehicleOverrideLights, 100, 1, car, 1) end end end addEvent("ligar", true) addEventHandler("ligar", root, faroisd)
    1 point
  25. I edited owl vehicle system so if someone want and reading this post you can use this: Using NewModels Here is github where you find edited vehicle system: https://github.com/Reynikk/OwlGaming-MTA-Addon-Models-Without-Replacing
    1 point
  26. Aquela / depois do * não existe. Remova ela.
    1 point
  27. It's great to see you here again after years. This worked. Thanks IIYAMA!
    1 point
  28. Thank you for your support to the community, it was an honor to have met you and I hope we meet again one day. I wish you the best of luck!
    1 point
  29. Try this one Client.lua local inventario = { ["THC"] = 0, ["LSD"] = 0, ["Cocaina"] = 0, ["Heroina"] = 0 } local productosVendedor = {"THC", "LSD", "Cocaina", "Heroina"} local precios = { ["THC"] = 500, ["LSD"] = 500, ["Cocaina"] = 500, ["Heroina"] = 500 } local ventana, lista, usarButton, cerrarButton -- Función para abrir el menú de compra function abrirMenuDeCompra() ventana = guiCreateWindow(0.3, 0.3, 0.4, 0.5, "Menu de Compra", true) lista = guiCreateGridList(0.1, 0.2, 0.8, 0.5, true, ventana) local columnaProducto = guiGridListAddColumn(lista, "Producto", 0.6) local columnaPrecio = guiGridListAddColumn(lista, "Precio", 0.3) for i, producto in ipairs(productosVendedor) do local row = guiGridListAddRow(lista) guiGridListSetItemText(lista, row, columnaProducto, producto, false, false) guiGridListSetItemText(lista, row, columnaPrecio, "$"..precios[producto], false, false) end local comprarButton = guiCreateButton(0.1, 0.75, 0.8, 0.1, "Comprar Producto", true, ventana) guiSetProperty(comprarButton, "NormalTextColour", "FF0000FF") -- Botón en rojo cerrarButton = guiCreateButton(0.1, 0.88, 0.8, 0.1, "Cerrar", true, ventana) guiSetProperty(cerrarButton, "NormalTextColour", "FFFFFFFF") -- Botón de cerrar -- Evento para comprar productos addEventHandler("onClientGUIClick", comprarButton, function() local selectedItem = guiGridListGetSelectedItem(lista) if selectedItem ~= -1 then local producto = guiGridListGetItemText(lista, selectedItem, columnaProducto) triggerServerEvent("comprarProducto", resourceRoot, producto) end end, false) addEventHandler("onClientGUIClick", cerrarButton, function() if isElement(ventana) then destroyElement(ventana) showCursor(false) end end, false) showCursor(true) end addEvent("abrirMenuDeCompra", true) addEventHandler("abrirMenuDeCompra", resourceRoot, abrirMenuDeCompra) -- Función para agregar el producto al inventario del jugador function agregarProductoAlInventario(producto) if inventario[producto] then inventario[producto] = inventario[producto] + 1 else inventario[producto] = 1 end actualizarPanelDeInventario() end addEvent("agregarProductoAlInventario", true) addEventHandler("agregarProductoAlInventario", resourceRoot, agregarProductoAlInventario) -- Función para mostrar mensaje de compra fallida function mostrarMensajeCompraFallida() outputChatBox("No tienes suficiente dinero para comprar este producto.", 255, 0, 0, true) end addEvent("mostrarMensajeCompraFallida", true) addEventHandler("mostrarMensajeCompraFallida", resourceRoot, mostrarMensajeCompraFallida) -- Función para mostrar mensaje de compra exitosa function mostrarMensajeCompraExitosa(producto) outputChatBox("Compra exitosa de " .. producto .. ". ¡Gracias por tu compra!", 0, 255, 0, true) end addEvent("mostrarMensajeCompraExitosa", true) addEventHandler("mostrarMensajeCompraExitosa", resourceRoot, mostrarMensajeCompraExitosa) -- Función para abrir/cerrar el panel de inventario (F2) function togglePanelDeInventario() if isElement(ventana) then destroyElement(ventana) showCursor(false) else ventana = guiCreateWindow(0.3, 0.3, 0.4, 0.5, "Inventario de Drogas", true) lista = guiCreateGridList(0.1, 0.2, 0.8, 0.5, true, ventana) local columnaProducto = guiGridListAddColumn(lista, "Producto", 0.6) local columnaCantidad = guiGridListAddColumn(lista, "Cantidad", 0.3) for producto, cantidad in pairs(inventario) do local row = guiGridListAddRow(lista) guiGridListSetItemText(lista, row, columnaProducto, producto, false, false) guiGridListSetItemText(lista, row, columnaCantidad, tostring(cantidad), false, false) if cantidad == 0 then guiGridListSetItemColor(lista, row, columnaCantidad, 255, 255, 255) -- Texto blanco else guiGridListSetItemColor(lista, row, columnaCantidad, 0, 0, 0) -- Texto negro end end usarButton = guiCreateButton(0.1, 0.75, 0.8, 0.1, "Usar Producto", true, ventana) guiSetProperty(usarButton, "NormalTextColour", "FF0000FF") -- Botón en rojo cerrarButton = guiCreateButton(0.1, 0.88, 0.8, 0.1, "Cerrar", true, ventana) guiSetProperty(cerrarButton, "NormalTextColour", "FFFFFFFF") -- Botón de cerrar addEventHandler("onClientGUIClick", usarButton, function() local selectedItem = guiGridListGetSelectedItem(lista) if selectedItem ~= -1 then local producto = guiGridListGetItemText(lista, selectedItem, columnaProducto) if inventario[producto] > 0 then usarProducto(producto) inventario[producto] = inventario[producto] - 1 actualizarPanelDeInventario() else outputChatBox("Debes ir al vendedor para comprar " .. producto, 255, 0, 0, true) end end end, false) addEventHandler("onClientGUIClick", cerrarButton, function() if isElement(ventana) then destroyElement(ventana) showCursor(false) end end, false) showCursor(true) end end bindKey("F2", "down", togglePanelDeInventario) -- Función para usar el producto seleccionado function usarProducto(producto) if producto == "THC" then outputChatBox("Usaste THC", 255, 0, 0, true) -- Aplica efectos de THC elseif producto == "LSD" then outputChatBox("Usaste LSD", 0, 255, 0, true) -- Aplica efectos de LSD elseif producto == "Cocaina" then outputChatBox("Usaste Cocaina", 255, 255, 0, true) -- Aplica efectos de Cocaina elseif producto == "Heroina" then outputChatBox("Usaste Heroina", 128, 0, 128, true) -- Aplica efectos de Heroina end end -- Función para actualizar el panel de inventario function actualizarPanelDeInventario() if isElement(ventana) then destroyElement(ventana) togglePanelDeInventario() end end Server.lua -- Crea un vendedor en una ubicación específica local vendedor = createPed(50, 2165.93, 1696.37, 10.82) -- Congela el vendedor para que no se mueva ni muera setElementFrozen(vendedor, true) setElementData(vendedor, "invincible", true) -- Crea un marker (área de interacción) cerca del vendedor local marketMarker = createMarker(2165.93, 1696.37, 10.10, "cylinder", 1.5, 255, 0, 0, 150) -- Función para mostrar el menú de compra function mostrarMenuDeCompra(player) triggerClientEvent(player, "abrirMenuDeCompra", resourceRoot) end -- Función para manejar la compra de productos function comprarProducto(player, producto) local precio = 500 if getPlayerMoney(player) >= precio then takePlayerMoney(player, precio) triggerClientEvent(player, "agregarProductoAlInventario", resourceRoot, producto) triggerClientEvent(player, "mostrarMensajeCompraExitosa", resourceRoot, producto) else triggerClientEvent(player, "mostrarMensajeCompraFallida", resourceRoot) end end -- Evento para mostrar el menú de compra cuando el jugador entra en el marker addEventHandler("onMarkerHit", marketMarker, function(player) if getElementType(player) == "player" then mostrarMenuDeCompra(player) end end) -- Evento para manejar la compra de productos addEvent("comprarProducto", true) addEventHandler("comprarProducto", resourceRoot, comprarProducto) -- Hacer al ped invulnerable addEventHandler("onPedWasted", root, function() if source == vendedor then cancelEvent() end end) addEventHandler("onClientPedDamage", root, function() if source == vendedor then cancelEvent() end end)
    1 point
  30. INTERFAZ DE CONFIRMACION SIMPLE Tal y como lo explica su título, este sistema muestra una interfaz simple para confirmar cualquier acción que se requiera. Utilizando funciones dxDraw para ello, con una animación de entrada y salida simple. SYNTAX dxConfirm(string title, string description, function funcYes, ...) -- title string - El titulo que tendrá la interfaz de confirmacion (default: Confirmación) -- description string - El mensaje de confirmacion que desee mostrar (default: ¿Estás seguro de que quieres hacer esto?) -- funcYes function - La funcion que se ejecutará una vez se presione el boton 'Si'. -- (...) vars - Las variables que contiene la funcion que se ejecutará al presionar el botón 'Si'. EJEMPLO PRACTICO function myFunction(var1, var2) outputChatBox("¡Haz presionado que si!") outputChatBox("var1: "..var1) outputChatBox("var2: "..var2) end dxConfirm("Confirmacion", "¿Estas seguro?", myFunction, "hola mundo!", 15); IMAGEN DE LA INTERFAZ ENLACE DE DESCARGA: CLICK AQUÍ ¡No olvides dejar tu estrellita!
    1 point
  31. yo puedo venderte uno, hecho desde 0, adaptado a tu servidor. discord: kaosblaze
    1 point
  32. Você precisa ativar o gamemode Play. Caso já esteja ativado, provavelmente é porque ele está editado e removeram a parte do SpawnPlayer. Caso não queira ativar o gamemode Play por estar usando outro gamemode, então coloque a parte do SpawnPlayer no seu gamemode. Não se esqueça de que precisa usar o setCameraTarget também para restaurar a câmera no jogador. Alguns gamemodes de roleplay por exemplo removem essa parte de propósito que é para dar tempo de algum médico chegar para buscar/curar o jogador falecido, para só então dar spawn nele.
    1 point
  33. Please use English when posting outside language-specific sections, thanks!
    1 point
  34. This feature is already available under Preferences -> Appearance tab, in the Skin section, select DarkVector for dark mode https://imgur.com/a/KyPB57e
    1 point
  35. Hi!, my name is Laxante101, I'm a .Lua developer, And today I will try to help you understand SQlite WHAT IS SQLITE? SQLite is a relational database management system (RDBMS) that does not require a separate server to function. Unlike database systems like MySQL or PostgreSQL, which need an active server process, SQLite is "embedded" (that is, the database is stored in a local file on disk), and operations with they are made directly within the program that uses it. Luckily for us, SQLite is already built into the MTA. This means that you can use SQLite databases directly in your MTA Lua codes without having to install anything additional "external" or configure an external database server. SQLite support is native to MTA, facilitating the use of databases for persistent storage of in game information. It is normally used on servers that do not use the login panel, they use SQlite so their information that would be saved in accounts is now saved in the .db file. Or on servers that don't use the original game money, they create other types of “money” like diamonds, stars which are all saved every day, well that's usually the case IMPORTANT DETAILS • Simplicity: Doesn't require anything other than a notepad • Portabilidade: Data is stored in a single .db file, which makes backup and migration easier. SQlite Global Structure Connect to Database with dbConnect Execute Queries using dbExec to modify data and dbQuery to recover data. 3. Manipulate Results with dbPoll and process the returned data. Connection to the Database the database file can be created automatically when connecting. The database file is saved in the server's root folder. local db = dbConnect("sqlite", "storage.db") or if you want to automatically create a folder for your file, or to save your .db files, if it is not created it creates it automatically, if it is created it just puts the file in the path. local db = dbConnect("sqlite", "db/storage.db") in this case the "db" folder will be created Creating Tablese data, you first need to create tables in the database. This is done using normal SQL commands like consulta local = [[ CREATE TABLE IF NOT EXISTS players ( id INTEGER PRIMARY KEY AUTOINCREMENT , name TEXT , score INTEGER ) ]] dbExec ( db , query ) Create a player table if it doesn't already exist In this case, we are creating a players table with three columns: ID Name Score Table Structure TEXT: STRINGS INTEGER: STORAGE NUMBERS REAL:STORES FLOATING POINT NUMBERS BLOB: STORES BINARY DATA (images, files). NULL: NIL VALUE If you don't understand what a string or Boolean values are, learn about data types VIDEO HERE Entering Data To add data to the database we use the SQL command INSERT INTO function AddPlayerLX1(name, score) local query = "INSERT INTO jogadores (name, score) VALUES (?, ?)" dbExec(db, query, name, score) end AddPlayerLX1("juninho", 100) The INSERT INTO command inserts a new player with the name "juninho" and score 100 into the players table. Note: The question marks (?) are placeholders for the values that will be passed to dbExec. This helps prevent SQL injection. Deleting Data To remove data from the database, we use the SQL DELETE command DELETE function DeletePlayerLX2(name) local query = "DELETE FROM players WHERE name = ?" dbExec(db, query, name) end DeletePlayerLX2("juninho") Error Handling It is important to verify that database operations were successful. MTA doesn't automatically return detailed errors other than "/debugscript (1, 2, 3)" so let's add checks. function AddPlayerLX3(name, score) local query = "INSERT INTO jogadores (name, score) VALUES (?, ?)" local sucess = dbExec(db, query, name, score) if sucess then outputDebugString("Sucess.") else outputDebugString("Error.") end end IF SUCESS THEN the success variable stores the result of the dbExec function. If the SQL command execution was successful (i.e. the player was added to the database), success will be true. If success is true, the code inside the if block will be executed. else If the success value is false (that is, if the player's insertion fails for some reason, such as an error in the database connection or SQL query), the code inside the else block will be executed Optimizations and Best Practices Optimizations are great for your day-to-day life as a developer, this makes your code more beautiful, less likely to give you server overload errors, etc... Remember to use dbFree to flush queries after use, especially if you are not using dbPoll. local LX4 = dbQuery(db, "SELECT * FROM players") dbFree(LX4) There are several ways to create clean code, I left just one of them Let's be clear: Since the SQLite database is a flat file, you can back it up by simply copying the .db file. To restore the database, simply replace the old file, this is a big advantage of using SQlite instead of using external databases. OBS: All codes were made based on an example of player name and id points, not made in a real project. (just to make it clear That's all I remembered, if there's anything I didn't make clear here you can say it and I'll edit it or respond to you
    1 point
  36. Introdução O conteúdo deste tópico será separado por seções, ensinando passo-a-passo cada detalhe - desde criar um BOT no site do Discord Developers, até finalmente ligá-lo e executar os comandos, que serão enviados para o seu servidor MTA. Siga todos os passos para que tudo dê certo. Configurando o ambiente Bom, para que nós possamos iniciar, é necessário instalar duas coisas no seu computador: Node.js e Visual Studio Code. Só um adendo: não é estritamente necessário usar o VSCode, estou apenas sugerindo-o, e também é a IDE que irei utilizar neste tutorial. Após instalá-los, seguiremos a próxima seção. Como criar um BOT no Discord Developers Acesse este link: https://discord.com/developers/applications - se você não estiver com uma sessão do Discord aberta no navegador, faça o login para que você possa acessar as funcionalidades desse site. Provavelmente, após entrar numa sessão, uma página como esta irá surgir: Ignore as minhas aplicações. O seu estará vazio - eu acho. Para iniciarmos a criação de uma nova aplicação, clique no botão que está no canto superior direito: Escolha o nome que desejar, isso não importa muito para este tutorial. Uma vez criada, uma outra página aparecerá, com mais informações. Primeiramente, vá até a aba Bot. O botão fica ao lado esquerdo: Agora, para que criemos de fato o BOT, clique no botão ao lado direito: Um pop-up irá aparecer, basta clicar em Yes, do it! Mais uma vez, irá carregar, na mesma aba, mais informações, agora sobre o seu BOT. Não compartilhe nada do que estiver escrito na página, com ênfase no seu token, que faz o seu BOT ficar online. Agora, voltemos para a aba principal: Nessa aba, você possui o Client ID da sua aplicação. Esse ID não é o token, você não precisa se preocupar caso compartilhe com alguém: Copie-o e acesse este link para que possamos dar continuidade: https://discordapi.com/permissions.html. Nesse site, nós podemos gerar o link de convite, no qual você irá precisar para adicionar o BOT no seu servidor do Discord. Cole o ID que você copiou neste campo: Também, selecione a permissão de administrador, que fica logo acima: Feito todos os passos, copie o link, abra uma nova aba no seu navegador e acesse o link gerado. Ele é parecido com este: Assim que você acessar, selecione o servidor no qual você quer adicionar o BOT e confirme tudo o que é pedido. Caso você tenha feito corretamente, o seu BOT já está no seu servidor. Vamos a próxima seção. Clonando o repositório do BOT Optei por criar um repositório no GitHub para que fique mais fácil este tutorial. Se você não sabe o que é clonar, apenas clique no botão de baixar, ao invés de clonar. Ele é assim: Clique em Download ZIP. Uma vez que temos o repositório no computador, descompacte-o na área de trabalho mesmo. Feito isso, uma pasta será criada. Agora, abriremos o VSCode. Siga estas instruções: Você irá selecionar a sub-pasta, que está dentro do pasta descompactada. Preste atenção ao selecionar. Há uma outra pasta dentro daquela que extraímos, abra a pasta correta. O resultado deve ser este: Ignore os ícones, fonte, cor de fundo. São extensões que eu uso. Vamos a próxima seção. Como instalar os pacotes da aplicação Ainda no VSCode, pressione CTRL + ' (aspas simples). O terminal irá abrir. Com ele aberto, digite o comando npm install. Os pacotes serão instalados - uma nova pasta e arquivo serão gerados. Não se preocupe com isso, não faz parte deste tutorial. Próxima seção! Como habilitar o Modo Desenvolvedor no Discord Para que nós possamos avançar a próxima seção, nós precisamos habilitar o modo desenvolvedor, para obter os IDs de canais, servidor, usuário, cargos e outros. É simples. Acesse as configurações da sua conta, clique na aba Aparência, desça tudo e irá se deparar com isto: O meu já está ativado. Caso o seu não esteja, ative-o. Next... Configurando as variáveis do BOT Agora que nós já podemos copiar o ID de alguns elementos do Discord, iremos configurar os arquivos que estão dentro da pasta config, abra-a. Os arquivos são estes: Primeiramente, crie um canal no seu servidor do Discord e copie o ID dele. Basta clicar com o botão direito em cima e copiá-lo. Abra o arquivo channel.js e apenas altere o valor que está lá. Salve o arquivo e abra o próximo, guild.js. Para eu não me estender muito, você fará os mesmos passos acima, copiando o ID e substituindo. Para copiar o ID do seu servidor, basta clicar com o botão direito em cima do nome dele. Já no arquivo mta.js, você deve alterar as informações de acordo com o seu servidor. Veja a explicação abaixo. ip - do seu servidor. httpPort - a porta HTTP do seu servidor, você pode consultá-la aqui neste site. username - crie um usuário no seu servidor e dê permissões administrativas para ele. password - a senha que você colocou no usuário. ATENÇÃO: USE UM USUÁRIO E SENHA QUE NÃO SEJA FÁCIL DE DESCOBRIR, LOGO NÃO COMPARTILHE COM NINGUÉM. Em relação ao outro arquivo, prefix.js, é apenas o prefixo que você usará nos comandos, altere se quiser. O arquivo token.js fala por si só, você irá pegar o token de acesso do seu BOT, lá no site do Discord Developers e substituir dentro do arquivo. Acompanhe na imagem abaixo. Bom, já disse na seção passada que você não deve compartilhar o token. Seguiremos a próxima. Clonando o repositório do resource Assim como no repositório do BOT, o resource também está no GitHub. Baixe-o, da mesma forma do BOT, mas agora adicione no seu servidor MTA, na pasta resources. Lembrando que deve-se extrair e colocar a pasta correta, verifique bem a sub-pasta. Uma vez adicionado no seu servidor, use o comando refresh para atualizar a lista de resources e inicie-o. Ah, e também dê permissões administrativas para ele! Pronto. Já podemos prosseguir. Iniciando o BOT Estamos quase ao ponto de executar os comandos. Vamos iniciar o BOT. Agora no VSCode, naquele mesmo terminal, use o comando npm start. Se tudo foi feito corretamente, ele irá se iniciar sem erros e uma mensagem dizendo que o BOT foi ligado deve aparecer. Testando os comandos Lembra que nós criamos um canal para executar os comandos? Pois é agora que iremos utilizá-lo. Lembre-se: o seu servidor deve estar ligado - entre nele também para que você possa ver as mensagens no chat. Alguns comandos que eu fiz, apenas para exemplificar. Você pode adicionar mais comandos se quiser. Se você não alterou o prefixo, aqui estão os comandos que fiz. (Você deve ser ADMINISTRADOR do seu servidor para executá-los) $settime <hora> <minuto> - $settime 12 00 | Irá alterar o clima no servidor. $text <mensagem> - $text opa, jogadores, tudo bem? | A mensagem será enviada no chat do servidor. $status | Mostrará algumas informações do servidor no chat do Discord. $mute <jogador> - $mute andr0xy | O jogador ficará mutado até se reconectar. $givemoney <jogador> <quantia> - $givemoney andr0xy 15000 | Dá dinheiro ao jogador. $cgroup <nome> - $cgroup VIP | Cria um grupo na ACL. Apenas uma observação: é possível sim, nos comandos que envolvem jogadores, executá-los pelo ID. Basta você editar o resource - não irei explicar como faz isso, pois não tem relação ao tutorial. Agradecimento & Informações Muito obrigado por seguir o tutorial. Fiz com o ❤ para toda a comunidade. Espero que vocês evoluam ambos códigos e que isso se torne muito maior dentro do servidor de vocês. Lembre-se que tudo é possível no MTA, contribuam sempre de alguma forma para que outros também possam evoluir. A união é importante nessa área. Busquem conhecimento! Crédito ao autor da SDK, o que faz ser possível conectar-se ao servidor MTA. 4O4 - GitHub Edições neste tutorial 28.01.2021 - AVISO: renomeie o resource para discordapp. 29.01.2021 - CORREÇÃO: texto confuso na seção Clonando o repositório do BOT. 29.01.2021 - AVISO: código do resource refatorado, sendo mais fácil adicionar novos comandos.
    1 point
  37. Hello all. This is another custom map open to the public of the MTA community made by me. It's a new island where players are free to go and explore. Please be aware this map will not come with any resources other than the map itself, draw distance and some custom textures. Feel free to use the map for any gamemode. This map offers the following stuff (Total Objects: 1622): - Airport - Beaches - Bridges - Contruction Area - Dock - Factories - Fire Department - Forested Area - Gas Station - Hospital - Parking Lots - Police Station - Restaurants - Ships - Shopping Area - Skyscrapers - Small Mountain - Stunt Objects - Suburban Area - Traffic Lights, Lampposts - Warehouses VIDEO: SCREENSHOTS: INSTALLATION: 1 - Simly unpack the ZIP file. Open the "resources" folder and copy the "Custom-City-LS" folder to: <MTA installation directory>\server\mods\deathmatch\resources 2 - Connect to your server and type "refresh" in the console window so the server will detect the new resources. 3 - Now in the console again type in: start Custom-City-LS. That's it Note: you can also open it with the map editor. LOCATION: Los Santos X: 2904 Y: -792 Z: 11 CLICK HERE TO DOWNLOAD This map wasn't rushed in any way, I've always tried to deliver high quality maps, also it has been tested for bugs and gameplay. Please do not upload these files on any other site. However, you are welcome to share the link to this site whereever you want. Cheers and have fun! MORE MAPS FOR FREE: [RACE] Reiko's Map-Pack [RACE] RG's Map-Pack [RACE] Custom Racing Circuit Map-Pack
    1 point
  38. Default MTA Server || Freeroam [P] EN The classic freeroam experience with unlimited chaos, drifting, shooting other players (or just using /peace for passive mode), hydra dogfighting and fun arena's. As a classic freeroam there are no restrictions to spawning in vehicles & weapons, and freedom applies to all other game aspects as well. Average players online is 100, so there's always someone to troll or fight! Click to join (mtasa://149.202.51.189:22005) ______ Prime Freeroam EN (Freeroam, NPC, AI) Click to join (mtasa://149.28.237.162:22003) ______ Welcome To San Andreas (Single Player Features!) EN (Freeroam, NPC, AI) The old-school single player San Andreas experience! Click to join (mtasa://wtsa.mtasa.moe:22003) SAES:RPG EN SAES:RPG is a gaming community and server which has ran on MTA since 2003 on both MTA:VC and MTA:SA, Our current server is an RPG based gamemode in which you can be Cops, Robbers, Gangs, Dealers, Medics, Mechanics and participate in Roleplay, Bank Robberies, Store Robberies, Racing, Hunting down criminals, Monthly giveaway events and much much more! Click to join (mtasa://51.38.67.64:4999) ______ CIT Cops 'n' Robbers, Gang Wars, Civilians | cit.gg EN/PT/AR/TR (CnR, Turf wars, Civilian jobs.) A community mainly focused on cops 'n' robbers, gang turf wars and a variety of civilian jobs, community made events, joining groups to play and have fun together. Click to join (mtasa://94.23.158.180:22003) ______ SAUR Utopia RPG EN An RPG server with multiple unique features and activities, with an active staff team. Click to join (mtasa://phoenix.saur.co:22003) FFS Gaming DM/Race/DD/Hunter/Shooter/Stuntage/Trials/HP/RUN/CW/PTP/CarBall/Training/Minigames/Geogesser EN FFS Gaming provides a vast amount of race type gamemodes all in one server. From regular races to be the fastest one, kicking your opponents into water in destruction derby or simply having a fun time in minigames, we provide everything to enjoy your stay. Click to join (mtasa://54.37.245.209:22003) ______ /TfF\ The Favoured Few - DM/HDM/OS/STUNTAGE/MINIGAMES/SHOOTER/CATCH/DD/POWERDD/HUNTER/RACE/CLANWARS/TRAINING The Favoured Few delivers thrilling Race Deathmatch (Regular, HDM or OS), competitive Clanwars, and an exclusive Power Destruction Derby mode, along with a wide range of gamemodes including Shooter, Hunter, Stuntage, Minigames, and Training. Take part in daily events to earn exclusive rewards, and explore the garage to customize your infernus! Click to join (tff.gg:22003) Drift Paradise MTA RU/UA/EN/US/PL/Global (Drift, Touge, Freeroam) Create the car of your dreams and travel to iconic places! All servers are synchronized, which means that you can play on any server on 1 account. #1 Drift Paradise [RED] MSK mtasa://95.129.234.27:22001 #2 Drift Paradise [RED] MSK mtasa://95.129.234.27:22002 #3 Drift Paradise [RED] MSK mtasa://95.129.234.27:22003 #4 Drift Paradise [RED] MSK mtasa://95.129.234.27:22004 #5 Drift Paradise [RED] MSK mtasa://95.129.234.27:22005 Note: Some users will need to use a VPN with a server in Russia to connect due to some restrictions. ______ Need For Speed: San Andreas Global/EN/PL/RU/ES/PT/TR/CZ/FR/DE/HU/ID (Race/Freeroam/Other) Racing server inspired by various nostalgic Need for Speed titles such as Underground 1/2, Most Wanted, Carbon, World where you start out with a slow car and progress by racing, participating in AI police pursuits and numerous other activities, all of which let you buy new cars and and upgrade their performance and visuals with hundreds of unique custom made body parts and complete customization of paintjobs through a NFS Carbon-like vinyl editor. Click to join (mtasa://178.33.54.30:20256) ______ Mr. Green Gaming EN/PT/AR/TR/RU/PL/DE/FR (Race, DM, CTF, Shooter, MIX) The classic racing experience! Join Race (mtasa://race.mrgreengaming.com:22003) Join Mix (mtasa://racemix.mrgreengaming.com:22003) ______ Sofa King Cool EN/Global Click to join (mtasa://87.98.182.70:22005) Epic-Row Zombie RPG EN (Zombie, RPG) PvE based zombie gamemode with RPG elements. Click to join (mtasa://s.epicrow.com:22003) ______ StoneAge [DayZ] EN, PT (Survival/Zombies/DayZ) Fight against other survivors, make new friends, trade items, get rid of zombies, and don't forget: here your goal is just to survive, whatever the cost! Click to join (mtasa://158.69.122.226:22003) San Andreas Police Department: First Response EN (Emergency Services Simulation / RPG / AI) Step into the life of a Police Officer, Paramedic or Firefighter and react to a wide variety of callouts all over San Andreas. Click to join (mtasa://37.187.250.129:22004) ______ SAAW World War II EN (Team deathmatch / War (Conquest) / Airstrike / Sea war / Tank war) A team-based tactical world war II server featuring third person and first person gameplay and dozens of different vehicles, weapons, classes and maps. Main objective in every map is to bring the enemy ticket count to zero by capturing points, shooting enemies or sinking convoy ships. Click to join (mtasa://116.203.196.16:22003)
    1 point
  39. Introduction This guide intends to teach 3ds Max users the basics and more advanced ways of working with Vertex Colors, in order to achieve lighting solutions for enhanced quality of game models, or blend several textures together using Vertex alpha. A lot of games utilises vertex colors to accomplish lighting or blending effects, which usually impacts the performance less than model shaders. Types of shaders such as Texture Splatting are pixel based techniques for rendering multiple textures onto a model, where each texture e.g earth, grass, gravel, has their own color on the splat map. This however may use up significantly more resources than its alternatives in some cases. As result, game developers may move their aim towards Vertex Alpha and Color rather than geometry shaders. Vertex Color works almost the same way, however it renders per vertex and not per pixel unlike shaders do. This may result in very poor results if the geometry is not subdivided at the places it is painted at. Besides texture blending, vertex colors are also widely used in games for fake lighting baked into models. This is due to some game engines not supporting Ray Tracing or other rendering, or they simply prefer using vertex colors over per-pixel lighting. In GTA:SA the only light rendering is done by vertex colors and 2DFX. In the days that the game was developed, vertex colors was a more sustainable rendering method over other options. Table of contents Different model lighting depending on game time Importance of vertex colors Importance of vertex illumination Basics of per-vertex Radiosity workflow Hard surface prelighting Faking ambient occlusion Texture blending with Vertex Alpha The vertexPaint modifier Extracting channel info Working with several VertexPaint modifiers Different model lighting depending on game time Game models use two vertex channels for lighting. Vertex color is displayed around 06:00 - 20:00. Vertex illumination is displayed outside that timeframe, that is, between 20:00 and 06:00. Between these timeframes, the two channels blends into eachother, creating a realistic daytime and nighttime visualization of the map. Remembering which channel is used for what can be a little troubling, on top of the many other things. Artists could consider Vertex Color = daytime, Vertex Illumination = nighttime. Below are various demonstrations of vertex color and illumination channels. Importance of vertex colors Below video demonstrates the effects of not prelighting game models for GTA:SA. The results are very easy to differ from prelit models, as the only depth seen on the models is made by the diffuse maps, which usually does not add sufficient shadows. That is where the artist may consider prelighting his model. As seen on the video, first footage is of San Fierro chunk without diffuse maps (textures) nor vertex colors. This results in completely white meshes. If however, the artist decides to utilise vertex colors, the model will have a lot greater depth added, without the need to bake light into textures at the expense of computer memory. The video's contents are 1:1 to how San Fierro would be rendered in-game around 12:00. No post processing or edits made to the models. Compression methods, post processing, sky and fog done by the Renderware engine will make it a tad different though. Below screenshot is taken from a Dust2 model ripped from Counter Strike. It shows how the vertex channel brings shadows and ambient occlusion into the model. If it did not have the vertex channel changes made, it would be completely flat, corridors would have no depth whatsoever, only some by the difference between the textures. Importance of vertex illumination Not all models use fancy colors like the pirate assets by Las Venturas strip. A lot of models use the same, though slightly darkened, version of vertex colors for the vertex illumination channel. The result of this is a darker object during night and brighter during day. Perhaps some has some highlights that are cast from streetlights and other light sources that appear during nighttime. Some models, notably light objects use vertex colors in conjunction with 2DFX in order to create realistic light with a real light source. Below example is a runway light. The white version is during day time, where the inner light mesh (the extruded part) is grey to represent an deactivated light. The red version is during night time, where the top surface has light reflected onto it, together with a corona image, more commonly known as 2D billboard or sprites. The corona acts as the light source and creates a bloom alike effect. (Not seen in image) Basics of per-vertex To get a somewhat understanding of how vertex colors work, below demonstration should be helpful. The triangle's top left vertex is painted blue, top right painted green and bottom painted red. This creates an RGB blend display of the triangle. The planar model has its bottom vertices painted black while the top ones are white. This creates more of a gradient across the entire model.To put the difference between per-vertex lighting and per-pixel lighting short, Vertex based lighting creates a gradient from one vertex towards the nearest one(s), and stops there. If a model has only 4 vertices, it is not possible to have circular or very detailed IES-like lighting, as the model would have only 4 points that can have light data. Pixel based lighting can have as many abstract details as artist wishes. It works as if there is a grayscale image on top of the model with a different blend mode, or dynamic lighting based on world models, hence the two are called per-vertex and per-pixel. Radiosity workflow Tired of painting vertex colors onto models with silly brushes all day? 3ds Max has an amazing light renderer, which can produce stunning renders and best of all, stunning prelights. As if it was made for GTA:SA era games! Not to forget, a 3rd party Max script was made to make the workflow a lot less difficult - can be found on: http://www.scriptspot.com/3ds-max/scripts/vertex-color-tools-1. With this script, artists can with a few clicks create a skylight, ground plane (for AO), then render a radiosity solution in less than a minute total. No more setting up radiosity settings, only a few adjustments to your likings if needed. I use it all the time myself, and in fact, I learned to create beautiful prelights by using this tool with radiosity rendering. Before moving on, ParoXum's Radiosity tutorial and the Radiosity wikipedia page contains extra information that is not covered in this thread, for instance particular use of point lights. For that reason they may be benefitable to read through. WARNING! Pressing the AO button on the Vertex Color Tool script, ALL materials will be reset to standard. This can not be reversed! Adding to the above. Make sure to create a backup Max project file prior to working with Radiosity. Use the backup Max project file for vertex colors, leave original file for modeling! This process is covered in the guide. Hard surface prelighting Most artists starting out with vertex colors have probably grown tired of selecting faces of a model, then painting a different value onto each to replicate a hard surface look. As it turns out, this is not an efficient way. The model will look odd if the artist has not put enough time (hours with sweat) into it. That is where automating it with Radiosity rendering is a fantastic solution. To get started, download the following FBX scene https://cdn.discordapp.com/attachments/308956559201796097/632340906170908673/demo.zip. Each point contains a spoiler with a video clip. For those who would like to mess around with the final result of mine, download FBX here: https://cdn.discordapp.com/attachments/308956559201796097/632559814387695626/demo_result.zip (video below) Important thing to note, when using Radiosity for prelights, the shading/lighting which is baked into the model entirely depends on the smoothing of the model. If it's set to Auto Smooth value 2 the shading will resemble 3ds Max's shading 'facets', while if the model has only one smoothing group, the shading will be incredibly smooth and generally won't have any facet shading. San Andreas models generally had very low smoothing value for its models at their creation, judging by their hard surface appearence. If a modeler were to create models that blend in with the game environment, they should strongly consider the above. Video tutorial: Text tutorial: Import the file Click the 3ds max upper left corner, at Import hover over the arrow for a drop down menu to appear. Click Import. Click the demo.FBX. Ensure to include Smoothing Groups on import, and units setup in Meters. Reset X, Y, Z positions to 0, 0, 0. At import the model is not centered. Create light Navigate to Create tab, click the gears icon, finally select the Daylight button. Max will ask if it can set an exposure control flag (not a country flag bleh), click Yes. Click anywhere, this sets the compass. Then, drag the mouse up into the sky, press LMB to spawn the daylight system. The compass position is not important. Alter light Navigate to Modify tab, change Sunlight from Standard to IES Sun. Likewise for sky, make it IES Sky. On Sun Parameters uncheck Shadows. Ensure the sun's state is On. On IES Sky Parameters it is possible to modify the intensity of the sky, as well as the sun. Some of the settings that affect the sun is whether the weather is clear or clouded. Leave default. On hierarchy list, select the Daylight001 item. While on Modify tab, click the Setup button for setting the scene weather. As the light system works like real daylight, the lower the number of hours, the darker the scene. Set hours at 9, month at 9, orbital scale at 320-360. Initiate the radiosity solution by running Vertex Color Tools Ver1.0. Press the AO button. Keep in mind, that this will remove all materials and cannot be reversed with undo. The render setup window opens. Another window from Rendering > Exposure Control is needed. On Exposure Control, change from none to Logarithmic. Tick on the Exterior daylight checkbox, which is required due to scene using a daylight system. Optionally, start rendering previews via the Exposure Control window. These previews are very low resolution and may help visualise the lighting. Or, real renders by SHIFT Q, although this may take significantly more time and processing power. On Render Setup window, reset value of Indirect Lighting Filtering. Increase the Direct Lighting Filtering to a value of 8. Under Radiosity Meshing Parameters tick the Include Skylight checkbox. Under Rendering Parameters select Re-Use Direct Illumination from Radiosity Solution. On Render Setup window, make sure to press Reset, to then start a clean rendering with the updated settings. Click Start. This may be an incredibly slow process, even on high end computers. If it gets stuck, set quality to less. It does not really have much of an impact for GTA:SA light anyway. Voila, done. The final result will be displayed in viewport. The result is equal to what is seen in-game during day hours. If something looks off, go back and tweak settings. Bake Radiosity lighting solution into vertex channel. Navigate to Utility tab, click More..., select Assign Vertex Colors. Upon scrolling down the utility tab, the Vertex Colors settings appear. Vertex Color is for day time, Vertex Illumination is for night time. Choose Vertex Color. Set light model as Lighting + Diffuse. Set Color Assignment as whichever seen fit. On Rendering options, enable Mapping and Radiosity, Reuse Direct Illum. from solution. Finally, click Assign to Selected View vertex color result in viewport. On the VertexPaint modifier, select the channel that was just modified. On the VertexPaint GUI, click the shaded box to the left. This displays the model with only vertex channel rendering, no other 3D shading will be used. Further tweaking If one wishes night time lighting, the best to do is render a new radiosity solution with less sun and daylight intensity, in order to darken the scene. Eventually change to clouded or mess with weather settings. The new radiosity solution will be equally the same as the one for daytime, although a tad darker. When rendered, assign to illumination channel. The letters can be painted for night time to look extra cool. This is where painting by buckets onto face selections of the mesh can come in handy, using the VertexPaint modifier. Odd looking shadows can be fixed up with the blur brush (VertexPaint modifier). Those who are able to get results with the above Radiosity workflow, may utilise their knowledge and take prelighting a next step with other types of lights, in order to create environment lights such as shadows for light poles, torches, buildings etc. Point lights, more specifically Free Light, were used a lot in the ship model further down the topic. Scene lighting is generally hit and miss. There are many settings which may need to be changed e.g scale of daylight and smoothing groups of models, in order to get the right look. Faking ambient occlusion Vertices can easily store ambient occlusion details, negating the need for geometry shaders. Some models may require additional geometry through subdividing the mesh, in order to achieve proper ambient occlusion details with vertex colors. The type of light used is usually skylight or daylight, this creates subtle shadows around corners and creaks, as well as maintaining global lighting. The below model has vertex AO baked by using a Skylight with the following settings. *you can eventually utilise a plane as ground for the ambient occlusion to calculate a lot better. The above practise can be used for GTA:SA assets as well, some settings may require to be tweaked first though. Prelighting in general is trial and error unless the artist has a solid background with lighting and rendering. Generally though, ambient occlusion should not be the only layer for lighting a model. Hard surface lighting as well as adding point lights is highly recommended. Without these, models with AO will still look rather flat in most cases, as there is not much definition between corners, other than soft shadows. Adding point lights to radiosity render will also give the lighting a more natural feeling, this can be done by adjusting the temporature of the light or its color. Combining point lights (free light, omni light, etcetera) with 2DFX can give stunning results. Texture blending with Vertex Alpha Texture blending on MTA was thought to only be possible by shaders, e.g texture splatmap. Instead, we can now blend textures using Vertex Alpha channel. On December 27 2019 we discovered that Vertex Alpha works without need for additional scripting (MTA Discord #modelling). We also need to thank Deniska for writing this guide (gtamaps) on vertex alpha plus creating a maxscript that exports vAlpha channel! Vertex Alpha works based on grayscale values just like alpha masks. Any vertex that's black will not be rendered - any vertex that's not black will be rendered. White is fully opaque, while the greyer it gets, the more transparency is made. Vertex Alpha will not render water behind its faces, so it's important to place an opaque object behind the vertex alpha mesh. This must be a separate model, not part of the mesh that uses vertex alpha. As with vertex prelights, vertex alpha needs geometry to work with. It's highly recommended to turbosmooth/subdivide the mesh so that you can paint in more detail. In the video below, I show how quickly the vertex alpha can be added to your models, and once that's done, you can export the model using the script from this page. Create a plane primitive. Give it 16x16 segments. Convert it to editable mesh. Give it the material that needs to blend using alpha. Set opacity of material to 98. Add a VertexPaint modifier. Select the vertex alpha channel. Use paint bucket with black color, 100 intensity, to paint entire mesh black. Add a secondary vertexpaint modifier. Grab your brush, adjust its size and strength. Begin painting a path from one end to another. Use the blur brush to finetune the semi-transparent edges of your path. Sharp edges ain't good. Looks OK? Start the export-script. You don't need to collapse your modifiers when exporting. Keep them in stack for later adjustments. Export with MMC. Remember to always set alphaTransparency enabled when replacing the model, or else only part of alpha will show. If you want to use another DFF script (for a higher quality dff), simply copy paste the sections e.g "Extra Vertex Colors" via RWanalyze. (Script will break (in which case, close script and run again) if you try to export vertex colors without having first assigned vertex colors/illumination to the model via its respective channels) List of model ID's that use the flag 68 (NO_ZBUFFER_WRITE(64) + DRAW_LAST(4)), which is required for Vertex Alpha: 2728, 3872, 3910, 4227, 4636, 4637, 7892, 9831, 9896, 9897, 11678, 11679, 11680, 11681, 13494, 13495, 13496, 13497, 13498, 13499, 13500, 13501, 13502, 13503, 13504, 13505, 13506, 13507, 13508, 13509, 13510, 13511, 13512, 13513, 13514, 13515, 13516, 13517, 13518, 13519, 13520, 13521, 13522, 13523, 13524, 13525, 13526, 13527, 13528, 13529, 13530, 13531, 13532, 13533, 13534, 13535, 13536, 13537, 13538, 13539, 13540, 13541, 13542, 13543, 13544, 13545, 13546, 13547, 13548, 13549, 13550, 13551, 13552, 13553, 13554, 13555, 13556, 13557, 13558, 13559, 13560, 13561, 13563, 16375, 16445, 16498, 16623, 16676, 16677, 16733, 16734, 16753, 16754, 16756, 16757, 16758, 16783, 16784, 17436, 17437, 17438, 17439, 17440, 17441, 17442, 17443, 17444, 17448, 17450, 17451, 17451, 17452, 17458, 17459, 17460, 17461, 17462, 17463, 17464, 17465, 17466, 17467, 17468, 17469, 17470, 17474, 17524, 18073, 18112, 18610, 18611, 18612, 18613, 18614, 18615, 18616, 18617, 18618, 18619, 18620, 18621, 18622, 18623, 18624, 18625, 18626, 18627, 18628, 18629, 18630, List of model ID's that use the flag 64 (NO_ZBUFFER_WRITE(64)) which are not tested, but might work for Vertex Alpha: 1315, 2981, 4712, 4724, 4554, 8004, 8044, 11306, 14765, Below are a few examples of how vertex alpha can be used to blend several textures together. Above image courtesy: worsas @ project tamriel (see link for more) 128x128 textures, 8192 polygons (can be a lot less!) You can probably create something a lot better than this. Time to get creative! If you're looking for additional inspiration, see the videos in spoiler. Note: The below spoiler contains information that does not apply to vertex alpha method, but instead to vertex colors. This requires shaders, since SA uses the colors for lighting, but is a decent alternative if the model use lighting shaders. The vertexPaint modifier VertexPaint is the modifier that houses the WIP vertex colors, illumination and alpha modifications. It may be accessed on Modifiers tab. While it is open, it allows the artist to do various changes to the vertex channels. Ranging from painting with the use of brushes, to refining vertex colors by blurring, adjusting hue, saturation, lightness etcetera. This is a very powerful tool, despite not having been updated for years. To get started, the modifier works with a float GUI with all of its necessary functions in it. It is worth noting that the modifier can not change existing vertex channel data, only the data that is stored in the modifier. That means it is not possible to import a GTA:SA asset and modify the hue of the vertex color channel. For an exhaustive list of what the modifier offers, check Autodesk's page on the VertexPaint Modifier. Brief explanation of what the modifier has to offer, from top to bottom: Extracting channel info For whatever reason, an artist may want to copy the vertex channel data, that is, the custom vertex information, and paste that onto their latest version of the mesh. This could be due to an irreversible action that would prevent the artist from undoing the lighting changes on present model, resulting in work lost and having to redo it all over again. Although this may seem like a promising solution to regain old channel data, it can generate problems if the two models contain different geometry counts. Below steps explains how to copy/paste data. Navigate to Utilities tab, click the More button, after which, click Channel info. At last, press the button that appeared on the bottom of the utilities tab. At first, the Channel Info GUI may seem complicated; but it really is not. The only information to look out for is the ID column and Channel Name column. The Num Verts, Faces etc. are only important to verify that the two model contains the same model geometry count. In the above example, the model has no custom channel data. The -2:Alpha, -1:Illum and 0:vc are the types of channel info's that are relevant for GTA:SA, although the Alpha data currently isn not compatible with MTA. To copy data, simply select either of the rows and press the Copy button. Then, highlight the present model, select the corresponding channel and paste. Working with several VertexPaint modifiers On more advanced tasks it may be necessary to use multiple VertexPaint modifiers stacked onto the model. Artist may find it helpful if they are doing several versions of prelighting for their model and wants to go through each result, picking the one that suits them the most. This means that each type of radiosity lighting solution will be stored in its own modifier, allowing artists to go through all of them and delete the poor ones. Having multiple modifiers on stack can also improve workflow by utilising each modifiers for each element of the model, such as Modifier1 for bonfire logs, Modifier2 for bonfire shadows, Modifier3 for ambient occlusion, Modifier4 for moonlight etc. Modifiers can also be renamed to quickly tell the artist what they are representing. The model can have as many modifiers in its stack as the artist wishes (or until the software times out), and they do not require to be collapsed when exporting the model to MTA. This means that the modeler simply needs to select the model, export it and load into MTA. Modifiers can then be collapsed to stack when job's done, however, it is strongly recommended to keep them in stack for future, in case of parts requiring rework. Below model may give a good look into just how much it helps to utilise multiple modifiers. The ship has its own modifier for virtually any type of light emmitting source. The rectangular screens to the right are symmetrical on the other side, so there is one modifier that represents those 6 rectangular emmissive screens. Same goes for the cyan U-shaped engravement, which uses its own independant modifier, and so on. This allowed to change the engravement prelight from initially dark blue to cyan, by not affecting other lights when modifying the hue, as the modifier was only used by that particular area. The stack works like so: By clicking the bottom modifier, only that one's layer will show. If clicking the one above it, assuming it is same channel, it will show both of them. Now, if clicking the top modifier, it will show all layers e.g the rest 4 that are associated with Vertex Illum channel. It will only display the channel that is selected on the right most panel. (This depends on version of Max)
    1 point
  40. В первую очередь тема будет полезна всем, кто только что вошел в скриптинг. ВНИМАНИЕ! Изучение языка Lua должно быть первым шагом в MTASA скриптинге, а не вторым или третьим, поэтому в этой теме я буду в первую очередь делать упор на русские доки по Lua, и во вторую - на доки по MTASA скриптингу. Желающие могут делиться ссылками, которые потом будут добавлены в этот пост. У новичков, обычно, возникают вопросы по языку Lua и по его применению в MTASA скриптинге. Но литературы на русском языке на этот предмет не так уж и много. Все, что касается скриптинга, можно узнать из вики - https://wiki.multitheftauto.com/. Там есть и русские документы, но их все равно мало по сравнению с английской версией, поэтому непонятные моменты можно уточнить здесь на форуме. Ну а что касается самого языка LUA - читаем дальше. Итак начнем просматривать нашу онлайн библиотеку.. Ссылки от юзера MX_Master, т.е. мои рекомендации : --- http://lua.ru/ http://lua.ru/doc/ Вторая ссылка - перевод официального справочника по языку Lua на русский язык. Очень мало пояснительной инфы и перевод местами сильно косноязычный. Дешево и сердито. Помогает уловить общий смысл, но тестировать все придется самому, т.к. примеров немного. http://ilovelua.narod.ru/ http://ilovelua.narod.ru/about_lua.html http://ilovelua.wordpress.com/ Ресурсы одного и того же автора. Все объясняется в самой что ни на есть доступной форме. Даже первоклассник программирования сможет это понять (: Вторая ссылка дает практически 70% того, что должен знать MTASA скриптер по языку Lua. Рекомендую. http://w3d.wiki-site.com/index.php/%D0%9E%D1%81%D0%BD%D0%BE%D0%B2%D1%8B_Lua Основы Lua. Простые и понятные примеры. Рекомендую. http://ru.wikipedia.org/wiki/Lua Куда же мы денемся без инфы в википедии. http://ltwood.wikidot.com/scripting:lua-lang Весьма понятный мануал. Примеров также много как и в официальном справочнике. http://steps3d.narod.ru/tutorials/lua-tutorial.html Мануальчик с небольшим игровым уклоном, в котором даже больше (вроде) инфы чем в официальном справочнике. Описания функций и примеры к особо непонятным функциям и конструкциям. http://netsago.org/ru/docs/1/4/ Введение в Lua. Небольшое. http://www.script-coding.com/Lua.html Введение. Общее инфо. Много простых примеров. http://xgm.ru/page/400 Немножко про LUA. http://luagml.ucoz.ru/doc/lua/lua.html Своеобразная копия http://lua.ru/doc/. Возможно, кому-то такой вид больше нравится. Cсылки от юзера Kenix : --- http://www.rldp.ru/mysql/mysqldev/glava04.htm - Нормальный перевод официального справочника на русский язык. Рекомендую. Примечание: в этом доке версия Lua 4.0, а не 5.1 как в МТА. Поэтому многие вещи могут отличаться. http://cortexcommandru.3dn.ru/forum/9-801-1 - В середине вся суть. http://progopedia.ru/language/lua/ http://big.vip-zone.su/doc/devel/lua.xml Cсылки от юзера CrazyDude : --- http://gta-rating.ru/forum/showthread.php?t=1370 Cсылки от юзера Kernell : --- Регулярные выражения в Lua http://www.lua.ru/forum/posts/list/57.page#408 Объектно-Ориентированное Программирование (ООП) в Lua http://mydc.ru/topic1429.html Основы декларативного программирования на Lua http://habrahabr.ru/blogs/development/77413/ Cсылки от юзера Elengar : --- Lua за 60 минут. http://zserge.wordpress.com/2012/02/23/lua Cсылки от юзера nikitafloy : --- http://www.cronos.ru/kb-cronospro-lua.html А еще у нас в подфоруме есть целый раздел с туторами по Lua/MTASA: viewforum.php?f=153
    1 point
  41. Dystopia 0.75 update Test server IP: mtasa://37.187.171.204:22008 Noutati: inventarul imbunatatit: mult mai intuitiv si usor de utilizat trafic NPC: fiecare factiune spawneaza vehicule specifice; vehiculele te vor ataca cand le intalnesti daca esti in alta factiune vanzatori NPC: poti cumpara si vinde itemele pe care le aduni mecanic: upgradeaza-ti vehiculul cu arme, blindaj si altele peste 40 de misiuni: castiga bani si respect ajutandu-ti factiunea noi tipuri de inamici cu noi abilitati multe bug-uri au fost inlaturate Mai multe detalii aici (in engleza)
    1 point
  42. Section Rules 1. Any fulfilled requests or discarded offers shall be reported via the report system in order to be locked and/or archived. This is mandatory, as the goal is to keep this section as clean and accurate as possible. 2.Topics must have a sufficient description of what are you offering or looking for. Eg. if you're looking for a scripter for your gamemode, you must detail what would you need the scripter for. This doesn't exactly involve giving away the whole concepts or whatever you don't want to disclose to the public, but it would be appreciated if you could include more details than just straight single line offers, such as "I need a scripter for a zombie gamemode". Whether or not the amount of detail is sufficient for the nature of your request is a subject to moderator judgement, and failing to meet criteria may result in your post being discarded. Formatting your topic In order to keep the section clean, accurate and easily viewable, it would be appreciated if you could use the following guidelines for your topic: 1. Topic titles should have the form [LF/OFFERING] Brief description [Paid/Non-Paid]. Please make the description as brief as possible here. Eg: [OFFERING] Skilled scripter [Paid] [OFFERING] Rookie modeller looking for some practice [Non-paid] [LF] Any-level scripter for a small server [Non-Paid] 2. The first post should be written in at least 2 parts: first part should contain a brief description of yourself (and/or the server or community you are from) second part should elaborate on what are you requesting/offering, once again, as detailed as you possibly can/want
    1 point
  43. Oh my wow!! I remember BizKit and the TTH team. I was Stewie392 or Interwebsz on here before and just re-registered because I think I'm going to start playing VC if anyone else still plays. Good to see the community is still partially alive!
    1 point
  44. It's a play on words. Some might consider it a euphemism. It is saying 'stop playing with yourself', as in multiplayer. But it also implies the act of 'playing with yourself', referring to masturbation. I'm really surprised not everyone knew this.
    1 point
  45. Start your MTA, then press F8 to open your console and in there type "serial" without quotes.
    1 point
×
×
  • Create New...