Leaderboard


Popular Content

Showing content with the highest reputation since 03/12/18 in all areas

  1. 23 points
    Hi there. The Winter Holidays are here, so as usual we have got a new recap and status update post for you. Here is the summary of what has happened this year. 📰 2018 in Recap We made efforts towards the new release through the first half of the year, so there was not much to talk about. There was an incompatibility issue with the 360 Total Security software which we advised you about and later in the year, there was a similar issue with McAfee. Late July, we have asked you about your thoughts about refreshing the community.mtasa.com portal. We have received some interesting feedback from you and we are still thinking about ways of implementing it, while considering our current resources. Also in July, we have migrated our bug tracking services to GitHub Issues, making it easier to track specific issues and link them to GitHub commits and pull requests. This has also allowed us to clean up our bug tracker - the old system had nearly 8000 tracked issues, some of which were 13 years old or so. On 7th of September, we have released Multi Theft Auto: San Andreas 1.5.6. This release added support for custom IFP animations among other things, like fixing the input and FPS lag reported by some of our users. Then a few days later, we have advised you to upgrade your MTA:SA servers to the latest version due to a server crash exploit that was discovered. There were some additional issues with this hotfix that were spotted later, but they have been all fixed within few days. If you have not yet upgraded your servers though, we still urge you to do so. 📺 A bunch of interesting MTA:SA-related YouTube videos from this year nX_ Vol.18 - CodeNX™ - 첫 장 - video by ElCrowMvs / map by nX [GTA:DM] Wonder - Interstellar - by Wonder MTA [MTA] Vice City - Map Preview #1 (JStreamer v3) - by Liberty City Roleplay Multi Theft Auto - Tactics - by LoG4nTG Multi Theft Auto - MTA CIT / GTA SA - San Andreas Police Department's 7th Anniversary (Dance Show) - video by PeteyFTW / server: CIT Multi Theft Auto San Andreas Fail + Funny moments #1 - by Mr. Green Gaming Multi Theft Auto: San Andreas - MTA DD - Map: Orgazm Cross - video by Game Master / map by Orgazm MTA:SA Fast And Furious Paradise Trailer ! - by SDRIFTER Abdlmounaim 📈 Current player counts and version fragmentation statistics Type Amount of players Date / Time Recent peak number of concurrent unique players 30625 players 2018.12.16 (at 16.30 GMT) Highest recorded number of concurrent unique players 34653 players 2018.02.03 (at 17.30 GMT) Recent number of daily unique players 150390 players 2018.12.01 (Saturday) Highest recorded number of daily unique players 185818 players 2018.02.03 (Saturday) Recent number of monthly unique players 605834 players November, 2018 Highest recorded number of monthly unique players 805903 players January, 2018 Player counts were just slightly lower than last year, but we have also had some nice peak values at the beginning of the year. Good to see that there is still an interest in old but great games. MTA:SA Version or series Percentage of players using that version or series as of 24th of December, 2018 1.6.0 (alpha) 0.05% 1.5.6 97.20% 1.5.5 2.00% 1.5.4 (and older) 0.40% 1.4.x 0.20% 1.3.x 0.15% Similar to last year, two of our most recent releases are used by over 99% of our player base. It means that there is little fragmentation between our releases and that players in general upgrade to the newest release once it is available. Also, there seems to be some interest in the newest alpha version as well - that is nice too. 📟 Status updates Community-wise, our Discord has expanded this year - currently we have got 10 language-specific sections available for you there, as well as the active as usual English ones. We have also opened a new forum section recently to keep appeals for global game bans in one place. Over the next few weeks we intend to refresh our forum rules to better suit the current forum needs. As for mod's development, we will continue working on the next release. We are thinking of integrating a new version of the client installer to reduce amount of issues encountered when installing MTA:SA (as well as to make it easier to investigate the remaining ones). We will also consider adding new features provided by our community members, such as editing collisions and adjusting surface properties by CrosRoad95. That's it for now. 🎄❄Happy Holidays and all the best to you in 2019! 🎉✨ -- MTA Team
  2. 17 points
    A simple script of dressable characters and deformable faces. You can move every vertex of the head with a simple displacement shader. The script is in test state right now, I'll create a new editor later. Hope you like it.
  3. 10 points
    السلام عليكم ورحمه الله وبركاتة اليوم الشرح عن فنكشن مهم ومعظم المبرمجين ما يدور عنوا executeBrowserJavascript صفحة الويكي | Wiki Page : https://wiki.multitheftauto.com/wiki/ExecuteBrowserJavascript اولا : ما هو معني الفانكشن ؟؟ html الفنكشن عبارة ينفذلك امر من لغه الجافا سكريبت علي صفحة اكيد ما فهمت شئ بوضحلك ------------------------------------------------------------------------------------- ملاحظات لاستخدام الفانكشن : 1 - اول واهم شئ انك تكون عارف شوية للجافا سكريبت 2 - لا يمكنك استخدام الوظيفة الا مع الصفحات المحلية يعني مينفعش تعمل الوظيفة دي مع صفحة جوجل مثلا 3 - يجب ان تعلم ان الفانكشن لا يشتغل الا علي الصفحات المحلية المعرفة في الميتا لنتعتبر ان اسم صفحتك call.html meta.xml اذن هنستدعيها كدا في ملف الميتا <file src="call.html" /> تقوم باستدعاء الصفحة داخل السكريبت حقك ( في ملف الكلنت طبعا لانوا متصفح ) url = "http://mta/"..getResourceName(getThisResource()).."/call.html" وبكدا url = رابط صفحتك ( call.html اللي هي ) اولا : تنشا متصفح yourBrowser = guiCreateBrowser(...) ثانيا : تحمل الرابط لما المتصفح يتنشا addEventHandler( "onClientBrowserCreated", theBrowser, -- ايفينت عبارة عن اول ما المتصفح يتنشا يحصل الفنكشن function( ) -- فنكشن loadBrowserURL( source, url ) -- تحميل رابط الصفحة حقتنا end -- انهاء الفنكشن ) -- اغلاق الايفينت ------------------------------------------------------------------------------------- بس لازم تعرف شرح الساينتكس بتاع الفنكشن bool executeBrowserJavascript ( browser webBrowser, string jsCode ) webBrowser : المتصفح بتاعك jsCode : كود الجافا سكريبت بتاعك ( الوظيفة لو الارقيومنات بتاعتها صحيحة بترجعلك قيمة وهي ترو ولو العكس او حطيت متصفح فية رابط موقع غير محلي بيرجعلك فولس) : ملحوظة _____________________________________________________ تمام كدا فهمنا الساينتكس ونشوف شوية امثلة المثال الاول :اظهار اسم الاعب عند كتابة 1 في اف 8 call.html <html> <p id = "msg"> hello </p> </html> client.lua( او ايا كان اسمة المهم انوا يكون ملف كلينت ) local jsCode = 'var p = document.getElementById("msg") ; p.innerHTML = "hello" + " '.. getPlayerName(localPlayer)..'"' local screenWidth, screenHeight = guiGetScreenSize( ) local window = guiCreateWindow( 0, 0, screenWidth-200, screenHeight-300, "Web Browser", false ) local browser = guiCreateBrowser( 0, 28, screenWidth-200, screenHeight-300, true, false, false, window ) local theBrowser = guiGetBrowser( browser ) addEventHandler( "onClientBrowserCreated", theBrowser, function( ) loadBrowserURL( source, "http://mta/"..getResourceName(getThisResource()).."/call.html" ) end ) addCommandHandler( '1' , function( ) executeBrowserJavascript( theBrowser , jsCode ) end ) المثال الثاني : اخراج الكلام الموجود في مربع الكتابة بتاع صفحة الويب علي شات اللعبه call.html <html> <input id='edit' ; type='text' /> </html> client.lua local jsCode = [[ var editBox = document.getElementById( 'edit' ) function onPressEnter() { if( event.keyCode == 13 ) { mta.triggerEvent("output",editBox.value) } } editBox.addEventListener("keypress", onPressEnter ) ]] local screenWidth, screenHeight = guiGetScreenSize( ) local window = guiCreateWindow( 0, 0, screenWidth-200, screenHeight-300, "Web Browser", false ) local browser = guiCreateBrowser( 0, 28, screenWidth-200, screenHeight-300, true, false, false, window ) local theBrowser = guiGetBrowser( browser ) addEventHandler( "onClientBrowserCreated", theBrowser, function( ) loadBrowserURL( source, "http://mta/"..getResourceName(getThisResource()).."/call.html" ) end ) addEventHandler( 'onClientBrowserDocumentReady' , theBrowser , function() executeBrowserJavascript(source,jsCode) end ) addEvent( 'output' , true ) addEventHandler( 'output' , root , function( msg ) outputChatBox(msg) end ) _______________________________________________________________________________________________________ المثال الثالث : عبارة عن انشاء وتغير لون الماركر من خلال صفحة ويب داخل اللعبه call.html <html> <p id = "msg"></p> <script> function func() { var c = event.keyCode if( c != 44 && c != 45 ) { if( c < 48 || c > 57 ) { event.returnValue = false } } if( c == 13 ) { mta.triggerEvent( 'createMarker' , document.getElementById("edit_Box").value ) } } function func2() { var c = event.keyCode if( c != 44 ) { if( c < 48 || c > 57 ) { event.returnValue = false } } if( c == 13 ) { mta.triggerEvent( 'changeMarker' , document.getElementById("color_Box").value ) } } </script> <strong><em>Enter Marker Position Here !! : </em></strong><input id = "edit_Box" style = "color:red" ; type = 'text' size = "50" onkeypress = "func()"> </input> <hr> <p id = "msg2"></p> <strong><em>Enter Marker Color Here !! : </em></strong><input id = "color_Box" style = "color:orange" ; type = 'text' size = "50" onkeypress = "func2()"> </input> </html> client.lua local screenWidth, screenHeight = guiGetScreenSize( ) local window = guiCreateWindow( 136, 131, 824, 468, "Web Browser", false ) local browser = guiCreateBrowser( 0, 28, screenWidth-200, screenHeight-300, true, false, false, window ) local theBrowser = guiGetBrowser( browser ) guiSetVisible( window , not guiGetVisible(window) ) visible = guiGetVisible(window) showCursor(visible) guiSetInputEnabled(visible) _Markers = { } addEventHandler( "onClientBrowserCreated", theBrowser, function( ) loadBrowserURL( source, "http://mta/"..getResourceName(getThisResource()).."/call.html" ) end ) setDevelopmentMode(true,true) addEvent( 'createMarker' , true ) addEventHandler( 'createMarker' , root , function( position ) if( #position == 0 ) then executeBrowserJavascript( theBrowser , 'document.getElementById("msg").innerHTML = "<b><i><u>يرجي كتابة احداثيات الماركر</u></i></b>" ; document.getElementById("msg").style.color="red"' ) if( isTimer( ti ) ) then killTimer( ti ) end ti = setTimer( executeBrowserJavascript , 2000 , 1 , theBrowser , 'document.getElementById("msg").innerHTML = "" ; document' ) return end local pos = split( position , ',' ) mark = createMarker( pos[1] , pos[2] , pos[3] , 'cylinder' , 1 ) if( isElement(mark) and getElementType(mark)=='marker' ) then if( type( pos ) == 'table' and #pos == 3 ) then executeBrowserJavascript( theBrowser , 'document.getElementById("msg").innerHTML = "<b><i><u>تم انشاء الماركر بنجاح</u></i></b>" ; document.getElementById("msg").style.color="green"' ) if( isTimer( ti ) ) then killTimer( ti ) end ti = setTimer( executeBrowserJavascript , 2000 , 1 , theBrowser , 'document.getElementById("msg").innerHTML = "" ; document' ) _Markers[#_Markers+1] = mark else executeBrowserJavascript( theBrowser , 'document.getElementById("msg").innerHTML = "<b><i><u>يرجي كتابة احداثيات صحيحة</u></i></b>" ; document.getElementById("msg").style.color="red"' ) if( isTimer( ti ) ) then killTimer( ti ) end ti = setTimer( executeBrowserJavascript , 2000 , 1 , theBrowser , 'document.getElementById("msg").innerHTML = "" ; document' ) return end else executeBrowserJavascript( theBrowser , 'document.getElementById("msg").innerHTML = "<b><i><u>يرجي كتابة احداثيات صحيحة</u></i></b>" ; document.getElementById("msg").style.color="red"' ) if( isTimer( ti ) ) then killTimer( ti ) end ti = setTimer( executeBrowserJavascript , 2000 , 1 , theBrowser , 'document.getElementById("msg").innerHTML = "" ; document' ) return end end ) addEvent('changeMarker',true) addEventHandler( 'changeMarker' , root , function( color ) if( #color == 0 ) then executeBrowserJavascript( theBrowser , 'document.getElementById("msg2").innerHTML = "<b><i><u>يرجي كتابة لون الماركر</u></i></b>" ; document.getElementById("msg2").style.color="red"' ) if( isTimer( t2 ) ) then killTimer( t2 ) end t2 = setTimer( executeBrowserJavascript , 2000 , 1 , theBrowser , 'document.getElementById("msg2").innerHTML = "" ; document' ) return end RGB = split(color,',') if( _Markers[#_Markers] and isElement( _Markers[#_Markers] ) and getElementType( _Markers[#_Markers] ) == 'marker' ) then if( type( RGB ) == 'table' and #RGB == 3 and tonumber(RGB[1])<=255 and tonumber(RGB[1])>=0 and tonumber(RGB[2])<=255 and tonumber(RGB[2])>=0 and tonumber(RGB[3])<=255 and tonumber(RGB[3])>=0 ) then executeBrowserJavascript( theBrowser , 'document.getElementById("msg2").innerHTML = "<b><i><u>تم تغيير لون الماركر بنجاح</u></i></b>" ; document.getElementById("msg2").style.color="green"' ) setMarkerColor( _Markers[#_Markers] , RGB[1] , RGB[2] , RGB[3] ) if( isTimer( t2 ) ) then killTimer( t2 ) end t2 = setTimer( executeBrowserJavascript , 2000 , 1 , theBrowser , 'document.getElementById("msg2").innerHTML = "" ; document' ) return else executeBrowserJavascript( theBrowser , 'document.getElementById("msg2").innerHTML = "<b><i><u>يرجي التأكد من البيانات</u></i></b>" ; document.getElementById("msg2").style.color="red"' ) if( isTimer( t2 ) ) then killTimer( t2 ) end t2 = setTimer( executeBrowserJavascript , 2000 , 1 , theBrowser , 'document.getElementById("msg2").innerHTML = "" ; document' ) return end else executeBrowserJavascript( theBrowser , 'document.getElementById("msg2").innerHTML = "<b><i><u>قم بأنشاء المأركر اولأ</u></i></b>" ; document.getElementById("msg2").style.color="red"' ) if( isTimer( t2 ) ) then killTimer( t2 ) end t2 = setTimer( executeBrowserJavascript , 2000 , 1 , theBrowser , 'document.getElementById("msg2").innerHTML = "" ; document' ) return end end ) bindKey( 'f7' , 'down' , function( ) guiSetVisible( window , not guiGetVisible(window) ) visible = guiGetVisible(window) showCursor(visible) guiSetInputEnabled(visible) end ) addCommandHandler( '1' , function( ) local x , y , z = getElementPosition( localPlayer ) setClipboard( x..','..y..','..z ) end ) addCommandHandler( '2' , function( ) if( _Markers[#_Markers] and isElement( _Markers[#_Markers] ) and getElementType( _Markers[#_Markers] ) == 'marker' ) then destroyElement( _Markers[#_Markers] ) _Markers[#_Markers] = nil local just = { } for i , data in pairs( _Markers ) do if( data ) then table.insert( just , data ) end end _Markers = just data = nil ; just = nil end end ) _______________________________________________________________________________________________________ >> { لأي استفسار تفضل في التعليقات في الاسفل } << ____________________________________ المصادر ____________________________________ https://wiki.multitheftauto.com/wiki/ExecuteBrowserJavascript https://www.w3schools.com/js/ https://wiki.multitheftauto.com/wiki/OnClientBrowserDocumentReady https://wiki.multitheftauto.com/wiki/OnClientBrowserCreated ______________________________________________ من قاموا بمساعدتي Who helped me ______________________________________________ @IIYAMA @botder ______________________________________________ الاهداءات @Master_MTA @!#DesTroyeR_,) @Default#^ @#,xiRocKyz @NX_CI @TOUNSI | ا̍ڸــڛۣــ؏ــٰٱ̍دہ @DABL @Kareem Amer والباقي في القلب
  4. 9 points
    Olá pessoal. Fiz um vídeo bem detalhado sobre os painéis CEGUI, abordando algumas das principais dúvidas e também algumas propriedades que podem ajudar muito na hora de criar um painel GUI. Recomendo que assistam com fones de ouvido, ou então que ativem as legendas no YouTube. Críticas, sugestões, opiniões, perguntas relacionadas ao vídeo, podem fazer por aqui ou então deixar nos comentários do vídeo. (Deu muitíssimo trabalho de produzir o vídeo, deixe seu like neste post e no vídeo. Se puder, se inscreva no canal e acompanhe a página Lord Henry Entertainment no facebook.) Links e funções que aparecem no vídeo em ordem de aparição: http://static.cegui.org.uk/docs/0.8.7/ guiGetScreenSize guiCreateWindow guiCreateButton http://static.cegui.org.uk/static/WindowsLookProperties.html guiSetProperty http://static.cegui.org.uk/static/WindowsLookProperties.html#FrameWindow http://static.cegui.org.uk/static/WindowsLookProperties.html#Button isMouseOnGUICloseButton Standard_GUI_Font_Names guiSetEnabled guiSetAlpha guiEditSetReadOnly guiEditSetMasked Tenham todos uma boa semana.
  5. 9 points
    الله يأخذ من أسس المنتدى .. ويأخذ مشرفين وأعضاء وعضوات المنتدى ....السلام عليكم ورحمة الله وبركاته ::لو أن السلام مو سنة كان ما سلمت ..!! قولوا ...آمــــــــــــييين الله ياخذ من أسس المنتدى ..ويآخذ مشرفين المنتدى...ويأخذ مشرفات المنتدى ...وياخذ أعضاء المنتدى ...ويآخذ عضوات المنتدى ...وياخذ زوار المنتدى ...وياخذ من يقرأ الموضوع ..وياخذني معاهم ..........:::: إلى ::::...........جنـــــــة عرضها السماوات والأرض ..لا هرم فيها ولا مرض لا تعب فيها ولا نصب ..لا هم فيها ولا وصب .. لا خوف فيها ولا هلعلا سأم فيها ولا جزع ......:: .. بعد عمـر طويـــــل مديــــد على الطاعة بإذن الله ..::.......آمــــــــــــــــــــيين ...
  6. 8 points
    بسم الله الرحمن الرحيم الصلاة والسلام على اشرف الانبياء والمرسلين نبينا محمد عليه افضل الصلاة واتم التسليم, اما بعد: أقدم لكم دورتي لـ تعلم لغة برمجة لوا.. ملاحظة: توجد مشكلة في الدرس الثاني الا وهي صغر الخط, وتم حلها ولن تتكرر في الدروس القادمة باذن الله تعالى MTA الدورة لا تتوجه لـلعبة ولكنها تتكلم عن البرمجة بشكل عام بالاضافة لتعليم وتدريس في لغة لوا اذا كان فيه نوع من الاقبال والتفاعل سأتخصص بـ برمجة ام تي ايه بالاضافة لبرمجة الديسكورد وشرح بعض اللغات الاخرى دمتم سالمين في أمان الله..
  7. 8 points
    Olá pessoal. Fiz um vídeo explicando as regras atualizadas do nosso fórum Português, além de como funciona e pra quê serve cada seção. Assistam ao vídeo antes de postar qualquer coisa em nosso fórum, o vídeo também tem algumas dicas pro pessoal que já faz parte da comunidade. Dúvidas, críticas, sugestões deixem nos comentários deste tópico ou então nos comentários do vídeo. Se inscrevam lá pra dar aquela força. Deixe também seu like no vídeo e neste post. Obrigado a todos. Conteúdo do vídeo: 0:53 - Regras e recomendações do fórum 2:01 - As seções do sub-fórum Português: 2:04 - Seção "Tutoriais em geral" 2:25 - Seção "Programação em Lua" * Formatando o Tópico * Criando um bom conteúdo pra mensagem * Conselhos e recomendações gerais * Use o botão <> para postar o seu código com a devida formatação 6:57 - Seção "Mapas Para MTA:SA" 7:09 - Seção "Ajudas relacionadas ao MTA:SA (Cliente/Servidor)" 7:30 - Seção "Servidores para jogar" 7:59 - Seção "Serviços de hospedagem" 8:13 - Seção "Offtopic" 8:28 - Suporte relacionado a banimento em servidores não são aceitos no fórum do MTA * NOTA: Para suporte com Ban global no MTA, seu tópico deve ser postado na seção internacional Ban appeals. APENAS para bans permanentes. Se for temporário, por favor, aguarde até que o ban expire. 8:53 - "Reviver" o tópico 9:18 - Sistema de reputação do fórum 11:03 - Tenha uma boa conduta no fórum 11:16 - Postagens em Português DEVE ser no sub-fórum Portuguese / Português 11:59 - Conselhos para quem ajuda no fórum 12:39 - Boas práticas de programação
  8. 7 points
    Events tutorial The reason why I created this topic, is that a lot of people are struckeling with them. In this tutorial I will only discus the very basic of them. If you want more, then there is a list of links at the end with more information. If I made any mistakes in the code, please let me know because I am not going to test every part. What are events? (basic description) Events are something custom added by MTA to make it easier to bring scripting(lua) closer to our game. If we do not have events, then the only thing we can do is give instructions to our game. But our code will never detect changes in our game. The same question again: "So what are the events?" Events are a way to communicate changes in our game to our scripts (or from our scripts). So for example my little ped(cat) gets ran over by a car. Then I really want to know about that, don't I? When an event activates, I describe this as: triggered (from the word trigger) Full wiki information can be found here: Event_system Before we can use events, what do we need to know? There are two things we need to know: The reason why it is triggered. <What happens?/when something happens?> In MTA this is the eventName of the event. (Example: you <ran over> my ped) Who is the one using the event? The event system in MTA is using elements as base (baseElement). This makes it easier to combine the what/when happens? with the one who is related to it. In MTA this is the source of the event. (Example: you ran over my <ped>) Trigger an event A scripting example: (this is not an official event) local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped triggerEvent("onPedRanOver", ped) In this example, a custom event gets triggered to tell you that my new created ped has been ranOver. The eventName is "ranOver" and the baseElement is ped. local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) In this SERVERSIDE example, I am also adding an extra argument drunkDriver to use the player that ran over the ped. This is not required, but it makes it more complete. See syntax. Syntax bool triggerEvent ( string eventName, element baseElement, [ var argument1, ... ] ) TriggerEvent Receiving triggers Receiving triggers is a bit more complicated, because there are a lot of options for it. You can receive events by listening to them. It is like: You know that something is going to happen but you do not know when. The first step that you have to take is related to this question: "Do I want to receive a custom or not custom event?" Custom events are self created events. They only exist when a scripter makes them. Two lists of NOT CUSTOM EVENTS but default MTA events, serverside and clientside: Server_Scripting_Events Client_Scripting_Events Do I want to receive a CUSTOM event? In case of a custom event, you have to register/enable it first. If you do not enable it and trigger it, you will receive a warning/error about that in your debug console. Syntax bool addEvent ( string eventName [, bool allowRemoteTrigger = false ] ) AddEvent The example below, shows you how to enable a custom event only for trigger events within the same server/client side. addEvent("eventName") -- Is the same as: addEvent("eventName", false) If you put the second argument to false or not fill it in, this means that you can't communicate from the other server/client-side. This option is most likely used for security reasons. Some events shouldn't be able to trigger by the other side For example, worst case scenario: (remote events enabled for a default MTA event) Serverside code: addEvent("onPlayerWasted", true) Clientside code: triggerServerEvent("onPlayerWasted", player, 0, localPlayer, 0, 9, false) OnPlayerWasted If this event is enabled for remote trigger events, then it might be possible to cheating kills/deaths score. Of course, it is not likely that players can run their own clientside code, but it is not impossible in case of not trust able community resources. Enable a custom event for trigger events that crossing sides (From clientside to serverside. From serverside to clientside). addEvent("eventName", true) This event can now be used by remote trigger event functions. See list: Client to server TriggerClientEvent TriggerLatentClientEvent Server to client TriggerServerEvent TriggerLatentServerEvent Enable the event from our previous example: addEvent("onPedRanOver", false) local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) If you do not use cross triggering, then I recommend to use the addEvent function in the same resource as where you are going to trigger from. This makes sure that the event is already added and that you will never receive this kind of error/warning "Event isn't added". If you put it in another resource which hasn't started yet, then after triggering you would still receive that error/warning. Start listening The next step is to add the addEventHandler. This function is used to listen to events. When an event is triggered, this handler(addEventHandler) will call the function you have attached to it, in MTA this function is called the handlerFunction. Syntax bool addEventHandler ( string eventName, element attachedTo, function handlerFunction [, bool getPropagated = true, string priority = "normal" ] ) AddEventHandler Resource 1 addEvent("onPedRanOver", false) local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) Resource 2 function handlerFunction () end addEventHandler("onPedRanOver", root, handlerFunction) The first 3 arguments, the require ones: eventName attachedTo handlerFunction Making sure that the addEventHandler options are correct set-up. Resource 1 addEvent("onPedRanOver", false) local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) Resource 2 function handlerFunction () end addEventHandler("onPedRanOver", root, handlerFunction) There are two conditions for an eventHandler to call the handlerFunction. 1. The event has to be exactly the same. In this case the event "onPedRanOver" is the same in both resources. 2. In both functions, triggerEvent and addEventHandler is an element being used. This element has to be exactly the same. (from where you trigger as well as where you receive) <OR> The triggered element from resource 1, has to be a CHILD of the element in resource 2. The root element is the very top layer of the MTA element structure. It will accept all elements you want to use for your events. See the element tree: If you do not understand the element tree please read this page: Element_tree Source variable The source of an event is the element that triggers the event. This variable isn't passed as an parameter, but it is predefined. This means that it is already created before hand. Some predefined variables do only exist under special conditions. The source variable is one of those, it is a hidden and local variable which is only available when a function is called by an event. List of predefined variables. addEvent("onPedRanOver", false) -- local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) function handlerFunction (drunkDriver) iprint(source) -- ped element end addEventHandler("onPedRanOver", resourceRoot, handlerFunction) In this example the ped is the source. See how those two code blocks are connected: addEvent("onPedRanOver", false) -- local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) function handlerFunction (drunkDriver) iprint(source) -- ped element end addEventHandler("onPedRanOver", resourceRoot , handlerFunction) resourceRoot In some examples, you see people use the resourceRoot instead of the root element for their addEventHandlers. The resourceRoot is an element created by a resource. This element holds all elements of that resource as (in)direct children. In the example above, the resourceRoot as baseElement will not work, because there are two resources. Each resource has it's own resourceRoot element. The resourceRoot is accessible with the same keyword: resourceRoot, but if you were to inspect the element in multiple resources, then the user data (element identifier) value is not the same. outputChatBox(inspect(resourceRoot)) If we were to put everything in one resource, then it would work: 🎉 addEvent("onPedRanOver", false) -- function handlerFunction () end addEventHandler("onPedRanOver", resourceRoot, handlerFunction) -- local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) In case of remote triggering, the resourceRoot in serverside and clientside is considered the same.(As long as they are part of the same resource) Why/when would we use resourceRoot? 1. Limit eventHandlers to the resource elements If you have 1000 markers in your server. One of the resources is for example a trucker mission, where you can get money by hitting markers. The resourceRoot element will make sure that the onMarkerHit event will only trigger for markers created by that resource. addEventHandler("onMarkerHit", resourceRoot, function () -- source element is the marker end) OnMarkerHit 2. Another benefit is that you are able to re-use the same eventNames. Resource 1 addEvent("onPedRanOver", false) function handlerFunction () end addEventHandler("onPedRanOver", resourceRoot, handlerFunction) -- local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) Resource 2 addEvent("onPedRanOver", false) function handlerFunction () end addEventHandler("onPedRanOver", resourceRoot, handlerFunction) -- local ped = createPed( 120, 5540.6654, 1020.55122, 1240.545 ) -- my ped local drunkDriver = getRandomPlayer() triggerEvent("onPedRanOver", ped, drunkDriver) These two resources do use the same event, but will not trigger each other their addEventHandlers. Warning: If root was used, then they will!!!! ;@ Lets cross triggering with resourceRoot! Clientside triggerServerEvent("example", resourceRoot) Serverside addEvent("example", true) -- second argument is true! cross triggering enabled! addEventHandler("example", resourceRoot, function () end) getPropagated In this bigger example we will be talking about the option getPropagated. If this option is disabled, it will not detect children any more. Keep reading! After that start code scanning from A, to B and then to C. Syntax addEventHandler bool addEventHandler ( string eventName, element attachedTo, function handlerFunction [, bool getPropagated = true, string priority = "normal" ] ) Example: Clientside -- A triggerServerEvent("onClientPlayerLoaded", resourceRoot) -- trigger an event to serverside --------------------------------------- -- C addEvent("onResponseServer", true) -- first listener addEventHandler("onResponseServer", resourceRoot, function () outputChatBox("getPropagated enabled") end, true) -- getPropagated true by default. -- second listener addEventHandler("onResponseServer", resourceRoot, function () outputChatBox("getPropagated disabled") end, false) -- getPropagated is false. Serverside -- B addEvent("onClientPlayerLoaded", true) -- second argument is true! cross triggering enabled! addEventHandler("onClientPlayerLoaded", resourceRoot, function () --[[ client is a predefined variable, which represents the client/player that communicates with the server More information about predefined variables: https://forum.mtasa.com/topic/33407-list-of-predefined-variables/ ]] triggerClientEvent(client, "onResponseServer", resourceRoot) -- first trigger event local element = createElement("randomElement") -- making a randomElement triggerClientEvent(client, "onResponseServer", element) -- second trigger event end) How does this this code works? A. When a client his code has been started, it will execute a triggerServerEvent. (It doesn't wait for any other clientside files to be loaded) B. The server receives the event. And sends two triggerClientEvents back: The first one is using the resourceRoot as baseElement. The second one is using a randomElement as baseElement. Both are using the event "onResponseServer" C. There are two addEventHandlers listening to the event: "onResponseServer" The first one is using getPropagated and the second one is not using getPropagated. The randomElement that is created, is by default an indirect child of the resourceRoot of the same resource. What will happen? When firing the first trigger event, both listeners will call their handlerFunction. But when firing the second trigger event, only the first listener will call it's handlerFunction. The randomElement is an indirect child of resourceRoot, but because getPropagated is disabled it will not call it's handlerFunction. Other tutorials related to this one: See also this tutorial about deeper limiting event ranges within your resource and reducing addEventHandlers https://forum.mtasa.com/topic/100069-tut-addeventhandler-on-a-group-of-elements-small-tutorial/ More information Full wiki information: Event_system A list of more information about triggering events: (Client to client / server to server) TriggerEvent Client to server TriggerClientEvent TriggerLatentClientEvent Server to client TriggerServerEvent TriggerLatentServerEvent A list of more information about receiving events: AddEvent AddEventHandler RemoveEventHandler Two lists of MTA events, serverside and clientside: (warning: not custom events) Server_Scripting_Events Client_Scripting_Events Cancel events CancelEvent WasEventCancelled (warning: custom events ONLY) GetCancelReason (Server only) Cancel latent events and their status GetLatentEventHandles CancelLatentEvent GetLatentEventStatus
  9. 7 points
    -: اعضاء فريق مجتمع العرب @justboy @#CroSs @NX_CI @ibrahim# @Rakan#
  10. 6 points
  11. 6 points
    السلام عليكم اليوم حابب اقلكم ابيكم كلكم تجون سيرفري واتمني تزوروني كلكم تنوروني ❤️ وهذا العدد قبل ساعة ايبي السيرفر : mtasa://46.105.250.205:26058 وسيتم وضع بعض الصور من السيرفر في نفس هذا الموضوع قريب
  12. 6 points
    @TOUNSI | ا̍ڸــڛۣــ؏ــٰٱ̍دہ -- سفير السلام و النوايا الحسنة 😕 @#StrOnG_,) -- دموا عسل مثلوا @SuperX -- دموا اعسل @Master_MTA -- حبيب الملايين @!#DesTroyeR_,) -- لا كلمة توصف هذا ال *************** جمال @سعد الغامدي -- محترم و طيب @#[K]iLLeR<3 -- حبيب الملايين
  13. 6 points
  14. 5 points
    Render events enchanting Having a lot of render events in your resource? Easier attach and remove? Or do you want to pass arguments in to a function which is attached to a render event? Then this might be something for you. Syntax: addRenderEvent bool addRenderEvent(function functionVar [, string eventName, arguments ...]) Arguments: The function you want to attach/target. The event you want to use. ( "onClientRender", "onClientPreRender", "onClientHUDRender") If you do not fill in one of these three, it will automatic fallback to "onClientRender". Fool proof. Arguments you can pass to the target function. (which isn't possible with the default addEventHandler + onClientRender function) Returns: true when added, and false otherwise. Syntax: removeRenderEvent bool removeRenderEvent(function functionVar [, string eventName]) Arguments: The function you want to attach/target. The event you want to use. ( "onClientRender", "onClientPreRender", "onClientHUDRender") If you do not fill in one of these three, it will automatic fallback to "onClientRender". Fool proof. Returns: true if found + removed, and false otherwise. (Not recommended to execute this function every frame > performance) onClientPreRender + timeslice If you use "onClientPreRender", just like the default event, it will pass the timeSlice to the attached/targetted function. https://wiki.multitheftauto.com/wiki/OnClientPreRender I am not sure if attached is the right word for this example, because it isn't really attached to the event. It is saved in a table which gets looped every frame. Performance Is this code bad for performance? The answer to that is NO. I ran a test for it, and it seems that addRenderEvent used less CPU AFTER adding the events. (addRenderEvent: 31% CPU, addEventHandler 99/100% CPU) Adding the event will probably use more CPU, but that is only one execution. Feel free to re-test this example, I am interested how it would perform on your pc's. Performance test code (Not the source code ) Source code:
  15. 5 points
    سلام علكيم . اليوم سويت سكربت بسيط وحبيت اعرضه للبيع . السكربت عباره عن لليزر لـ الطلقة ينفع لـ سيرفرات الشوتر + الهنتر تقريباً . وبإمكانك ان تشتري الليزر + تغير لونه . فيديو لـ الي مافهم الفكرة . سعر السكربت 7$ باي بال أتمنى مايكلمني الا الصامل . تواصل معي خاص او سكايب حقي بالوصف .
  16. 5 points
    نسيت اذكر حاجة جدا مهمة , اعضاء فريق مجتمع العرب كان شرف كبير لنا دخولكم معنا وكان من اجمل الاوقات صراحة قضيناها معكم والعلاقه بتكون مستمرة ان شاء الله بالسيرفر او بدونه احلى تحية لاعضاء فريق مجتمع العرب .
  17. 5 points
    @TOUNSI | ا̍ڸــڛۣــ؏ــٰٱ̍دہ مو ذا نفس مود التوب حقك ؟ المشكلة كاتبلك By Pumpa
  18. 5 points
    السلام عليكم ورحمة الله وبركاته -:في هذا الموضوع يمكنك تقديم طلب للانضمام لفريق مجتمع العرب, يجب عليك قبل كل شيء اتباع شكل التقديم التالي :اذا كنت تريد التقديم كـ مصمم في مجتمع العرب, الرجاء اتباع الشكل التالي :اذا كنت تريد التقديم كـ مبرمج في مجتمع العرب, الرجاء اتباع الشكل التالي الآن السؤال الذي يدور في بال الكثيرين, ماهو المقابل, الراتب الذي ستوفرونه؟ الفلوس (الراتب) تستطيع ان تربحهم فقط من المشاريع التي ستشارك في تطويرهم ولاتوجد طريقة أخرى
  19. 5 points
    سلام عليكم لي فتره معتزل من برمجه لكن رجعتتت بمود جديد و حصري مود عباره عن امر اسمه #send تكتب بالشات مثل كذا #send 100 100 عدد فلوس وبعدين مود نفسه يطلب منك علي طول تكتب اسم الاعب بالشات ( يجب عليك الان كتبت اسم الاعب ) يطلع لك بالشات كذا تكتب اسم الاعب عشان يوصلو له الفلوس وكل ذا داخل الشات وبنحط كود تحت طبعا هو يشتغل وكل شي لكن لو في غلط او شي او بق ياريت تقولو لي سيرفر addEventHandler("onPlayerChat",root,function(msg2) if getElementData(source,"go") == true then plr = getPlayerFromName(msg2) if plr then if plr ~= source then if getPlayerMoney(source) > 1 then givePlayerMoney(plr,tonumber(moeny)) givePlayerMoney(source,getPlayerMoney(source) - tonumber(moeny) ) outputChatBox(""..getPlayerName(source).." Has Been give moeny To "..getPlayerName(plr).." money is "..moeny.."",root,0,255,0,true) setElementData(source,"go",false) else outputChatBox("ليس لديك المال الكافي لارسله",source,255,0,0,true) setElementData(source,"go",false) outputChatBox("يجب عليك كتبت امر من جديد #send",source,255,0,0,true) end else outputChatBox("لا يمكن ارسل الفلوس لانفسك",source,255,0,0,true) setElementData(source,"go",false) outputChatBox("يجب عليك كتبت امر من جديد #send",source,255,0,0,true) end else outputChatBox("الاعب غير موجود بالسيرفر",source,255,0,0,true) setElementData(source,"go",false) outputChatBox("يجب عليك كتبت امر من جديد #send",source,255,0,0,true) end end end ) addEventHandler("onPlayerChat",root,function(msg) if string.find(msg,"#send") then if getElementData(source,"go") == false then len = string.len(""..msg.."") if len > 6 then text = string.sub(""..msg.."", 7,len) outputChatBox("يجب عليك الان كتبت اسم الاعب",source,0,255,0,true) setElementData(source,"go",true) moeny = text else outputChatBox("يجب عليك كتبت عدد الفلوس",root,255,0,0,true) end else outputChatBox("يجب عليك كتبت اسم الاعب لي ارسل الفلوس اليه",source,0,255,0,true) end end end ) الميتا <meta> <script src="server.lua" type="server" /> </meta> وفي مود ثاني قعد اشتغل عليه هو برنامج مثل لوحة ادمن بس لسه ما خلصته
  20. 5 points
    حي الله اللي انضمو معنا @justboy @#CroSs @!#DesTroyeR_,) @Rakan# @*RayaN-Alharbi. @ibrahim# @Abu-Solo @iMr.WiFi..!
  21. 5 points
  22. 4 points
    @justboy - صديق @SuperX - يا متوحش يا شرير يا قاسي @#StrOnG_,) - يشبه البطاطس ولاكنه كائن هلامي @Rakan# - صديقي ولاكن من ورا الجدار @ibrahim# - ثكلته امه @KillerX - سفاح من خلف الجدران @#_iMr,[E]coo - خوي كفو واكثر من صديق ولاكن مشكلته يحب يحطم الاخرين @TOUNSI | ا̍ڸــڛۣــ؏ــٰٱ̍دہ - i love you , you love me
  23. 4 points
    سلام عليكم ورحمة الله تعالى وبركاته كيفكم ياحلوين من زمان عنكم والله حبيت أخبر كل شخص يحبني .. إني راجع للبرمجة وراح انزل كل مود حصري بسويه بـ يدي ونقول ولكم باك يـ فخامة ؟؟
  24. 4 points
    1- ماهو أسمك (يفضل كتابة الاسم الحقيقي) ابراهيم 2- كم عمرك 20 3- :الرجاء كتابة تخصصك في مجال التصميم, على سبيل المثال Photoshop, Illustrator, Web Designer, etc.. web developer 4- الرجاء ارفاق بعض الصور (الفيديوهات) التي قمت بتصميمهم https://codepen.io/xibrahim/ 5- معلومات اخرى (تستطيع كتابة بعض المعلومات عن نفسك او عن الموهبة, المهنة التي تجيدها) مبتدئ في مجال اختبار الإختراق
  25. 4 points
    دليل انك نزرف مودات , ^ اعترفت بنفسك