Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 22/07/17 in all areas

  1. اول مرة اشوف واحد يعرف للدي اكس مايعرف للجوي ههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههه
    2 points
  2. @50cent, I already answered your question in the Hungarian Facebook group. Go and check it out.
    2 points
  3. الأفضل تفهمها لهم بطريقة واضحة ... تعطيك الارقمنتات print مثلا عندك وظيفة تقدر تسوي عدد لانهائي من الطباعات print(1, 2, 3, 4, ...) كيف ؟ باستخدام الثلاث النقاط هذي ويكون عملها بالطريقة هذي function myprint(...) local output = "" for k, v in ipairs({...}) do output = output..v.."\t" end return print(output) end myprint(1, 2, 3, 4) بعض الامثلة للتوضيح function abc(x, ...) if x == 1 then return print(...) end end abc(1, 2, 3) -- 2, 3 function add_to_x(x, ...) local sum = x for k, v in ipairs({...}) do sum = sum+v end return sum end print(add_to_x(10, 5, 5, 4, 6)) -- 10+5+5+4+6 = 30 select مثلا تقدر تستخدمها مع function get_number_2_of_args(...) return select(2, ...) end print(get_number_2_of_args("foo", "bar")) -- bar مثلا تقدر تعرف متغير عليها function declare_xyz_as(...) x, y, z = ... end declare_xyz_as(1, 2, 3, 4) print(x, y, z) -- لاننا حددنا ثلاث متغيرات للتعريف لذا 4 لن تتعرف وتقدر تتحقق من عدد الارقمنات بالفنكشن معها i function print_yes_if_arg_count_eq_3(...) if #{...} == 3 then print("yes") end end print_yes_if_arg_count_eq_3(1, 2, 3)
    2 points
  4. مافي بس تقدر تسهل على نفسك استخدامها بهذي الطرييقه for _,r in ipairs(getResources()) do -- جبت كل المودات for _,v in ipairs(getResourceExportedFunctions(r)) do -- جبت الموادات الي فيها export if v == "exportFunction" then -- حددت اسم الـexport exports[getResourceName (r)]:exportFunction(test) -- نفذت الامر end end end قلت افيدك بالطريقه لنه فادتني كثير من ناحيه انه صار عندي حريه اغير اسم المود وانه انفذ الامر اذا موجود باكثر من مود بنفس الوقت وانه ما يجي لي اخطاء في حاله انه المود متوقف ...
    2 points
  5. Mmmmm did enough research and annoyed enough scripters to finally get it working. Thanks everybody.
    2 points
  6. Hello, We, the eXo-Reallife team, would like to release a module that is also used on our server. It is a pathfinding module developed by Jusonex and StiviK. The module uses the A * algorithm. (https://en.wikipedia.org/wiki/A*_search_algorithm) We use this for our GPS: Why did we develop a module for this and did not simply write a script? This has a very simple reason. The module calculates the routes in your own threads, which has the advantage that it is much faster than a script, and secondly, you can calculate how much routes as you want side by side. This will not cause any lags etc.! What are the features of the module? The module can load several graphs / nodes side by side The module calculates the routes in its own threads Very useful API functions (such as findNodeAt or getNodeNeighbors) What are the main features? int loadPathGraph (String pathToGraphFile) This function loads the graph from the given file and returns a GraphId which you need for all other functions. If something does not work, false is returned. bool findShortestPathBetween (int graphId, float startX, float startY, float startZ, float endX, float endY, float endZ, function callback) This function finds the shortest route between the points. (Unfortunately, no vectors can be handed over!) The callback function is called when the calculation is finished. As an argument, either a table is returned that contains all nodes, or false if no route is found. bool unloadPathGraph (int graphId) You can use this function if you no longer need and want to unload the graph, it returns true if everything is fine, false if an error has occurred. You will find all the other functions that are included in our documentation. Why is the eXo team releasing all this? Well, that has the simple reason, we want to share our work with others and not just keep it for us! We hope we can enrich you with it and vlt. Even help! Where can I download the module? The whole module is open-source and can be viewed in our GitHub organization. It's released under the MIT License. GitHub organization: https://github.com/eXo-MTA Repository: https://github.com/eXo-MTA/ml_pathfind Download the module (Windows / Linux): https://github.com/eXo-MTA/ml_pathfind/releases Nodes of all roads in SA: https://github.com/eXo-MTA/ml_pathfind/blob/master/test/sa_nodes.json If you find any mistakes or suggestions, you can simply create a new issue and we will look into it. So now that's it, have fun with the module! - StiviK and the eXo-Reallife team (Original thread in German: https://www.mta-sa.org/thread/36365-release-mta-sa-pathfinding-module/?postID=407938#post407938)
    1 point
  7. Heya, This is a small project I've spend three days on so far. I was bored of the same old desert so I decided to add a canyon. I feel like this gives the desert a fresh, new feeling while still retaining the good ol' San Andreas vibe. https://www.youtube.com/watch?v=RwetzEnNs-8&feature=youtu.be Things I've yet got to do: Create LOD models. Prelight the models so they fit in more with the enviroment. Small tweaks here and there. Let me know what you think! -Noah
    1 point
  8. APPENDIX DATA SYNCHRONIZATION. What is it? MTA's synchronization methods. Optimization tips. DATA SYNCHRONIZATION 1. What is it? Since unmemorable times humanity have faced problems caused mainly due to the storage of different ideas in almost each human. But thank God, machines storage methods are different and they have the possibility of having stored the same values in more than 100 machines. Well this is great, but those values must be set by someone, and here's where the server-side and client-side can be used as example of data synchronization. The server-side store's all the values given by each client-side and give's back those values to the all the client-sides ending up into something like this ( Figure 1 ). This is a way to get the same data in all the client-side, but there's also other methods well known like P2P. Figure 1. 2. MTA's synchronization methods. Since data sync it's a base element of every multiplayer game or mod, MTA is not an exception. That's why MTA scripting interface gives us two core ways to sync the server data with the client data or client data with server data. Well this two methods are the following one's. Element Data, it consists of assigning values to an element that are being stored under a key ( the key usually being a string like "health" ). This way is being used by a great amount of scripters in MTA because it's easy to use. But there are also negative points if this way is not being used properly like saving small amount of data in just one key and syncing it with the server or client's. An example of it would be: [[--CLIENT.LUA--]] local value = 0 local function handleStart() value = getTickCount() -- WE GET THE TIME THE SERVER HAS BEEN WORKING WHEN THE RESOURCE START setElementData( localPlayer, "start_tick", value, true ) -- WE SAVE THE 'value' VARIABLE INTO THE 'localPlayer' ELEMENT WITHIN THE KEY 'start_tick' AND WE SYNC IT TO GET THIS DATA TO THE SERVER. end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), handleStart ) [[--SERVER.LUA--]] local function handleCMD( thePlayer ) local mineTick = getElementData( thePlayer, "start_tick" ) -- WE RETRIEVE THE DATA, THAT HAS BEEN SAVED INTO 'thePlayer' DATA. local resultTick = getTickCount() - mineTick -- GET HOW MUCH TIME HAS PASSED SINCE THE RESOURCE STARTED FOR THE PLAYER outputChatBox( resultTick, thePlayer ) -- PRINT INTO THE CHAT THE RESULT end addCommandHandler( "mytime", handleCMD ) -- IN CASE YOU WANT TO TRY IT SAVE THE CODE WITH THE NAME MARKED ABOVE THEM. [[--META.XML--]] <meta> <script src="server.lua" type="server"/> <script src="client.lua" type="client"/> </meta> Events, this method is the one that elementData's one bases on, which means this is a 'rawer' method which can also be faster than elementData if it's being used efficiently. An event is just a message that's being send to one or various systems, if these systems handle the message then when the message is sent to the system there's a trigger which calls the functions that are defined like a reaction to that message that has been sent. It's pretty easy to understand, just think of this. You say hello to someone, the message in this case is 'Hello' and the system where is pointed to mainly is the person, the person gets the message and handles it by calling some cognitive functions, these functions at their time trigger another message as result which in the most common case would be 'Hello' or just a strange face motion because he or she doesn't know you. Maybe you will ask yourself about what does a hello to someone have to do with Events in MTA. Well let's convert the situation above into script. We've got to define first the message by using addEvent( "Hello" ), good we have defined our message, but if we stop here then we have made some useless stuff that's not going to be used ever, that's why we have to use this message somewhere and here is when we simulate the action of saying something the message by using triggerEvent( "Hello" ) but... wait who's supposed to say the message? Let's make it look like the localPlayer was saying the message so it would be like triggerEvent( "Hello", localPlayer ), okay we have said the message but do we talk alone? Maybe but it's not pretty normal, so we must find a receptor which in this case will be a ped so we add the a ped to the game by using createPed( 0, 105, 20, 5.5 ) supposing we are located in the position 104, 20, 5.5. Okay we have the receptor now but it won't answer to our message so let's obligate him to answer us by adding a handler for the message to the ped like this addEventHandler( "Hello", thePed ), okay but this way it will do the same as we wouldn't have used addEventHandler that's why we need to pass also a function to call like an argument which in this case is going to be called 'answerToHello' and we would finish up with addEventHandler( "Hello", thePed, answerToHello ). All this and little bit more of code below for simulating an answer to hello from a person in a non-realistic way. [[--CLIENT--]] -- EVENTS addEvent( "Hello", false ) -- LET'S MAKE IT LIKE JUST THE CLIENT CAN TRIGGER IT SO WE MAKE SURE JUST WE ARE GOING TO TALK TO THE PED -- VARIABLES local thePed = createPed( 0, 105, 20, 5.5 ) -- WE ADD THE PED SO WE DON'T FEEL LONELY -- FUNCTIONS -- SAY HELLO local function sayHello() -- THIS FUNCTION WILL BE USED TO SEND UP THE MESSAGE TO THE PED triggerEvent( "Hello", thePed ) -- WE SAY HELLO TO THE PED end -- ANSWER local function answerToHello() -- WE DEFINE THE MESSAGE HANDLER SO WE MAKE SURE THE PED ANSWERS TO US outputChatBox( "Hello to you too!" ) -- THE PED GET'S THE MESSAGE AND GIVES US BACK A MESSAGE THAT WE CAN CHECK INTO THE CHAT. end -- COMMANDS addCommandHandler( "sayit", sayHello ) -- WE'VE GOT TO SAY SOMEHOW HELLO TO THE PED SO LET'S USE A COMMAND -- EVENT HANDLERS addEventHandler( "Hello", thePed, answerToHello ) 3. Optimization tips. Well both methods can be used in large development but there are some tips you can follow to make sure your script will run in an efficient way. Pack reasonable amount of data into one's element data key, don't save values like ( health, armor, money ) into different keys, compress them into an only one by using tables, by using this method we pass 3 values packed in one sync meanwhile separating each value with one key creates upon 3 different syncs which would end up in a greater amount of packets sent between the server and the client. This tip can be used for both methods [ elementData, Events ]. local basic_data = { health = 100, armor = 100, money = 100 } -- COMPRESSED PLAYER INFO setElementData( thePlayer, "main", basic_data, true ) -- WE GIVE 3 DIFFERENT VALUES TO 'main' KEY BY USING JUST A VARIABLE THAT'S A TABLE 'basic_data' triggerClientEvent( thePlayer, "onSync", thePlayer, basic_data ) -- WE SEND A MESSAGE TO THE CLIENT IN ORDER TO MAKE IT SYNC THE DATA OF THE PLAYER TO THE ONE THAT IS BEING STORED IN THE SERVER Lua is a garbage collection language so the reduce the amount of global variables as much as possible in order to make it run faster. Hope you enjoyed the tutorial, if you have any question just feel free to ask it in this post or by PM, Skype ( killer.68x ) or Email ( [email protected] ) or Discord ( Simple01#1106 ).
    1 point
  9. Con dx sería más fácil pero creo que puedes hacer lo mismo que para destruir un objeto que ya existe, en la parte donde actualizas la imagen coloca que si ya existe que se borre.
    1 point
  10. Nah, you can use it as it's a public image. But at least you could ask for it, if you have seen it, and you thought it's cool.
    1 point
  11. Are you near the ped?
    1 point
  12. Can you post the full code?
    1 point
  13. Do you have an element called 'ped'?
    1 point
  14. Yep, just like that. I mean, if you want the camera to be in an exact pos, you can just change local position = {getElementPosition(localPlayer)} to a fix one, and then it would be a static cam which would follow a ped. If you need further help, feel free to ask.
    1 point
  15. You have to use a timer or an event which is called every frame (onClientPreRender is what I would use). If you want have a fix position for the cam pos, you can just get the player's pos every time when the functions is called, and then set the camera matrix with the fix pos and the player's pos.
    1 point
  16. I just came back from a long break because of an another motorcycle accident. Feels awesome mate.
    1 point
  17. آخ يقدمك ذذ , لو تذكر قبل سنتين اتوقع كنت مسوي موضوع حق مود شوب ادمن المهم انا قاعد اطلب الفنكشنات واحاول اسوي واحد ولقيت واحد منشور واخذته وقلت حق ربعي هههههههههههههههههههههههههههههههههههه بصراحة وقتها كنت بسب نفسي xDD مدري لو تتذكر الموضوع ذاك ولا لا بس شيك عليه في حسابي الثاني @[iMr]-WFi,.! -- ^ هذا حسابي القديم فيه ماضي اسود وحالك جداًً بس انا عتزلت سنة ورجعت لها ومستواي تطور وشكراً على التحطيم لذاك الوقت كنت استاهله xDD === ترا عندي ماضي اسود اكثر من كذا الي يبي يسمعه يحط لايك ذذ ,
    1 point
  18. ذا مثال كامل اي شي تكتبه بالايدت وتضغط الزر راح الكل يشوفه كلينت local screenW, screenH = guiGetScreenSize() aWindow = guiCreateWindow(screenW - 367 - 10, (screenH - 216) / 2, 367, 216, "[ Send Text to All ]", false) guiWindowSetSizable(aWindow, false) guiSetVisible ( aWindow , false ) aEdit = guiCreateEdit(0.08, 0.23, 0.88, 0.16, "", true, aWindow) aButton = guiCreateButton(104, 142, 164, 49, "Send Text", false, aWindow) guiSetProperty(aButton, "NormalTextColour", "FFAAAAAA") aLabel = guiCreateLabel(0.00, 0.31, 0.49, 0.06, "", true) guiSetFont(aLabel, "default-bold-small") addCommandHandler ( "f2" , function ( ) guiSetVisible ( aWindow , not guiGetVisible ( aWindow ) ) showCursor ( guiGetVisible ( aWindow ) ) end ) addEventHandler ( "onClientGUIClick" , resourceRoot , function ( ) if ( source == aButton ) then local aText = guiGetText( aEdit ):len ( ) > 2 and guiGetText ( aEdit ) or "Welcome To Server " triggerServerEvent ( "onSendText" , root , aText ) end end ) addEvent ( "onSetText" , true ) addEventHandler ( "onSetText" , root , function ( aText ) guiSetText ( aLabel , aText ) end ) سيرفر addEvent ( "onSendText" , true ) addEventHandler ( "onSendText" , root , function ( aText ) triggerClientEvent ( source , "onSetText" , source , aText ) end ) عشان اثبت لك المشكلة من عندك
    1 point
  19. هي اللاعب اللي مات onClientPlayerWaster السورس حقت مافي داعي تعرف لاعب ثاني الا القاتل
    1 point
  20. addEventHandler("onClientPlayerWasted", root, function() if localPlayer == source then setTimer( function() fadeCamera( false, 0.2 ) setTimer( function() fadeCamera( true, 0.6 ) end, 6000, 1 ) end, 2000, 1 ) local wstd = playSound("wasted.mp3", true) setTimer( function() stopSound(wstd) end,5000,1) addEventHandler("onClientRender", root, ws) triggerServerEvent("takemoneywastedfromzombie", localPlayer) end end )
    1 point
  21. Conf روح لملف messages.xml خش setinterior دور على <> ثاني سطر يمكن اللي ب player غيرها ل log اذا كان
    1 point
  22. اغلبها فاقعة ناصعة اما بعض الالوان الداكنة ماتعجبني اضافة الى ان اللون اختير بعناية فائقة مع شامبو ... اقصد مع اللعبة راح يكون متناغم
    1 point
  23. مو بكسل بكسل ياث*ر باللوب سويتها
    1 point
  24. You're welcome
    1 point
  25. Sorry I was wrong. You need to use pairs () to get the keyname and the value for type,value in pairs(commands["value"]) do for _,value in pairs(value) do if type == "report" then addCommandHandler(value, report) elseif type == "checkAdmins" then addCommandHandler(value, checkAdmins) end end end
    1 point
  26. for type,data in ipairs(commands["value"]) do if type == "report" then addCommandHandler(data[1], report) elseif type == "checkAdmins" then addCommandHandler(data[1], checkAdmins) end end The first value of the ipairs/pairs will be the keyname and the second will be the value
    1 point
  27. ابشر ------------------------------- -- سويت ازرار ااضفية لو احتجنا لو ما احتجنا نحذفهم -- لا تشفر شي حتا اني اعرف الاكواد ------------------------------- GUIEditor = { button = {}, edit = {}, label = {} } local screenW, screenH = guiGetScreenSize() wnd = guiCreateWindow((screenW - 336) / 2, (screenH - 453) / 2, 336, 453, ".:[ Kanz System By |M.r|LooFe| ]:.", false) guiWindowSetSizable(wnd, false) guiSetProperty(wnd, "CaptionColour", "FFFF0000") GUIEditor.edit[1] = guiCreateEdit(72, 35, 241, 32, "", false, wnd) guiEditSetReadOnly(GUIEditor.edit[1], true) GUIEditor.edit[2] = guiCreateEdit(72, 84, 241, 32, "", false, wnd) guiEditSetReadOnly(GUIEditor.edit[2], true) GUIEditor.edit[3] = guiCreateEdit(72, 135, 241, 32, "", false, wnd) guiEditSetReadOnly(GUIEditor.edit[3], true) GUIEditor.button[1] = guiCreateButton(206, 234, 117, 47, "جلب احداثياتي", false, wnd) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF30FE00") GUIEditor.button[2] = guiCreateButton(10, 234, 117, 47, "تعطيل/تفعيل الماركر", false, wnd) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF30FE00") GUIEditor.button[3] = guiCreateButton(206, 300, 117, 47, "موافق", false, wnd) guiSetFont(GUIEditor.button[3], "default-bold-small") guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FF30FE00") exx = guiCreateButton(110, 391, 117, 47, "اغلاق", false, wnd) guiSetFont(exx, "default-bold-small") guiSetProperty(exx, "NormalTextColour", "FF30FE00") GUIEditor.label[1] = guiCreateLabel(13, 35, 49, 22, "Pos X :", false, wnd) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 48, 254, 0) GUIEditor.label[2] = guiCreateLabel(13, 88, 49, 22, "Pos Y :", false, wnd) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetColor(GUIEditor.label[2], 48, 254, 0) GUIEditor.label[3] = guiCreateLabel(13, 135, 49, 22, "Pos Z :", false, wnd) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetColor(GUIEditor.label[3], 48, 254, 0) GUIEditor.button[4] = guiCreateButton(10, 300, 117, 47, "حذف الماركر", false, wnd) guiSetFont(GUIEditor.button[4], "default-bold-small") guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FF30FE00")
    1 point
  28. فكره جميله صراحه تسلملي حبيب قلبي
    1 point
  29. المود شغال 100 % ومعرب الاكونت وكل شيء بس ابي اتحقق ان م يقدر يسوي نفس الرسالة الهوا الحساب فقط مو الباقي
    1 point
  30. اخوي اعذرني كتبت حرف كابيتل وهوا يجب يكون سمول بالسطر الرابع بكلمه Player عدلتها تفضل local marker = createMarker (2229.6000976563,487.39999389648,20.8, "cylinder", 2, 255, 0, 0) addEventHandler ("onMarkerHit", marker, function (player) if getElementType (player) == "player" then if getElementData (player, "Group") == "[MiCrO]" then local veh = getPedOccupiedVehicle (player) if veh then fixVehicle (veh) end end end end )
    1 point
  31. طول عمرك مبدع يا تنطيل و فعلا الللوحة رائعة استمر حبيبي
    1 point
  32. Would be great if you gave us more details, like what is a country chat script....
    1 point
  33. 1 point
  34. هههههههههههههههههههه الله يعافيك
    1 point
  35. سوف نعمل على تطوير العمل في الايام القادمة بإذن الله </>
    1 point
  36. Which programs did you use to create this? - And if there's the possibility, could you bring me any tutorial to learn how to do this stuff? I'd be glad!
    1 point
  37. MTA:World - проект, который планировалось запустить в сети Prineside, и о котором речь шла в группе ВК (https://vk.com/mta_w, в новостях больше информации о проекте), выложен в свободный доступ на GitHub под лицензией MIT, так как разработка остановлена и сервер не будет запущен (причины этого так же можно найти в новостях группы). Исходный код, ресурсы и более подробное описание на GitHub: https://github.com/prineside/mtaw Лицензия MIT разрешает делать с кодом что угодно. Если вы планируете продолжить разработку или просто хотите узнать, как реализованы некоторые функции, желаю успехов!
    1 point
  38. Не могло вас забанить за макрос
    1 point
×
×
  • Create New...