Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 23/06/17 in all areas

  1. ع اساس مالك يد بالموضوع 90 % من الاعضاء مسمجين هنا ومنهم انا
    2 points
  2. وانا اعذرني على سوء الظن حسبتك فعلا شخص منهم +العفو صراحه كل ما جيت احاول اساعد بموضوع اشوف صورتك اطلع +_+
    2 points
  3. aPlayer بدل سطر بكذا بدال g_players + حط بسطر تسعه break + انته عارف معنى الصوره الليي انته حاططها ايه؟
    2 points
  4. كلامك يحكي شي وكودك يحكي شي لو تقصد الي يدخل البحر ينقله لي مكان محدد function waterCheck() vehicle = getPedOccupiedVehicle(localPlayer); if isElementInWater(vehicle) then setElementPosition(vehicle,201.71985, 1887.42810, 17.64806) setElementDimension(vehicle,0) end end setTimer(waterCheck,100,0)
    2 points
  5. 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
  6. https://luca-spopo.github.io/ash.html Made using bakaGaijin. I am not going to type everything here again, so just click the first link on top. Some teasers: https://youtu.be/qGYF3OFbGy8 https://youtu.be/pVPMER9JTiI https://youtu.be/Hm0xIc35BfA Before you ask: No, this does not use Javascript or CEF. It is a pure Lua implementation.
    1 point
  7. Well... that's something, I've never done. --But maybe table1 = {1,3,9,2} table2 = {3, 10, 4, 6} tableCount = #table1 for i, v in ipairs(table2) do table1[tableCount+i] = v end
    1 point
  8. Allright. I don't wanna confuse you, but if you want to store a color i.e in a table but in one "slot", You can have tables within tables. myTable = {1, 8, {255, 0, 0, 255}, 3} -- And you handle it like: myTable[3][1] -- This is 255
    1 point
  9. -- You declare the table myTable = {} -- Have an element (I'll make one here) myTable[1] = createPed(29, 0, 0, 0) -- OR ped = createPed(29, 0, 0, 0) myTable[1] = ped -- OR ped = createPed(29, 0, 0, 0) table.insert(myTable, ped) -- This will insert the ped in the table as an adittional element, unless you declare an index, while the upper ones overwrite myTable[1]
    1 point
  10. So in Lua {} this is a table. Tables have indexes and values So like: exampleTable = {1, 8, 4} --[[ The index is the place in this table. So like the Index of 1 is 1, cuz it's on the first place of the table, it's value is 1. The index of 8 is 2, the value is 8..... you can get an exact value from the table by exampleTable[2] for example. exampleTable[2] is 8. --]] exampleTable2 = {"toy", "story"} --[[ The index of "toy" is 1, the value is "toy". You get "toy" as result by exampleTable2[1] --]] exampleTable3 = {toy = 1, story = 8} --[[ The index of 1 is "toy", it's value is 1. Same with story. You get 8 as result by exampleTable3["story"] --]] --[[ You can also handle tables with for loops. If your table has only numerical INDEXES, your loop will look like this: --]] for i, v in ipairs(exampleTable2) do outputChatBox(v) --This will output all outputable values of that table. end -- If your table has indexes, not numbers u use "pairs" for i, v in pairs(exampleTable3) do outputChatBox(v) end If you need further help, I'll do my best to help you.
    1 point
  11. Hy. As I know, it is not possible, unless you make some tricky solution with some variables or such. I never tried tbh, it doesn't worth the time for me.
    1 point
  12. commando = { } laikas = 5000 function Tele( playerSource ) if (commando[playerSource]) then end setElementPosition(playerSource, 1518.88757, -1668.16504, 13.54688) commando[playerSource] = true setTimer( function() commando[playerSource] = false end, laikas, 1) if isPedInVehicle(playerSource) then car = getPedOccupiedVehicle(playerSource) commando[playerSource] = true setElementPosition(car, 1518.88757, -1668.16504, 1354688) warpPedIntoVehicle(playerSource, car) setTimer(function() commando[playerSource] = false end, laikas, 1) end end addCommandHandler( "ls",Tele) ------------------------------------------------------------------------------------------------------------------------- function Tele( playerSource ) if (commando[playerSource]) then end setElementPosition(playerSource, 2032.60022, 1343.41199, 10.82031) commando[playerSource] = true setTimer( function() commando[playerSource] = false end, laikas, 1) if isPedInVehicle(playerSource) then car = getPedOccupiedVehicle(playerSource) commando[playerSource] = true setElementPosition(car, 2032.60022, 1343.41199, 10.82031) warpPedIntoVehicle(playerSource, car) setTimer(function() commando[playerSource] = false end, laikas, 1) end end addCommandHandler( "lv",Tele) ------------------------------------------------------------------------------------------------------------------------- function Tele( playerSource ) if (commando[playerSource]) then end setElementPosition(playerSource, -2028.97644, 148.12634, 28.83594) commando[playerSource] = true setTimer( function() commando[playerSource] = false end, laikas, 1) if isPedInVehicle(playerSource) then car = getPedOccupiedVehicle(playerSource) commando[playerSource] = true setElementPosition(car, -2028.97644, 148.12634, 28.83594) warpPedIntoVehicle(playerSource, car) setTimer(function() commando[playerSource] = false end, laikas, 1) end end addCommandHandler( "sf",Tele) ------------------------------------------------------------------------------------------------------------------------- try that
    1 point
  13. -- My Login Panel :D function interfaz( ) local components = { "weapon", "ammo", "health", "clock", "money", "breath", "armour", "wanted", "radar" } for _, component in ipairs( components ) do setPlayerHudComponentVisible( component, false ) end local x, y = guiGetScreenSize( ) showCursor( true ) main = guiCreateWindow( x/3.8, y/3.8, x/2.02, y/2, "Login Panel", false ) guiWindowSetMovable( main, false) guiWindowSetSizable( main, false) guiSetInputEnabled(main,true) guiCreateLabel( x/10, y/8, x/4, y/4, "Username:", false, main) guiCreateLabel( x/10, y/5, x/4, y/4, "Password:", false, main) loginU = guiCreateEdit( x/8, y/6.8, x/5, y/24, "", false, main) loginP = guiCreateEdit( x/8, y/4.5, x/5, y/24, "", false, main) guiEditSetMasked( loginP, true ) guiEditSetMaxLength( loginU, 10 ) guiEditSetMaxLength( loginP, 10 ) btnL = guiCreateButton( x/8, y/3.5, x/10, x/20, "Login", false, main) btnR = guiCreateButton( x/4, y/3.5, x/10, x/20, "Register", false, main) addEventHandler ("onClientGUIClick", btnL, function (us, pa) local us = guiGetText (loginU) local pa = guiGetText (loginP) triggerServerEvent ("loggin", getRootElement(), getLocalPlayer(), us, pa) end, false ) addEventHandler ("onClientGUIClick", btnR, function (us, pa) local us = guiGetText (loginU) local pa = guiGetText (loginP) triggerServerEvent ("register", getRootElement(), getLocalPlayer(), us, pa) end, false ) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), interfaz ) function hideW () local components = { "weapon", "ammo", "health", "clock", "money", "breath", "armour", "wanted", "radar" } for _, component in ipairs( components ) do setPlayerHudComponentVisible( component, true ) end showCursor (false) guiSetVisible (main, false) guiSetInputEnabled(main,false) end addEvent ("Succes", true) addEventHandler ("Succes", getRootElement(), hideW)
    1 point
  14. v0.2 - Improved the custom damage handling Every vehicle has different loss-limits, which depend on the mass and collision damage multiplier of the vehicle Added electric damage Minimum vehicle health could be 500 If the vehicle health reaches the minimum, loss-limits will be lowered - Improved vehicle handlings (unfinished) Vehicles accelerate slower Vehicles steer harder More realism (for example, non AWD vehicles drive harder on terrain, etc.) Vehicles don't flip too easily anymore, they do flip although Once your vehicle is flipped, you can't unflip it by reversing and holding left/right steer key - Improved custom vehicle sounds, mostly minor bug fixes and changes (unfinished) - Improved the anti-players-pushing-vehicles feature (vehicle will unfreeze if you are not in contact with the vehicle anymore, before that it unfreezed only when you entered the vehicle or pushed it with another vehicle) The vehicle health bar is just temporary. Breakdowns won't happen as frequently as shown in the video. Fire damage will only be applied if smoke damage is applied. Video (sorry for the bad quality):
    1 point
  15. addEventHandler onClientGUIClick getAccountData triggerServerEvent warpPedIntoVehicle if isElement destroyElement(car[source]) setVehicleLocked setVehicleOverrideLights takePlayerMoney givePlayerCar onMarkerHit createVehicle setCameraMatrix وبنسبة للوحة حق شراء سيارات سوي جدول زي كدا cars = { {"اسم سيارة",الايدي,السعر}, }
    1 point
  16. @Pirulax we didn't make whole functions thus there's no need for adding the event handler. And I think everybody who's reading this topic would know that in order to draw something on the screen they'd need to use onClientRender.
    1 point
  17. لاحول ولا قوة إلا بالله
    1 point
  18. مشكوور @Abdul KariM مشكووور
    1 point
  19. مافهمت شي والله ايش تبي تسوي
    1 point
  20. اسف علي الصورة وثانية بجرب الكود function spectateDriver() aPlayer = getElementsByType("player") -- get a list of all players in the server for i,aPlayer in ipairs(aPlayer) do local isDriving = isPedInVehicle(aPlayer) if isDriving then if ( getElementType ( vehicle ) == "vehicle" and getElementModel ( vehicle ) == 407 ) then setCameraTarget( aPlayer ) break else outputChatBox( player,"there is no drivers currently" ) end end end end addCommandHandler("spectatem",spectateDriver) @Master_MTAمش شغال
    1 point
  21. تسلم والله مكنتش اعرف هغيرها حالا بس
    1 point
  22. ماسوني يعني عبدة شياطين فهمت؟ غيرها افضلك
    1 point
  23. الكود كلنت سايد لا تحطه سيررفر
    1 point
  24. function aCheckCars ( ) local aVehicle = getPedOccupiedVehicle( localPlayer ) if ( aVehicle and isElementInWater( aVehicle ) ) then if ( getElementModel ( aVehicle ) == 407 ) then setElementPosition( aVehicle ,201.71985, 1887.42810, 17.64806 ) setElementDimension( aVehicle ,0 ) end end end setTimer ( aCheckCars,1000,0 )
    1 point
  25. I'm certain it was something like a troll saying: ''write /bind w kill'' but then a variation causing what @homies describes (like a specific server script command + arguments that cause the lag and freezes he mentioned) The solution is simple: go to settings > binds, and reset to default.
    1 point
  26. السلام عليكم ورحمة الله تعلى وبركاته أرائكم بلوحة التسجيل وأول فيديو لي ض اللوحة م باقي كثير ترتيب فقط . أنشرها أو ماذا
    1 point
  27. قولي الأخطاء عشان اصلحها + مانك شايف خلفية .-.
    1 point
  28. @IIYAMA Thanks again mate, small mistake I hadn't seen. It works now
    1 point
  29. بسم الله الرحمن الرحيم سلام عليكم ورحمة الله وبركاته كيفكم شباب ان شاء الله تكونو بأتم الصحة والعافية , اليوم شباب بشرح كيف تسوي وظيفة خاصة فيك وتنشره او تصنع وظيفة مفيدة , سواءً لنفسك او للموضوع وظايف العرب المفيدة بسم الله نبدأ , : الخطوات المهمة عشان تسوي الوظيفة : 1- اسم الوظيفة يكون سهل وواضح 2- كود الوظيفة مايكون طويل جداً الا ان تطلب ذلك 3- انه الوظيفة ماتكون مكررة , 4- يكون للوظيفة فايدة معينة 5- وش الارقمنتات المطلوبة الي راح اطلبها من الشخص =[ نقطة مهمة ]= حاول ماتخلي كل شيء يعتمد على الارقمنتات 6- وش راح يرجعلي ؟ فأنت لما تسوي وظيفة ممكن تخليها ترجع boolean -- قيمة منطقية او true or false == string -- سلسلة نصية او "سلسلتك النصية" == table -- جدول 7- نتحقق انه مافي أي خطأ في الأرقمنتات عشان مايكتبله خطأ في الفنكشن طيب الحين فهمنا الخطوات بنطبقها الحين انا عندي وظيفة بسميها بأسم getPlayersOnMarker طبعاً من اسم الوظيفة يعني جلب اللاعبون الموجودون داخل الماركر طيب بنسوي الكود function getPlayersOnMarker( marker ) حطينا الارقمنت الأول والي هو الماركر احنا بنخليها الماركر المراد به جلب اللاعبون داخله طبعاً القيمة بتكون اكثر من قيمة واحدة فبنستعمل جدول طيب نكمل الوظيفة بنسوي تحقق انه الماركر موجود , وانه نوعه ماركر function getPlayersOnMarker( marker ) PlayersOnMarker = { } -- سوينا جدول if isElement( marker ) and getElementType( marker ) == 'marker' then -- سوينا التحقق -- بنكمل الكود else -- اذا ماكتمل التحقق return false -- بيرجعله فولس end -- اند للتحقق end -- اند للوظيفة تمام تحققنا طيب الحين نبي يكتبله الخطأ وش نوعه وأي ارقمنت ؟ نستعمل وظيفة error -- وظيفة موجودة بلوا تلقائياً اذا استخدمت الوظيفة هذي راح يطبع لك في الديبق + راح يرجع القيمة فولس function getPlayersOnMarker( marker ) PlayersOnMarker = { } -- سوينا جدول if isElement( marker ) and getElementType( marker ) == 'marker' then -- سوينا التحقق -- بنكمل الكود else -- اذا ماكتمل التحقق error("getPlayersOnMarker Bad Argument 1@ [ Execpted 'marker' got "..getElementType( marker ).." ]") end -- اند للتحقق end -- اند للوظيفة تمام الحين بنسوي لوب للاعبين ونسوي تحقق انه اللاعب داخل الماركر بـ isElementWithinMarker ثم نضيفه لجدول function getPlayersOnMarker( marker ) PlayersOnMarker = { } -- سوينا جدول if isElement( marker ) and getElementType( marker ) == 'marker' then -- سوينا التحقق for PlayerIndex,PlayerValue in ipairs ( getElementsByType ( 'player' ) ) do -- نسوي لوب لجميع اللاعبين , وطبعاً ذي الوظيفة ترجع القيمة لاعب if isElementWithinMarker( PlayerValue, marker ) then -- سوينا تحقق انه اللاعب في الماركر table.insert(PlayersOnMarker, PlayerValue ) -- نضيف اللاعب في الجدول end -- آند للتحقق end -- آند للوب else -- اذا ماكتمل التحقق error("getPlayersOnMarker Bad Argument 1@ [ Execpted 'marker' got "..getElementType( marker ).." ]") end -- اند للتحقق end -- اند للوظيفة تمام قربنا نخلص الحين وش بيرجع للاعب ؟ أو مستخدم الوظيفة ؟ جدول الي سويناه PlayersOnMarker نسوي بعد اللوب استرجاع للجدول ويصير بهذا الشكل function getPlayersOnMarker( marker ) PlayersOnMarker = { } -- سوينا جدول if isElement( marker ) and getElementType( marker ) == 'marker' then -- سوينا التحقق for PlayerIndex,PlayerValue in ipairs ( getElementsByType ( 'player' ) ) do -- نسوي لوب لجميع اللاعبين , وطبعاً ذي الوظيفة ترجع القيمة لاعب if isElementWithinMarker( PlayerValue, marker ) then -- سوينا تحقق انه اللاعب في الماركر table.insert(PlayersOnMarker, PlayerValue ) -- نضيف اللاعب في الجدول end -- آند للتحقق end -- آند للوب return PlayersOnMarker -- راح يرجع الجدول الي فيه اللاعبين else -- اذا ماكتمل التحقق error("getPlayersOnMarker Bad Argument 1@ [ Execpted 'marker' got "..getElementType( marker ).." ]") end -- اند للتحقق end -- اند للوظيفة كذا سوينا وظيفة خاصة فينا , اتمنى انه يكون الشرح مفهوم وواضح , أي خطأ موجود في الشرح نبهوني عليه وانا اعدله , <3 وسلام خير الختام
    1 point
  30. كيف حالكم ان شاء الله بخير , اليوم رجعنا بـ نظام بسيط ويسهل عليك الامور طبعا النظام واضح من العنوان انك تعطي احد لايك او تجيب لايكاته وتقدر تستخدمه في اشياء كثيرة مثل مسابقات والى اخره طبعا النظام مانب مستعمل فيه الداتا ولا التيبلات فقط السكل الفنكشنات قبل التحديث الفنكشنات بعد التحديث الاحداث الخاصة بالنظام بعد التحديث بعض الامثلة من خارج السكربت على الفنكشنات والحدث تم اضافة ميزة الايكات في السكور بورد وهي اختياريه طبعا السكربت مشفر لحفظ الحقوق فقط وانا ماودي اشفر سكربتاتي لكن فيه اطفال تجبرني على اني اشفر : الاهدائات Just , Mr.Saad , خلف , خالد العمري , كور , برستيج , مجمتع العرب روابط تحميل الاصدارات وهذا الي كان عندي اليوم في امان الله وحفظ الرحمن
    1 point
  31. اول شي اقرا هذا الرابط https://ar.wikipedia.org/wiki/جسون ثانيا اعرب لك كلام الويكي عشان تفهم بعدين ننتقل الى التطبيق fromJSON يمكنك استخدام هذا في التخزين ومن ثم تحميله مرة اخرى باستخدام ،JSON هذه الوظيفة تحول قيمة واحدة(ويفضل ان يكون جدولا) في سلسلة الآن التطبيق Accounts = { {Name = "Mr.Tn6eL", Rank = "Shooter", ContentCount = 2477, Joined = "November 22, 2013"}, {Name = "iMr ~ MnHmAr", Rank = "Street Cat", ContentCount = 380, Joined = "January 4"}, } jsonstring = toJSON(Accounts) -- التحويل الى جسون outputChatBox(fromJSON(jsonstring)) -- التحويل من جسون
    1 point
×
×
  • Create New...