Leaderboard
Popular Content
Showing content with the highest reputation on 06/10/17 in all areas
-
3 points
-
TAPL Tete Omar MR.GRAND MR.S3D 3NAD #NssoR #CrosS Master_MTA iMr.[W]ifi #Himoo2 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.1 point
-
السسسسلااممء عليكمم كيف الحال نشاء الله بخير ^^ Mtaالموضووععء واضح من العنوان وش احسسسنء مبرمجج عندككء في بالنسبههء لي المبدععء طلال 07 ^^1 point
-
السلام عليكم الحين جبتلكم سكربت بسيط لسيرفرات الزومبي الي هو سكربت شراء دم + درع طبعا ادري انه سهل لاكن في ناس تحتاجه صور السكربت 1 - 2 - ____________________________________________________________________________________________________ لتحميل السكربت : اضغط هنا لتحميل الجيو ميسج : ااضغط هنا ____________________________________________________________________________________________________ الاهدائات @#KENDER @MR.StoRm @Abu-Solo @#Soking ____________________________________________________________________________________________________ اتمني السكربت يكون اعجبكم ويلا مع السلامة1 point
-
بسم الله الرحمن الرحيم سلام عليكم ورحمة الله وبركاته كيف الحال ي شباب ان شاء الله تكونو بأتم الصحة والعافية في موضوع او مشكلة تكررت كثير معي او مع غيري والي هي تقليد الاسم الموضوع اثر علي من ناحيتين الكذب وتخريب السمعة : ( اولاً : عندي اقتراحات نحل هالمشكلة وهي : الاولى اعطاء الأسم للشخص الي له سمعة اكبر او معروف بشكل اكبر الثانية اعطاء الاسم للشخص الي له اكثر من سنين على هالاسم الثالثة مضاربة والحل الي يفوز بالمضاربة ( امزح الثالثة : احس فيها عنصرية شوي بس احس انها افضل طريقة وهي تحدي من الطرفين في البرمجة والي يفوز يربح بالاسم ^.^ بديت احس انه الموضوع مبالغ فيه بس للأسف انا قررت اضع واحط هالموضوع لأن اكثر من 5 اشخاص مقلديين اسمي وانا الاسم هذا من عام 2013 واعرف اشخاص كثيرين لأن ما كان في بالي الا حل واحد واني اغير اسمي بس حسيت له تأثيرات كبيرة مثل فقد السمعة , فقد المعرفة شيء زي كذا علعموم نريد اقتراحات لحل هالمشكلة العويصة الغريبة /: وافضل حل نحل فيه هالمشكلة .. بدون اي تأثيرات او شيء زي كذا الي مع هالموضوع يشارك بالرد او بوضع اللايك على الموضوع عشان نعرف انه هالموضوع له دعم او لا ._.1 point
-
السلام عليكم ورحمة الله وبركاته شرحنآ اليوم عن وظيفة هذه الوظيفة سيرفر فقط ! giveWeapon فآئدة الوظيفة :- تقوم بإعطاء البيد / الآعب سلاح ___________________________________________________________ الجملة التركيبية للوظيفة :- bool giveWeapon ( ped thePlayer, int weapon [, int ammo=30, bool setAsCurrent=false ] ) شرح الارقيومنتات ، ped thePlayer :- الآعب أو البيد int weapon :- آي دي السلآح لمعرفة آي دي الأسلحة من هنآ int ammo= 30 :- عدد الرصاص علما بأن هذا الأرقيومنت اختياري ، اذا ما حطيته رح يحط عدد الرصاص 30 bool setAsCurrent=false : رح يطلع بإيده السلاح true هذا الأرقيومنت اختيآري فآئدته اذا تبي اول م ياخذ السلاح يحطه بايده يعني اذا حطيت القيمة السلآح ما يطلع بإيده false إذا حطيت القيمة ___________________________________________________________ امثله :- عند كتابة كلمة في إف 8 يعطيه سلاح addCommandHandler("weapon", function (player) giveWeapon (player,31,200,true) end ) والسلام خير الختآم ،1 point
-
1 point
-
يقدر يستعمل الكيبورد الي موجود في النظام , يعني بدل مايكتب بالكيبورد الخارجي يكون في برنامج فيه ازرار حق الكيبورد العادي1 point
-
1 point
-
1 point
-
1 point
-
Spanish section: https://forum.multitheftauto.com/forum/166-spanish-español/ Prueba algo así. function militarCommands( player, cmd ) local playerTeam = getPlayerTeam( player ) if ( getTeamName( playerTeam ) == "Militar" ) then if ( cmd == "uzi" ) then giveWeapon( player, ID ) elseif ( cmd == "jetpack" ) then -- bla bla elseif ( cmd == "armor" ) then -- bla bla end end end addCommandHandler("uzi", militarCommands) addCommandHandler("armor", militarCommands) addCommandHandler("jetpack", militarCommands) -- Las otras funciones que debes usar son 'setPedArmor' y 'doesPedHaveJetPack' (o algo así)1 point
-
Variables are shared. Unless They are declared as locals. local localVariable Or if they are parameters. (which are also locals) function thisFunction (parameter1, parameter2) end A local variable can not leave it's block, neither it's file(which becomes it's block). http://lua-users.org/wiki/ScopeTutorial -- start file block function exampleFunction () -- start function block if true then -- start IF block -- ... -- end IF block elseif true then -- start ELSEIF block -- ... -- end ELSEIF block else -- start ELSE block -- ... -- end ELSE block end -- end function block end -- end file block -- start file block -- function exampleFunction () -- start function block if true then -- start IF block -- ... -- end IF block elseif true then -- start ELSEIF block -- ... -- end ELSEIF block else -- start ELSE block -- ... -- end ELSE block end -- end function block end -- -- end file block local variable -- I can not leave :(1 point
-
local r, g, b, alpha = getMarkerColor ( CPMarker[i]) setMarkerColor ( CPMarker[i], r, g, b, 128) local r, g, b, alpha = getMarkerColor ( CPMarker[i]) setMarkerColor ( CPMarker[i], r, g, b, 0) setElementAlpha does not work for markers because they have their own method to set the alpha. (which is actually not really consistent to be honest ) bool setMarkerColor ( marker theMarker, int r, int g, int b, int a ) Required Arguments theMarker: The marker that you wish to set the color of. r: The amount of red in the final color (0 to 255). g: The amount of green in the final color (0 to 255). b: The amount of blue in the final color (0 to 255). a: The amount of alpha in the final color (0 to 255). https://wiki.multitheftauto.com/wiki/SetMarkerColor1 point
-
1 point
-
Please check it out this line from the section's requirements : - Topic titles shall have the form [SERVER TYPE] Brief description/Name [LANGUAGE]. If you don't apply the requirements within 24 hours your topic will be removed. @[SAEG]Wicked1 point
-
1 point
-
1 point
-
1 point
-
You are using my jobs resource, no problem. You edited it, I'm aware that's going to happen, that's why I didn't compile it. You actually give me credits. But selling it, that's just scamming.1 point
-
0 points
-
Yeah, I saw that but it's server-side, whereas my whole code is client-side. I managed to fix the problem like this: 1. Do not create the markers on map start. 2. If the isSpectatingGhost is 'false' - do nothing, but if it's 'true' - create 2 markers (and 2 radar blips) ahead of the ghost's current position. 3. If the ghost's position is in a radius of 45m to the position of a marker - destroy the marker (and the radar blip). 4. If I stop spectating the ghost (isSpectatingGhost == false) and markers (and blips) have been made - destroy all markers (and blips) that have been created (max can be 2). 5. All this in a for loop and onClientRender. Didn't want to do it like this, it would have been easier and more efficient to just set alpha of markers (and blips), but oh well, if no other way then it's fine. Thanks for the help anyway0 points
-
الموضوع بسيط جداا النسخ addEventHandler('onClientGUIClick', root, function() local name = getPlayerName(localPlayer) if source == الزر then setClipboard( name ) end end )0 points
-
Why are you checking if the localPlayer is the localPlayer ._. localPlayer can only be localPlayer ._______. Are you getting any errors in the debug when you restart the script? /debugscript 30 points