Leaderboard
Popular Content
Showing content with the highest reputation on 29/06/17 in all areas
-
السلام عليكم ورحمة الله تعالى وبركاته كيف الحال ؟ إن شاء الله الكل بأحسن احوالهم, حبيت أنشر فيديو صغير من قناتي, فيديو مونتاج - كواليس البرمجة وأيضا ترقبوآ سكربت iMail - System مود البريد الإلكتروني بشكل مصغر داخل mta الفيديو : ايضا لا تنسى ان تنضم إلى اكبر مجتمع يخص MTA في الوطن العربي على فيس بوك Multi Theft Auto Arab في أمان الله تعالى, اخوكم ... مستر جراند2 points
-
addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) if bodypart == 9 then if getPlayerWeapon(attacker) == 24 then setElementHealth(source, getElementHealth(source) -50) end end end ) Man, please at least look at your code again and double check it, I know you're trying to help but try to make sure you're not making at least syntax mistakes..2 points
-
In September 2013, we launched a service to compile Lua files for your MTA servers, hosted within our web network - https://luac.multitheftauto.com . Currently, the service offers some basic encryption abilities and some (admittedly imperfect) protection to prevent decompilation, and an API so that users can compile scripts as simply as possible. Over time this service has been gently encouraged in MTA Server debug warnings until it has become fully enforced. Now, all compiled scripts are required to go through this service or they will not run on your MTA Server. We've had no choice but to keep quiet on the motivations behind this process, but this post seeks to clarify the circumstances for which this had to happen. We can only apologize for the clear disruption this causes servers (particularly larger ones), but hope that you'll agree that when we say that we were backed into a corner. Keeping our users safe MTA is a complicated mod where we have multiple stakeholders that we have to consider. The main ones are hosting service providers, server owners, and our players. It's our job to ensure that all stakeholders are catered for, and crucially, they are kept safe. This is particularly a problem for players. We simply cannot trust server owners to always provide a safe environment for players - a scenario where a server owner baits players into joining to distribute viruses is unfortunately a reality that must be dealt with. Enter Lua bytecode. For those unaware, the junk that you see when you open a compiled script is called "bytecode", so a compiled script or bytecode are more or less the same thing. Over 3 years ago, a lecture by Peter Cawley at the Lua Workshop 2011 presented a number of bytecode exploits in Lua 5.1 and 5.2. I actually spoke to some resident Lua experts over at Freenode who only reiterated concerns surrounding the use of bytecode in Lua. The consequences of such a discovery is clear: a booby-trapped script can be sent to unwitting players who have their systems exploited. Around the time luac.multitheftauto.com was launched, a proof of concept exploit was released - exploiting the Lua engine in the game Company of Heroes 2. I can't recall exactly when we first became aware of the dangers of having bytecode enabled, but I think it was towards the end of 2012. We started taking serious consideration over the issue in early 2013. I actually contacted Peter regarding our options over this. After plenty of research we established a few possible ways to deal with the issue. What our options were 1) Disable compiled scripts. This is the most obvious answer, and the best way to guarantee safety for our users. Researching how other software dealt with this exploit revealed that this was the best option. Now we get back to stakeholders: by doing this we guarantee the safety of our players and the future of the mod, but agitate all our server owners in the process. 2) Implement a way to detect malicious scripts. If the client and server had a built in way to detect the scripts that are malicious, then we could simply block those. Unfortunately, none of the team are experienced enough with Lua's intricacies to stand any chance at implementing this ourselves. A 3rd-party Lua verifier was actually released, but only for Lua 5.2. There are a number of issues with this. We don't support Lua 5.2 - so we'd have to spend time upgrading it in MTA. This might not sit nicely with things such as the then in-progress OOP implementation. The main issue is that there was no active development on the verifier, with the last commit being in September 2011. This is arguably fine for something that's 'finished', but after further indications that the author wasn't actively looking at bytecode issues, worries of a 'cat and mouse scenario' began to creep in. Even if we adopt this verifier, there's a chance more bytecode exploits are found - and when that happens we have to wait for an inactive project to be updated. On top of all of this, compiled scripts in Lua 5.1 aren't compatible in 5.2, which means everything would have to be recompiled anyway. 3) Make sure that all compiled scripts are safe. This third option is subtly different to (2). What if we can verify compiled scripts are safe by making sure the compiler is safe? If only a single compiler can be used, then no one could booby-trap their scripts. This would further require a way to prevent users from modifying scripts used by this compiler. Initially, the consensus was to disable compiled scripts completely, and we had been discussing ways to replace the functionality of compiled scripts. Protecting scripts could be offered by some form of encryption - but we're not cryptographic experts and could never guarantee protection of scripts - in fact script protection was more of an idea and didn't really have a solid roadmap. It made me wonder whose responsibility it actually was to protect the content of scripts. Either way, all the existing compiled scripts would be rendered incompatible with a newly introduced encryption system. I've already gone into detail over why option (2) proved to be impractical, which left our third option - providing our own compiler. By ensuring all scripts are compiled by https://luac.multitheftauto.com, we know for sure that they are legitimate and have nothing harmful in them. So, why not distribute an offline compiler? We also have to prevent against script tampering - i.e. scripts compiled with our "official compiler" then modified afterwards. We prevent this using code-signing technology - the same certification system we use to sign the MTA client itself. In layman's terms, we put an MTA "seal of approval" so if someone tampers with the MTA client executable, the seal is damaged and things break. The same principle applies to scripts compiled on https://luac.multitheftauto.com. It's simply not possible for code-signing to happen offline since we're the only ones who can stamp the 'seal'. Hosting the compiler gave us the opportunity to implement some extra features that server owners may benefit from, such as anti-decompile, and some basic encryption. It also opens doors in future - we can potentially take further action against some of our shadier scripting community. I'd also like to point out all this research and the final decision happened over several months of deliberation - how we stop the exploit, when we can implement it, and how we tell the community about it. Why we remained silent This was an extremely delicate situation. If this post had been made back in 2013, we would have effectively announced to the world that there's an security hole sitting in MTA waiting to be exploited. Equally, by not coming clean we would basically be forcing server owners to pass scripts through our servers and not explain why. Overall, we felt the safest choice was settling for the latter, despite issues we might face. We chose to make our online compiler, but phase it in over the period of almost a year. Before now, I've responded to angry server owners by pointing out the benefits of things like the script encryption, but the underlying motivation has always been about bytecode exploits. It's inevitable that things like anti-decompile are being cracked, but there are now new avenues to enhance protection to make things better for server owners. We announce this now because we feel our players are largely safe. To keep it this way, we urge anyone who's found an exploit or even got around our compilation to check our Security bounty scheme. What does luac.multitheftauto.com actually do? There are various rumours over what luac.multitheftauto.com actually does, and what we do with your scripts. The answer is simple: you send a script to the server. The server then puts it through a standard Lua 5.1 compiler. It then signs the script. If you opted for encryption, the script is encrypted using a private key. Then it gives it back to you. Nothing is stored, and there's not even anything automated to read the code in the scripts. Hopefully everything I've said already makes it clear that there's no reason for anything else to happen. We have no interest in stealing your scripts Which leads me to an important point: we don't want to steal your scripts. We don't care for drama or politics, only for our user base. There is no motivation for any of us to steal your scripts. This should be self-explanatory - it makes no sense for us to introduce a way to hurt the users of our software. "But what if you wanted to sell the scripts for your personal gain, and probably world dominance?" I hear you cry. I say this: if we wanted to steal your scripts, don't you think we would have come up with a much smarter way than to invite people onto our website to upload them? We're developing a piece of software that's designed to interact with servers to send and receive files. You do the math. Other concerns that are commonly raised is that server owners don't want to risk their scripts being exposed in case our server is hacked. Once again, for reasons outlined above, we don't store your scripts. That's a waste of our webspace. We only care for compiling them, and making sure they're sane. Nothing is stored on our servers. Another one is that by making scripts go through us, we're making scripters rely on the indefinite existence of https://luac.multitheftauto.com . What if we can't afford the rent and the website suddenly goes down? This is a valid point, but for reasons stated above we have no choice but to compile the scripts ourselves, on our web server. Moreover, the server browser master list and other services are already hosted by us - so some form of dependence on MTA's services is uncontrollable. Will things ever go back to how they were? As you can see, we spent a long time figuring out how to deal with this problem. It's unlikely things can ever go back to traditional offline compiling. But keep in mind the reasons why this was introduced. If you have experience or possible avenues that could be explored, we're always open to suggestions (or even someone implementing it themselves). At the end of the day, we try to make sure all our users are happy. So if there is a Option (4) out there, it's not something that's already ruled out. In the meantime, we've tried to bridge the gap by offering an API, and some members of the community have developed tools to help. Thanks for reading1 point
-
I have launched a new, entirely free service that offers personal tutoring to anybody who wants to learn new MTA skills, including: Setting up an MTA Server Resources / scripts / meta.xml Writing Lua code MTA concepts such as events, timers, client-side interfaces, etc. SQL and other data storage methods I've been in the MTA community for coming up to 11 years now, and have worked with many of the 'big servers' that exist today, so the information will be delivered by people (including myself) with plenty of experience. The few students I'm already tutoring are well on their way to writing some basic MTA scripts already, after only a few days (totaling 4-5 hours). If you want to get involved, be sure to join the Discord server. You can also click here to see the recommended syllabus. If you know of anybody else who wants to learn to script, be sure to let them know of this great offer!1 point
-
السلام عليكم كيفكم شباب اليوم جايب لكم المود الثاني لي طبعاّ الصور: عند الشراء الوحة الرابط top4top https://up.top4top.net/downloadf-543die241-zip.html و شكرا1 point
-
-- * Modo porcentagem * ... -- simples metodo que usa um valor real para ser multiplicado por um valor entre 0 e 1, base para entender o calculo: -- temos uma variavel x cujo valor é 500 -- x = 500, multiplicar x*0 = 0, ou x*1 = 500 e por fim x*0.5 = 250. -- continuando .. calculos para escala sX,sY = guiGetScreenSize() -- valor real em pixels x e y do monitor function resX(value) -- (aspectRatio) return (value/1920)*sX -- calculo baseado na resolucao full hd end function resY(value) -- (aspectRatio) return (value/1080)*sY -- calculo baseado na resolucao full hd end -- calculo de escala do texto fonts = {} function dxFont(i) if not fonts[i] then fonts[i] = dxCreateFont("files/font/font.ttf",resX(index),false,"draft") or "default-bold" -- configure com a sua font end return fonts[i] end -- exemplos de como ser usado dxDrawRectangle(sX*0.2,sY*0.2,resX(200),resY(200),tocolor(255,255,255,255)) dxDrawText("test text",sX*0.2,sY*0.2,sX*0.2+resX(200),sY*0.2+resY(200),tocolor(0,0,0,255),1,dxFont(16),"center","center",true) -- * Calculo normal... + - / -- maioria dos scripts que eu vejo sao assim para -- calcular centro do monitor -- sX/2 ou sY/2, ai acabam tipo fazendo o script naquele tamanho em todas as resolucoes.. -- eu tambem fiz um metodo para calcular isso e fazer ele crescer comforme os tamanhos do sY function fixRes(value) local min_ = math.floor(sY/500) local count = 1 if min_ > 1 then count = count + 0.2*min_ end return value*count end -- calculo de escala do texto fonts = {} function dxFont(i) if not fonts[i] then fonts[i] = dxCreateFont("files/font/font.ttf",fixRes(index),false,"draft") or "default-bold" -- configure com a sua font end return fonts[i] end -- exemplos dxDrawRectangle(sX/2-fixRes(100),sY/2-fixRes(100),fixRes(200),fixRes(200),tocolor(255,255,255,255)) dxDrawText("test text",sX/2-fixRes(100),sY/2-fixRes(100),sX/2+fixRes(100),sY/2+fixRes(100),tocolor(0,0,0,255),1,dxFont(16),"center","center",true) -- espero q tenham entendido como eu uso, fiquem avontade para melhorar o sistema e tambem dar dicas onde devo melhorar Vlw Galera!1 point
-
1 point
-
1 point
-
1 point
-
It doesn't actually take a string, it takes a font element. Replace "roboto" with roboto1 point
-
No offence, but you are just copy-pasting links and stuff, did you actually check that link yourself? In my post I referenced MTA wiki, but I'll quote it again, this control list will only work with the functions toggleControl and toggleAllControls So I guess you can't use it with getPedControlState. The code you posted should work with every other controls, but not these ones. So whatever you tried to achieve, you'll need to find a different solution or if you tell us your goal, we might be able to help you.1 point
-
Okay, all you have to do is check the player's team in the if statement inside onMarkerHit event handler. if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) and getPlayerTeam ( p ) == getTeamFromName("YOUR_TEAM_NAME") ) then1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
You can do it with @pa3ck's method. --[[ You can set a little shake to the camera, and you can press controls randomly for a period of time. --]] math.random() setPedControlState() setTimer() setCameraShakeLevel() -- with these, you can easily make a drunk effect.1 point
-
I'm not sure if there's a native MTA function that will do that, but as far as I remember, it only presses random buttons (eg. direction change, brake/accelerate), which can easily be done with Lua.1 point
-
I'd make a table on client side, which contains all your resources and a state, and when a resource has downloaded, I'd set it in the table, then run a check to see if every resource is downloaded, and if that comes back true, I'd show the login panel. So I imagine it like this (of course there could be a better solution): resources = { firstResource = false secondResource = false } addEventHandler("onClientFileDownloadComplete", root, function() local resourceName = getResourceName(source) for i, v in pairs(resources) do if (i == resourceName) then resources[i] = true end end for i, v in pairs(resources) do if (v == false) then ready = false break else ready = true end end if (ready == true) then -- Make your login visible end end ) NOT TESTED1 point
-
We disallow these kind of mods for a reason. Your only option is to restore these files.1 point
