Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/09/19 in all areas

  1. Hello MTA:SA community, i release now all my Selfmade Gamemodes and Scripts. INFO: You have a error, warning or otherwise? Then write me a DM(Direct Message) or add me on Discord (DorteY#3099) and write a DM there. Hud (Script): https://github.com/DorteY/mtasa-selfmadehud Cops 'n' Robbers (Gamemode): https://github.com/DorteY/mtasa-copsNrobbers (Updated: 10.12.2019) Zombie Apocalypse (Gamemode) https://github.com/DorteY/mtasa-Apocalypse (Updated: 12.12.2019) Lakeside Reallife (German) (Gamemode) https://github.com/DorteY/mtasa-LakesideGER (Updated: 25.12.2019)
    1 point
  2. Hello to whoever is reading this topic, today I've decided to take some time and explain in (personally) easiest possible way how to make a drawing or a GUI that will fit all resolutions, no matter if it's 1280x1024 or 640x480. Here are the following steps: Let's say you're using 1280x1024 resolution. You have the following function: dxDrawText("$10000000", 990, 200, 1100, 250, tocolor ( 0, 0, 0, 255 ), 1, "pricedown") Take out the positionings from the function: 990, 200, 1100, 250 Divide 1280 with X positions (990, 1100) separately. You'll get 1280/990=1.292929 and 1280/1100=1.16363 Do the same with Y positions, but use 1024 as that is maximum height (aka Y of the screen). You'll get 1024/200=5.12 and 1024/250=4.096 The numbers you got are the scales that will work in every resolution as they work in your resolution (1280x1024). To use those scales, simply divide the clients' resolution with the scale, for example: screenWidth, screenHeight = guiGetScreenSize() dxDrawText("$10000000", screenWidth/1.292929, screenHeight/5.12, screenWidth/1.16363, screenHeight/4.096, tocolor ( 0, 0, 0, 255 ), 1, "pricedown") That's it! There's an extra scaling you can do for text size, which is tricky to work with (due to text getting blurred, ugly and unreadable) but if you're up for it: screenWidth, screenHeight = guiGetScreenSize() scale = (screenWidth/1280)*(screenHeight/1024) -- this will give you a number that will vary around 1, depending on clients' resolution (if resolution is smaller, scale will be below 1, if higher then above 1) dxDrawText("$10000000", screenWidth/1.292929, screenHeight/5.12, screenWidth/1.16363, screenHeight/4.096, tocolor ( 0, 0, 0, 255 ), scale*1, "pricedown") -- as you can see I multiplied the text size (1) with the scale, which means the text will be bigger or smaller (again, depending on the clients' screen resolution) Hope I helped, please provide some feedback for future references!
    1 point
  3. السلام عليكم ورحمة الله وبركاته اليوم سويت تعديل علي مود كان منزله واحد اجنبي بس عجبني قلت اطور فيه لفهم وظيفة المود تابع الصور ملاحظة المود للعرض بس .. لو عجب بعض الناس الي في القلب بينزل قبل التطوير للوحة الاختيار للوحة عرض الكل للوحة اذا بحث عن معلومات للاعب اذا بحثت عن اسم شخص مدخلش الخادم او بحثت عن سريال شخص لم يدخل الخادم او ايبي او حساب يجيب نفس رسالة الشات :\ بعد التطوير شكل اللوحة بعد التطوير رسائل الأخطاء : اللوحات الجديد والمعدلة ياريت يعجبكم المود والسلام عليكم ورحمة الله وبركاته التحيات لله
    1 point
  4. Atualize essa aba com F5. Eu coloquei o código depois.
    1 point
  5. Eu deixaria do jeito que está, utilizando todos os parâmetros.
    1 point
  6. Não use variáveis nesse caso. addEventHandler ("onClientRender", root, function() dxDrawImage (screenW * 0.6332, screenH * 0.0729, screenW * 0.1881, screenH * 0.1068, "images/vida2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage (screenW * 0.6523, screenH * 0.1146, screenW * 0.0220, screenH * 0.0313, "images/comida.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage (screenW * 0.7035, screenH * 0.1159, screenW * 0.0220, screenH * 0.0299, "images/sede.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage (screenW * 0.7577, screenH * 0.1159, screenW * 0.0220, screenH * 0.0299, "images/sono.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText (getElementData (localPlayer, "Fome").."", screenW * 0.6772, screenH * 0.1172, screenW * 0.6991, screenH * 0.1458, tocolor(255, 255, 255, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false) dxDrawText (getElementData (localPlayer, "Sede").."", screenW * 0.7255, screenH * 0.1172, screenW * 0.7474, screenH * 0.1458, tocolor(255, 255, 255, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false) dxDrawText (getElementData (localPlayer, "Sono").."", screenW * 0.7826, screenH * 0.1172, screenW * 0.8045, screenH * 0.1458, tocolor(255, 255, 255, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false) end)
    1 point
  7. A element-data "O mais usado -> Bank:Caixa" provavelmente não existe no server, defina a element data correta na linha 11.
    1 point
  8. To be honest, I am trying to avoid using that site. It is most of the time missing critical information, especially for semantic HTML. There is only 1 thing that I like of it, and that is the simplicity of the information. I normally use MDN(Mozilla Developer Network) for everything, but they do not have SQL docs. But it seems like they recommend these sites on their website: https://sqlzoo.net/wiki/SQL_Tutorial http://www.tutorialspoint.com/sql/
    1 point
  9. So the central message of you is that a table is being looked up faster when the key is shorter, which makes sense.
    1 point
  10. المواصفات ممتازه بالسعر اللي انت كاتبه وتشغل الألعاب بس لا تتوقع أداء خرافي + القسم غلط
    1 point
  11. Na linha 120, faça isso: local formatted = number or 0
    1 point
  12. @Einheit-101 If we keep looping out of it and only talk about indexing. This below is just an assumption: If this is the userdata key: (which is at the very end just a complex and unique identifier.) "userdata-324ftfdbgfd" And this is the data: table = { ["userdata-424ftfsdgsf"] = true, ["userdata-3sd3524ftfd"] = true, ["userdata-325524ftfdb"] = true, ["userdata-324ftfdbgfd"] = true } Depending on which algorithm is used, the search time variates. (algorithm < which I have no knowledge of) But if I would program this search, I might do it like this in my first try: I know already the type, so my start would be: "userdata-" >>> userdata-424ftfsdgsf userdata-3sd3524ftfd userdata-325524ftfdb userdata-324ftfdbgfd Collect all items with userdata. steps * items >>> userdata-424ftfsdgsf userdata-3sd3524ftfd userdata-325524ftfdb userdata-324ftfdbgfd print(string.byte("3")) -- 51 + update position * 4 + 4 steps >>> userdata-3sd3524ftfd userdata-325524ftfdb userdata-324ftfdbgfd print(string.byte("s")) -- 115 print(string.byte("2")) -- 50 + update position * 3 + 3 steps >>> print(string.byte("4")) -- 52 userdata-325524ftfdb userdata-324ftfdbgfd < found item in table + update position * 2 + 2 steps Lua would probably be better in this then I do. But this has multiple search steps in it, no matter what kind of algorithm you use. table = { true, -- 1 true, -- 2 true, -- 3 true -- 4 } table = { [1] = true, [2] = true, [3] = true, [4] = true } Finding the index in this kind of table should be technically be faster based on two ways. Position of the characters do not matter. It is a single value, the cpu knows very well how to work with that. As with user-data's/strings, not only the position matters, the value is also different: print(string.byte("a")) -- 97 Much complexer values X position. Everything is already placed in order if you keep the table as an clean array. Just as with cleaning your room. After the cleaning, you do not have to look everywhere in your room. You more or less know where to find what and how many things you have of it. Searching for item 4? no, no, no, yes (4 steps) Note: looping to find an item VS using a custom key to find an item is a different subject. If somebody knows how this really works, then that would be nice fun facts.
    1 point
  13. addCommandHandler("getcm", function() local x, y, z, cx, cy, cz = getCameraMatrix() setCameraMatrix(x, y, z, cx, cy, cz) setClipboard( x..","..y..","..z..","..cx..","..cy..","..cz ) outputChatBox("done!") setCameraTarget(getLocalPlayer()) end) كّذا أسهل عليك تنسخ الاحدثيات حقت الكاميرا
    1 point
  14. لو انك مبتدئ بالبرمجة استخدام فانكشن مثل هذا رح يكون صعب عليك شوي الحل هو انك تروح على الويكي من بعدها على ال Useful Function وتروح عند وظائف الكاميرا في وظيفة مصنوعة تسوي لك الشي اللي انت تبيه وبصورة سهله وبسيطه ومن دون تعقيد هذا رابط الوظيفة : https://wiki.multitheftauto.com/wiki/SmoothMoveCamera اشرحها لك بالعربي عشان توصلك الصورة smoothMoveCamera ( float x1, float y1, float z1, float x1t, float y1t, float z1t, float x2, float y2, float z2, float x2t, float y2t, float z2t, int time ) x1, y1, z1: المكان اللي رح تبدا منه الحركة x1t, y1t, z1t: الشي اللي رح تكون الكاميرا تنظر له في البداية x2, y2, z2: المكان اللي رح تنتهي فيه الحركة x2t, y2t, z2t: الشي اللي رح تكون الكاميرا تنظر له في النهاية time: سرعة الحركة بإختصار يصنع لك لقطه سينمائية مثل اللي في بالك اي شي يصعب عليك كلمني وبساعدك تحياتي .. @Bechi_)!!
    1 point
  15. 1 point
  16. السسلام عليككم ورحمةة الله وبرككاته ء اليوم سويت مود معلومات الاعب ادري انه ممود منششور ء بس مافي افككار ثانية عندي قلت اسسوي ذا كـبداية ححلوهء المود يجيب لك الاف بي اس والبنق والفلوس والاسسم حقكك يفتح من اف8 بككلمة معلومات صورة للمود رابط التحميل من هنا واتمني ان يعجبككم السسكربت
    1 point
  17. 1 point
  18. Tópico movido para a seção de Programação em Lua.
    1 point
  19. بسم الله الرحمن الرحيم سلام عليكم ورحمة الله وبركاتة كيف الحال ؟ ان شاء الله طيبين اليوم قررت افتح موضوع بسيط وحلو يفيد المبتدئين والمتوسطين اننا نشارك ببعض المعلومات البرمجية مع أضافة مثال كمثال : مثال آخر : واتمنى انكم تحطون معلومات مهمة مو معلومات عادية مثل وفي أمان الله
    1 point
  20. Link: http://www.lua.org/gems/sample.pdf I think it should be useful for everyone.
    1 point
×
×
  • Create New...