Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 17/04/24 in all areas

  1. Eu testei e funciona. Ele inicia o fogo para explodir, depois conserta, depois inicia o fogo e fica nesse loop até você descapotar o carro. Mas não explode.
    2 points
  2. A new arena? Youuu betcha! Get ready to experience a new and exciting way to play in San Andreas. Become one of the first ever to play GeoGuesser inside the world of San Andreas. TRY IT OUT NOW! Server: mtasa://mta.ffs.gg:22003 Website: https://ffs.gg/ Discord: https://ffs.gg/discord How It Works GeoGuessr is a popular game where you are dropped into a random location on the globe, and you are supposed to guess your position on the map. Well, that is essentially what our new arena GeoGuesser is, except... You are in San Andreas! Join or Create your own room Each round, right-click on the map to mark where you think you are Click on GUESS! button or press Spacebar to make your guess At the end of each round you get a score based on how close your guess was The winner is the player with the highest score at the end of the game Room Features Categories: choose the locations you want to play in (see list below) Lock Camera Rotation: want to make it more challenging? You can restrict players from looking around their surroundings Time & Weather: you can set the time and weather for everyone in your room. Sandstorm, anyone? Categories San Andreas (all categories) Los Santos San Fierro Las Venturas Los Santos & San Fierro & Las Venturas Countryside Badlands Desert Countryside & Badlands & Desert Los Santos & Countryside San Fierro & Badlands Las Venturas & Desert Map Controls Zoom: use the Mouse Wheel or the and buttons to zoom in and out Resize: shrink or enlarge the map using the and buttons Lobby Creating a Room Joining a Room Waiting Room Help Page HUD Best regards, -ffs-PLASMA, -ffs-JessePinkman, -ffs-NitroN & -ffs-Leadership
    1 point
  3. Pretty unique! Definitely going to try this one out.
    1 point
  4. Só para complementar, recentemente foi criado uma nova propriedade para a função setWorldSpecialPropertyEnabled. Basta você usar desta maneira e nenhum carro do servidor irá pegar fogo e/ou explodir ao capotar. -- Server addEventHandler("onResourceStart", resourceRoot, function() setWorldSpecialPropertyEnabled("burnflippedcars", false) end)
    1 point
  5. If It was a roleplay server use Owl Gaming to do it easily
    1 point
  6. Out of video memory. This can happen on servers with unoptimized mods and (faulty) scripts that abuse video memory, or even when you have a powerful graphics card in case the stuff on a server is extremely unoptimized so that it starts hitting GTA limits. If you have a powerful graphics card and more players suffer from this crash type, inform the server owner of this problem as it probably means their scripters & designers don't know what they are doing.
    1 point
  7. Please disregard the post above.. This is a working code ----server addCommandHandler("adminchat", function(player, _, ...) local account = getAccountName(getPlayerAccount(player)) --get the player account for _,v in ipairs(getElementsByType("player")) do if isObjectInACLGroup("user." .. account, aclGetGroup("Staff")) then --- this section you can customize which ACL role they are. outputChatBox("#7D6608[Admin]#9A7D0A"..getPlayerName(player):gsub("#%x%x%x%x%x%x", "").."#7D6608: #FFFFFF"..table.concat({...}, " "):gsub("#%x%x%x%x%x%x", ""), v, 255, 255, 255, true); --- thisplay chat you can customize as well. else outputChatBox("You don't have enough access to use this chat!") end end end ) ---client bindKey("h", "down", "chatbox", "adminchat"); Please hit like on 2 of my posts if these helped you
    1 point
  8. It should be possible, just a concept, not sure it works with this code, but you can modify the rest. --- server addCommandHandler("adminchat", function(player, _, ...) for _,v in ipairs(getElementsByType("player")) do if isObjectInACLGroup("user."..account,aclGetGroup("Staff")) then --- uses ACL to determine who is able use. if (getElementData(v, "adminchat") == getElementData(player, "adminchat")) then outputChatBox("#7D6608[Admin]#9A7D0A"..getPlayerName(player):gsub("#%x%x%x%x%x%x", "").."#7D6608: #FFFFFF"..table.concat({...}, " "):gsub("#%x%x%x%x%x%x", ""), v, 255, 255, 255, true); end end end end); --- client bindKey("u", "down", "chatbox", "adminchat");
    1 point
  9. 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
  10. Download (Github) https://github.com/gta191977649/MTASA-SkyGfx Note: the resource updates frequently, please always check the github for the latest verion SkyGfx (Sky is name of Renderware for the PS2, any semblance to the actual sky is purely accidental) brings accurate PS2 and Xbox graphics to the PC version of San Andreas, Vice City and III. if you enjoy vanilla San Andreas graphic, this mod is essential to have. to learn more about it from the original author (AAP), please see here. Now i will straight go through the documentation. Screenshots The Thanks List ren712 - for shaders & coronas help aap - for the original work & renderware engine help What have done or working in progress? Not Start yet/ not invesgate ? Partically Works Done & Fully Supported Pre-request Library Timecyc Parser Rendering the timecyc interpolation directly from timecyc.dat, interpretation algorithm conveted from librwgta. custom_coronas For rendering the classicFX, like VC style vehicle big headlight, trail light effect. DGS - (Optional) for the debugTools, But you're need dgs to work, i just a bit lazy with gui things Features Postfx Trails(Blur) - blurLeft,blurTop,blurRight,blurBottom works! Radiosity - Color Filter - ? PS2 PC Mobile - Night Version Goggles - Infrared Goggles - Building Pipeline SimplePS - BuildingVS - ? partially, some engine data requires to work, still working on that BuildingVSFX - For model with specular lighting property Not even start yet Vehicle Pipeline PS2 Pipeline - Done, you happy? Xbox Pipeline - ? Only specular lighting works. Pipeline tweaks radiosityFilterPasses - radiosityRenderPasses - radiosityIntensity - zwriteThreshold - detailMaps - leedsShininessMult - neoShininessMult - neoSpecularityMult - envShininessMult - envSpecularityMult - envPower - envFresnel - sunGlare - just see my feature PR. ps2ModulateBuilding - World Effect Dual Pass Render - Yeah, it's done, thanks to ren712 PS2 Alpha Test not even start yet Grass dualPassGrass - it overrides by dual pass render. grassBackfaceCull - grassAddAmbient - grassFixPlacement - only can do it via modify the mta engine ps2ModulateGrass - Shadows pedShadows - stencilShadows - Misc disableClouds - disableGamma - neoWaterDrops(xbox rain postfx) - neoBloodDrops - transparentLockon - lightningIlluminatesWorld - toogle timecyc lighting on world object. fixPcCarLight - coronaZtest - ? partially works, however this will breaks and bugs up the other corona's ztesting in mta. needs to work on a new solution. fixShadows - Special Misc FX (Unique addon by nurupo) vehicleClassicFx Show VC/III liked vehicle big headlight and light trails when you rotate the screen vehicleTrailLength Length of light trails (buffered frame) vehicleTrailDrawDist What distance should trails start visiable? vehicleHeadLightAlpha Alpha multiplier for head light vehicleRearLightAlpha Alpha multiplier for rear light buildingExtraBrightness Multiplier for building extra brightness vehicleExtraBrightness Multiplier for building extra brightness stochasticFilter Make repeative texture look better, ported from Valdir da Costa Júnior Bugs/Issue Sun can see through by walls -> Due to zTest disabled fixed by manually re-create sun from shader, thanks to Ren712 Element garbage collection for vehicle classic fx
    1 point
  11. Cześć, mam problem z edytorem. Nic już nie pomaga, nawet reinstalacja gry. Nie wiem kompletnie co z tym robić. Może ktoś ma jakiś pomysł? = Server name : Map Editor Server = Server IP address: auto = Server port : 22010 = = Log file : ..rver/mods/deathmatch/logs/editor_server.log = Maximum players : 1 = HTTP port : 22011 = Voice Chat : Disabled = Bandwidth saving : None ================================================================== [13] Resource 'acpanel' requests some acl rights. Use the command 'aclrequest list acpanel' [13] Resource 'guieditor' requests some acl rights. Use the command 'aclrequest list guieditor' [13] ERROR: Couldn't find map StadiumMapping.map for resource maps [13] Loading of resource 'maps' failed [13] ERROR: Problem with resource: assault; Failed to link to scoreboard [13] ERROR: Not processing resource 'briefcase' as it has duplicates on different paths: Path #1: "resources\briefcase" Path #2: "resources\[gamemodes]\[briefcaserace]\briefcase" [13] ERROR: Problem with resource: briefcaserace; Failed to link to scoreboard [13] ERROR: Problem with resource: cdm; Failed to link to scoreboard [13] ERROR: Problem with resource: ctf; Failed to link to scoreboard [13] ERROR: Problem with resource: ctf-bombsite; Failed to link to scoreboard [13] ERROR: Problem with resource: ctf-canals; Failed to link to scoreboard [13] ERROR: Problem with resource: ctf-hydrastrike; [13] ERROR: Problem with resource: ctf-tbd; Failed to link to scoreboard [13] ERROR: Problem with resource: ctv; Failed to link to scoreboard [13] ERROR: Problem with resource: deathmatch; Failed to link to scoreboard [13] ERROR: Problem with resource: editor; [13] ERROR: Problem with resource: editor_main; Failed to link to freecam [13] ERROR: Problem with resource: fallout; Failed to link to freecam [13] ERROR: Not processing resource 'freecam' as it has duplicates on different paths: Path #1: "resources\freecam" Path #2: "resources\[editor]\freecam" [13] ERROR: Problem with resource: hay; Failed to link to scoreboard [13] ERROR: Not processing resource 'ipb' as it has duplicates on different paths: Path #1: "resources\ipb" Path #2: "resources\[admin]\ipb" [13] ERROR: Problem with resource: maps; Couldn't find map StadiumMapping.map for resource maps [13] ERROR: Not processing resource 'parachute' as it has duplicates on different paths: Path #1: "resources\parachute" Path #2: "resources\[gameplay]\parachute" [13] ERROR: Problem with resource: race; Failed to link to scoreboard [13] ERROR: Not processing resource 'scoreboard' as it has duplicates on different paths: Path #1: "resources\scoreboard" Path #2: "resources\[gameplay]\scoreboard" [13] ERROR: Problem with resource: scores; Failed to link to scoreboard [13] ERROR: Problem with resource: stealth; Failed to link to scoreboard [13] ERROR: Problem with resource: tdm; Failed to link to scoreboard [13] ERROR: Problem with resource: tdma; Failed to link to scoreboard [13] Resources: 336 loaded, 20 failed [13] Starting resources... [13] Server minclientversion is now 1.3.5 [13] ERROR: Couldn't find resource parachute. Check it exists. [13] Server started and is ready to accept connections! [13] To stop the server, type 'shutdown' or press Ctrl-C [13] Type 'help' for a list of commands. [13] CONNECT: Karol998 connected (IP: bla bla bla Serial: nie pokoze Version: 1.5.6-9.16588.5) * Connected! [MTA:SA Server 1.5.6 [Windows]] [13] JOIN: Karol998 joined the game (IP: 127.0.0.1) [13] WARNING: [editor]\edf\scriptreader.Lua:88: Bad argument @ 'getElementData' [Expected element at argument 1, got boolean] Server FPS limit: 50 Server AC info: [Allowed client files: None] [Disabled AC: None] [Enabled SD: None] GUI load time measures (ms): createWorldDetector() : 0
    1 point
  12. You most likely crashed as a result of memory problems. This can happen when you are using a mid-tier PC to play on a server loaded with heavy mods, unoptimized scripts, or just as often a combination of both. DISCLAIMER: some players would argue that their PC is good enough and has plenty of RAM memory, like 6GB or more. So much that they don't expect to run out of memory. So here's the story - GTA SA is an old game from 2005, and you can run MTA with hardware from that era on most decent servers with ease. But servers that are not decent, but "bad" in the sense described earlier, are able to turn this old game into a more demanding one than modern titles. One that even hits limits of this 2005 game, which wasn't designed for what is being done. We mean that any usage on gta_sa.exe above 3.2GB, even if you have much more RAM memory available, will not be stable. SOLUTIONS: Find another server to play on Upgrade your PC's hardware (most important is the amount of RAM memory) and perform some OS mainentance, limit the amount of processes using up memory. If you're on a 32-bit OS, install a 64-bit version. For more information, please read https://forum.mtasa.com/topic/78081-32-bit-windows-crashing/ If being able to play on a certain server is really important to you, and you decide to upgrade, then please note that unless you get a gaming PC, depending on the severity things are "bad" on said server, it might only extend the duration you can play at once without crashing. If things are bad enough, you can crash within an hour from connecting while using the baddest gaming PC available. Example: a lot of russian total conversion servers. If you cannot upgrade your PC or improve your situation by one of the above steps, then unfortunately there's no option other than mind the (type of) servers you're playing on.
    0 points
  13. LuaRocks is the package manager for Lua modules. Small tricks allow you to use it on MTA server. Installing Linux x64: Windows x86: Usage example: Installing packages is done by typing commands such as: Linux: luarocks install lua-cjson Windows: luarocks.exe install lua-cjson Now you are ready to load this package from MTA. Do this in your Lua script file: -- You should run this function once in your resource initLuaPackage() -- Load library local json = require "cjson" -- Use it print( json.encode({ key = "example" }) ) It's done. Tell me in PM, if you have any remarks and additional information for this tutorial. Thx
    0 points
×
×
  • Create New...