All Activity
- Today
-
Mohab started following [شرح] ربط اللعبة مع ديسكورد باستخدام الويب هوك
-
:جدول المُحتويات مقدمة تحليلية: كيف تُربط MTA:SA مع Discord باستخدام Webhook؟ المفهوم العام (اللوجيك الأساسي) تحليل الكود خطوة بخطوة خلاصة المنطق كاملًا ملاحظات إضافية للمطور مصادر مهمة مقدمة تحليلية: كيف تُربط MTA:SA مع Discord باستخدام Webhook؟ السلام عليكم ورحمة الله وبركاته في هذا المشروع، نريد تمكين اللاعب من إرسال رسالة من داخل اللعبة إلى قناة في Discord. لتحقيق هذا سنستخدم: - أمر داخل اللعبة (command) - كود Lua في سيرفر MTA - خدمة Webhook من Discord - دالة `fetchRemote` في MTA لإرسال البيانات إلى Discord المفهوم العام (اللوجيك الأساسي): 1. اللاعب يكتب أمر داخل اللعبة مثل `/discord مرحباً`. 2. السكربت يقرأ هذا الأمر ويستخرج الرسالة. 3. السكربت يُنشئ رسالة منسّقة (باستخدام JSON). 4. يتم إرسال هذه الرسالة إلى Discord عبر رابط Webhook. 5. Discord يعرض الرسالة داخل القناة المحددة. تحليل الكود خطوة بخطوة: رابط الويب هوك local discordWebhook = "https://discord.com/api/webhooks/...." - هذا هو الرابط الأساسي. - Discord يوفّره لك لكل قناة تريد استقبال الرسائل فيها. - يتم تخزينه في متغير `discordWebhook` لاستخدامه لاحقًا عند الإرسال. دالة تنفيذ الأمر function sendMessageToDiscord(player, command, ...) - هذه الدالة يتم ربطها بالأمر `/discord`. - يتم تنفيذها تلقائيًا عندما يكتب اللاعب الأمر. - البراميتر `player` هو كائن اللاعب الذي نفّذ الأمر. - البراميتر `...` يمثل كل الكلمات التي كتبها اللاعب بعد الأمر. جمع الرسالة local message = table.concat({...}, " ") - يتم دمج الكلمات التي كتبها اللاعب إلى جملة واحدة. - مثلًا: `/discord السلام عليكم يا شباب` → تصبح `"السلام عليكم يا شباب"`. التحقق من وجود رسالة if message == "" then outputChatBox("اكتب رسالة! مثال: /discord مرحبا", player, 255, 0, 0) return end - إذا لم يكتب اللاعب أي شيء، يتم عرض تنبيه داخل اللعبة. - يتم إيقاف تنفيذ الدالة (باستخدام `return`). تجهيز بيانات الرسالة local playerName = getPlayerName(player) - نحصل على اسم اللاعب الذي كتب الرسالة. إعداد شكل الرسالة (باستخدام `embeds`) local webhookData = { username = "MTA:SA Server", -- اسم البوت في Discord embeds = {{ title = "رسالة من اللاعب", description = message, color = 3447003, -- لون الشريط (أزرق) author = {name = playerName}, footer = {text = "MTA:SA Discord Bot"}, timestamp = os.date("!%Y-%m-%dT%H:%M:%SZ") -- وقت الإرسال بصيغة ISO }} } هذا الجزء هو أهم جزء، لأن Discord يستخدم ما يسمى بـ `embeds` لتنسيق الرسائل، ويتضمن: +----------------+----------------------------------------+ | العنصر | وظيفته | +----------------+----------------------------------------+ | username | اسم البوت في الديسكورد | | title | عنوان الرسالة داخل الـ Embed | | description | نص الرسالة الحقيقي | | color | لون الشريط الجانبي (بالـ Hex) | | author.name | اسم مرسل الرسالة (اللاعب) | | footer.text | تذييل صغير | | timestamp | وقت الإرسال بشكل احترافي | +----------------+----------------------------------------+ إرسال البيانات باستخدام fetchRemote fetchRemote(discordWebhook, { method = "POST", headers = {["Content-Type"] = "application/json"}, postData = toJSON(webhookData):sub(2, -2) }, function(responseData, responseInfo) ... end) ما الذي يحدث هنا بالضبط؟ fetchRemote: دالة من MTA لإرسال طلب HTTP إلى عنوان خارجي (هنا Discord). method = "POST": نوع الطلب الذي نستخدمه لإرسال بيانات إلى الخادم (Discord في هذه الحالة). headers: نقوم بإخبار Discord بأن نوع البيانات التي نرسلها هي JSON. postData: نقوم بتحويل البيانات إلى JSON باستخدام دالة toJSON، ثم نحذف الأقواس الزائدة [] باستخدام :sub(2, -2) لتهيئة البيانات بشكل صحيح. function(responseData, responseInfo): هذه دالة "رد الفعل"، التي تُنفذ عندما يرد Discord على الطلب. التعامل مع النتيجة if responseInfo.success then outputChatBox("تم إرسال رسالتك إلى Discord!", player, 0, 255, 0) - إذا تم إرسال الرسالة بنجاح، يُبلغ اللاعب برسالة نجاح. التعامل مع الأخطاء else local statusCode = responseInfo.statusCode or "غير معروف" outputChatBox("فشل الإرسال! (الكود: " .. statusCode .. ")", player, 255, 0, 0) - إذا فشل الإرسال، يتم طباعة الكود الخطأ، مثل: 400: خطأ في البيانات (ربما الرسالة فارغة أو JSON غير صالح). 401 / 404: رابط Webhook غير صحيح أو تم حذفه. 429: تم إرسال عدد كبير جدًا من الرسائل (تم تجاوز الحد المسموح به). ربط الأمر مع الدالة addCommandHandler("discord", sendMessageToDiscord) - هذا السطر هو الذي يربط `/discord` مع الدالة التي كتبناها. - أي شخص يكتب هذا الأمر يتم تنفيذ الكود أعلاه له. خلاصة المنطق كاملًا: ملاحظات إضافية للمطور: - Webhooks يمكن استخدامها لعدة استخدامات مثل: - إرسال تنبيهات عند دخول أو خروج اللاعبين. - إرسال رسائل النظام. - تتبع الأخطاء في السكربتات. - يمكنك تحسين السكربت بإضافة: - صورة اللاعب. - أزرار تفاعلية (عبر Discord Buttons). - أكثر من Embed في نفس الرسالة. مصادر مهمة: - رابط السكريبت كامل على جيت هب مع الشرح - رابط السكربت على موقع المودات بالتوفيق لكم
-
Ridzz joined the community
-
Marcela da silva santos joined the community
-
Alex2132 joined the community
-
proskyrish143 joined the community
-
SergioneJeler joined the community
- Yesterday
-
Eagle Loader – Streamlined Custom Map Processing for MTA:SA GitHub: https://github.com/BlueEagle12/MTA-SA---Eagle-Loader What is Eagle Loader? Eagle Loader is an efficient and lightweight map processing resource for Multi Theft Auto: San Andreas. It simplifies the loading of custom maps and objects using a custom .definition system and a customized .map format tailored for performance and flexibility. Key Features Easy Custom Map Loading Load complex custom maps with minimal performance overhead. Definition File System Handle map data, models, effects, and LODs through structured .definition files and customized .map files. String-Based Custom Model IDs One of Eagle Loader’s standout features is the ability to assign string-based IDs to custom models instead of numeric ones—making it significantly easier to manage and organize assets. Optimized for Speed Designed for fast loading and smooth integration with the MTA:SA engine. Demo Map – MTA: Vice City Want to see Eagle Loader in action? Check out this fully functional Vice City map port: MTA: Vice City – Demo Map How to Load the Vice City Map Download the Resources Clone or download both repositories: Eagle Loader MTA: Vice City Place in Your Server Resources Folder Drop both folders inside your resources/ directory. Start Eagle Loader First start eagleLoader Start the Vice City Map Resource start viceCity With just a few simple steps, you’ll be walking through Vice City inside MTA:SA — powered by Eagle Loader. Download & Docs: Eagle Loader on GitHub Feedback & Contributions are welcome!
-
- eagle loader
- streamer
-
(and 1 more)
Tagged with:
-
Vegas-mta.pl Cześć! Wstęp Nasz serwer jest tworzony z myślą o Graczach, którzy pragną stabilnej i satysfakcjonującej rozgrywki na wysokim poziomie. Naszym celem jest zapewnienie wyjątkowych doświadczeń, które będą angażujące zarówno dla nowych, jak i doświadczonych Graczy Multi Theft Auto. Zaprojektowaliśmy nasz serwer w taki sposób, aby każdy mógł znaleźć coś dla siebie. Wprowadziliśmy różnorodne rozwiązania, które mają na celu zapewnienie dynamicznej i emocjonującej zabawy. Choć wprowadzamy również elementy RP (Role Play), nie chcemy, aby dominowały one w rozgrywce – naszym priorytetem jest, aby Gracze mogli w pełni cieszyć się grą i odnaleźć w niej radość. Cele Naszym wspólnym celem jest stworzenie serwera, który zapewni Graczom przyjemne i komfortowe doświadczenia. Dbamy o to, aby nasza oprawa graficzna była estetyczna i przyjemna dla oka, łącząc nowoczesny design z nostalgią dawnych lat. Zdecydowaliśmy się na unikalny model rozgrywki, który nie ogranicza się do jednej lokalizacji, lecz obejmuje całą mapę, co pozwala na odkrywanie różnorodnych miejsc i przygód. Naszym głównym punktem startowym jest malownicze Las Venturas, które stanie się początkiem ekscytujących wędrówek i niezapomnianych przygód. Gospodarka Na naszym serwerze, znajdziecie średnie zarobki, dzięki którym nie będziecie musieli całą grę pracować żeby coś osiągnąć lecz nie będzie tak lekko. Znajdziesz również przeróżne prace sezonowe jak i zwykłe umożliwiające zdobycie pieniędzy poza frakcjami bądź drogą przestępstw. Social media Tryb gry: RPG + RP Discord: https://discord.gg/5PpkRZSjXy
-
Only one from SL joined the community
-
BestZeytone changed their profile photo
-
kaise_07. joined the community
-
juzek joined the community
- Last week
-
venta [VENTA] Sistema de Descargas y Encriptación 🌐
Maruchan replied to Sergioks's topic in Recursos y aportes
Será que si ya has vendido varias lo donarias?,- 1 reply
-
- downloader
- sell
-
(and 1 more)
Tagged with:
-
HoLsTeN0 changed their profile photo
-
Cześć! Nazywam się Kacper i od ponad 8 lat działam w społeczności MTA / GTA:SA / FiveM, specjalizując się w mapowaniu, grafice oraz tworzeniu i konfigurowaniu serwerów Discord. Łączę kreatywność z doświadczeniem, by pomagać projektom osiągać profesjonalny poziom wizualny i techniczny. Co oferuję? Mapowanie Tworzę dedykowane mapy pod serwery RPG / RP Styl dopasowany do klimatu projektu (np. wiejski, miejski, gangowy) Edytuję i optymalizuję istniejące lokacje Gwarantuję estetykę i lekkość mapy Grafika – UI/UX Design Projektowanie interfejsów użytkownika i elementów UI Tworzenie logo, banerów, avatarów oraz grafik promocyjnych Komplety graficzne pod fora, serwery i prezentacje Spójność stylu i dopasowanie do Twojego projektu Profesjonalne Discordy Zakładanie i konfiguracja serwerów Discord od A do Z Uporządkowana struktura kanałów, ról i kategorii Integracja z botami (automaty, ticket systemy, statystyki) Estetyczne elementy graficzne (ikony, emoji, bannery) Masz wizję, ale brakuje Ci wykonania? Odezwij się – pomogę przenieść Twój pomysł na ekran! Kontakt: Discord / Forum Moje prace możesz zobaczyć tutaj: https://www.behance.net/Wumpus1k Discord: Wumpus!k & devvy_1 Forum: Napisz tutaj!
-
I installed the latest nightly version and tried several previous versions and the problem still occurs, mta diag with the latest nightly version shows the same problem: https://pastebin.multitheftauto.com/3853917608
-
Kuziores started following MTA Error 0xc0000005 Windows 11
-
Hello, I have a problem with my mta. After installing windows 11 mta does not want to start properly, the luncher turns off and the game does not start. I installed mta diag and these are the results: https://pastebin.multitheftauto.com/7229400576 I have installed all system updates and the latest drivers, gta from the original source from rockstar and mta also downloaded from the mta website. Can someone help me fix this problem because I would like to continue playing mta
-
I found another way. On start interface resource add and instant remove armor to localPlayer, it's turning on armor bar, then taking health bar coords, armorY + (healthY - armorY) / 2 = breathY. And it's working perfect. UPDATE: for correct working of this method you need to let armor bar to be drawn for 1 frame at least. I used a timer, which checking armorX and armorY, until they became not 0, 0.
-
It will probably be visible when the camera is fade out. So yes you need to add some more exceptions for unexpected situations. This condition might catch some of the problems: if getCameraTarget () ~= localPlayer then return end
-
That's something that I want to do. And if breath bar has its coords, then all ok. But if not, then stamina bar going to left top corner. I just can't upload images. If character will be in water while player has black screen by fadeCamera() and HUD off, will it trigger breath bar?
-
IIYAMA started following Way to force draw bar
-
I don't think there is a way to force it. If it did, then it should be defined here: https://wiki.multitheftauto.com/wiki/HUD_Components#Properties https://wiki.multitheftauto.com/wiki/SetPlayerHudComponentProperty But as alternative you can draw a bar under it with: https://wiki.multitheftauto.com/wiki/DxDrawRectangle https://wiki.multitheftauto.com/wiki/DxSetAspectRatioAdjustmentEnabled https://wiki.multitheftauto.com/wiki/OnClientHUDRender
-
waky started following Ошибка AC4 LAGSWITCH(cd48)
-
ошибка AC 4 LAGSWITCH https://imgur.com/a/QqgbEmd https://pastebin.mtasa.com/8365945770 - mtadiag
-
Hi guys. In 1.6 was added some new functions for HUD. I liked the idea to use it to draw my stamina bar in place, where is breath bar by default. But then I got a problem - until the player gets into the water, breath bar x, y = 0, 0. Is there a way to force draw that bar without going into water?
-
Hey, I'm experiencing a strange issue where I randomly get disconnected from the SAUR server with the message: "Connection with the server was lost." This happens randomly, sometimes every few minutes and when it does, I can't join any MTA server for a few minutes. It's like the entire MTA network becomes unreachable for me temporarily. After a few minutes, everything works again without me doing anything. At the same time, I also can't access the SAUR forum (saur.co) when this happens. It just fails to load, while other websites like Google, YouTube, etc., work perfectly fine. I did some testing, including traceroutes and ping tests. The server IP (193.70.80.143) is hosted on OVH, and it seems like something in the route (possibly peering or filtering) causes the connection to break temporarily. The forum is hosted separately but also uses OVH infrastructure (as confirmed by SAUR staff), so I suspect this could be related to OVH routing or filtering on my ISP's side. I also tested connecting using a mobile hotspot, and everything works perfectly then – no disconnects, no forum issues – which again suggests a possible ISP-side or routing-related issue. Additionally, I work as a Technical Support Representative for the ISP I use. While I’ve already checked with them, I'm quite sure they won’t be able to do much since I’m using a personal router, not one provided by them. The only things they can check are the connection to the ISP and tests related to my infrastructure. I would really appreciate any advice or if anyone else has experienced something similar. Thanks in advance!
-
SethJunior started following #Reckless
-
SethJunior started following .WhiteBlue2
-
SethJunior started following .WhiteBlue
-
SethJunior started following .Sky.
-
Very good idea. I'll check it out as soon as I'll start doing the map idea.
-
when i try to open mta it loads a bit then it just crashes i tried so many times to fix this. But none of them worked please help me.
-
Maybe move the checkpoint very high in the air (and replace it with a dummy). When the rocks are cleared, move it back.
-
androksi changed their profile photo
-
Straim changed their profile photo
-
Hey! Is it possible to disable a racing checkpoint via a lua script, and then re-enable it? I tried with Grok, and grok can't seem to script it properly (can't disable the checkpoint). I think the race client itself need to be modified for it. Example map that I wanted to test such a script: Racing map, where you need to clear the path (rocks) by moving them with Dozer to the marker (sphere, cylinder) and if you will clear all of the rocks on the way, then checkpoint will enable. Or 2nd example: A Forklift map, where you would need to deliver a crate with forklift, to a specific place (drop the object on the marker) - and after delivering it would re-enable the checkpoint Grok did a better job (but still failed) at putting laps, he somehow duplicated checkpoints (he added them via a script somehow) and they were glitched out on the radar, but he never made them hidden. Do you guys have any suggestion, how it could be done?
-
Not complain about the game itself but instead at the server owners
-
XX767XX changed their profile photo
-
Hi my question is that I know that Mta does not have Linux support.now I know how I will stop and play mta from my Linux on a 20 year old platform, it is strange to live in this problem, so you will say that you can use it with software such as Wine Lutris, and we used it well, but the servers block wineyi because it imitates windows files, rightly due to protection from cheating, some servers block wineyi because it imitates windows files, you are stuck in the login of some servers, or you enter and mta multiplies until the login opens. My last request from you, dear Mta team, please provide a way so that we can play comfortably like in windows and not be left as enemies by the cheat blocking system.
-
Processzor affinitás kikapcsolása a nulladik magon A legújabb verziókban elérhetővé vált egy új kísérleti beállítás, amely segíthet növelni az MTA teljesítményét, ezzel több FPS-t biztosítva. A beállítás neve jelenleg nyelvi beállítástól függetlenül „Set CPU 0 affinity to improve game performance”, de ez a jövőben változhat. Szinte minden számítógépen javítani fogja a teljesítményt, ezért mindenképpen érdemes kipróbálni. Mi is ez valójában? A processzor affinitás kikapcsolása a nulladik magon lehetővé teszi, hogy az MTA ne a nulladik magot használja a műveletek végrehajtásához. Ez azért előnyös, mert a fontosabb rendszerszintű folyamatok mindenképpen ezt a magot fogják használni. Hogyan kapcsolhatom be? Nyisd meg a Beállítások menüt. Kattints a Haladó fülre. Engedélyezd a Set CPU 0 affinity to improve game performance opciót. Mikor érdemes kikapcsolni? Ha az opció bekapcsolása után teljesítménycsökkenést tapasztalsz, próbáld meg kikapcsolni. Ez általában csak akkor fordul elő, ha egymagos processzorod van. Miért nem találom ezt a beállítást? Ez a beállítás csak a 23104 számú verzió óta érhető el. Ha régebbi verziót használsz, frissítened kell a legújabb verzióra, hogy kipróbálhasd. A jelenlegi verzió ellenőrzéséhez nyisd meg a konzolt, majd írd be a ver parancsot. Ha manuálisan kell frissítened, látogass el a https://nightly.mtasa.com/ oldalra. Mi várható a jövőben? A következő verziókban ez az opció alapértelmezetten be lesz kapcsolva, így nem lesz szükség manuális konfigurálásra. Emellett a beállítás neve várhatóan hamarosan minden nyelven lefordításra kerül.
-
Contact server staff or find another server to play on