Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/04/17 in Posts

  1. I brought you bakaGaijin and Ash Now I bring Discord integration with MTA scripts. MTA already has this for IRC Shoutout to the people who made the Sockets module, you're awesome. Features: -Scripts can echo messages to any Discord text channel of their choosing. -Any Discord channel can be set up to echo all messages to an ingame script. (Including the name of the person who said it, and his role) -One MTA server can send/receive to multiple Discord guilds. Example use: To show how this is useful, I made a small program to echo all global chat to a "global" Discord channel, and all team chats to individual "team" Discord channels. These Discord channels ofc echo messages back when someone posts. As proof of concept for commands, if a Discord user types "!ban name" then his role is checked, and if it includes Founder, the chat outputs "name was banned!" This is the client side script I used for this example: local SECRET_KEY = "15-A-53CR3T-K3Y" --The script works even if your server IP changes. You are mapped to a unique key. local function onopen(self) self:send(SECRET_KEY) --Your MTA server logs in addEventHandler("onResourceStop", resourceRoot, function() self:close() --Break off from Discord end) addEventHandler("onPlayerChat", getRootElement(), function(message, type) --Example hook to capture player chats local name = getPlayerName(source) local channel = "global" --Send to global channel if global chat if type==2 then channel = getTeamName(getPlayerTeam(source)) end --Or team channel if teamchat --Format to send messages is ("discord", channelName, message) self:send("discord", channel, name..": "..message) end) end function onmessage(self, data) local channelName, name, role, message = data[3], data[4], data[5], data[6] local orginal_message = message --The message we got from discord message = "("..role..") "..name..": "..message --Make it pretty if channelName=="global" then --Output to global chat or team chat outputChatBox("(DISCORD) "..message) else local team = getTeamFromName(channelName) local members = getPlayersInTeam(team) or {} local r, g, b = getTeamColor(team) --Color the output for lulz for _, player in ipairs(members) do outputChatBox( "(DISCORD) (TEAM) "..message, player, r, g, b) end end local commandExample = string.match(orginal_message, "^!ban (.+)") --If message started with !ban... if role=="Founders" and commandExample then -- ...and the person who said it had the right Role outputChatBox(commandExample.." was banned!", getRootElement(), 255, 0, 0) end end local function onclose() outputChatBox("The Discord link was closed") end local discord = Discord.new(onopen, onmessage, onclose) That's 41 lines of code, now let's see it in effect. I would love to hear what you think about it.
    1 point
  2. السلام عليكم ورحمة الله و بركاته هذا الموضوع ان شاء الله راح يفيدك في صنع مابك عام الشاطىء البحر الغواصة و الارصفة المباني الحانات و النوادي و الكازينو مصانع و مستودعات مكاتب و ناطحات السحاب مباني عادية مطاعم و فنادق http://farm7.staticflickr.com/6118/6378209341_a2af3174db_b.jpg الرياضة و الملاعب الصناعية الرافعات صناديق و براميل و رفوف عام داخلية مشروبات كزينو ملابس الابواب و النوافذ اثاث مستلزمات منزلية مستلزمات المحلات طاولات و كراسي منوعات طعام و مشروب درج عسكري ايقونات مميز اغراض الشوارع و الطرق زبالة طبيعة نباتات صخور اشجار http://farm7.staticflickr.com/6096/6378190855_1a1b56a53e_b.jpg المنشئات المطار و الطائرات قفزات لوحات التنقل الطرق السريعة و الجسور الصور من منتدى اجنبي جبتها و السلام عليكم و رحمة الله و بركاته
    1 point
  3. السلآم عليكم ورحمة الله تعالى وبركاته, كيف حالكم ان شاء الله طيبيين , اليوم حبيت أنشر لوحة معلومات اللاعب دي آكس من صنعي طبعاً, وهذا السكربت اول سكربت أنشره في المنتدى !, صورة للمود : -- ملاحظة : داتا الوقت يمديك تعدله لأني ما شفرت المود للي يبي يستفيد, هو كذا : getElementData ( localPlayer , 'PlayTime' ) PlayTime : تغيرها لداتا الوقت حقك ! لما تضغط ع تاب تقدر تشوف وش داتا الوقت حقك طبعا لازم يكون مود توزيع الساعات موجود نجي لرابط التحميل : MR.StoRm - Information_Panel ! والسلام عليكم ورحمة الله تعالى وبركاته !
    1 point
  4. CaosHost esta de acuerdo con esta propuesta, cuando borren todos los post, se publicara uno nuevo con la nueva informacion requerida y ademas se actualizara con nuevos contenidos, ya sea promociones u otras. Muchas Gracias!
    1 point
  5. The '()' after a function is a parameter list. Parameters are basically variables, which are used when you need to pass data through to a function. You can have as many parameters as you like. Here's a small example. function add(x, y) --define your parameters, in this example they are "x" and "y" local sum = x + y return sum end local myVar = add(1, 3) --we pass through 2 arguments into the "x" and "y" slots of the add() function. x = 1, y = 3 In the example above, "myVar" would now contain the value "4". Once we have passed the arguments through to the add() function, we can refer to them as x and y thereon. In this example, it's useful because we can keep using the add() function, but passing new values through each time it is called. Hope this makes sense, anything else just ask.
    1 point
  6. Fixed my problem, Contact me on discord
    1 point
  7. شكراً لك على الاضافة .. مرورك نور الموضوع
    1 point
  8. هذا الموقع مميزاته جداً قليلة وهو صنع فقط لتجربة الدورات حقت w3schools.com عندك هذا موقع افضل بكثير (CSS,JS,HTML) http://codepen.io/pen/ * للمتقدمين في اللغة بالتوفيق لك
    1 point
  9. You've got your publicity here, the one thing left to do is create a GitHub repo and set up some sort of QA for PR's. Also it's recommended to let more experienced (handpicked or yourself) scripters write the core of the gamemode (or the best initial commit PR), as it's vital for future integrations and everyone works based off it. I assure you anyone interested after reading this topic will come create PR's and contribute, if only they had a reference point where to start. I personally think this idea has potential, good luck.
    1 point
  10. 1 point
  11. Did you use setTimer() ? If so you can just do local secs = getTimerDetails(theTimer)/1000 https://wiki.multitheftauto.com/wiki/GetTimerDetails
    1 point
  12. السلام عليكم ورحمة الله وبركاتة نحن الأن نعمل علي إعادة بناء صندوق البحث , لذلك عندما تقوم بالبحث عن شئ معين ربما لن يظهرلك جميع النتائج المتوفره او من المحتمل لن يظهر لك اي نتائج مدة إعادة البناء : يوم واحد فقط يمكنك ايضاً إستخدام بحث قوقل كـ بديل في الوقت الحالي https://www.google.com/advanced_search ومن ثم قم بالبحث عن ماتريد في اول صندوق بحث يظهرلك forum.multitheftauto.com بكل بساطة قم بإدخال الرابط التالي في اول خانه واتمني لكم التوفيق #Edit: لقد تم إصلاح المشكلة
    1 point
  13. local hillArea = createColRectangle ( -2171.0678710938, 678.17950439453, 15, 15 ) function hill_Enter ( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then if ( ( getElementInterior( thePlayer) == 30 ) and ( matchingDimension ) ) then local nameOfThePlayer = getPlayerName ( thePlayer ) outputChatBox ( nameOfThePlayer.." entered the zone!", getRootElement(), 255, 255, 109 ) end end end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) Colshapes are created for all dimensions so you have to check within the function attached to the event if it the element that hit it is in the same dimension by checking if the argument variable 'matchingDimension' is true or false. If its true then they are in the same dimension but in your case you must check the elements interior too.
    1 point
  14. Было такое, только с маркерами, на форуме помогли, когда был подаван)) Рад, что нашел
    1 point
×
×
  • Create New...