Leaderboard
Popular Content
Showing content with the highest reputation since 26/01/26 in all areas
-
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
-
Hi, We do not handle server bans. This is not a MTA ban. Please reach out to the admin team of the server that banned you in order to appeal your ban, or seek other servers to play on. Good luck!1 point
-
Yeah. I've seen this documentation. So much to start with xD. But yesterday i checked it and downloaded server folder from github repo. I thought that there will be more code. But for my luck that code is acceptably short. Like i guess still month to understand all functions, and how to call them. But one month to start code something is not that wrong. Anyway. Thank you so much for your help. For now i decided to make my own buffer system as module. As im not having problems with understanding C/C++ it will be easier even for me to make whole server as C code lol. I can make that module as lua script. But i like to keep everything organized. When i'll get courage to make that module. Maybe also i'll get will to make my own documentation and publish it. So no one longer gonna strugle with modules. Anyway. Thank you for your help again and your recomendations. From me i can recommend you getting in to C languages. Getting point of how them work improve also skills in lua. As you are "closer" to machine. I think that this topic can be locked.1 point
-
I have no experience with C++ myself nor with modules. But I do know that Lua is fast enough for a basic gamemode. The moment C++ might become important is when you want to implement something like pathfinding. There are other things that can save you more resources. For example using less timers. Most of the time getTickCount / getRealTime is more than enough. Or use as less as possible element data. Sort of : https://wiki.multitheftauto.com/wiki/Modules_Introduction1 point
-
Ofc you are right. and this should always be good advice for everyone to not mess with critical data. i know it, and more programmers should know that. i like to organize everything in hierarchy of importance. like cars possitions can be lost if something happens wrong. as that's not so crucial to server working after shutdown. and in database are still hold relativeley "fresh" data, like vehicle possitions and so on. But money and housing systems for examples are 1st or 2nd importance. so it must be sure that after buying a house money amount is right and house owner is assigned afap in buffer and database. and ofc validate everything. yeah i know that i can do that this way. but i was thinking about directly working with server objects. like buffermodule takes objects how they real look like. and scan only for lets say vehicles. and all previous ideas of how it will be implemented in lua. and make them in Cpp instead of lua. oldtable newtable etc. direct calling from module to built in dbFunctions should be faster in theory. and if i use some coroutines i can prevent that way server from lagging. but still keeping the lua code just to drive module. but i can mistaken somewhere and what i think can be fast. can also be not fast. on one side i can then keep everything hardly bounded together. but on the other side it can be error generating nightmare. what i know from experience in Cpp xD. and my question is. do i'm right about it? and if so. are there good sources to start with it? cause personaly i didn't found anything more usefull on the internet than example module. and ofc mta blue repo. im having in mind some sort of documentation. cause looking at servers source code just to get an idea of how module should look like and work pushes me back even from trying. im doing it everyday, so getting point of my mates is my second nature. but mta blue server is a lot of code. so i guess my natural questions are. if there is a chance that server can save 5% to 10% of power and space. is there any code documentation? so i can short my working time on module. ofc if im right that it can save cycles. i never wrote mta module, and didn't heard opinions of people who did. maybe someone is reading this rn. please get in to discussion. you can help me and others just by getting in to discussion. EDIT also thanks for earlier replying @IIYAMA1 point
-
For some changes it is a good way to save resource. Like for example statistics or car fuel. But do not do it for critical data. When for example your power shuts down, it could create weir de-syncs. (Like if you were buying a house ingame: you do not receive the house [in buffer] but the money has already been withdrawn [not in buffer]) You can use MySQL + dbConnect, instead of writing a custom module. The current MySQL module available is blocking the CPU thread, so that is not really an option for 200 players in my opinion. Also a way to save resources, is to enable multi_statements: local connection = dbConnect("sqlite", "database/database.db", "", "", "multi_statements=1") When for example if you want to remove data at multiple tables. dbExec(connection, "DELETE FROM shared_memory_file WHERE clientId = ?;DELETE FROM shared_memory_frame WHERE clientId = ?;DELETE FROM shared_memory_frame_position WHERE clientId = ?", clientId, clientId, clientId) Or get data from multiple tables: dbQuery(processRequestSharedMemory, { player, clientId }, connection, [[ SELECT variantKey, item, fileData FROM shared_memory_file WHERE clientId = ?; SELECT x, y, item FROM shared_memory_frame WHERE clientId = ?; SELECT x, y, z FROM shared_memory_frame_position WHERE clientId = ? LIMIT 1 ]], clientId, clientId, clientId)1 point
-
Ty so much for reply. Yes i had same thing in head about how buffer should look like. Changing only values that has changed etc. I didn't precised it well. By sending tables to database every 30s. i was thinking about mechanism that also stacks changed values to certain amount. Like old table and new table concept. Lets say im checking every 30s if cars changed their position. I compare old table with new. And values that has changed i move to some sort of stack. And stack is let say sent every 4 cycles of checking car positions. Before that stack is sent to database he's checked for latest values and reduced in size. By validating what comes from client i was thinking about putting clever anticheat trigger mechanism. Like while checking for changes. It's checking if that change was possible with my scripts for cars. Is car moving too fast or something. If it's. Then anticheat is triggered. and let me end here about anticheat mechanism. But ty also for mentioning your script. I'll take a look on it. Also by outside database i was thinking about LAMP thing in LANetwork on the other physical device. As i wanna only let one device to talk with the world. Just to reduce risk. Im sharing same network so i need to keep packs small so i have transfer reserved for server talking to trustfull world. Not exact desciption on purpouse here. Im having physical hardware so CPU and RAM are not problem. Problem is rational use of power. As i want to run my server independent. And made it most watt per player ratio effective. And keep it cheap. As im not planing earn money from server. Sorry for not mentioning details, but i didn't knew how to describe it all earlier and now too. as english is not my great side. Also ty for yours recommendations. Especialy about last one i forgot about that nice feature EDIT ADD Isn't it better for me to just make mta module that handle this stuff with multi core rather than single threaded lua? TheoreticaIy it should save me cycles on lua. And let them to be used more productive on bare bone server mechanics and scripting. And if so. what are good sources to begin with mta modules.1 point
-
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
-
1 point
-
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
-
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
-
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
-
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
-
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
-
1 point
-
@Dutchman101 pls change my ban reason cuz this one is boring my serial is C0C42AB588698E74FD719E8FC4B00394 and ur mom is fat1 point
-
1 point
-
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
-
1 point
-
1 point
-
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) Pray1 point
-
1 point
-
0 points
-
0 points
