J4cobLIVEmain
Members-
Posts
98 -
Joined
-
Last visited
-
Days Won
6
Everything posted by J4cobLIVEmain
-
I got an answer on GitHub, that they will remove (or removed) all integrity checks in 1.7, check it out So I guess you should guys move to nightly 1.7 and check there if it's already in place.
-
Problem z odpalenie MTA
J4cobLIVEmain replied to szymzi's topic in Pomoc z grą lub klientem/serwerem MTA
Siemka, To wynika z tych "dziwnych" updateów, które MTA ostatnio nam zafundowało. Wydaje mi się, iż wprowadzają do kodu gry po prostu kod AI, który wszystko pierdoli. Wszystko działało perfekcyjnie do Stycznia / Lutego 2026 a potem się wyjebało. Mam podobne problemy I te problemy najlepiej, zgłaszać na GitHubie MTA, bo tutaj - nikt z "wyżej położonych" deweloperów MTA już zwyczajnie nie zagląda: https://github.com/multitheftauto/mtasa-blue/issues Przytoczę pewną wiadomość którą raz dostałem, bo sam zgłaszałem problem - że deweloperzy MTA plują na graczy I nie wierzą że takie problemy w ogóle istnieją, a jak widać na GitHubie, sporo ludzi ma problem z Anti-cheatem (choćby ja) czy Integrity Violation Taka rada, lepiej przenieść się na SA-MP. Dalej tutaj jestem tylko dlatego, że od czasu do czasu coś poskryptuję - z AI również bo według mnie do skryptów AI nie jest takie złe, natomiast same praktyki MTA teraz są dziwne - auto-updater który update'uje się już bez progress baru i widać tylko nieznikający proces MTA w menadżerze zadań, później znika i gra się załącza (po minucie) po aktualizacji na przykład. Niektórzy nawet nie mogą wejść po za menu MTA, tak też u mnie się stało: https://github.com/multitheftauto/mtasa-blue/issues/4922 Złe czasy nastały w tej epoce AI które mamy I niestety ale MTA ma coraz mniej graczy I szczerze będzie się trzeba stąd ulotnić przed GTA VI, bo potem już umrze na 100% -
Guys, post it on GitHub so they see just like me https://github.com/multitheftauto/mtasa-blue/issues/4922 So far I heard many other people got it, and mta devs don't care on Discord, and forums are dead anyway (only people advertise here or show off some scripts and they barely get any attention) so yeah
-
That's new... I guess it's crashing somewhere. I have crashes everywhere too lol, can't even get past the menu because of that :~ty Access Violation error. I guess nothing you can do about it, move to SAMP or something it will be 100% better for you, just find some servers or ip's (because Samp server list got shut down, but servers are still there)
-
Wait couple of minutes, it's a :~ty "silent update" thing that they implemented. MTA is just now updating itself very silently without progress bar anymore, it's visible in the task manager. It does some stuff in the background and then finally launches (For me it was like 1-2 minutes). Unfourtanetely devs dont care nowadays so yeah, move to Samp or something, or play GTA IV original MP through GTA Connected lol
-
Hey. I don't think you should be majorly ashamed with the AI usage, if you are not selling the script or anything. I used Gemini Pro in the past, and it gave amazing results tho, but it's better of course to know script knowledge. I don't know if you saw, but I did this with 98% AI and it's clunky af, but works, still AI will not replace humans at scripting I dont see it coming anytime soon, but who knows lol
-
New MTA is very unstable, every day new problems.
J4cobLIVEmain replied to WafelTLD's question in Client
Hey, I made this thread with the same problem before! It is really frustrating, now new problem arose which is making me believe, they use AI to I guess modify the .exe - keep in mind I don't have any problem with AI for scripting for fun, or upgrading scripts - but modyfing .exe and the core of MTA and having this many problems this is baffling. Now another problem that I have is that the game :Oing updates for 2-3 minutes sometimes even, without an update progress bar. So the process is still there, in task manager - and it's just "silently updating" which is beyond stupid, because you don't know if at that point - MTA crashed, or god knows what happened. After 1-2 minutes (or 3 minutes even) it manages to launch but then - Integrity Violation or other :Oing crash might pop up. This is extremally frustrating, and I'm thinking about abandoning MTA and just playing SAMP at this point. The same problem occurs with oCam (recording program) that I can only record with, high quality - because OBS has those bitrate problems on "worse computers" and oCam is straight up crashing giving the integrity violation. I'd use Bandicam or Fraps - but these ain't free, and Bandicam has a watermark, and Fraps... records with AVI and after 1 minute of recording I have like 20gb recording. oCam triggers integrity violation, before it was a bit better - it could record the menu but crashed the game upon joining any server (no AC issues). Keep in mind, oCam records base game (singleplayer) perfectly in full HD, without no issues at all, one of the best recording programs for lower-end PC's (well I have a medium spec PC but it ain't that good and I can't play newer games) The sad thing about is when I was inside the Discord, many other people report those issues - and guess what? Nobody :Oing cares. Like old admin - KWK (which left the MTA staff long time ago) said, when I spoke with him on his private server few years ago, said that those people are underskilled and are making MTA worse. You can change it, by posting the same problem and liking the problem enquiries on MTA Blue Github (i also posted about this issue and got 2 likes already) so maybe they will finally start :Oing caring about this I have a temp fix for HB timeout but only if you have your own private server, do this: Go to MTAserver.conf and look for this: <!-- Comma separated list of disabled anti-cheats. For details see https://wiki.multitheftauto.com/wiki/Anti-cheat_guide e.g. To disable anti-cheat #2 and #3, use: 2,3 --> <disableac>TYPE **95** HERE</disableac> so it looks like this: <disableac>95</disableac> Theoretically if you know a server owner he can disable it for you on a public server but this might be an issue since it's Anti-Cheat releated. And you will get rid of the problem, also need to do the same for Map Editor server (editor.conf). I never had it happened on public server. Try joining my server that is running on a Polish hosting for 80+ more days: Vanilla | Classic Race Server | 24/h @1shot1kill.pl it doesn't have any AC restrictions but it works just fine for me without any tweaks, and it is a public server. I was a MTA:SA Pro Racer from 2013-2017 (playing in pro games) and there were no streaming issues like this back then, but when racers demanded more FPS on servers they started to arose - like on spectating, if someone goes too fast, then spectators for example see objects dissapear and mta starts to spill out LOD's all over the place (streaming issues). I don't really look at these Map Editor stuffs as something bad I just never cared when it happened, but if it's not map editor then wow. We tried to fix it with others on our own, on our servers but to no avail. Sad part about this is MTA devs will not address that such problem is affecting so many different people. If you want to see my thread on GitHub about this, give it a like or something so more people see this: https://github.com/multitheftauto/mtasa-blue/issues/4922 Oh I forgot to mention - MTA after update leaves upCache file, which is 200mb, thanks that I have WinDirStat program I can track it down and delete it, it's clogging the disk sometimes - delete it and free up your disk space if you can It's also stupid, it should auto-delete after update, but idk maybe it needs to be there and that's why it constantly auto-updates in mine because I always clean that garbage up. I guess I need to consider moving to SAMP and doing MTA-like racing there, with toptimes and such. Last time I played samp was like 2009 or 2010 with a :~ty 500 ping internet lol -
Nice idea, when I will come back to racing once again I will try it - I think I might also move the "nicknames" on the screen, because if they are positioned like that (right side) they go off screen (points)
- 2 replies
-
- 1
-
-
- race
- lowrider dance
-
(and 1 more)
Tagged with:
-
Misterix resource for Multi Theft Auto. Inspired by the original Misterix script on MTA resources made by Rhypasa; https://community.multitheftauto.com/index.php?p=resources&s=details&id=15163, and by the singleplayer mod. My own take on this. Note about AI usage I don't condone you guys making scripts with AI - it sucks and its like a sysyphean job. Hire a scripter and he will do a 1000% better script than this. My dream was to play a way cooler version of misterix than Rhypasa made, because I felt some stuff were missing there, and script weren't updated that often so I decided to fulfill my own vision of the script with the help of an AI . I scripted few smaller scripts before for my own use (like a script, which permits people from certain countries to enter the server) on my own and let me tell you - learning scripting is much more fun than using an AI for it. You can use AI to learn scripting and such, and attempt to do these kinds of projects by yourself but I recommend you to do that privately. I also don't sell it, which to be honest - selling an AI script would be such a dog:~ move. But if anyone else, dreamt about this kind of Misterix script (with a lot of features like this) this is for those people who just want to have fun and always wanted to try it and don't mind it being an mostly made AI script. With the help of AI I realized that vision, how a misterix script in my opinion should look like, because I'm not that experienced like some of the veterans here are. I hope, despite like 99% of the code being AI - you have fun playing this, or watching the vid for it. Moreover, if you can make it better with actual human input and skill, you always can, GitHub link with all the files is below - and I'm rooting for you. Call it an AI Slop, insult me, call me names, flame me even more or whatever - I'm still amazed that AI can pull off something like this. I don't think it's ready for major public use, but I have a server just in case you want to test it out, it's not open most of the times because it's a free server and we had played around for fun with my friend there. If you want it msg me privately I shared the script on GitHub. If you want to make a fully human remake, or check how AI made some stuff like AI, car AI and all that sh*t then visit it here: https://github.com/AlfredoAnonym/Misterix-MTA-SA Feel free to make your own versions of this script, implement any stuff from this script to yours - I'd love to see an actual fully human-made misterix script better than this. What I will try to do is I will try to fetch the music files so instead of downloading grueling 60+ mb file, you will be able to load in quickly to the server because music could be played from Github and fetched. Features Create your own ped mysteries (with /cm command) - you need to be an admin to do this Create car mysteries as well (with separate car ai) Skin mods for various peds and music that you can always edit / add in the script AI can throw projectiles at you, or fire with projectiles (spraycan still doesn't work, but flame thrower does for example) Taxi system for few myths for now (check out the video to know how to make more taxi paths) Weapon buying system (for future gamemode) Health bars for myths Not only 1 peds in one myth, there can be multiple peds (check out Epsilon or Zombies-Nemesis) Spawn friendly Yakuza with /yakuza command - they will help you battle the myths. Better spawn them after you accepted the mission, you might see some glitches like them not getting out of the vehicle. I also tried to make Drive-by (with AI too) and they just seem to have an invisible weapon out of the car window, and they don't shoot with it so yeah, but they get out / get in of the cars, attack the myths, that's enough for me They also if there are no car seats left, look for a nearby car and drive it behind you (that's a nice touch I think) Save system (saves your skin, money, stats - sometimes muscles do not save or aren't loaded) (for future gamemode, still buggy) Garage: You can add any vehicle to your garage by typing a command, and then you can retrieve it from the garage by typing /grg and you'll spawn inside of it. In which gamemode this script is supposed to be played on? It should be played on Freeoram now. I planned to make it a separate gamemode, but I don't have a lot of help with it and frankly its hard to do a separate gamemode if you don't know scripting. I only script (small easier stuff) by myself, but most of the code is sadly AI for this script (and I feel like I need to disclose that). I edited stuff myself too, and if you are a better scripter you can make this script a lot more better, and you can remake it even better than I did. I wanted that kind-of misterix script to be in MTA:SA, and that one that we played had only few mysteries, which half of them never worked for me and my friend - and this was the dream, that AI helped us to achieve (to play a better version of "misterix") it still has glitches
-
Lowrider RACE dancing map. Another one of my ideas. Player who wins with other player, gets teleported to the finish and finishes the map, while other just dies. If you are alone, you need to reach certain amount of points. Buttons work but sometimes even if you are in the middle (but way off middle) you can still get perfect. If you don't see the video, here's the id: watch?v=3W-vXzHMMFE
- 2 replies
-
- 1
-
-
- race
- lowrider dance
-
(and 1 more)
Tagged with:
-
MTA keeps getting worse and worse - AC and Integrity Violation Error
J4cobLIVEmain posted a question in Client
Hello there, Can someone tell me, why MTA is getting worse and worse when new updates comes? I never had these problems: CSRW gamemode (that is old enough) used to run just fine year ago (last time I checked one off time was January 2026). When I launch it and try to skip the MOTD (Message of the Day) info box, it shows this: Keep in mind I don't have any AV's (I'm on a Windows Defender I don't use antivirus software) and this is bothering me. Also I do not have ANY external programs running, basic windows services and Chrome browser mostly. I even removed ASI mods from my GTA:SA main folder but it didn't help either. But that's not all. Whenever I join a map editor server, or a private server ran from MTA Server.exe, some anti-cheat :~ty error pops up saying that it kicked me because I didn't move or something. Keep in mind, this pops up randomly, or doesn't pop up at all, or pops up everytime I launch MTA and join the server. This is literally pathetic as I normally move and interact with the game. Moreover, it doesn't happen on a public server, only on local server The first problem with integrity violation happens everywhere when I launch the CSRW gamemode. And I get some people hating on MTA devs nowadays. It was never happening to me year ago or at the beginning of the year when I was using MTA, but they keep breaking the game even more... Like what the f*ck An request for someone who knows scripting Do you know what causes this integrity violation issue in CSRW gamemode? I suspect it might be those csrw-models but I have no clue, since they always worked without no issue at all. I'd love to know, because I wanted to convert a certain map and port it to the gamemode, but I can't obviously test it out because gamemode is unplayable, because of that integrity violation. I uploaded the gamemode on GitHub so if someone can evaluate the problem and maybe help me out running this on a public server, would mean a lot. I want to re-make the gamemode in the future too (or make a brand new one based on it) or just change it slightly. Sorry for the foul language and overall agressive tone, but this is just sad. Hoping that it will be fixed, but seeing how MTA devs do the updates I'm not hoping for any miracles.-
- 3
-
-
-
- anti-cheat
- integrity violation
-
(and 1 more)
Tagged with:
-
Hey there, guys Can someone explain / or help me convert this specific Vice City map (from the VC gamemode) to work on race, and maybe paste an example script how to change checkpoint sounds? Would be very appreciated. And I'm also wondering if its possible to change the checkpoint model in general, like an arrow checkpoint from GTA:VCS Racing https://github.com/gta191977649/MTA-VCS Help will be much appreciated.
-
Race Server with ELO System (still WIP, but you can earn elo or bet your elo on other players!) with fully functional Map Uploader that allows logged in users to upload their race maps. It's a 24/h server, sometimes you'll see me or my friends testing out some scripts. From interesting maps, we have a Paramedics Sub Mission (similar to the single player one), or a coop Towing map that you tow vehicles It's checkpoint racing, not DM / DD racing. Server name: Vanilla | Classic Race Server | 24/h @1shot1kill.pl IP: mtasa://91.224.117.19:28060 Feel free to play, any player is welcome from EU or any other regions. I'll see more activity: More scripts will come. To-do probably: Userpanel with few stuff like "player of the week" (similar to what GTA.RU Racing Server had before) Money system that will save money and you'll be able to buy some stuff with it Server is extended to August 2026 so you have many months to play on it Enjoy
-
Hey there! I'd like to share some videos of my crazy and insane RACE map ideas First off, a map with the locked "V" key, that locks you in the "front view" camera of a Hydra. Need to be a total badass to fly through without crashing and with high speed Do you like planes? I kinda do, but this Rustler Tree Slalom (HARD-CORE written purposefully) and if you like trees, or crashing on trees... This map is just for you!
-
Amazing stuff! Thanks a lot. Will test it out and surely will share it accross racing. I think I know how to implement this.
-
Hey, so I forgot to message here before because I went quite inactive after this So I tested it out, and I don't think that helped. Still saw textures dissapearing when I was on the spectate and spectating someone caused this, but I think now - new MTA:SA version and "Fixed" handling might've fixed it (and vehicle physics set to 30) because there are something like "slowroads" and "speedroads" phenomenons. So basically, if you drive not at the main road in LV, but on the strip (these colored like floors near 4 dragons) they will give you more speed than usual. Now recently I noticed 30 fps won't enable those pesky speedroads so maybe that is the problem, but i'd love to still play on the Legacy handling, but idk how i would disable the "speedroad" phenomenon I remember one video saying that "It is really easy to disable it with a simple script" but I don't think that's the case.
-
Hello there guys! I want to organize an Racing event, to test the new changes in the edited Race CW script by Vally - so I'm organizing an event on my own server. Date: 28.02.2026 Time: 4:00 PM EU CET (UTC) +1. Time in other timezones: (GST UTC+4 7:00 PM) (EET UTC+2 5:00 PM) (ART / BRT / CLST / PYST UTC-3 12:00 PM Noon) IP: mtasa://51.75.58.35:10899 (Server name: Polski / Polish Race Server | ELO System | Lemmehost.com) Add me on Discord too if you'd like to participate in more (if you'd like them): jacobmta As always I'll post the full stats here, but I doubt anyone from here will actually care to come unfourtanetely, but hopefully some of you will prove me wrong! I'll try to invite some of my friends too to test some stuff out. Maps will be randomized, but mainly street / offroad / bike races. Checkpoint racing if you'd ask too Hope I see you there! Everyone's welcome.
-
A Ready Race Server Repository Contains various scripts that Classic Racing (checkpoint racing) servers use and some new scripts too with maps. Ready for casual racing or pro racing. It has around 800-900 vanilla RACE maps, and 100-200 casual maps. It has most important scripts for pro racing, like Pole Remover that's required in some maps, offroad wheels and much more. There is also well known RACE clanwar script by Vally, that has been redesigned to new standards Changes for some classic scripts Map Ratings - Now correctly working, with its own F4 gui where you can sort best rated / worst rated maps. It also notifies you to rate a map from 1-10. Map ratings save if you turn off the script VallyCW - Race League (clanwar) script by Vally. Completely overhauled, added bunch of new things - including ability to set captains, new point system more used in FFA games, /tech pause (it locks after 10 seconds) and much more. One of the most amazing implementations is the ability to export stats now - it should export the match stats to the VallyCW folder to stats.txt, which will give you full score and player scores. cw_script - Edited by BurN, now edited by Mateoryt. Also added new points system, and overhauled the script with new features. Toptimes - Retained more classic look, but edited few things like colors (1st, 2nd, 3rd toptimes), similar to SiK server back in the day. Only bad thing about it is spacing between the country flag. I'll probably upload robson race_toptimes2 there too, but if country flags will not work there for you, then use this one or remix the Robson script. It uses the flags from the scoreboard resource Carhide - the classic carhide from servers like GTA.RU back in the day. Fixed and working on newer servers Delay Indicator - smaller delay indicator, with an new command /clearsplits to clear splits when you delete a toptime. They will not show up anymore if you do that Installation: First off, do not wipe everything from resources. Only wipe the [addons] and [maps] folder from [gamemodes] / [race] folder. You can also keep voicepack or whatever I don't use it, but if you delete it it might cause you some warnings Put everything (or replace some stuff) to your server resources folder. Replacing i mean one thing in gamemodes / race / race client and server.lua to support onSpectateRequest so it warps people to spectator mode if clanwar script is running and they are in the spectators team Important thing: First off, type in the server console aclrequest list and check if any of the resources need acl requests, if they do - type aclrequest allow all or aclrequest allow (resource name) or all. Then you'll give all the scripts that need this acl rights so they can function properly. If any of the scripts will not work, try extracting that script from .zip maybe it will work better If you'd like to play on a server of mine I don't run 24/h servers I run a server whenever I can, and whenever I play - check out mtasa://51.75.58.35:10899 - I have most of these scripts in-place Feel free to contribute to anything, i'm looking for a working racing carfade that other servers have (I don't know if the mta community version works fine, or that one that is in the base server). Some scripts there are WIP but playable and you can test them out too like the ELO script (or modify it if you want)
-
Thanks, will share to my mates and we'll test it out.
-
Hey there folks! I have a question for very good scripters, is it possible to disable those "streaming issues" when you are for example: going too fast with a car, the whole texture switches to a LOD and looks broken (it mostly happens on spectate during race). A solution to this would be a lot helpful when recording racing and stuff.
-
gl bro but i dont think anybody cares these days on this forum, you might get few ppl. It is really better to just buy google ads or smth lol
-
[Race Tournament]The End of The Battle
J4cobLIVEmain replied to GARIK08's topic in Leagues and events
Add the image with imgur or something, and make sure it has .png or any other image format at the end of the link. -
Hey there! I told you before in some other post that I used Grok for scripting. He nearly pulled off a very nice Racing map panel. However there is a slight problem - when you buy the map, money goes away (money is inside the script too I think when you win a race it gives you certain amount) and map doesn't play or its not set. If you guys have any idea how can it be fixed, lmk. By the way, to get this kinda script you need around 2 hours on Grok for him to properly understand MTA scripting Codes: server.lua local moneyFile = "money.xml" local nextMapQueue = nil -- Store the next map if race resource isn't running -- Load player's money from XML function loadPlayerMoney(player) local serial = getPlayerSerial(player) local xml = xmlLoadFile(moneyFile) or xmlCreateFile(moneyFile, "money") if not xml then outputDebugString("Failed to load or create money.xml", 1) return end local node = xmlFindChild(xml, serial, 0) or xmlCreateChild(xml, serial) local money = tonumber(xmlNodeGetValue(node)) or 0 setElementData(player, "money", money) xmlSaveFile(xml) xmlUnloadFile(xml) end -- Save player's money to XML function savePlayerMoney(player) local serial = getPlayerSerial(player) local money = getElementData(player, "money") or 0 local xml = xmlLoadFile(moneyFile) or xmlCreateFile(moneyFile, "money") if not xml then outputDebugString("Failed to load or create money.xml", 1) return end local node = xmlFindChild(xml, serial, 0) or xmlCreateChild(xml, serial) xmlNodeSetValue(node, tostring(money)) xmlSaveFile(xml) xmlUnloadFile(xml) end -- Handle player join addEventHandler("onPlayerJoin", root, function() loadPlayerMoney(source) end) -- Handle player quit addEventHandler("onPlayerQuit", root, function() savePlayerMoney(source) end) -- Fetch all race map resources function getMapList() local mapList = {} local resources = getResources() if not resources then outputDebugString("Failed to get resources - check ACL permissions for 'function.getResources'!", 1) return mapList end local includedCount = 0 local excludedCount = 0 for i, resource in ipairs(resources) do local resName = getResourceName(resource) -- Skip system resources, our own resource, and known gamemodes if resName ~= "race_map_panel" and not resName:find("^%[") and resName ~= "csrw" and resName ~= "race" and resName ~= "play" and resName ~= "assault" and resName ~= "destructionderby" and resName ~= "ctf" and resName ~= "as-cliff" and resName ~= "ctf-goldcove" then local metaPath = ":" .. resName .. "/meta.xml" local metaFile = xmlLoadFile(metaPath) if metaFile then -- Check if the resource is a gamemode local infoNode = xmlFindChild(metaFile, "info", 0) local isGamemode = false if infoNode then local resType = xmlNodeGetAttribute(infoNode, "type") if resType and resType:lower() == "gamemode" then isGamemode = true excludedCount = excludedCount + 1 end end if not isGamemode then local isRaceMap = false local hasMapFile = false local gamemodesValue = nil -- Check for <map> element with a .map file local mapNode = xmlFindChild(metaFile, "map", 0) if mapNode then local mapSrc = xmlNodeGetAttribute(mapNode, "src") if mapSrc and mapSrc:find("%.map$") then hasMapFile = true end end -- Check for #gamemodes setting local settingsNode = xmlFindChild(metaFile, "settings", 0) if settingsNode then local settingNodes = xmlNodeGetChildren(settingsNode) for j, setting in ipairs(settingNodes) do local settingName = xmlNodeGetAttribute(setting, "name") local settingValue = xmlNodeGetAttribute(setting, "value") if settingName == "#gamemodes" then gamemodesValue = settingValue -- Parse the gamemodes value (e.g., '[ "race" ]' or '[ "race", "assault" ]') local gamemodes = settingValue:gsub("%[", ""):gsub("%]", ""):gsub('"', ""):gsub(" ", "") local gamemodeList = split(gamemodes, ",") if #gamemodeList == 1 and gamemodeList[1]:lower() == "race" then isRaceMap = true end break end end end -- If no #gamemodes setting, assume it's a race map if the name suggests it if hasMapFile and not gamemodesValue then if resName:find("^%[race%]") or resName:find("race-") then isRaceMap = true end end -- Include or exclude the map if hasMapFile and isRaceMap then includedCount = includedCount + 1 local mapInfo = { resourceName = resName, -- Store the actual resource name name = resName, -- Default to resource name author = "Unknown", cost = math.random(300, 1000) -- Random cost } if infoNode then local author = xmlNodeGetAttribute(infoNode, "author") local name = xmlNodeGetAttribute(infoNode, "name") if author then mapInfo.author = author end if name then mapInfo.name = name end end table.insert(mapList, mapInfo) else excludedCount = excludedCount + 1 end end xmlUnloadFile(metaFile) else excludedCount = excludedCount + 1 end else excludedCount = excludedCount + 1 end end outputDebugString("INFO: Total race maps found: " .. #mapList .. " (Included: " .. includedCount .. ", Excluded: " .. excludedCount .. ")", 3) return mapList end -- Send map list and player money to client addEvent("requestMapList", true) addEventHandler("requestMapList", root, function() local mapList = getMapList() local player = source local money = getElementData(player, "money") or 0 triggerClientEvent(player, "receiveMapList", player, mapList) triggerClientEvent(player, "receivePlayerMoney", player, money) end) -- Send player money to client addEvent("requestPlayerMoney", true) addEventHandler("requestPlayerMoney", root, function() local player = source local money = getElementData(player, "money") or 0 triggerClientEvent(player, "receivePlayerMoney", player, money) end) -- Function to set the next map function setNextMapIfPossible(mapResource, mapDisplayName, player) local raceResource = getResourceFromName("race") outputDebugString("DEBUG: Attempting to set next map to " .. getResourceName(mapResource) .. " for player " .. getPlayerName(player), 3) if raceResource and getResourceState(raceResource) == "running" then outputDebugString("DEBUG: Race resource is running, calling queueNextMap", 3) local success, errorMsg = pcall(function() return exports.race:queueNextMap(mapResource) -- Updated to queueNextMap end) if success and errorMsg then outputDebugString("DEBUG: Successfully queued next map to " .. getResourceName(mapResource) .. " for player " .. getPlayerName(player), 3) outputChatBox(getPlayerName(player) .. " has queued the next map to '" .. mapDisplayName .. "'!", root, 255, 255, 0) nextMapQueue = nil -- Clear the queue since the map was set return true else outputDebugString("DEBUG: Failed to queue next map to " .. getResourceName(mapResource) .. " - queueNextMap failed: " .. (errorMsg or "unknown error"), 1) outputChatBox("Failed to queue the next map (queueNextMap failed). Please try again.", player, 255, 0, 0) return false end else outputDebugString("DEBUG: Race resource not running (state: " .. (raceResource and getResourceState(raceResource) or "not found") .. "). Queuing map " .. getResourceName(mapResource), 1) nextMapQueue = { resource = mapResource, displayName = mapDisplayName, player = player } outputChatBox("Race gamemode not running. Your map '" .. mapDisplayName .. "' will be set as the next map when the gamemode starts.", player, 255, 255, 0) return false end end -- Handle map purchase and set as next map addEvent("onPlayerBuyMap", true) addEventHandler("onPlayerBuyMap", root, function(mapResourceName, mapDisplayName, cost) local player = source local money = getElementData(player, "money") or 0 if money >= cost then setElementData(player, "money", money - cost) savePlayerMoney(player) -- Set the purchased map as the next map local mapResource = getResourceFromName(mapResourceName) if mapResource then setNextMapIfPossible(mapResource, mapDisplayName, player) else outputDebugString("DEBUG: Map resource " .. mapResourceName .. " not found for player " .. getPlayerName(player), 1) outputChatBox("Map resource not found. Please try again.", player, 255, 0, 0) end triggerClientEvent(player, "onMapPurchaseSuccess", player, mapDisplayName) outputChatBox("You now have $" .. (money - cost), player, 0, 255, 0) else triggerClientEvent(player, "onMapPurchaseFail", player) end end) -- Try to set the queued map when the race gamemode starts addEventHandler("onResourceStart", root, function(startedResource) local resourceName = getResourceName(startedResource) if resourceName == "race" and nextMapQueue then outputDebugString("DEBUG: Race resource started. Attempting to set queued map " .. getResourceName(nextMapQueue.resource), 3) setNextMapIfPossible(nextMapQueue.resource, nextMapQueue.displayName, nextMapQueue.player) end end) -- Try to set the queued map when the current map ends addEvent("onRaceEnd", true) addEventHandler("onRaceEnd", root, function(winner) outputDebugString("DEBUG: onRaceEnd triggered with winner " .. getPlayerName(winner), 3) local player = winner local money = getElementData(player, "money") or 0 local reward = 1000 setElementData(player, "money", money + reward) savePlayerMoney(player) outputChatBox("You won the race and earned $" .. reward .. "! Total: $" .. (money + reward), player, 0, 255, 0) triggerClientEvent(player, "receivePlayerMoney", player, money + reward) -- Try to set the queued map if it exists if nextMapQueue then outputDebugString("DEBUG: Race ended. Attempting to set queued map " .. getResourceName(nextMapQueue.resource), 3) setNextMapIfPossible(nextMapQueue.resource, nextMapQueue.displayName, nextMapQueue.player) end end) -- Handle race win detected by client addEvent("onClientPlayerRaceWin", true) addEventHandler("onClientPlayerRaceWin", root, function() outputDebugString("DEBUG: onClientPlayerRaceWin triggered for " .. getPlayerName(source), 3) local player = source local money = getElementData(player, "money") or 0 local reward = 1000 setElementData(player, "money", money + reward) savePlayerMoney(player) outputChatBox("You won the race and earned $" .. reward .. "! Total: $" .. (money + reward), player, 0, 255, 0) triggerClientEvent(player, "receivePlayerMoney", player, money + reward) end) -- Hook into possible race gamemode events (for debugging) addEvent("onPlayerFinish", true) addEventHandler("onPlayerFinish", root, function(rank) outputDebugString("DEBUG: onPlayerFinish triggered for " .. getPlayerName(source) .. " with rank " .. rank, 3) if rank == 1 then local player = source local money = getElementData(player, "money") or 0 local reward = 1000 setElementData(player, "money", money + reward) savePlayerMoney(player) outputChatBox("You won the race and earned $" .. reward .. "! Total: $" .. (money + reward), player, 0, 255, 0) triggerClientEvent(player, "receivePlayerMoney", player, money + reward) end end) addEvent("onPlayerWin", true) addEventHandler("onPlayerWin", root, function() outputDebugString("DEBUG: onPlayerWin triggered for " .. getPlayerName(source), 3) local player = source local money = getElementData(player, "money") or 0 local reward = 1000 setElementData(player, "money", money + reward) savePlayerMoney(player) outputChatBox("You won the race and earned $" .. reward .. "! Total: $" .. (money + reward), player, 0, 255, 0) triggerClientEvent(player, "receivePlayerMoney", player, money + reward) end) addEvent("onPlayerRaceFinish", true) addEventHandler("onPlayerRaceFinish", root, function(rank) outputDebugString("DEBUG: onPlayerRaceFinish triggered for " .. getPlayerName(source) .. " with rank " .. rank, 3) if rank == 1 then local player = source local money = getElementData(player, "money") or 0 local reward = 1000 setElementData(player, "money", money + reward) savePlayerMoney(player) outputChatBox("You won the race and earned $" .. reward .. "! Total: $" .. (money + reward), player, 0, 255, 0) triggerClientEvent(player, "receivePlayerMoney", player, money + reward) end end) addEvent("onPlayerVictory", true) addEventHandler("onPlayerVictory", root, function() outputDebugString("DEBUG: onPlayerVictory triggered for " .. getPlayerName(source), 3) local player = source local money = getElementData(player, "money") or 0 local reward = 1000 setElementData(player, "money", money + reward) savePlayerMoney(player) outputChatBox("You won the race and earned $" .. reward .. "! Total: $" .. (money + reward), player, 0, 255, 0) triggerClientEvent(player, "receivePlayerMoney", player, money + reward) end) addEvent("onPlayerWinDD", true) addEventHandler("onPlayerWinDD", root, function() outputDebugString("DEBUG: onPlayerWinDD triggered for " .. getPlayerName(source), 3) local player = source local money = getElementData(player, "money") or 0 local reward = 1000 setElementData(player, "money", money + reward) savePlayerMoney(player) outputChatBox("You won the race and earned $" .. reward .. "! Total: $" .. (money + reward), player, 0, 255, 0) triggerClientEvent(player, "receivePlayerMoney", player, money + reward) end) -- Debug command to simulate a race win (admin only) addCommandHandler("winrace", function(player) if not hasObjectPermissionTo(player, "general.adminpanel") then outputChatBox("You do not have permission to use this command!", player, 255, 0, 0) return end outputDebugString("DEBUG: Simulating race win for " .. getPlayerName(player), 3) local money = getElementData(player, "money") or 0 local reward = 1000 setElementData(player, "money", money + reward) savePlayerMoney(player) outputChatBox("You won the race and earned $" .. reward .. "! Total: $" .. (money + reward), player, 0, 255, 0) triggerClientEvent(player, "receivePlayerMoney", player, money + reward) end) -- Debug command to check money addCommandHandler("money", function(player) local money = getElementData(player, "money") or 0 outputChatBox("Your money: $" .. money, player, 255, 255, 0) end) client.lua local screenW, screenH = guiGetScreenSize() local mapPanelVisible = false local selectedMap = nil local maps = {} local playerMoney = 0 -- Create the map panel GUI function createMapPanel() if mapPanelVisible then return end mapPanelWindow = guiCreateWindow((screenW - 400) / 2, (screenH - 300) / 2, 400, 300, "Map Panel", false) guiWindowSetSizable(mapPanelWindow, false) mapGrid = guiCreateGridList(10, 30, 380, 150, false, mapPanelWindow) guiGridListAddColumn(mapGrid, "Map Name", 0.5) guiGridListAddColumn(mapGrid, "Author", 0.3) guiGridListAddColumn(mapGrid, "Cost", 0.2) for i, map in ipairs(maps) do local row = guiGridListAddRow(mapGrid) guiGridListSetItemText(mapGrid, row, 1, map.name, false, false) guiGridListSetItemText(mapGrid, row, 2, map.author or "Unknown", false, false) guiGridListSetItemText(mapGrid, row, 3, tostring(map.cost), false, false) end moneyLabel = guiCreateLabel(10, 190, 380, 20, "Your Money: $" .. playerMoney, false, mapPanelWindow) infoLabel = guiCreateLabel(10, 210, 380, 20, "Select a map to see details.", false, mapPanelWindow) buyButton = guiCreateButton(10, 230, 180, 30, "Buy Map", false, mapPanelWindow) quitButton = guiCreateButton(200, 230, 180, 30, "Quit", false, mapPanelWindow) addEventHandler("onClientGUIClick", mapGrid, onMapSelect, false) addEventHandler("onClientGUIClick", buyButton, buyMap, false) addEventHandler("onClientGUIClick", quitButton, closeMapPanel, false) mapPanelVisible = true showCursor(true) -- Show the cursor when the panel opens if #maps == 0 then outputChatBox("No maps found on the server!", 255, 0, 0) end end -- Handle map selection function onMapSelect() local row = guiGridListGetSelectedItem(mapGrid) if row ~= -1 then selectedMap = maps[row + 1] guiSetText(infoLabel, "Name: " .. selectedMap.name .. " | Author: " .. (selectedMap.author or "Unknown") .. " | Cost: $" .. selectedMap.cost) end end -- Buy the selected map function buyMap() if not selectedMap then outputChatBox("Please select a map first!", 255, 0, 0) return end triggerServerEvent("onPlayerBuyMap", localPlayer, selectedMap.resourceName, selectedMap.name, selectedMap.cost) end -- Close the panel function closeMapPanel() if mapPanelWindow then destroyElement(mapPanelWindow) mapPanelVisible = false selectedMap = nil showCursor(false) -- Hide the cursor when the panel closes end end -- Toggle the map panel with F3 addEventHandler("onClientResourceStart", resourceRoot, function() bindKey("f3", "down", function() if mapPanelVisible then closeMapPanel() else triggerServerEvent("requestMapList", localPlayer) end end) setTimer(function() outputChatBox("Press F3 to open the Map Panel!", 255, 255, 0) end, 5000, 1) end) -- Receive map list from server addEvent("receiveMapList", true) addEventHandler("receiveMapList", root, function(mapList) maps = mapList outputChatBox("Received " .. #maps .. " maps from server.", 0, 255, 0) createMapPanel() end) -- Receive player money from server addEvent("receivePlayerMoney", true) addEventHandler("receivePlayerMoney", root, function(money) playerMoney = money if moneyLabel and isElement(moneyLabel) then guiSetText(moneyLabel, "Your Money: $" .. playerMoney) end end) -- Handle successful purchase response from server addEvent("onMapPurchaseSuccess", true) addEventHandler("onMapPurchaseSuccess", root, function(mapDisplayName) outputChatBox("Map '" .. mapDisplayName .. "' purchased successfully and set as the next map!", 0, 255, 0) triggerServerEvent("requestPlayerMoney", localPlayer) closeMapPanel() end) -- Handle insufficient funds addEvent("onMapPurchaseFail", true) addEventHandler("onMapPurchaseFail", root, function() outputChatBox("Not enough money to buy this map!", 255, 0, 0) end) -- Detect "You have won the race!" message addEventHandler("onClientChatMessage", root, function(message) if message == "You have won the race!" then triggerServerEvent("onClientPlayerRaceWin", localPlayer) end end) It also creates money.xml which stores money, and I tried AI to understand that I wanted to pick up the money from the users account (when you add it via admin panel for example) but I couldn't. I'm also wondering if you guys could make this script better anyhow? I recommend debugscript 3 too Thanks for any help.
-
Very good idea. I'll check it out as soon as I'll start doing the map idea.
