Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 15/06/19 in all areas

  1. [TUT] Scaling DX The reason why I am creating this topic, is because there are a lot of people asking this question: And to be honest there is no best practice for. But here you have my recommendation as guidance for display them the ~s~a~m~e~ for all screen formats. There are two important factors while dealing with screen formats 1. Pixel density Indication: PPI(Pixels Per Inch) and some also use the term DPI(Dots Per Inch) They do not have to be the same while talking about printing stuff. This indication tells us about how many pixels are used per inch. Which more or less tells us how sharp/smooth things like text can be looking. PPI doesn't really play a big role, but to display something nicely you need enough pixels to display it. Else it will be either too small or too crispy. So be careful to not scale things (especially text) too small. 2. Display aspect ratio Wiki The difference between resolution X and resolution Y as a ratio. A list of common ratios: 4:3 5:4 3:2 16:10 16:9 So for example if we take: fHD: 1920x1080 Which has the ratio 16:9 that is calculated like this: 1920 / 16 = 120 120 * 9 = 1080 Scaling without ratio Before I am going to explain any of this, I am going to ask you an important question: Like this: (vertical) ▮ Or horizontal? ▅ I assume most people would agree to play MTA horizontal, else you are probably reading a book or document. p.s If you play MTA on a vertical screen, then we developers do not like you at all, sorry. So what does this tell us? You can assume that the X-resolution is never going to be smaller than the Y-resolution. Useful? You will figure it out. Doing the scaling Note: This part is ABOUT SCALING and not positioning. So what we are going to do is: Calculating a scale which can display the same DX on multiple screen formats > without messing with the ratio. Example: A computer runs MTA at a resolution of 1920 x 1080. Lets define that! local devScreenX = 1920 local devScreenY = 1080 If this code is used by a different pc, we also need to know on which resolution it is running: local screenX, screenY = guiGetScreenSize() For the next step we have to look at this screenshot: I have cut out of the wide-screen format a square. Squares have the ratio 1:1, which means that we have removed our ratio difference from this screen resolution. It is very easy to do, as our Y * Y resolution makes exactly that beautiful square! The next thing we have to do is creating our scaling value. This value is required for adjust our resolution values so that they match to every screen format. So to use our ratio 1:1, we use the Y resolution to achieve that: local scaleValue = screenY / devScreenY And as last we can create a rectangle shape that is displayed at the center of every screen format, perfectly! local devScreenX = 1920 local devScreenY = 1080 local screenX, screenY = guiGetScreenSize() local scaleValue = screenY / devScreenY addEventHandler("onClientRender", root, function () -- create a scaled size local sizeX = scaleValue * 300 -- 300px local sizeY = scaleValue * 50 -- 50px -- get the center of the screen local centerX = screenX / 2 local centerY = screenY / 2 -- calculate the starting point of the rectangle local startRectangleX = centerX - (sizeX / 2) local startRectangleY = centerY - (sizeY / 2) dxDrawRectangle ( startRectangleX, startRectangleY, sizeX, sizeY, tocolor ( 255, 255, 255, 255 ) ) end) Lower limit What if we have a resolution of 800x600? And the text is getting too small? Making sure that the pixel density is OK, is very important. So to counter that we have to make sure that the text is not getting too small. Our development Y resolution is 1080 pixels. And we are dealing with an Y resolution 600 pixels. The first thing we are going to look at, is what the scale is going to be at that point. 600 / 1080 = 0.55555555555555555555555555555556 It is not very nice to have your text scaled to 55.5% of the original size, when having low resolution already. But without scaling, the DX stuff might fill up the entire screen and that is just as bad. So what we now need is a limit, in this case a lower limit. scaleValue = math.max(scaleValue, 0.65) The math.max function returns the highest value of all the arguments you put in to it. In this case it contains the: scaleValue: 0.555 And the lower limit of: 0.65 This will make sure that the DX stuff is not getting smaller than 65%. This might make text read able for a 800x600 resolution. Positioning Do you want to place your dx-effects at a specific place on your screen? See the following useful function: https://wiki.multitheftauto.com/wiki/GetScreenStartPositionFromBox
    2 points
  2. الوظيفة ماعندها بارامتر اللاعب . . إستعمل RequestBrowserDomains
    2 points
  3. bengines provides custom engine sounds for vehicles. The resource is not focused to be ultra realistic, it is designed to use for casual servers. Not useful for me anymore so sharing with community. Used on old project. Sounds are copyrighted content not owned by me. Features: ready to use, chooses the best engine for vehicle depending on handling! easy to customize & expand for Lua programmers 30 soundpacks for vehicles (buses, bikes, sport cars etc.) stable code with quite high performance used on server with 600 players ALS effect (exhaust flames) Turbo (satisfying whistle and blow-off sounds) Videos: https://streamable.com/n7k40 https://streamable.com/lp14t https://streamable.com/q5e9g Download: Github: https://github.com/brzys/bengines (feel free to send pull requests) Community: to-do For programmers: --[[ Element datas used by resource [array] vehicle:engine - stores basic info about engine type, sound pack etc. (synced) [string] vehicle:type - used for engine calculation, useful for servers. Available: Bus, Truck, Sport, Casual, Muscle, Plane, Boat, Motorbike (synced) [string] vehicle:fuel_type - customized for each engine. Useful for servers. Available: "diesel", "petrol" (synced) You can use setElementData(vehicle, "vehicle:upgrades", {turbo=true, als=true}) to add turbo or ALS. --]] --[[ Exported functions --]] exports.bengines:getVehicleRPM(vehicle) -- returns RPM of given vehicle exports.bengines:getVehicleGear(vehicle) -- returns current gear of given vehicle exports.bengines:toggleEngines(bool) -- true / false, restore GTA engine sounds
    1 point
  4. Slipe is an open source framework that enables anyone to write scripts for MTA:San Andreas in C# instead of Lua, wrapping all MTA elements and classes and including some .NET Core namespaces. It is based on CSharp.Lua by Yang Huan. Slipe features: Runs on Windows and Linux Built in continuous deployment support with (GitHub) webhooks Object oriented wrappers for all MTA elements Async/await for MTA functions that use callbacks C# style Http requests, sockets and XML methods. Use Visual Studio and its Intellisense Type safety You can find more information about the project on https://prod.mta-slipe.com. Our Discord Our Github The project is still in Alpha, and since it is open source anyone is welcome to contribute
    1 point
  5. You can text your friends and arrange on what server to play on so having a DM system outside of servers is pointless. Also, they usually update MTA at November each year - from what i've noticed the past two years- so updates are pretty frequent. They also have small updates that fix bugs so you can't expect anything else since they're doing a good job at it. If you have friends that quit playing because of this then you guys are ungrateful.
    1 point
  6. Sim, há um resource sim, você pode pesquisar por bubble chat ou chat ballons. Aqui mesmo na comunidade tem... Um dos que eu achei aqui na comunidade: Bubble Chat Adeque à seu gosto
    1 point
  7. Nice trick for the scale on :~ty resolutions Also here's a similar topic which @Halemade and I expanded with another method as well:
    1 point
  8. By the way, using a timer inside a render event is useless because 'onClientRender' event gets triggered everytime GTA renders a new frame.
    1 point
  9. الشاطئ اسمه بيتش Beach
    1 point
  10. Vc já deve ter resolvido. Mas caso alguém queira saber a resposta: Remover o chat não dá. MAS tem como desabilitar ele no momento em que o jogador entra no servidor. addEventHandler ("onPlayerJoin", root, function () showChat (source, false) end) Isso impede o chat de aparecer e a tecla T também deixa de funcionar. Vale lembrar que o jogador ainda pode reativar o chat usando showchat no Client Console do F8. Por ser um comando de cliente nativo do MTA, não há como bloquear esse comando.
    1 point
  11. It was a result of the same issue as described in https://forum.multitheftauto.com/topic/117131-network-trouble/?do=findComment&comment=956241
    1 point
  12. جميل جداً والي اعجبني فيه بزياده حركة البيد لكن لو يكون البيد ياخذ الفلوس ويمشي يحطها بالخزنه تطلع اطلق بالتوفيق ?
    1 point
  13. The last link I gave you is the latest version, so yes!
    1 point
  14. لا حوووووول اللي مايعرفون شي ويفهمون غلط منتجع نيكي بيتش
    1 point
  15. MTA San Andreas 1.5\MTA\config\coreconfig.xml - open config file and delete everything in the recently_played_servers node.
    1 point
  16. السلام عليكم ورحمة الله وبركاته سويت من فترة سكربت بسيط وهو عبارة عن widgets له استخدامات متعددة أبسط شي ممكن تسويه هو لوحة فيها كلام , مع امكانية اظهار زرين اسفل اللوحة بتصميم جميل وأنيق وتقدر تستخدم الزرين حسب احتياجك ولتوسعة مجال الاستخدام سويت وظائف لرسم edit, button, checkbox ممكن أضيف شغلات اكثر في التحديثات القادمة ولكن هذي الاشياء هي الاكثر استخدام خصوصاً للويدجتس طريقة استخدام الوظائف والاحداث موجودة في ملف اسمه help.txt ويوجد ملف فيه أمثلة .. ولذلك ماله داعي اشرح طريقة الاستخدام في الموضوع فيه حدث للرسم داخل الويدجت مثل رسم الازرار والايدت .. الخ , وكلشي موجود في الأمثلة أفكار للاستخدام نظام اشعارات بسيط وموجود ظمن الامثلة الموجودة في السكربت تنبيهات أو نوافذ للمهمات السريعة صنع لوحات خفيفة وافكار كثيرة... المود مو مشفر ماعدا الملف الخاص بالسيرفر وطبعاً ما اسمح بتغيير الحقوق بالنسبة للتحديثات .. بيوصل تنبيه عند تشغيل المود في حال وجود تحديث جديد لتحميل السكربت https://up.top4top.net/downloadf-994h145t1-zip.html وجاري الرفع على الكومنتي وشكراً
    1 point
×
×
  • Create New...