Leaderboard
Popular Content
Showing content with the highest reputation on 07/03/23 in all areas
-
--------------------------- -- Head Moving --------------------------- local scrX, scrY = guiGetScreenSize() setTimer(function() if not isPedAiming(localPlayer) then local x, y, z = getWorldFromScreenPosition(scrX / 2, scrY / 2, 15) setPedLookAt(localPlayer, x, y, z, 3000, 1000, nil) else local sx, sy, sz = getPedWeaponMuzzlePosition(localPlayer) local ex, ey, ez = getPedTargetEnd(localPlayer) if ex and ey and ez then setPedLookAt(localPlayer, ex, ey, ez, 0, 0, nil) end end end, 120, 0) --------------------------- -- Functions --------------------------- function isPedAiming(thePedToCheck) if isElement(thePedToCheck) then if getElementType(thePedToCheck) == "player" or getElementType(thePedToCheck) == "ped" then if getPedTask(thePedToCheck, "secondary", 0) == "TASK_SIMPLE_USE_GUN" or isPedDoingGangDriveby(thePedToCheck) then return true end end end return false end i tried to do something but i hope it works, i didn't test it1 point
-
First issue: Lua is parsed and executed from top to bottom; by the time of the setTimer call, timerJail has not been declared or defined. You need to move the setTimer call after the timerJail function definition. Second issue: addEventHandler requires an element to bind onto (2nd argument) -- this means which element (and its children if propagation is enabled, which it is by default) should the event fire for -- and in your code it is an nil-value variable source, hence the error. source is defined within an event handler function, so getElementData(source, "jailLoc") is fine, source is the player that spawned. source outside that function, such as in the arguments passed to addEventHandler, it is undefined/nil. Change this to something like root (this is a pre-defined synonym for the value returned by getRootElement()).1 point
-
Thank you very much for your advice! I thought that he would not ask such a question, since the default GTA HUD has such an animation by default, and did it right on the user interface. Here is the corrected code: Client: local delay = 20 function moneyChange(commandName, count) count = tonumber(count) if type(count) ~= "number" then return end local operaceType = "give" if count < 0 then operaceType = "take" count = -count end local addMoney = 0 local modf = 1 if count > 100 then modf = modf*10 end if count > 1000 then modf = modf*10 end if count > 10000 then modf = modf*10 end if count > 100000 then modf = modf*10 end if count > 1000000 then modf = modf*10 end local timer = setTimer(function() addMoney = math.random(1,modf) count = count - addMoney if count < 1000000 and modf == 100000 then modf = modf/10 end if count < 100000 and modf == 10000 then modf = modf/10 end if count < 10000 and modf == 1000 then modf = modf/10 end if count < 1000 and modf == 100 then modf = modf/10 end if count < 100 and modf == 10 then modf = modf/10 end if count <= 0 then triggerServerEvent("money:moneyChange", resourceRoot, localPlayer, count + addMoney, operaceType) count = 0 if isTimer(timer) then killTimer(timer) timer = nil end return end triggerServerEvent("money:moneyChange", resourceRoot, localPlayer, addMoney, operaceType) end, delay, 0) end addCommandHandler("money", moneyChange) addEventHandler("onClientRender", root, function() dxDrawText(tostring(getPlayerMoney(localPlayer)), 500, 300, _, _, _, 3) end) Server: addEvent("money:moneyChange", true) addEventHandler("money:moneyChange", root, function(player, count, operaceType) if not player or not count or not operaceType then return end if operaceType == "give" then givePlayerMoney(player, count) else takePlayerMoney(player, count) end end)1 point
-
Looks nice! Just some side notes, feel free to ignore those. I recommend not do these kind of animations serverside. You are basically sending data to the client/player every 20 milliseconds, which might causing network trouble on a not local server. Just set the end-value serverside. And trigger an even clientside + do the animation there. Also the GTA default money animation can be displayed with setPlayerMoney (unless of course you want to use a custom transition): https://wiki.multitheftauto.com/wiki/SetPlayerMoney1 point
-
Hello! I tried to do something similar, but even without animation, the code came out hard to read. I'm sure it's not optimal, but at least it works. Sorry, but my knowledge is hardly enough to create an animation. But I can try if you still need it! Video: Code: local image = dxCreateTexture(":nfsmw/assets/icon.png") local selected = 1 local count = 5 local elementOffset = 10*scaleValue --padding between items in a menu list local w, h = 100*scaleValue, 100*scaleValue local offsetX, offsetY = 550*scaleValue, 50*scaleValue local x, y = getScreenStartPositionFromBox(w, h, offsetX, offsetY, "right", "bottom") function render() local selectedPos = x for i=1, count do local difference = i-selected --get the difference between the selected element and the rendered element local differenceCopy = difference if difference < 0 then differenceCopy = -difference end local height = h - (differenceCopy*20*scaleValue) --here we decrease the size as we move away from the selected element local width = w - (differenceCopy*20*scaleValue) local offset = 0 local step = 1 if difference < 0 then step = -step end if difference ~= 0 then for k=0, difference, step do --the loop calculates the offset using the width for each element. I didn't come up with a formula how to calculate it without a loop offset = offset + (20*scaleValue)*k end end if difference > 0 then offset = offset - 20*scaleValue*differenceCopy end --if the element is further than the selected one, then we decrease the offset by one point. without it, elements after the selected one have an offset one point less than required local xImage = selectedPos + (w*difference) - offset + 10*scaleValue*difference --the actual position of the x-axis of the element local yImage = y+(h-height)/2 --the actual y-axis position of the element local alpha = 255 - 100*(differenceCopy) --transparency decreases with distance from the selected element if alpha < 0 then alpha = 0 end dxDrawImage(xImage, yImage, width, height, image, _, _, tocolor(255,255,255,alpha)) --element rendering end end function startRender() addEventHandler("onClientRender", root, render) end startRender() function selectElementInMenu(key, keyState, turn) --element select function if turn == "right" then if selected >= count then selected = count return end selected = selected + 1 elseif turn == "left" then if selected <= 1 then selected = 1 return end selected = selected - 1 end end bindKey("o", "up", moveMenu, "right") bindKey("i", "up", moveMenu, "left")1 point
-
What a ride down memory lane (and yes this is the original Cray... I have long since lost my original login/email to these forums, but rest assured that I have been a lurker ever since). It's great to see jhxp, eAi, Ransom and so many others continuing to progress this far past anything I had dreamed of in the early days pushing code out, spinning up a server on my basement server and getting some folks in IRC to help me test. Amazing. Keep up the great work! I forgot to say that I still cringe at my interview. Don't worry, I am much more comfortable speaking infront of crowds as a 40 year old1 point
-
wow 20 years and still going, thats insane, congratulations to everyone that contributed to, and played MTA! from when i joined, up to when i left for australia, this project has been my beautiful prison of self isolation for drug induced psychosis. i hated my real life job back then, it was mind numbing and lonely, this was my second job that i loved for the creativity, the company and the energy, everyone was in it for the same goal and for no compensation. Thanks for all the trust that has been given to me and all the great times. my favourite memory is release days, just watiching IRC go ape:~, unable to keep up with reading etc, then helping people out with problems and recieving all their overwhelmingly positive feedback. it has been a great journey and one that could not be replicated to this day for me personally, i keep looking back with a smile. i did not get into any IT related job but im very happy to read about so many oldies having their careers kinda kickstarted trough MTA! As Ransom said, kinda difficult to watch Rockstar copying everything we did 1:1 (even all my personal 3d models) but today i see it as a tribute to our creativity and skill, tbh i still think they could use a bunch of help for their multiplayer. MAD_BOY: DK won turf wars, that was also an official tournament in my book! take care everyone, youre awesome!1 point
-
Slothman Here!,( Under My new handle that I'm using since my email for my old login is long gone.) Was thinking about MTA today and I was shocked to see we had just hit the 20th anniversary! That is an achievement in itself! I'm still Proud of the scripts I contributed to this game, And I love seeing that some people are still using myscripts Stealth, Zday, and Slothbot. (or at least, variations of them) I actually learned to code with the help of this community. Just like everyone else, I was overflowing with game ideas, and this Mod made it possible to actualize them! I still code games for fun to this day. (right now I am working on Homebrew NES games!) Multi Theft Auto was a bit of an addiction back then, Many nights were spent awake untill 7am, chugging Jolt Cola and madly re-writing my garbage code. But the most fun I had was playing GTA3 Dodo and shotgun duals, Heli fights and Clan matches in VC, and climbing Hay Bales in SA I hope that most of the team have moved on to monetize their talents, As to this day I haven't seen a more professionally built Mod community. Heres to the first and best online community I was ever part of!1 point
-
Crazy to see things still going after all these years. I remember fondly the days I was involved in development working alongside IJs amongst others. I enjoyed coding before MTA but this project really turned it into a passion and I can only thank IJs and the others for inviting me in to participate before it went open source.1 point
-
This is an amazing milestone. I've not been involved really now since around 2007-8, but for some years Multi Theft Auto was (almost) my life. I spent most of my nights and spare time as a teenager and while at University focused on developing MTA. I started playing almost back at the start - probably a month or so after the initial MTA for GTA 3 was released. I remember trying to play - and finding the experience really quite bad - endless crashes and loads of limitations, but I loved MTA from the start: the way it opened my eyes to a technical way of achieving was initially seemed impossible, the ambition of the project and the enthusiastic community around the project. Everyone could see what MTA should be - the product vision was obvious - it was just a massive challenge to get it there. As I was a fairly competent Visual Basic programmer (the first version of MTA was built by modifying an existing trainer for GTA3) I was able to get involved and help out fairly quickly. IJs let me join around the time that MTA:Blue was just starting development. This was a big rewrite of MTA and the foundations of what MTA is today. I cut my teeth as a C++ programmer with this project which was really ambitious - we were almost writing a parallel game engine alongside the GTA engine that had to map almost 1-2-1 to it. This involved learning a lot of techniques for reverse engineering, C++ and assembly language. At this time, there was probably a core of 2-3 people working actively on the project in their spare time as developers and there was a lot of pressure to deliver something. We deliberately picked an easier goal - adding a racing mode, so that we didn't need to achieve some challenging features such as shooting synchronization. MTA Race was a big success and it was around this time that we had the rise of other copycat mods which really heaped on the pressure. At times the community seemed to turn into a battlefield between the different mods with cheaters thrown in the mix. We also had to handle various people from the cheating community making cheats as performing DDOS attacks against our infrastructure. Now days these things are easier to mitigate against, but as a small volunteer run project, these caused us a lot of hassle. After MTA Race, we were really ambitious with what we wanted to achieve - we wanted to add scripting to the game, and we wanted to build a modding infrastructure that was really flexible. I remember being proud of designing the resource system that MTA is still using today (though I'd definitely do some things differently now!) The version we released was really powerful - with a pretty good, extensible editor, downloadable resources, a web admin interface and pretty good synchronisation of gameplay. At times during the development I was the only developer for a while, so I like to think that MTA wouldn't have survived if I hadn't carried on fighting to make progress. I remember spending a whole summer trying to get shooting to work! But I think MTA was such a strong idea and had such a fan base that I'm sure someone would have picked up the torch. Now days I run a small games development company (www.fireboltgames.com) and I've worked professionally in the games industry for the last 15 years, and I'm certain I wouldn't have got where I am or have the skills I do without MTA, and for that I'm really glad. It's still one of the most successful things I've worked on and one I'm really proud of. It's certainly the longest-lived! We actually created a Roblox game recently inspired by the Hay mode made by Aaron for MTA - check it out here: https://www.roblox.com/games/6645345380/Climb-King The community around MTA was what made it all worth it - it was hard work, but there were so many good, enthusiastic people, all working together towards a common goal. We never met - we never even talked (this was before voice-chat was so widely available!) - but we were good friends and had a lot of respect for each other. All in all, this is a really well deserved milestone and I'm so glad I had a chance to be part of the history of this great project. Here's to another 20 years! PS: I designed the front page about 16 years ago - it is probably time to update it! Here's a few random screenshots from my archive: MTA:Green (MTA:Blue for GTA3, never released): http://opencoding.net/old_opencoding_net/misc/MTA/green_progress_6.JPG Old website design: http://opencoding.net/old_opencoding_net/misc/MTA/mta_site_design_2.jpg http://opencoding.net/old_opencoding_net/misc/MTA/mta_hud_9d.JPG1 point
-
Hello, Effective immediately it's no longer possible to: - Report players to AC team - Appeal any global bans Please do not attempt to report players to MTA staff team, or appeal any bans. A) If you need to report a player, please contact admins on the server they are playing on. Server admins should pay the amount of attention that staff in other multiplayer games (with hosted servers) typically pay, and owners should be mindful of script security and scripted anti-cheat solutions to fill in some cracks that started to be created over the past few years, and continue to do so as a result of lowered manpower within the MTA AC team. B) Appealing bans is no longer needed as permanent bans have been removed last month, and any of the handful of cases not covered aren't meant to ever be appealed, without exception. Temporary bans were never meant to be appealed, although some staff member's intepretation of that (while redirecting users) has varied - if you got a temporary ban, wait for it to expire and surely you got a feeling of what not to do/not to run next time while MTA is opened, to avoid getting banned again. AC team is actively monitoring the reliability & integrity of standard detections that may lead to temporary bans, that's one of the things its manpower still allows it to do, so you can see why we're confident to go this route - any leakage of appeals in places they don't belong/users contacting MTA about their bans anyways, our experience has learned is 99.9% users that know why they got banned but won't accept it and are persistent.. as before, all such inquiries won't lead anywhere, but especially now we said "No appeals anymore" there will be zero interaction and certain behaviors may also lead to removal from the respective platforms where inquiries are made in a persistent or disruptive fashion. We don't want to come across as rude, but there was simply too much spam and people not accepting no for an answer. Finally, regarding cheaters - the level of sophistication that our AC has reached due to years of playing a cat mouse game with cheaters, is a hugely raised border for cheats to be made and will continue to do so (as methods that were used in the past were patched as per the spoilered text in this topic, so they can't be re-used). However, with the loss of dedicated AC developers within AC team, comes that we can no longer keep up as before, this situation has existed for the past 2 years so as of this post nothing is abruptly changing, it's just the point of admitting we won't be tryharding as much as in the past to be known as totally cheater-free game, a reputation we held for long. If you look around in the gaming industry, you'll see that we held up pretty well in comparison, but the cheating industry (due to toxicity demand) has also hardened, and after 20 years we are low on manpower which is fully understandable. We will continue to bring AC improvements and get rid of emerging cheats and cheaters, but at our own pace, without external pressure or too high community expectations, from now on everything is on a best-effort basis and the point is that there may be periods during which we can't make any waves due to manpower constricts. You can see that this topic intends to lower your expectations and respect the amount of free time we (as volunteers) are able to invest, and get off our backs for things being different compared to some years ago. We're also OK to restrict ban appeals and player reports so we can delegate all of the manpower that's left on our new strategy, breaking cheats (patching them) and just preventing them from working to begin with, instead of permanently banning cheat users and having to deal with them "regretting" in ban appeals. We are also OK to restrict reporting cheaters as our focus shifts to breaking the cheats, and to get the required information to break one, we have our own methods and channels so much that we don't need any sort of reports. Due to the state of anticheat and heuristics, we always have a good picture of abnormalities and what cheats are doing, so the main limiting factor is manpower to get to work with what we have & know. Enjoy the game, and remember that player desires make the market for servers - so if you see too many cheaters, ask server owners to invest their time in training server admins to be on the lookout for cheaters and ban them, script protection/alert systems, and after all, have some peace of mind because cheating in MTA will always be a raised border and still won't be as common as in directly competing projects. // Note: using the bug bounty program for security bugs remains possible, end user security will always be among MTA team's top priorities. The program has been frozen for cheats, though, and documentation will soon reflect that.1 point
