Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 19/05/20 in all areas

  1. Olá e bem-vindo ao fórum. Para manter o local organizado temos os respectivos sub-fóruns, por isso, sempre que criar um tópico por favor crie-o dentro do sub-fórum Portuguese / Português. Você pode encontrá-lo pela página inicial do fórum da forma mostrada abaixo: Isso evitará o trabalho que os moderadores têm diariamente de mover posts para os locais certos. Sempre que criar um novo tópico, certifique-se que esteja na devida categoria. No sub-fórum Português ficam todas postagens na linguagem portuguesa, enquanto que fora da categoria Other languages só é permitido posts em inglês, por isso, sempre que responder um tópico, preste atenção a isso.
    1 point
  2. It is not as if players can download every file from the server. If they could, they would be able to steal all your stuff. You need to serve the file first with a webserver. Read: https://wiki.multitheftauto.com/wiki/Resource_Web_Access <html src="sound.mp3" raw="true" />
    1 point
  3. السلام عليكم ورحمة الله وبركاته مجتمع الاتحاد العرب | ArabsUnity يحتوي على مجتمع كامل من ناحية تفاعل الادارة واخدماتنا وسيرفراتنا كل العاب شغاله على اون لاين MTA , Minecraft , TeamSpeka , يعني مجتمع كامل يوجد عدد كبير من الادارة حرصهم وتواجدهم على المجتمع الكبير يعني ما اقول انى عنصري من ناحية المجتمعات الاخرى كله افضل من الثاني بداية مجتمعنا من سيرفر ام تي اي حرب العصابات الى ما بدا الى الاعلى ونطمح على الافضل انشاء الله من ناحية الاداب و الاحترام الادارة و الادمنية موجوده كل مجتمعنا نختار الافضل من مطورين مستمرين معنا بشكل متواصل كل هذا لجلكم وشكرأ لكل الي دعم مجتمعنا الاتحاد العربي IP Server MTA : mtasa://91.218.66.181:22003 IP Server TeamSpeka : arabsunity القادم اجمل انشاء الله نشكر كل من ساهم معنا وقف معنا الى الان مستمرين ومتواصلين معكم وشكرأ لكم
    1 point
  4. You're welcome ? You're welcome ?
    1 point
  5. السلام عليكم ورحمة الله وبركاته اسعد الله اوقاتكم بكل خير ، وأسأل المولى عزوجل أن يقينا ويقيكم شر كل داء ويحفظنا بحفظه .انه لمن دواعي سروري أن اكتب موضوعي هذا مبينا فيه السلسلة التاريخية لسيرفرنا والتي قد مرت بأزمات وصعاب ولكن بفضل من الله ثم بعزيمتنا تصدينا لها ولا أخفيكم انه من اهداف موضوعي هذا اود ايصال رسالة شكر لكل من ساهم في نجاح السيرفر منذ تأسيسه الى وقتنا الحاضر وكلنا نعلم أن من لايشكر الناس لا يشكر الرحمن . بداية تم تأسيس السيرفر ع يد -Mr-Wael -EBDA3 حيث أنهم قد استمروا الى حين انضمام المبرمج @Mr.Talal07 ولايخفى عليكم انه كان شمعة من شموع البرمجه واسم لامع حيث قاد هؤلاء الثلاثة السيرفر الى ان اصبح سيرفرا منافسا بعد ذلك بسبب ظروف المؤسسين فقد تم اعتزالهم وقمت انا محدثكم MAX-511 باستلام السيرفر سنتين انضم خلال هذه الفترة وبعد اعتزال المبرمج انذاك mrdk-ly @Do_De<3 حيث انهم قاموا بمجهودات عظيمة يصعب ان يتم جحدها او نكرانها بينت وفائهم لاصدقائهم وصدقهم واخلاصهم توقفت انا بسبب تخرجي وعدم القدرة على التفرغ الى تسليم ia7bk حيث كان مثالا للصبر والحكمة ولكن بسبب الظروف نفسها للسابقين فقد اعتزل وتسلمت الامور الى Howlywood والذي هو مستمر في فترته الحالية دون توقف في هذه الفترة انضم المبرمج نصور والذي هو السبب بعد الله في نجاح السيرفر هذه الفترة وذلك لما يقدمه من مودات وبرمجه ولمسات سحرية يعجز اللسان ان يصف جمالها كما لا ننسى شخصين من افضل مصممين المابات M3LM SHB7 تصميمهم الابداعي ولمساتهم الجميلة في المابات تزيد جمال السيرفر فلذلك ان كل مادفعني اليه الامر الى ايصال شكري لهؤلاء الاشخاص الذين حق لي فخرا ان اذكرأنني قمت بالعمل معهم حيث كانوا كالرجل الواحد وبالكلمه الواحدة حيث انني اريد رد الجميل لما يقدمونه ويسهرون ويتعبون ولكن لكل منهم دعوة اخويه في ظهر الغيب لا يعلمونها وفي النهاية اعتذر عن الاطاله ونوعدكم بالافضل دام مبرمجنا نصور ومصممينا موجودين مع احتمالية عودة صاحب السيرفر وائل والمبرمج السابق انكسار ضض والسلام عليكم ورحمة الله وبركاته تقبلوا تحياتي
    1 point
  6. Tente: local marker = createMarker (2493.1730957031, -910.67498779297, 125.1, "cylinder", 1.0, 255, 69, 0, 60 ) function verificacao() for i, player in ipairs(getElementsByType("player")) do --Verificação de todos os players do servidor if isElementWithinMarker(player, marker) then -- Verifica se algum player está no MK, se si: outputChatBox("Alguém esta no Marker!") end end end setTimer(verificacao, 500, 0)
    1 point
  7. Actually it does, you can use the second argument to detect if he's still pressing "holding" or not, so if he released the key this means he's not holding it anymore.
    1 point
  8. It's not stealing, shared resources are considered as an open-source, so everyone can learn from them. At least that's my opinion
    1 point
  9. A shame, the way I am currently doing it is with onClientResourceStart. I was hoping there might be a more efficient way to do it - guess I'll just have to continue adding an event handler in each file that makes use of this shorthand reference to a resource's exports.
    1 point
  10. As far as I know, the only way to solve this is to use event handlers so I'd recommend you to use onResourceStart or onClientResourceStart and re-define the reference.
    1 point
  11. الأجنبي طفش فالاسبوع 4 مرات يحول للقسم العربي ههههههههههههههههههههههههههههههههههههههههههههههههه ^ + إذا قصدك تغير مكان المود فـ جرب مثلاً حط ليبل فوق الشاشة وجيب احداثياته وحط الإحداثيات فالمود ذا
    1 point
  12. ليه ما رديت علي علي موضوع اقدم من كدا الموضوع له سنتين يا الحبيب ??
    1 point
  13. Doesn't the event onClientKey detects hold? hmmm Well if it doesn't: local nextCharacterRemoveTime = 0 local characterRemoveInterval = 200 function checkCharacterRemove () if getKeyState ( "backspace" ) then -- https://wiki.multitheftauto.com/wiki/GetKeyState local timeNow = getTickCount() if timeNow > nextCharacterRemoveTime then nextCharacterRemoveTime = timeNow + characterRemoveInterval -- strip the string! end end end function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end local function backspacePress ( button, press ) if button == 'backspace' then if press then if not isEventHandlerAdded("onClientRender", root, checkCharacterRemove ) then addEventHandler("onClientRender", root, checkCharacterRemove) end elseif isEventHandlerAdded("onClientRender", root, checkCharacterRemove ) then removeEventHandler("onClientRender", root, checkCharacterRemove) end end end
    1 point
  14. We are still up running, feel free to join us at our: Discord: https://discord.gg/C6gBnTZ IP: mtasa://185.53.130.227:22003 Forums: https://creativegamingrpg.com/index.php
    1 point
  15. Nunca usei essa função, mas acho que assim dá: givePedWeapon(testPed, 0, 1, true)
    1 point
  16. Lua tutorial for absolute beginners This tutorial can also be viewed on GitHub This tutorial aims to teach the Lua scripting language to those with 0 previous experience with programming / scripting. This guide will start with explaining some Lua concepts, and will later on move to explaining MTA:SA specific concepts. Table of contents: Lua Scripts Variables Data types Operators If statements Functions Return values scopes & locals For loops Tables Iterators (pairs/ipairs) Callbacks Anonymous functions MTA Server & Resources Server vs client MTA functions & wiki Elements (userdata) Command handlers Event handlers predefined globals server <-> client communication Now what? Lua This part of the tutorial discusses Lua itself. No MTA-specific concepts will be discussed here. Scripts The Lua scripting language is a language which is interpreted by a "Lua interpreter". MTA:SA's resources use such an interpreter to run Lua code. For the beginning of this tutorial you can use the online Lua interpreter available on https://www.Lua.org/demo.html. Any code in the Lua part of the tutorial can be run on this website. Lua is written in "plain text". This means it exists of regular characters like any other text you are writing. To edit Lua files you will require a text editor. You could use Notepad, but there are many far better alternatives. My personal favourite is Visual Studio Code, but there are many other good options, to name a few: Atom, sublime text, notepad++ Lua files are usually saved with the .Lua file extension Variables The first concept we're going to discuss is variables. Variables allow you to store a value in your code. For example: x = 10 print(x) print(x) will output the value of the x variable. We will get into what exactly print is later in the tutorial. Variables can have any name you want, as long as you follow some specific rules. variable names must start with a letter (lower or upper case), or an underscore (_) variable names may contain letters (lower and upper case), numbers and underscores. x = 10 y = 20 z = 30 print(x) print(y) print(z) The convention in Lua is to name your variables in "camelCase". This means if a variable exists of multiple words you start every word with a capital letter, except for the first one. camelCaseVariable = 5 Data types So far we've seen variables used to store numeric values, but there are many different types of data Lua can handle. These are: number Any numeric value string A piece of text, a string is surrounded by " or '. For example "Hello world" or 'Hello world' boolean A boolean is a data type that has only 2 options, true and false. nil nil is a value indicating nothing. It's the absence of a value. (Not the be confused with 0) table Tables will be discussed later in the tutorial userdata Userdata will be discussed later in the tutorial function Functions will be discussed later in the tutorial thread Threads are out of scope for this tutorial and won't be discussed So we can use these different data types, and store them in variables: numberVariable = 10 stringVariable = "Hello world" booleanVariable = true nilVariable = nil Operators Operators are symbols in Lua which can be used to do "things" with variables. Here's a list of operators and an example for each: + operator Adds two values together x = 10 + 10 print(x) y = 20 print(y) z = x + y print(z) - operator Subtracts a value from another value x = 10 - 10 print(x) * operator Multiplies two values x = 10 * 10 print(x) / operator Divides a value by another value x = 10 / 10 print(x) % operator This is the "modulo" operator. This will divide a value by another, and return the leftover. x = 10 % 4 print(x) The result of this is 2 and operator The and operator will return true if both variables are "truthy". Otherwise it returns false (A "truthy" value is anything except for false and nil) x = true and false print(x) y = true and true print(y) or operator The and operator will return true if one of the variables are "truthy". Otherwise it returns false x = true or false print(x) y = false or false print(y) == operator The == (equals) operator will return true if both of the variables are the same. Otherwise it returns false x = "hey there" == "hello there" print(x) y = 150 == 150 print(y) ~= operator The ~= (does not equal) operator will return true if both variables are not the same. Otherwise it returns false x = "hey there" ~= "hello there" print(x) y = 150 ~= 150 print(y) > operator The > (greater than) operator will return true if the first value is greater than the second value. Otherwise it returns false x = 10 > 5 print(x) y = 10 > 15 print(y) y = 10 > 10 print(y) >= operator The >= (greater than or equals) operator will return true if the first value is greater than, or equal to, the second value. Otherwise it returns false x = 10 > 5 print(x) y = 10 > 15 print(y) y = 10 > 10 print(y) < operator The < (less than) operator will return true if the first value is less than the second value. Otherwise it returns false x = 10 < 5 print(x) y = 10 < 15 print(y) y = 10 < 10 print(y) <= operator The <= (less than or equals) operator will return true if the first value is less than, or equal to, the second value. Otherwise it returns false x = 10 < 5 print(x) y = 10 < 15 print(y) y = 10 < 10 print(y) .. operator The .. (string concatanation) operator allows you to add two strings together. x = "Hello" z = "World!" combined = x .. " " .. z print(combined) If statements An if statement allows your code to decide to do something, or not. Depending on a value. Often times if statements are used in combination with some of the above operators. An if statement is written as : if <expression> then <code> end x = 10 if x > 5 then print("X is higher than 5") end Any code between then and end will only be executed when the expression is true. You might also have noticed that the code between the then and end is moved over a bit to the right. This is called "indentation". Whenever we open a new scope (scopes will be discussed later in the tutorial) we move our code to the right. This is usually done by either a tab or several spaces . Many code editors will convert a tab to spaces. Else Within an if statement, you can also add an else block. The code in such a block will be executed when the code in the if block is not executed. x = 10 if x > 5 then print("X is higher than 5") else print("X is not higher than 5") end Elseif If you want to do multiple if statements, you can use an elseif: x = 15 if x > 10 then print("X is higher than 10") end if x > 5 then print("X is higher than 5") end x = 15 if x > 10 then print("X is higher than 10") elseif x > 5 then print("X is higher than 5") end The difference between the first example and the second is that if x is higher than 10 in the first example both lines "X is higher than 10" and "X is higher than 5" will be output. Whilst in the second example only "X is higher than 10" will be output. And if statement must always start with an if, can contain multiple elseifs, and may only have one else. name = "NanoBob" if name == "NanoBob" then print("Hello world!") elseif name == "Brophy" then print("Black 123") elseif name == "Tombaa" then print("Stupid") else print("I have no idea") end Functions Functions allow you to write less code, by reusing pieces of code. The syntax to create a function is function <name>(<parameters>) <code> end function foo() print("Hello world #1") print("Hello world #2") end In order to execute code in the function, you "call" the function. You do this by writing the function name followed by (). function foo() print("Hello world #1") print("Hello world #2") end foo() foo() foo() Functions also allow you to send a variable to the function, for it to do something with. This is what's called a function parameter. Function parameters are defined in the brackets () after the function name. function foo(x) print(x) end foo(10) foo("50") You may notice that this looks a lot like the print() we have been using. This is because print is a built-in Lua function. Return values A function not only can execute code, it can also give something back to where it was called. This is called a return value. In order to return something from a function you use the return keyword. function foo() return 10 end x = foo() print(x) print(foo()) Just like in an if statement, all code within a function is indented. Now let's combine everything we have learnt so far: function foo(x) if x > 10 then return "X is higher than 10" elseif x > 5 then return "X is higher than 5" else return "X is not higher than 5" end end y = foo(15) print(y) print(foo(10)) print(foo(0)) Scopes & locals We quickly encountered scopes before, and said we indent our code whenever we enter a new scope. But scopes allow you to do more than that. Most importantly, "local" variables. A local variable is only available in the scope it was defined in (or scopes that were created from within that scope) You can create a new scope using a do block (functions and if statements also have their own scope). do local x = 5 print(x) end print(x) do local x = 5 do local y = 10 print(x) print(y) end print(y) end For loops (For) loops are ways in scripting / programming to have code executed multiple times, without having to write the same thing multiple times. An example of such a loop: for i = 1, 10 do print(i) end The first part : i = 1, 10 defines a variable called i. Which start at 1. This will be incremented by 1, until it reaches 10. The code within the loop then can use this variable. You can also increment with a different number than 1 (including negative numbers) using this construct. for i = 20, 0, -2 do print(i) end This code sample will start with i at 20, and keep adding -2 (thus subtracting 2), until it reaches 0 Tables Tables are a datatype in Lua which allows for lists of things. Here's an example: x = { [1] = 100, [2] = 200, [3] = 300 } print(x[1]) print(x[2]) print(x[3]) Tables consist of key/value pairs. In the example above the key 1, has the value 100, 2 has the value 200, and 3 has the value 300. You can get the value in a table, by putting the key in between square brackets []. Like in print(x[1]). x = { 100, 200, 300 } print(x[1]) print(x[2]) print(x[3]) You can choose to not include the keys in a table. Doing so will automatically add numbers as keys, starting at 1. So the above example would be the exact same as the first example. Table keys and values can be of any data type, including other tables. This allows you to create (very) complex table structures. t = { [1] = { 100, 200, 300 }, ["x"] = 100, [true] = "something" } print(t["x"]) print(t[true]) print(t[1][1]) print(t[1][2]) print(t[1][3]) When using a string as the key in a table, you can leave out the square brackets and the quotes. This goes for both when defining the table, and for indexing it (getting a value from it). For example t = { x = 100, y = 200, z = 300 } print(t.x) print(t.y) print(t.z) A table's values can be modified / set after creating the table as well. t = {} t[1] = 10 t[2] = 20 t[3] = 30 t["x"] = "banana" t[true] = false t.x = "banana" When using tables you will often want to add something to the "end" of a table. This is most common when you are using tables with numeric keys. In order to do this you can use a # to get the amount of items currently in the table. t = { 10, 20, 30 } t[#t + 1] = 40 This will store the value 40 on the key 4 , because #t is 3. Iterators (pairs/ipairs) Iterators are a mechanism that allow you to make a loop, which goes over a set of values. Writing your own iterators won't be discussed in this tutorial. But there are two functions which are often used to create an iterator to iterate over a table. These are pairs and ipairs. t = { 10, 20, 30, 40, 50 } for key, value in ipairs(t) do print(key, value) end The difference between pairs and ipairs is the order in which the key/value pairs are iterated over, and which of the key/value pairs are iterated over. Where ipairs will always use numeric keys, starting at 1, and going up by 1 every time, until there is no entry in the table. This also means it won't iterate over anything key that is not numeric. t = { ["x"] = 5, [1] = 10, [2] = 20, [3] = 30, [5] = 50, } for key, value in ipairs(t) do print(key, value) end A pairs loop will iterate over any value in a table, but the order is not guaranteed. Meaning that between different runs of the script the order could be different. t = { ["x"] = 5, [1] = 10, [2] = 20, [3] = 30, [5] = 50, } for key, value in pairs(t) do print(key, value) end Callbacks Callbacks are when you pass a function as an argument to another function. To have the function you passed be called later on. This is used often within MTA. An example of a Lua function which uses a callback is table.sort. table.sort will sort a tables values, by default these values are sorted numerically. But you can use a callback to change this behaviour. values = { 5, 4, 3, 6, 8, 1, 2, 9, 7 } function sortFunction(a, b) return b > a end function reverseSortFunction(a, b) return a > b end table.sort(values, sortFunction) print("Sorted: ") for _, v in ipairs(values) do print(v) end table.sort(values, reverseSortFunction) print("\nReverse sorted: ") for _, v in ipairs(values) do print(v) end In the first call to table.sort (table.sort(values, sortFunction)) you can see the sortFunction function is passed as second argument to the function. Note that we don't write sortFunction() here (notice the brackets difference) because that would call the sortFunction function, and pass its return value to table.sort. table.sort will then call this function when it compares two different values, this function should return true or false depending on whether its second argument (b in this case) is larger than it's first argument (a), in the context of sorting. Anonymous functions It is also possible to use an "anonymous function" when passing a callback to a function. values = { 5, 4, 3, 6, 8, 1, 2, 9, 7 } table.sort(values, function(a, b) return b > a end) print("Sorted: ") for _, v in ipairs(values) do print(v) end table.sort(values, function(a, b) return a > b end) print("\nReverse sorted: ") for _, v in ipairs(values) do print(v) end MTA This part of the tutorial discusses MTA specific constructs. Code in this part of the tutorial won't run in the online Lua interpreter. You will need to set up a (local) server for this. Server & Resources By default when installing MTA:SA a server is installed as well. This server is located in the "server" directory of your MTA directory. This is usually at C:\Program Files (x86)\MTA San Andreas 1.5\server. This directory contains an MTA server.exe file, running this file will start a server. Scripts on a server are grouped by resources, a single resource can consist of multiple script files and other assets such as images, sounds, fonts, mods and more. Resources are placed in your mods\deathmatch\resources folder in your server folder. A resource is always in its own directory. A resource must always have a single meta.xml file. This file tells the server (among others) what script files to load. A typical meta.xml file looks like this: <meta> <script src="vehicleSystem.Lua" type="server"/> <script src="vehicleMods.Lua" type="client"/> </meta> You will need an entry for every .Lua file you want to have executed on the server. You can start a resource by typing start <resource name> in the server console (the window that opened when you started MTA Server.exe). The resource name is the name of the directory your meta.xml is in. (This may not have spaces). Starting a resource will start running the Lua scripts, if you've changed your scripts you will need to restart the resource for the changes to take effect. (restart <resource name>). Server vs client Lua code can be executed in one of two places. The server, or the client. Server sided scripts are executed on the actual machine that is running the MTA server.exe process. Client sided scripts are executed on the computer of every player that connects to your server. Server sided and client sided scripts have a distinct difference in responsibility and possibility. Some functions for example are only available on the client, whilst others are available only on the server (and many on both). Note: Some of these functions which are available both server sided and client sided are different on server and client MTA functions & wiki In plain Lua there's not much you can do to affect a game engine like MTA:SA. This is why MTA:SA offers a (large) list of functions available for you to use in your scripts which interact with the actual GTA world. You can find a list of all of these, what they do and how to use them on the MTA wiki. Server sided functions Client sided functions shared functions An example of such a function is createObject(). This function will create a physical object in the game. The wiki page contains information on how to use it (what arguments it expects, and in what order). And often shows an example of how to use it. createObject(1337, 0, 0, 3) Elements (userdata) At the start of this tutorial we quickly mentioned userdata data types. These are data types configurable by the implementation of Lua. In this case, MTA. MTA uses userdata to represent "elements". Many things in MTA are elements, like objects, markers, peds, players, user interfaces, vehicles, etc. On the MTA wiki you will notice many functions either return elements, or require an element as arguments. A list of different types of elements can be found on the MTA wiki. Elements also have a hierarchical structure to them. Elements can have a "parent", and multiple "children". This will result in a tree of elements, the element at the top of this tree (and thus the grandparent of all elements) is called the root element. Command handlers Often times in MTA you want certain things to happen when a player enters a command. This is done using command handlers, command handlers use a callback, which we previously discussed. The wiki contains a page for the addCommandHandler() function. For this example we will be using the server side version. function handler(player, command, argument) outputChatBox("You entered " .. command) if argument ~= nil then outputChatBox("You used the argument " .. argument, player) end end addCommandHandler("banana", handler) This example also uses the outputChatBox() function, this will output a piece of text to the chat.(in this case, only for the player who executed the command) The callback function passed to addCommandHandler will be called every time a player uses the /banana command ingame. Event handlers Besides having your script do things when a user executes a command you likely want the game to respond to many different types of things that happen in the game. Like players taking damage, coming close to something, etc. These things are called events. Whenever an event is triggered you can run a piece of Lua code. You do this using event handlers. Event handlers are created using the addEventHandler(). The first argument to the addEventHandler() function is the string name of the event. These can be found on the MTA wiki as well. Server sided events Client sided events An event is always triggered for a specific element, for example "onPlayerWasted" is triggered on the player that was wasted (killed). You can attach an event handler to a single element to only have your callback function be called when the event is triggered on that specific element. But you could also use the root element here and your function will be called for every element the event is triggered on. function handlePlayerDeath() outputChatBox("You died!!", source) end addEventHandler("onPlayerWasted", getRootElement(), handlePlayerDeath) The getRootElement() function used in this example returns the root element discussed earlier. You can also see source is used in this code snippet, we'll talk about that some more in the next section. predefined globals MTA has some predifined global variables for you to use in your script. A list of them can be found on the wiki. Here's a couple notable ones and what they're used for root The root element, same as the return value of getRootElement()) source The element an event handler was called on. An event's wiki page always describes what the event source will be for the event. localPlayer The player element for the player whose client the script is running on. (Thus only available client sided) client Will be discussed in the next section server <-> client communication As stated earlier in this tutorial scripts can run either on the server, or one of the connected clients. However often times you would want to trigger something on the server from a client, or the other way around. An example of this would be when the user clicks the login button on a GUI (Graphical user interface) the server should try to log that person in, and send him back whether or not this was successful. This can be done using events. MTA allows you to create and trigger your own events, and these events can be triggered from server to client (and the other way around). You can do this using the addEvent() function. Once an event has been added (and marked as remotely triggerable by passing true as second argument to addEvent()) you can call it from server/client. You do this using [triggerClientEvent()]https://wiki.multitheftauto.com/wiki/TriggerClientEvent() and triggerServerEvent() respectively. Server sided: function handlePlayerLogin(username, password) outputChatBox("You tried to log in with the username " .. username, client) end addEvent("LuaTutorial.Login", true) addEventHandler("LuaTutorial.Login", root, handlePlayerLogin) Client sided: function pretendLogin() triggerServerEvent("LuaTutorial.Login", localPlayer, "username", "password") end pretendLogin() This example will trigger the "LuaTutorial.Login" event from the client sided script. And passes the "username" and "password" arguments to the event. The server then handles this event in the handlePlayerLogin() function, which in our case just outputs something to the chatbox. In this example you can see the previously mentioned client global variable. This variable is set to the player element corresponding to the client the event was triggered from. (And is thus only usable when used in an event handler which has been triggered from a client). Now what? With this information you should be able to start scripting, and making things in MTA! If you didn't understand it all in one go, or you have any more questions there is no shame in that! You can find myself and many others willing to help you with your scripting questions in the #scripting channel on the MTA discord. Another good source for programming / scripting related questions is stack overflow.
    1 point
  17. Multi Theft Auto قوانين منتدى .الرجاء إتباع هذه القوانين لضمان بقائك هنا .Multi Theft Auto اهلاً ومرحباً بكم في منتديات باختصار شديد .استخدم التفكير السليم ولا تفعل أي شيء يسبب لنا المتاعب لضمان عدم تسبيبنا لك المتاعب ايضاً حسابات المستخدم .لن يسأل طاقم مشرفين المنتدى او فريق المطورين عن كلمات المرور الخاصة بحساباتك في المنتدى أو اللعبة او الخدمات الأخرى .(في مثل هذه الحالة (أنظر أدناه لمعرفة معلومات الاتصال الخاصة بنا IRC إذا فقدت معلومات حسابك القديم يمكننا مساعدتك في استرجاعهم. تواصل معنا على .يمكننا دمج حسابين أو أكثر في حساب واحد عند الطلب هذا المنتدى قد يستخدم تفعيل يدوي للحسابات من قبل إدارة المنتدى كوسيلة لإيقاف الهاربين من الحظر وال سبام بوت بسبب هذا، حسابك قد لا يتم تفعيله .مباشرة الرجاء عدم إنشاء حساب إضافي لأنه لن يتم تفعيله بشكل أسرع، إلا إذا كنت تحتاج إلى حساب إضافي أو قد مرت 24 ساعة منذ تسجيلك للحساب الأصلي ولم تتلقى أي رسالة تفعيل على الإيميل. .يمكن للمستخدم امتلاك أكثر من حساب، طالما لن يتم استخدامهم لكسر قواعد المنتدى أو أي أفعال خبيثة مثال: الهروب من الحظر أو التلاعب بإحصائيات المنتدى .استخدام حسابات متعددة لوضع آراء مزيفة عن السيرفرات أو الإستضافات أو المودات إلخ.. ممنوع بتاتاً :وبالمثل، نحن نسمح بمشاركة الحسابات، باستثناء الحالات التالية .الحساب المشترك لديه حقوق المشرف - مشاركة مثل هذا الحساب غير مسموح به إطلاقاً .واحد من المستخدمين المشاركين للحساب محظور .(الحساب مشترك بنية المصلحة الشخصية بواسطة واحد من المستخدمين (مثال: التلاعب بإحصائيات المنتدى .الحساب مشترك بنية تخريب موضوع في المنتدى عن طريق وضع ردود خارج الموضوع نصائح عامة .الرجاء استخدام زر البحث لمعرفة ما إذا كان سؤالك قد سؤل من قبل .إذا لا تستطيع معرفة مكان مشاركتك، يمكنك البحث عنها. فيمكن ان يكون قد تم نقلها .الرجاء تصفح صفحة الويكي أولاً إذا لديك مشاكل .هذا المنتدى يتم إدارته من قبل أشخاص متطوعين. الرجاء احترام جهودهم، كما أنهم يفعلون هذا في وقت فراغهم .يمكنك التظلم من حظر او قرار اتخذ من قبل احد المشرفين - انظر للنصائح ادناه لمعرفة الطريقة الصحيحة للقيام بذلك .إهانة مشرف أو الدخول في مجادلة معه هو ليس الطريقة الصحيحة لفعل هذا. يمكنك توقع إجراءات إضافية منا إذا فعلت هذا نصائح عن وضع المشاركات .إذا تريد إنشاء موضوع، الرجاء استخدام القسم المناسب له. يمكنك إيجاد الأقسام في الصفحة الرئيسية الخاصة بالمنتدى .تأكد من إضافة عناوين واضحة لمواضيعك. بعض العناوين التي تتكون من كلمات مثل "ساعدوني" أو "ارجو القراءة" .ليست واضحة على الإطلاق .الرجاء تجنب المشاركات المزدوجة .لا تقم بإعادة وضع مشاركة أو موضوع أو محتوى أكثر من مرة في أقسام مختلفة .لا بأس أن تعيد مشاركة ترجمة محتوى قد تم كتابته بالإنجليزية في الأصل في قسم اللغات الأخرى (أو العكس) طالما أن هذا لا يكسر القوانين الأخرى .إذا يوجد موضوع مشابه لذلك الذي تريد أن تُنشئه، شارك في هذا الموضوع، بدلاً من إنشاء موضوع جديد يمكنك رفع موضوع قديم إذا قد تم إنشاؤه بواسطتك، أو إذا الموضوع يخص مشكلة أنت أيضاً تواجهها. يرجى القيام بهذا باعتدال، وفقط بعد مرور بعض الوقت منذ أن شاركت. .إذا كنت تنوي أن ترفع موضوع خاص بالدعم في شيء ما، يجب تزويد بعض التفاصيل عن المشكلة في المشاركة الجديدة، إذا كانت متوفرة .الرجاء استخدام الأقتباس باعتدال. عادة لا داعي لاقتباس محتوى الكاتب الأصلي كاملاً، أو المشاركة التي توجد مباشرة فوق مشاركتك، فيرجى عدم فعل هذا إذا كنت تحتاج إلى إضافة كود في مشاركتك، اضغط الزر '<>' وقم بأختيار نوع الكود الذي ترغب في وضعه في مشاركتك .هذا يجعل كودك سهل للقراءة ويزود الكود بألوان لتسهيل قراءته وتمييزه .عند مشاركة أكواد في هذا المنتدى، أنت توافق على أن تدع الكود يبقى ظاهر للكل حتى يتقرر خلاف ذلك من قبل إدارة المنتدى لا تقم بالرد على المشاركات المزعجة أو المشاركات التي تخالف قوانين المنتدى بشدة، يرجى الإبلاغ عنهم بدلاً من ذلك! السبب لهذا هو أنه إذا قمت بالرد على سبام بوت، ردك سوف يبقى حتى وإن قمنا بحذف جميع المشاركات التي تمت من قبل ال سبام بوت. هذا لا يترك لنا عمل أضافي فحسب، بل أنه من الممكن أيضا ان يؤدي إلى التعليم على حسابك بالخطأ لإزالته بسبب مشاركة محتوى غير مرغوب فيه. في نفس الوقت، يرجى الملاحظة أننا سوف نقوم بتجاهل البلاغات الصادرة بشأن خلاف ناشئ بين بعض المستخدمين التي يقوم فيها المبلغ بالطلب منا أن .(نقف في صف أحد منهم (المخالفين قوانين المنتدى العامة في الأقسام الرئيسية كل المشاركات يجب أن تكون باللغة الأنجليزية ويجب أن تكون في الأقسام المناسبة. للغات غير الأنجليزية، لدينا قسم خاص باللغات الأخرى: هنا. .قد يتم رفضها MTA طلبات معرفة تواريخ الصدور أو موقع الأختبار التجريبي أو معلومات بشأن المميزات المستقبلية لـ العنصرية و التعصب و النشاط الغير قانوني غير مقبول بأي شكل من الأشكال، سواء كان ذالك مشاركات أو صوراً أو تواقيع. ويشمل هذا الصور الإباحية و العنصرية، و اللغة العنيفة و الأهانات من أي نوع. كسر هذه القاعدة يمكنه أن يؤدي إلى فرض حظر فوري. .لا تقوم بإهانة أو انتحال شخصية أعضاء المنتدى .تجنب الوقوع في جدال ديني بقدر ما يمكن. هذا منتدى للعبة. وليس منتدى لمناقشة المعتقدات والجدال فيها. ليس لدينا أي مشاكل مع أي من معتقداتك، فقط لا تجرنا لهذا ."لن يتم التسامح مع إثارة المشاكل و"الحروب المشتغلة .التهرب من الحظر لن يتم التسامح معه و سيتم التعامل معه بصرامة .عدم وضع ردود تحتوي على الابلاغ عن هاكات او اشخاص او اياً كان خارج إطار المنتدى، وكذلك يمنع التحذير منهم .يمنع إتهام شخص بسرقة مودات .لا يسمح بالتصرف كأحد المشرفين. إذا كنت ترى أن شيئاً ما يجب القيام به حول موضوعاً أو مشاركة أو عضواً قم بالإبلاغ عنه و دع القرار للمراقبين .الخاص بنا EULA لا تشارك أي شيء ضد ال .MTA لا تضع أي برنامج يمكن أن يستخدم للغش في اللعبة بـ .MTA لا يحق لك الإعلان عن منتجات او خدمات او مواقع تحتوي على مضمون غير مرتبط بـ بموقعنا. .إذا كنت ترغب في الإعلان عن السيرفر الخاص بك أو خدمة استضافة سيرفرات - استخدام القسم المناسب لذالك هنا قونين الملف الشخصي (500x150 | 720x80 يجب أن يكون إجمالي حجم الصور في توقيعك في حدود (بيكسل .أي شئ اكبر من هذا الحجم قد يتم ازالته عندما تتم ملاحظته .يجب للتوقيعات أن تستخدم أحجام خطوط معقولة وفقط عدد محدود من الروابط التظلم من قرار مشرف ومعلومات الإتصال .(#mta قناة GTANET شبكة) IRC يمكنك التواصل مع مشرف عن طريق الرسائل االخاصة المدمج بمنتدانا، أو ابحث عنه في القناة الخاصة بنا على الرجاء عدم التواصل مع العديد من المشرفين أو المدراء عن نفس الموضوع. يمكنك التواصل مع مشرف آخر إذا لم يتم الرد علي مشكلتك بعد مرور 48 ساعة على الأقل. .مشرفينا يتم اختيارهم من قبل اعضاء موهوبين ونشطين من مجتمعنا. نحن نثق في القرارات التي يتخذونها .مع ذلك، إذا لست راضٍ عن قرار مشرف معين، يمكنك التواصل معه مباشرة عن قلقك. تأكد من أن تكون مؤدب واشرح وجهة نظرك جيداً .إذا ما زلت لست راضٍ عن القرار، يمكنك التواصل مع مشرف أعلى رتبة ليحل المسألة. كما أعلاه، كن مؤدباً واشرح وجهة نظرك أفضل من ذلك التظلم من الحظر .إذا تم حظرك، يرجى عدم المبادرة بإنشاء حساب جديد في المنتدى. إذا فعلت ذلك، سوف يتم حظرك مرة أخرى لهروبك من الحظر، ومدة حظرك الأصلية ستزيد #mta في irc.gtanet.com IRC بدلاً من ذالك يمكنك طلب أزالة الحظر في القناة الخاصة بنا أو عن طريق الاتصال بنا بوسائل أخرى (@ - operators and % - halfops أبحث عن الأسماء الي تحتوي على علامات مثل) .إذا كنت محظوراً في القناة أيضاً، لا تحاول التهرب من الحظر. أطلب من شخص آخر الأتصال بنا .على حسب مخالفاتك، سنصدر مدة لألغاء حظرك. عندما تنتهي المدة، أطلب منا مرة أخرى لإلغاء حظرك .يمكنك أيضاً التظلم من حظر دائم أو كلي. لكن تذكر، في مثل هذه الحالة، ينبغي لك أن ترينا بعض الندم أولاً .(يرجى الملاحظة أننا قد نرفض طلب إلغاء حظرك لأي سبب (مثال: بسبب السلوك المسيئ تجاه مدير إذا كنت تريد رفع الحظر عنك في أحد سيرفرات أم تي أي، يرجى الأتصال بمالك السيرفر فنحن لا يمكننا رفع الحظر فليس لدينا أي سلطة على ذلك السيرفر، أسهل طريقة للأتصال بصحاب السيرفر هي عن طريق الذهاب إلى موقع السيرفر أو البحث عن معلومات أتصال في القسم الرئيسي القوانين الخاصة بالأقسام الأقسام (غير الإنجليزية) العالمية .التوجيهات الأساسية. يمكن لقواعد إضافية أن تنطبق، على حسب القسم .يمكنك فقط المشاركة في هذه الأقسام إذا تتكلم اللغة الخاصة بهم. غير ذلك، لا تشارك هناك .بالإضافة إلى ذلك، المناقشات الإنجليزية غير مسموح بها في هذه الأقسام بشكل عام. المشاركة بالإنجليزية في هذه الأقسام يمكن أن يؤدي إلى صدور تحذير بعض الإستثناءات تنطبق - إذا أنشأ مشرف موضوع في مثل هذه الأقسام بالأنجليزية، حينذلك يمكن للمستخدمين الآخرين (فقط هؤلاء الذين يتكلمون اللغة الخاصة بالقسم) أن يشاركوا بالإنجليزية في هذا القسم أيضاً. General Multi Language discussion المشاركة بالإنجليزية مسموح بها (ويفضل ذلك) في قسم .قد يكون الإشراف في بعض الأقسام محدود إذا ليس لدينا مشرفون فصيحون في اللغات الخاصة بهذه الأقسام البرمجة ستتم إضافة قوانين لاحقاً المساهمات ستتم إضافة قوانين لاحقاً الخوادم ستتم إضافة قوانين لاحقاً القسم العام ستتم إضافة قوانين لاحقاً ملاحظة بسيطة بخصوص هذا القسم: لا مشكلة في المشاركة في المواضيع القديمة فيه Other او مدير منتدى إذا لم تتلقى رد في وقت مناسب Lead Global Moderator إذا لم تعد تنوي زيارة منتدياتنا، يمكننا أزالة حسابك الشخصي، يمكنك الطلب من اي .نحن نحتفظ بحق عدم إزالة مشاركاتك عند إزالة حسابك، لأنه يمكنهم أن يكونوا مفيدين لبعض المستخدمين الآخرين لكن تذكر، يجب أن تكون عضو نشيط في المنتدى Other Languages نحن نبحث عن مشرفين جدد بإستمرار، خصيصاً في الأقسام غير المراقبة في قسم .ويكون لديك عدد كبير من المساهمات للمنتدى حتى يتم أخذك بعين الإعتبار من قبلنا ما نعتبره مساهمات للمنتدى: مشاركة محتوى مفيد أو أصلي، مساعدة أعضاء المنتدى، الإبلاغ عن المشاركات والمواضيع المزعجة ومساعدتنا في تنظيم المنتدى. ما لا نعتبره مساعدة: وجود عدد هائل من المشاركات التي تحتوي على محتويات عادية (غير مفيدة) أو مناقشات منتظمة. ناهيك عن كسب هذا العدد بطرق تخريبية. .IRC للتقدم بطلب إشراف، الرجاء التواصل مع مشرف عن طريق رسالة خاصة أو عن طريق ال .تذكر أن طلبك سوف يتم مشاركته مع المشرفين الآخرين. هذا لضمان أن الطلب يتم مناقشته وتقييمه بصورة صحيحة .إذا فشلت في الإلتزام بهذه القواعد، قد يتم حذف مشاركتك او موضوعك فوراً بدون سابق إنذار و (أو) قد تواجه عقوبات إضافية بحسب شدة المخالفة -- فريق MTA ملحق أ - المصطلحات .رفع موضوع يحدث عندما يقوم مستخدم بالمشاركة في أحد المواضيع بنية وضعه في أعلى قائمة المواضيع الخاصة بالقسم لجذب الإنتباه ملحق ب - قائمة الإجراءات الإدارية الممكنة لانتهاء القواعد .(رسالة خاصة عن شكوى من المشرف (عادة هذا فقط الذي يحصل، على شرط أن يكون المستخدم متعاون معنا .(تحذير (ينتهي بمرور الوقت، يمكن أن يرُى في حساب المستخدم; الحصول على 3 تحذيرات أو أكثر في نفس الوقت يمنع المستخدم من المشاركة .(تقييد المشاركة (أي مشاركات أو مواضيع جديدة تمت بواسطة المستخدم قد تتطلب موافقة من مشرف .(حظر مؤقت (لا يمكن للمستخدم دخول المنتدى خلال وقت معين; اي حظر إضافي سيكون بمدة أطول .(حظر مؤبد (كما في الأعلى، باستثناء أن المدة لا تنتهي; يمكن إزالتها بواسطة رفع تظلم حظر كلي من كل الخدمات (نظراً إلى المخالفات المستمرة الحادة، أو استغلال الثغرات، أو استخدام برامج غش في اللعبة، أو مشاركة مود خطير; تمنع المستخدم .(ويتضمن ذلك اللعبة أيضاً MTA الوصول إلى أي شيء يخص ال .(رفع شكوى على المستخدم للمزود الخاص بالانترنت الذي يستخدمه (آخر وسيلة إذا المستخدم مازال يسبب لنا مشاكل
    1 point
  18. تنبيه: إذا قد تلقيت تحذيرين, فإن ثالثهما حظر, والمدة تعتمد تقديرياً على ما فعلت, فإن كررت الخطأ بعد فك الحظر, ستزيد المدة, إلى ان تصل المدة إلى دائمة
    1 point
×
×
  • Create New...