Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 20/01/26 in all areas

  1. Hello MTA community! My name is Ehsan/Exxon I’m excited to share a project I’ve been working on: mtasa-nestjs – a high-level API server framework for MTA:SA, inspired by Express.js and NestJS. What is mtasa-nestjs? mtasa-nestjs is a modular, structured Lua framework that makes building server-side APIs for MTA:SA simpler and more scalable. It brings modern backend patterns like Controllers, Middlewares, Guards, Interceptors, and DTOs directly into MTA:SA resources. It’s perfect for developers who want to build secure, maintainable, and professional APIs for their game servers. Key Features Express.js / NestJS-inspired structure: Clear separation of concerns for Controllers, Middlewares, Guards, and Interceptors. JWT Authentication & Password Hashing: Built-in secure JWT (HS256) implementation and password hashing from scratch. DTO Support: Validate and structure input data for cleaner code. Middlewares & Guards: Handle CORS, JSON parsing, authentication, authorization, and more. No External Dependencies: Works out-of-the-box in Lua for MTA:SA. Why I Built This Many MTA:SA servers handle HTTP requests in an ad-hoc manner, often leading to messy and hard-to-maintain code. With mtasa-nestjs, you can structure your API like a professional backend framework, making your server easier to scale and maintain. Example Usage Creating a JWT Token: local token = jwt.encode({userId = 123, role = "admin"}, "SECRET_KEY") iprint(token) Protecting Endpoints with Guards: AuthGuard = function(ctx) local authHeader = ctx.headers["authorization"] if not authHeader then error(Exception.Unauthorized("Missing Authorization header")) end local token = authHeader:match("^Bearer%s+(.+)$") local payload = jwt.verify(token, "SECRET_KEY") ctx.user = payload return true end Why You Should Try It If you’ve ever wanted a clean, structured, and modern API architecture for your MTA:SA server, this is a great starting point. It’s fully modular, fully Lua-based, and ready to handle complex server-side logic with minimal fuss. Where to Get It Ready on my github repository called mtsa-nestjs Make sure to create your own controllers, guards and etc. I’d love to hear feedback from the community. If you try it out, let me know what features you find most useful or what could be improved. Happy coding!
    2 points
  2. Buffers can be useful. Because you can only pick a server with a good CPU once. Sometimes you can upgrade the CPU, but there is a limit. While with ram, it is easier to upgrade. MTA Lua processes are afaik still is single threaded. But you need to invest a lot of time. I can be. An example db resource I made a while a go, not very efficient storage (text/string based), but easy to use. Not sure why I build the types text based, I would have build it differently now a days. Also recommended to write automatic tests for your creation, like I did with mine in sub folder \dev\*. You can storage md5 hash validation strings for validation, if you are interested in that. Smaller hash storage [binary]: using the UNHEX(hash) function (convert back with HEX(binary). Example resource that uses hash validation for client screenshots. I am not one of them. But I do work often met databases. I have put my recommendation in a spoiler if you are still interested:
    1 point
  3. Back in 2011, we threw a crazy idea on the table—what if we merged multiple servers into one seamless world? At the time, it sounded impossible. Everyone talked about it, a few even tried, and some of the biggest names in the scene turned it into a quiet race. But we were the ones who actually crossed the finish line. Not only did we pull it off—we did it so well that it caught the attention of FFS Gaming leadership and even the MTA developers themselves. If you’ve ever played on FFS Gaming and enjoyed the unified experience there… well, you’ve already seen the legacy of what we built. And now, after all these years, we’re finally releasing our archives to the public. Not for clout. Not for nostalgia. But to ignite the same fire in a new generation that once burned in us — the thrill of building something the world said couldn’t be done. Originally, this was meant to be a community-driven project born on the MTA forums. Over time, the team chose to keep it private, and the project evolved behind closed doors. NPG became a full multi‑gamemode experience for Multi Theft Auto: San Andreas, engineered to push the platform to its absolute limits and deliver gameplay no one had seen before. Today, that door opens. Break it. Improve it. Learn from it. Or simply enjoy the raw ambition of a project built by kids who refused to accept “impossible.” The legacy is real. The code is yours. The next chapter belongs to you. Modes Freeroam Race Fallout Hay RPG Dance Our Wonderful Team Benxamix (early v0.1 Founder) @qaisjp(MTA Developer, development, owner), @Orange(MTA Developer, development), Myself (Leadership, owner), Otto (Web development, co-owner) Noel (Co-owner) @Anderl (Contributor) Naz (Contributor) Others: BlueRay, Ryder, Kieran, Liam, Pocco, Samer, Viper, @AeroXbird Thank you to everyone who made it possible. DOWNLOAD LINK PS. This is old code from 2011-2012; you'll need to adapt it to the current MTA version. This is not a simple plug & play. Coding experience is required to get it running. We do not bear any responsibility or consequences for how you use this code. PPS. Hi everyone, hi old OGs - stumbling upon this place brings back so many memories.
    1 point
  4. For a access scoped accounts. Step 1. Make a backup of your acl.xml file. Step 2. Create a new account with for example the name: /register user_XTrqveZgi8 {password} Step 3. Modify the acl.xml. Add a group: Used for defining who has access to what. The prefix user.{username} is used to define that it is a user account that is granted access. <group name="webaccess"> <acl name="webaccess_acl"></acl> <object name="user.user_XTrqveZgi8"></object> </group> And the access list: Used to define the access rights. Replace resource.{resourcename}.http with the resource that is allowed to be accessed to. You can also rename webaccess_acl, but you also have to update the same name in the acl tag located in the group: <acl name="{name}"></acl>) <acl name="webaccess_acl"> <right name="resource.resourcename.http" access="true"></right> </acl> This all will grand the user 'user_XTrqveZgi8' access to http requests to resource {X}. Things to keep in mind: Never use an old ACL, because not yet created -> known accountnames can be recreated by a random player in your server. Always make a backup of your ACL file.
    1 point
  5. UPDATE: I figured that it was an acl issue, that I had to enable HTTP for everyone, so the created API can be available for everyone, even the ones who don't have any auth But I will be needing help on ACL, since I am creating a new form scratch gamemode, I will need to write my own and custom acl as well. Or perhaps use the current account system of MTA as well since I can't edit to create my own And I appreciate a lot for the helps IIYAMA gave me during this issue with the stuff I had with CEF and how they should communicate.
    1 point
  6. Not sure what kind of backend you use. But here is an npm packets that could be used for inspiration. Probably some dependencies are deprecated. https://github.com/4O4/node-mtasa/tree/master The authOptions: https://github.com/4O4/node-mtasa/blob/aeac8ab9417a7b6a65f117491d1e648a6ad62422/src/client.ts#L107C17-L107C28 Using it in request: https://github.com/4O4/node-mtasa/blob/aeac8ab9417a7b6a65f117491d1e648a6ad62422/src/client.ts#L62 But under the hood (in JS) it is something like this: const credentials = `${username}:${password}`; const encodedCredentials = Buffer.from(credentials).toString('base64'); const result = "Authorization: Basic " + encodedCredentials The header is: Authorization The value is something like: Basic bWlqblVzZXI6Z2VoZWltV2FjaHR3b29yZA==
    1 point
  7. It should be for security concerns. You wouldn't want to visit a site that is designed to look for 'new functions' and starts call them. If you take a look at this page: https://wiki.multitheftauto.com/wiki/Meta.xml You can see that it is possible to call an export function over http What syntax do you need for calling an export function? http://<your IP>:<your port>/<resource_name>/call/<exported_function_name> https://wiki.multitheftauto.com/wiki/Resource_Web_Access How does authentication works? https://en.wikipedia.org/wiki/Basic_access_authentication#Client_side A 'basic' authentication should the way to go. It requires login credentials of an MTA user account with the correct permissions. This has to be passed every request. When you connect through the browser: http://127.0.0.1:22005/resourcebrowser/ You more or less understand what to expect. There is also a section about 'Router', which is new. Might be useful. https://wiki.multitheftauto.com/wiki/Resource_Web_Access#Router For inspiration https://community.multitheftauto.com/index.php?p=resources&s=details&id=18781 This resource is about fetching data from MTA to a (remote) host. This is the opposite of what you are trying to achieve, but probably still useful. Fetching from MTA to remote host Creating a MTA user (installation_s.lua) that only has the correct permissions.
    1 point
  8. There is a bug in the site, it stuck like this:
    1 point
  9. Don't be sick please, remember that you've bought the scripts not the author rights. He can do everything he wants with his script because he has the author rights and you don't. Next time be sure that you buy that rights please.
    1 point
  10. I am still waiting for refund.
    1 point
  11. Okay, so i want a refund, i sent you request on Skype.
    1 point
  12. Some crashes in 32 bit Windows are caused by MTA running out of address space. The best solution is to use 64 bit Windows. For 32 bit Windows, these MTA settings may help a little: 1) Settings->Advanced->Fast CJ clothes loading->Off 2) Settings->Advanced->Streaming memory->Min 3) Remove all GTA:SA graphic mods (GTA:SA reinstall is ideal) Or, you could try enabling the 3GB switch in 32 bit Windows Details at this link In summary, for 32 bit Windows 7,8,10: 1) Find C:\Windows\system32\cmd.exe in Windows Explrorer 2) Right click on cmd.exe and select 'Run as Administrator' 3) In the black box enter this command: bcdedit /set IncreaseUserVa 3072 4) Press return 5) Restart computer 6) Pray
    1 point
  13. You bastard I missed you.
    1 point
×
×
  • Create New...