Leaderboard
Popular Content
Showing content with the highest reputation on 07/10/17 in all areas
-
Summer is over, but fear not, we have got a new release for you - Multi Theft Auto: San Andreas 1.5.5! This release is focused on bugfixes (most notably, some popular crashes were fixed with help from @Dutchman101 - eg. this one, code cleanups and under-the-hood improvements for developers (migration to a Docker-based environment and support for VS2017 and GCC-6). It may look like it is not much of an update, but the amount of such smaller changes should be a good incentive to update. In other news, we have enabled some additional forum account security features for your convenience - namely a possibility to set a security question(s) for the account and support for Authy and Google Authenticator two-factor authentication. You can enable them in your Account Security settings. Release Highlights updated CEF elements and fixed red/blue color swap issue with Intel VGAs added 'localhost' to the hardcoded CEF whitelist modified launch patcher to work with more exe variants added black outline option for chat text fixed #4166 ("Engine Sounds of other Helicopters and planes missing unless you get in a Helicopter or plane.") fixed #9681 ("Unable to hear proper engine sounds when sitting in car as passenger") fixed #3944 ("Radio titles do not always show.") fixed #8590 ("createEffect with some effects places it's sfx sounds to position 0,0,0") added guiGetCursorType(), isResourceArchived(), getDevelopmentMode(), setDevelopmentMode() (used to be client-only, now it's also server-side), debugSleep(), setVehicleModelExhaustFumesPosition(), getVehicleModelExhaustFumesPosition() improved client connections through firewalls fixed FOV setting not updating censored onClientConsole for login command potentially fixed crouchbug resource pack: various changes in admin, editor, freeroam, headshot, ipb, joinquit, killmessages, play, and realdriveby ... plus more! A complete list of changes can be found here (recommended read) and here (incomplete, from r11302 upwards). List of changes to the resource pack can be found here (starting from and including Apr 22, 2016 upwards). Want to download MTA:SA 1.5.5? Click here to download the build for Win 7+. Looking for a legacy build for XP/Vista? You can download it here. Or you can click here to go to our home page. Once there, click the Download button at the top center of the page, then choose your build and you are set. Linux server packages are also available. This release is backwards compatible with other 1.5-based builds (1.5.4, 1.5.3, 1.5.2, 1.5.1 and 1.5). However if you still use these versions, why not upgrade to the newest one? It works just as good, or even better. Community credits for this release: AboShanab, Arran, CrosRoad95, Dezash, Dutchman101, emre1702, Gothem, lopezloo, Necktrox, qaisjp, Sergeanur, ZReC ^ Have you contributed to MTA:SA 1.5.5's source code/resources pack but were not mentioned in the above list (or maybe you would like to modify your entry above eg. change your nickname or add a link to your Twitter/Github)? PM @jhxp with a link to your contribution (for missing entries only) and you will be added ASAP ^ See y'all. -- MTA Team8 points
-
addEventHandler + group elements I noticed that some people like to add 10000000000000000 addEventHandlers for each element, while you probably only need 1 addEventHandler. Using ONE addEventHandler on a group of elements? Answer: local group = createElement("groupMyCutePeds") -- Create a custom element and save it in to the variable <group>. -- Create 3 peds. local ped1 = createPed(120, 5540.6654, 1020.55122, 1240.545) local ped2 = createPed(120, 5541.6654, 1021.55122, 1240.545) local ped3 = createPed(120, 5542.6654, 1022.55122, 1240.545) -- Set the parent of the 3 peds. setElementParent(ped1, group) setElementParent(ped2, group) setElementParent(ped3, group) -- Add an addEventHandler and use the <group> as <attachedTo> element. addEventHandler("onPedWasted", group, -- "onPedWasted" = serverside. "onClientPedWasted" = clientside. function () outputChatBox("One of my cute peds just died. ;'( No exceptions!") end) Code is untested, but the method is tested. Syntax for functions in example createElement syntax element createElement ( string elementType, [ string elementID = nil ] ) setElementParent syntax bool setElementParent ( element theElement, element parent ) addEventHandler syntax bool addEventHandler ( string eventName, element attachedTo, function handlerFunction, [ bool getPropagated = true, string priority = "normal" ] ) DO NOT disable getPropagated getPropagated: A boolean representing whether the handler will be triggered if the event was propagated down or up the element tree (starting from the source), and not triggered directly on attachedTo (that is, handlers attached with this argument set to false will only be triggered if source == this). If you disable this, children of the <group> element are not included. Make use of the element tree Element tree For applying addEventHandlers to elements created by the resource: Use: resourceRoot / getResourceRootElement For applying addEventHandlers to elements created by scripts of the resource: Use: getResourceDynamicElementRoot For applying addEventHandlers to elements created by maps of the resource: Use: getResourceMapRootElement I hope your code will be without... print(10^10^10^10) -- Print here: https://www.lua.org/cgi-bin/demo ...addEventHandlers in the future.2 points
-
مرحبا لقد قمت بإطلاق الاصدار الجديد من لوحة الادمنية العربية بعد ان لاحظت ان معظم الاعضاء يقومون بإستخدام لوحات الادمنية العربية القديمة التي مر عليها الدهر من دون اي تحديثات او حماية وكما انها غير مؤمنه كـ اي لوحة ادمنية حديثة الإنشاء,( وبالمناسبة انني هولندي ولا اتحدث اللغة العربية ) وكما انني بذلت الكثير من جهدي حتي اقوم بنقل الترجمة العربية من اللوحات العربية القديمة الي هذه اللوحة حديثة الصنع وكل ما اريده هو ان اقوم بإفادة اصحاب السيرفرات الذين يستخدمون لوحة الادمنية العربية القديمة وكما انه يمكنك ان تري اخر تحديثات لوحة الادمنية من خلال : https://github.com/multitheftauto/mtasa-resources/commits/master/[admin]/admin وإذا كان لديك صاحب سيرفر يستخدم لوحة الادمنية العربية القديمة رجاء اخبره بهذا الموضوع لكي يقوم بتحميل النسخة الحديثة من اللوحة العربية لتحميل اللوحة العربية DOWNLOAD:https://community.multitheftauto.com/?p=resources&s=details&id=14837 واذا كان هناك خطأ في ترجمة اللوحة رجاء اخبرني " لقد تمت ترجمة الموضوع من قبل نصور " ENG: I'm here releasing a new Arabic-translated admin panel from today's version (september 2017) after I noticed all community circulating AR panels were outdated as hell. As they pose serious security risks, eventhough I'm not Arabic, I felt it of such importance that I've spent a long time transferring translations from older circulating panels to this most up-to-date Admin panel. I'm helping a huge amount of server owners with this, because most will just use a Community version that is outdated because of the great time to invest in translating yourself. Ofcourse, you'll also benefit from new features and updates made to Admin recently, (look here: https://github.com/multitheftauto/mtasa-resources/commits/master/[admin]) both for this reason and security I advise you inform all server owners you know about this release and suggest they update if they're using Arab panels. If you spot any translation issues, please leave a reply. Main view example; (updated 24/09/2018)1 point
-
There's also this pretty useful page: https://springrts.com/wiki/Lua_Performance Where you can see in test 9, that using for i-1, #table is more than 2 times faster than using ipairs. In reality you shouldn't bother with such micro optimizations if you aren't traversing tables with thousands of elements pretty often. The page can be pretty useful if you want to read more about lua optimization quirks tho.1 point
-
The second one is using the ipairs function: https://www.lua.org/pil/7.3.html Benefit of the ipairs: ipairs returns the value as wel as the index. (no need to index on the next line as with the normal for loop) ipairs stops if there is no item at a given index: (not always a benefit thought) table = { 1, nil, -- < stops here 3 } Benefits of the normal for loop: Faster because it isn't using a function to loop. (functions are relative slow in compare to the rest of the code.) Can loop through nil values if required. table = { 1, nil, -- < keeps going! 3 } Can loop with different steps: for i=2, 10, 2 do --[[ 2 4 6 8 10 ]] end Can loop invert: for i=10, 1, -1 do --[[ 10 9 8 7 6 5 4 3 2 1 ]] end With other words there is no reason to use ipairs in my opinion.1 point
-
1 point
-
شكرا أخوي للمساعدة بس انا كنت بسأل بس ينفع أستخدم ذي كعلامة ضرب * ومن جوابك يعني صح وشكرا لك والله1 point
-
تعديل على المثال الي فوق ^ local sPos = { guiGetScreenSize ( ) }; GUIEditor = { window = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow( ( sPos [ 1 ] - 520 ) / 2, ( sPos [ 2 ] - 452 ) / 2, 520, 452, "Flashing window", false) guiWindowSetSizable(GUIEditor.window[1], false) btn = guiCreateButton(50, 50, 50, 50, '', false, GUIEditor.window[1]) guiCreateAnimation ( GUIEditor.window[1], true, 0.5 ) guiSetFlashing ( GUIEditor.window[1], true ) outputChatBox 'Start !' setTimer ( function ( ) guiSetFlashing ( GUIEditor.window[1], false ) outputChatBox 'Finish !' end, 5000, 1 ) end ) local flasherEvent = { }; function guiSetFlashing ( wnd, state ) if ( state ) then flasherEvent [ wnd ] = function ( state ) if ( source == wnd ) then guiCreateAnimation ( wnd, not state, 0.5 ) end end addEventHandler ( 'onClientGUIAnimationEnd', resourceRoot, flasherEvent [ wnd ] ) else if ( flasherEvent [ wnd ] ) then removeEventHandler ( 'onClientGUIAnimationEnd', resourceRoot, flasherEvent [ wnd ] ) end end end ____ Example 2: local sPos = { guiGetScreenSize ( ) }; local wordsTable = { { 'Hi', 'Hello !' }, { 'Bye', 'Good Bye !' }, { 'Wow !', 'Nice !' }, { '', '????' }, }; GUIEditor = { window = {} } addEventHandler('onClientResourceStart', resourceRoot, function() GUIEditor.window[1] = guiCreateWindow( ( sPos [ 1 ] - 500 ) / 2, ( sPos [ 2 ] - 500 ) / 2, 500, 500, 'My window', false) guiWindowSetSizable(GUIEditor.window[1], false) btn = guiCreateButton(50, 50, 50, 50, '', false, GUIEditor.window[1]) btn1 = guiCreateButton( 500 / 2, 500 / 2, 50, 50, '', false, GUIEditor.window[1]) guiSetVisible ( GUIEditor.window[1], false ) addEventHandler ( 'onClientGUIClick', btn, text, false ) addEventHandler ( 'onClientGUIClick', btn1, text, false ) end ) bindKey ( 'F5', 'down', function ( ) local b = guiCreateAnimation ( GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ), 0.5 ) if ( b ) then guiSetEnabled ( GUIEditor.window[1], false ) outputChatBox'DONE' else outputChatBox'Please Wait' end end ) addEventHandler ( 'onClientGUIAnimationEnd', resourceRoot, function ( openState ) if ( source == GUIEditor.window[1] ) then local mathRandom = wordsTable [ math.random ( #wordsTable ) ] guiSetText ( btn, mathRandom [ 1 ] ) guiSetText ( btn1, mathRandom [ 2 ] ) guiSetEnabled ( GUIEditor.window[1], true ) showCursor ( openState ) end end ) function text ( ) outputChatBox ( '1 : ' .. guiGetText ( btn ), math.random ( 255 ), math.random ( 255 ), math.random ( 255 ), true ) outputChatBox ( '2 : ' .. guiGetText ( btn1 ), math.random ( 255 ), math.random ( 255 ), math.random ( 255 ), true ) end1 point
-
function betOnPlayer(source, cmd, amount, target) if amount then iprint("Amount") if target then local targetPlayer = getPlayerFromPartialName(target) outputChatBox("The player name is "..getPlayerName(targetPlayer), source) iprint("Target found!") --- Your code here. else iprint("No target player") end else outputChatBox("/"..cmd.." [Amount] [Target]", source) end end1 point
-
function militarCommands( player, cmd ) local playerTeam = getPlayerTeam( player ) if ( getTeamName( playerTeam ) == "Militar" ) then if ( cmd == "uzi" ) then giveWeapon( player, 28, 9999 ) elseif ( cmd == "jetpack" ) then if ( not doesPedHaveJetPack( player ) ) then givePedJetPack( player ) else removePedJetPack( player ) end elseif ( cmd == "armor" ) then setPedArmor( player, 100 ) end end end addCommandHandler("uzi", militarCommands) addCommandHandler("armor", militarCommands) addCommandHandler("jetpack", militarCommands) Obviamente debes tener el team "Militar" ya creado. Espero lo entiendas.1 point
-
MTAs default resources are made by experienced programers. They like it that way. Also if you check the default resources, you can see that it is really complex. I don't mean the code, I mean the resource in runtime. To achieve that complexity so you can do a lot of things it can be necessary for everything to be connected to everything. About OOP. It is much more clear, if you "speak" OOP you can see that it is more effective and more simple. What you can make in OOP in 10 lines, CAN take up to 30 in not OOP.1 point
-
1 point
-
100 % بورت خطأ قم بتعديل بورت الى 3306 هل البورت مفتوح؟ لتأكد يجب أن يكون مثل http://164.132.106.152:3306/ في حال كان مغلق قم بفتحو هل تستخدم XAMPP? ياريت تتأكد من الأيبي أجعله localhost1 point
-
0 points
