Leaderboard
Popular Content
Showing content with the highest reputation on 20/12/20 in all areas
-
San Andreas Roleplay Launched: December 1, 2020 sa-roleplay.net History San Andreas Roleplay is a community founded by @FernandoMTA in early 2020 and @Portside who became co-founder in August of this year. A big shoutout to everyone who's been around since the beginning and has put a lot of time, effort and dedication into the project. My idea and project of making a server shaped by the MTA Roleplay community started back in 2017 with what some may know as Neptune Gaming. The goal was to create a server where people could roleplay in a friendly environment with no abusive and corrupt administrators and toxic players ruining the experience. It wasn't an easy task, I failed a few times due to my inexperience and the destructive intentions of some individuals. A lot of mistakes were made and lessons learned. But thanks to the help and collaboration of a lot of friendly people that I've met along the way and have sticked around, some for more than 5 years now, we now have a stable and peaceful RP community. Long story short, SA-RP has become the only serious English text roleplay server on Multi Theft Auto: San Andreas, the successor of the now extinct OwlGaming MTA roleplay server. About San Andreas Roleplay now has a server that is online 24/7, located in France. Click here for statistics. Read our latest post here about the server's current roleplay setting and updates. We're a community focused on player input, feedback and suggestions. This is why we've been listening to our players, making change and adding new things that enrich the roleplay experience. I highly recommend you join your Discord! Useful links: Website/UCP: https://sa-roleplay.net/ Forums: https://forums.sa-roleplay.net/ Discord: https://sa-roleplay.net/discord Server IP: mtasa://server.sa-roleplay.net Media (much more on our Discord and in the replies below) Credits to the respective posters on Discord & our Forums! Thank You San Andreas Roleplay wouldn't have been possible without a community of dedicated players, contributors, staff team members and admins. A huge thank you to all of you! SA-RP is here to stay for as long as we all want to play on it. Now proudly almost 2 years old!3 points
-
I back to work on BP! I Successfully added support for multithreading, so simulation will work smooth until you get crazy. Also set of function get changed, old function has changed and new get added. Here's current progress:2 points
-
This is the official thread that contains MTA player count stats. As you may know, MTA is still one of the most popular multiplayer games worldwide (it should blend in to the top 10/top 15 of most lists found on the internet.. but old games simply don't get media attention or publicity).. so here are some interesting figures. Updated: 30/10/2020 08:45am Statistics (click to enlarge) Highest: 52,098 concurrent players - 2nd April, 2020 Players online at the same time (always close to 30,000 concurrent players): Unique players per day: Unique players per week: Unique players per month:1 point
-
MAP Converters Some basic map converters that may be useful. https://mtaclub.eu/converters Please let me know if you find a bug!1 point
-
After a worrying discussion on Discord last night regarding password storage and remember me functionality I've decided to write a tutorial on how it should be done. This guide assumes you are not using MTA's built in account system, but a custom one. Any code shown in this tutorial is purely for illustrative purposes, and is not finished code, you should use it as a guideline, not a solution. The following topics will be discussed in this tutorial: How to hash and salt passwords (register) How to validate a hashed password (login) How to add "remember-me" functionality How to offer password recovery How to migrate from an older hashing algorithm, to a newer one Using a password policy (Extra) How to handle database leaks (Extra) What even is hashing and salting? For the purpose of this tutorial we expect a database structure which is somewhat similar to this: How to hash and salt passwords When you have a user register on your service, that user expects of you to keep their password safe. Whilst it is generally bad practice to use the same password for multiple services there are many users that still do so. Because of this it's crucial that you save the user's passwords in a way that an attacker will be unable to find out the original password the user typed. This includes if they have full access to your database. In order to do this we do what is called "Password hashing" When a user registers, your server receives the user's intended username, (email) and password. Before you save that password to the database you have to hash and salt this, luckily MTA has a function that takes care of this. If you wish to know more about what exactly it does, there's more information at the end of this tutorial. In order to hash this password you use the passwordHash function. This function is relatively slow (by design), so it is highly recommended you pass a callback to this function, so your entire script doesn't wait for it to complete. https://wiki.multitheftauto.com/wiki/PasswordHash local mysqlHandle -- we're assuming this value is set somewhere else in code function register(username, email, password) local player = client passwordHash(password, "bcrypt", {}, function(hashedPassword) -- callback function for hashing the password local handle = dbExec(function(handle) -- callback function for storing the user in the database if (handle) then triggerClientEvent(player, "registrationSuccess") -- inform the user that registration was successful else triggerClientEvent(player, "registrationFailed") end end,mysqlHandle, "INSERT INTO users (email, username, password) VALUES (?, ?, ?)", email, username, hashedPassword) end) end addEvent("passwordTutorial:register", true) addEventHandler("passwordTutorial:register", getRootElement(), register) How to validate a hashed password Once you've saved the hashed pasword to your database you need to do a little bit of additional work when authenticating the user. Luckily MTA offers a passwordVerify() function, which is the counterpart of the previously discussed passwordHash(). What this function does it basically hashes the password in the same way, resulting in the same output hash. https://wiki.multitheftauto.com/wiki/passwordVerify In order to get the account the user is trying to log in to you have to do a query for an account which has the user submitted username, and of which the password matches through passwordVerify. PasswordVerify is also a relatively slow function, thus you should use a callback. function login(username, password) local player = client dbQuery(function (handle) -- callback for the query selecting the user by username local results = dbPoll(handle, -1) if (#results == 0) then triggerClientEvent(player, "loginFailed") return end passwordVerify(password, results[1].password, {}, function(matches) -- callback function for the password verify if (matches) then -- Do anything you wish with the database result to log the player in with the rest of your scripts triggerClientEvent(player, "loginSuccess") else triggerClientEvent(player, "loginFailed") end end) end, mysqlHandle, "SELECT * FROM users WHERE username = ?", username) end addEvent("passwordTutorial:login", true) addEventHandler("passwordTutorial:login", getRootElement(), login) How to add "remember me" functionality When users on your server log in, they often do not want to have to enter their username and password every time they want to log in. In order to satisfy this need you can implement a "remember me" function. What I've seen happen in the past, is people would store the user's password (encrypted) on the client. This is NOT safe, and should never be done! In order to properly use remember me functionality what you would do is upon login in, generate a random string. The longer the better. This random string is what we call an access token. You would then allow the user to log in with such an access token, preferably only once generating a new access token each time one is used. To implement this you would generate that token every time the user logs in, whilst they have "remember me" enabled. You will have to save this token in your database alongside your user. For extra security you could also store the user's serial alongside the access token, you can then validate that the access token is being used from the same device. https://wiki.multitheftauto.com/wiki/Filepath function login(username, password) -- This code should be put in the callback to the dbQuery function, but to keep the example clean that's not shown here if (rememberMe) then local token = generateRandomToken() dbExec(function() triggerClientEvent(player, "loginSuccess", token) end,mysqlHandle, "INSERT INTO access_tokens (user_id, token) VALUES (?, ?)", results[1].id, token) end end function rememberMeLogin(username, accessToken) -- this function handles a user's login attempt dbQuery(function(handle) local result = dbPoll(handle, -1) if (#result == 0) then triggerClientEvent(player, "loginFailed") else -- Do anything you wish with the database result to log the player in with the rest of your scripts triggerClientEvent(player, "loginSuccess") end end,mysqlHandle, "SELECT users.* FROM access_tokens JOIN users ON users.id = access_tokens.user_id WHERE users.username = ?", username) end addEvent("passwordTutorial:loginRememberMe", true) addEventHandler("passwordTutorial:loginRememberMe", getRootElement(), login) How to offer password recovery Offering password recovery requires a little bit more than just your MTA server. Generally password recovery is done with emails. So you would need access to an email server / service which you can use to send an email from an HTTP request. (Like you can do with fetchRemote()). When a user requests a password reset, have them enter the email you registered with. You then fetch a user from the database with this email address. You would then store a password recovery token for this user. This token, just like the remember me token, is a random string. Ideally, you would send the user a link with a password reset form that goes to a webpage where the user can reset their password. You could do this with an external service, like a webserver. Or you could use MTA's Resource web access for it, but if you do make sure you handle permissions properly for anything else that uses this. However another option would be to have the user copy paste the generated token from the email into you server's login window. Which of the two solutions you pick is up to you, my personal preference goes to the one with the link in the email. But in either case the server side logic is the same. When the user attempts to perform password recovery, verify that the token they give you belongs to a user, and then change the password to the newly requested password. Make sure you hash this password the same way you do in your login. function requestPasswordRecovery(email) dbQuery(function (handle)) local result = dbPoll(handle, -1) if (#result == 0) then triggerClientEvent(player, "passwordTutorial:passwordRecoveryRequestFailed") else local token = generateRandomToken() dbExec(mysqlHandle, "UPDATE user_data SET recovery_token = ?", token) -- mail the token to the user, mail implementation depends on the mail server/service you use triggerClientEvent(player, "passwordTutorial:passwordRecoveryRequestSuccess") end end, mysqlHandle, "SELECT * FROM users WHERE email = ?", email) end function recoverPassword(recoveryToken, password) dbQuery(function (handle) local result = dbPoll(handle, -1) if (#result == 0) then -- this is only valid if you have the user request password recovery from ingame triggerClientEvent(player, "passwordTutorial:passwordRecoveryFailed") else passwordHash(password, "bcrypt", {}, function(hashedPassword) -- callback function for hashing the password local handle = dbExec(function(handle) -- callback function for storing the new password in the database if (handle) then -- this is only valid if you have the user request password recovery from ingame triggerClientEvent(player, "passwordTutorial:passwordRecoverySuccess") -- inform the user that registration was successful else -- this is only valid if you have the user request password recovery from ingame triggerClientEvent(player, "passwordTutorial:passwordRecoveryFailed") end end,mysqlHandle, "UPDATE user_data SET password = ? WHERE recovery_token = ?", username, recoveryToken) end) end end, "SELECT * FROM users WHERE recovery_token = ?", recoveryToken) end Besides changing the password, it's important you also delete any access tokens that user might have if you're using remember me functionality. It is also good practice to make recovery tokens expiry after a certain amount of times, and not allow a recovery token to be created whilst one is already in prgoress. This prevents a user from sending a large number of emails from your service. How to migrate from an older hashing algorithm, to a newer one Maybe after reading this topic you realise that your password security is not what it should be. So you want to change your old password hashing / validation logic to the ones explained in this topic. And due to the nature that hashes can not be "unhashed", you can't simply migrate your passwords over. So in order to migrate the passwords what you have to do is when a user logs in, first validate their password with the old hashing algorithm. If this matches, then hash (and salt) it with your new hashing algorithm and save it in your database. Make sure to delete the old password otherwise your password security is not any better than before. Using a password policy Passwords policies are important to prevent your users from picking a password that is too easily cracked / brute forced. Many password policies come in the form of "Must have at least one capital letter, one digit and one number". But that discards that fact that the best way to make your password more difficult to crack, is making your password longer. So in the code snippet below is a function that measures the 'search space' of a password. The search space of a password is the amount of possible passwords there are with a certain combination of characters. In order to use this, you would have to set a minimum password search space when a user registers for an account. This minimum is up for you to set, but be reasonable, you shouldn't expect a user's password to be impossible to remember / create. I recomend playing with the function a bit to see what values you get out of it, and pick something you believe is sensible. function getPasswordSearchSpace(password) local lowerCase = password:find("%l") and 26 or 0 local upperCase = password:find("%u") and 26 or 0 local digits = password:find("%d") and 10 or 0 local symbols = password:find("%W") and 32 or 0 local length = password:len() return (lowerCase + upperCase + digits + symbols) ^ length end -- The below function calls are to indicate the difference in search space for a set of passwords print(getPasswordSearchSpace("a")) print(getPasswordSearchSpace("abc")) print(getPasswordSearchSpace("Abc")) print(getPasswordSearchSpace("Ab!")) print(getPasswordSearchSpace("Ab!0")) print(getPasswordSearchSpace("Mu#9A0h.")) print(getPasswordSearchSpace("This is a demonstration of how easy an incredibly strong password is to remember")) How to handle database leaks If you have reason to believe that your database has been leaked or otherwise compromised, it is important that your first course of action is removing any access tokens stored in your database. Once you have done that you have to inform your users. Whilst when properly hashed and salted it's extremely difficult / time consuming to find out a user's password it is still a possibilty. So you should inform your users of the breach, tell them that their passwords were properly hashed, and they do not need to fear for their passwords immediately. However you should suggest to your users that they change their password either way, just in case. What even is hashing and salting? Hashing has been brought up several times in this tutorial, whilst you do not need to know what it is / does, you might be interested in knowing regardless. I won't be going too far in depth as I simply do not have the knowledge, but the basic idea of hashing is this: When you hash anything, you turn it into a string of characters (or other value) that has no relation to the original input, other than when you hash the original input again, it will always generate the same hash. For example, when you hash the stirng 'banana' using the sha512 hashing algorithm, it will always yield the output: "F8E3183D38E6C51889582CB260AB825252F395B4AC8FB0E6B13E9A71F7C10A80D5301E4A949F2783CB0C20205F1D850F87045F4420AD2271C8FD5F0CD8944BE3" Now hashing can not be reverted, you can not "unhash" a hash, so in order to verify someone's password you hash it again, and see if the two hashes are the exact same. Now this is great, passwords are safely stored. However there is still more to do, salting. Salting is adding some random data to your password prior to hashing it. This prevents when two users (on the same service, or on others) have the same password, that their hashes are also the same. Meaning if one password is compromised, the other password is not. It is important that a salt is random for every user in your application, not one salt for your entire application. Now you might think we didn't do any salting in the code / tutorial above. This is not true, we just didn't do it ourselves. MTA's passwordHash function actually hashes the passwords and salts it, this salt is then stored in the output hash it self, just before the actual password hash. In the case of bcrypt it actually stores a little bit more info in the resulting hash, but you need not worry about that.1 point
-
Help MTA by finding security flaws and working cheats so we can fix them. Vulnerabilities from resources: * €100 - Run arbitrary x86 code in MTA * €50 - Ability to run a compiled script that has not been compiled at https://luac.multitheftauto.com/ (or otherwise authorized by MTA) * €50 - Read directories outside of MTA install directory * €Ask - Other vulnerability you may have found Client cheats: * €30 - Working cheat engine variant * €30 - Other working cheats * €15 - Exploiting (previously unknown) bugs or glitches * €5 - Using a program to gain unfair advantage MTA web sites: * €50 - Serious security breach * €30 - Small security breach * €15 - XSS with exploit potential * €5 - XSS without exploit potential * €Ask - Other vulnerability you may have found Terms: 1) Game vulnerability/cheat must work on latest 1.5 nightly, with all AC detections enabled. 2) Submit your vulnerability/cheat by creating a topic in the Private Bugs board. 3) Only the first person to submit any particular vulnerability/cheat will get the bounty. 4) We reserve the right to change terms in case of abuse or other similar reasons. 5) We only accept PayPal for bounty payments. P.S. The undetectable MTA cheats from BoxyHaxSamp (multihack nbvf, Aim bot, Change Serial) are all scams, so please don't bother reporting them. If you are wondering why MTA pays security researchers/ethical hackers: Note: the MTA AC team uses "method" in 1 breath with "vulnerability" and "technique" MTA has a security-oriented anti cheat that doesn't work by signatures of individual cheats, but patches the underlying method (then considered a vulnerability) used to get cheating functionality. It's complicated to explain and would be an essay, but we summarized it in the below spoiler. Open it to read, especially if you plan to try and hack MTA for the bug bounty program1 point
-
1 point
-
Thread's moved to the Scripting section. I highly recommend Daniel Lett's video tutorials. I was able to get a better understanding working through them. https://www.youtube.com/watch?v=Goqj5knKLQM&list=PLY2OlbN3OoCgTGO7kzQfIKPj4tJbYOgSR1 point
-
Попробуй кинуть от головы https://wiki.multitheftauto.com/wiki/ProcessLineOfSight Или https://wiki.multitheftauto.com/wiki/IsLineOfSightClear1 point
-
You put 'elseif' as in if the job wasn't the 'RS Haul Delivery' then it would check if the hours played is below 50, which is why you were able to get the job regardless of how many hours played. Here you go though. local hoursplayed = tonumber(getElementData(localPlayer, "hoursplayed")) or 0 if (jobtext=="RS Haul Delivery") then if hoursplayed < 50 then outputChatBox("You must play at least 50 hours to work as a RS haul delivery driver", 255, 0,0) return true end end1 point
-
é só vc subsituir a textura da parte do corpo por uma image 2x2 em png sem nada nela1 point
-
É shader amigo, basicamente você pegar uma imagem e irá mascarar a textura dela com a imagem entende ?. para isso você usará: dxCreateShader dxCreateTexture engineApplyShaderToWorldTexture dxSetShaderValue. der uma estudada nessas functions e entederá ! https://www.sendspace.com/file/bjwoqp -- aqui você baixa o shader. espero te ajudado1 point
-
I believe that what you are suggesting is still not yet a feature. You should read more about this on MTA's GitHub, for example by searching here: Issues · multitheftauto/mtasa-blue (github.com) This here is very interesting in particular: Add efficient modding interface for new model ID's · Issue #1792 · multitheftauto/mtasa-blue (github.com)1 point
-
This is because setVehicleComponentVisible is a client-side only function. It's actually possible to combine 2 models into the same file and run them without ID's, or make a custom system for ID's. I've successfully added different vehicles to MTA without replacing anything. Note it's not advised because the file size just gets insane, textures get jumbled up, and other things.1 point
-
You can use 6. extra0, extra1, extra2, extra3, extra4, extra5. If your project needs more than 6 you would want to use one of the above methods.1 point
-
A database would use more CPU than just a plain file. When using a timeout (as Addlibs said), you can separate the database thread from the MTA thread. When having multiple CPU cores in your VPS server. Your CPU can automatic assign both threads to different cores, which leads to a very low impact on the performance. As for the file, MTA doesn't write directly to the hard drive, there is a buffer in between. Read more about flushing the buffer here. (Note: You shouldn't flush log files without reason) There is no big penalty here either. Very simple writing to a log file: local hFile = fileOpen("test.txt") -- attempt to open the file (read and write mode) if hFile then -- check if it was successfully opened fileSetPos( hFile, fileGetSize( hFile ) ) -- move position to the end of the file fileWrite(hFile, "hello" ) -- append data fileFlush(hFile) -- Flush the appended data into the file. fileClose(hFile) -- close the file once we're done with it else outputConsole("Unable to open test.txt") end -- https://wiki.multitheftauto.com/wiki/FileOpen And the downside of plain file has explained Addlibs already: Accessibility. XML? That is not a good idea for infinity data. XML uses a node system, each node representing a data-location in the XML tree, when you load the file, you load also all the nodes in to the memory. Loading the file should take longer based on the amount of nodes.1 point
-
Hi and welcome to the forums, @Mongou Your thread has been moved to the Portuguese Coding forum section for best results, as the International Scripting Tutorials section is only for tutorials that we approve. On topic, yes it is possible to do what you're asking, but I've been let know by someone who's used it that it can be very bad on performance, and of course this gets worse for more detailed models and textures. For more help I invite someone else to weigh in as I am not very knowledgeable on coding.1 point
-
1 point
-
Login System Some Images of GUI: https://puu.sh/sJnRg/2928be4ec3.png https://puu.sh/sJnTw/cb57d4b9ce.png Features: Uses External MySQL Database for register/login Logs in user to MTA System if account exist. It is opensource Installation: Configure your database configurations in server.lua Export database.sql to your selected database. Add this resource to your ACL's admin group and boom! Finished! You can start the script and connect to the server! Download Links MTA Community Resource: https://community.multitheftauto.com/index.php?p=resources&s=details&id=13930 Exports: -- To Be Updated.. exports.login:getPlayerUsername(player) -- Gets Player Username.1 point
-
As of 09/03/2017 we've pruned the entire section, as we felt some sort of rules and guidelines were needed in order to achieve a good listing for both server staff and interested parties. Rules: - General forum guide of conduct and rules apply in this section. - Any modification which is outside limits for the OP shall be reported via the report system in order to be addressed by a moderator. This is mandatory, as the goal is to keep this section as clean as possible. - Topics must have a detailed description of your server, this involves a brief description of your community, gamemodes you're offering and anything else that helps players to get interested on you. - Drama, server bashing, staff bashing, won't be allowed by any means. Members found guilty of these behaviour will be punished accordingly to our general guidelines and more severe depeding of staff judgement. - You should be atleast a staff member (or owner) of the server you're advertising (so no promotion by 'satisfied players'). - It's not allowed to actively recruit or persuade people to leave a positive opinion on your topic. Moderators reserve the right to judge if a spree of posts is suspicious (likely to be a result of this practise) and remove it on their own discretion, this is non-negotiable. Formatting your topic: - Topic titles shall have the form [SERVER TYPE] Brief description/Name [LANGUAGE]. - The first post shall be written in at least 3 parts, being the first a brief description of yourself, the second any media you may provide about your server, mostly ingame shots and anything you might want to show to interested players, and the third one server details, this involves connection details, contact details, and anything else you may provide to get players to your community. Any thread not following this guidelines shall be deleted and the user/s involved been given a warning depending of the staff judgement.1 point