Leaderboard

  1. Lord Henry

    Lord Henry

    Other Languages Moderators


    • Points

      436

    • Content Count

      3,185


  2. IIYAMA

    IIYAMA

    Scripting Moderators


    • Points

      336

    • Content Count

      5,351


  3. DNL291

    DNL291

    Moderators


    • Points

      199

    • Content Count

      3,759


  4. Patrick

    Patrick

    Scripting Moderators


    • Points

      148

    • Content Count

      804



Popular Content

Showing content with the highest reputation since 11/08/19 in all areas

  1. 39 points
    Multi Theft Auto: San Andreas 1.5.7 is released Today we are proud to announce the release of MTA:SA 1.5.7. You will receive an automatic update soon, but if you don't have MTA installed, you can get it from the home page. This is the final release to support Windows XP and Vista — if you still use Windows XP or Vista, upgrade Windows now. We are also looking for a web designer to help us create a new website! Statistics Multi Theft Auto: San Andreas turned 10 years old last week. Happy birthday! This is the 24th 1.x.x release 359 days since our last release 27 new functions 4 new events 117+ bug fixes and changes 540+ commits 30 contributors, of which 7 are new 64+ total contributors Download This release is backwards compatible with the older 1.5.x releases (1.5.6, 1.5.5, all the way to 1.5). However, if you would like to take advantage of all of these useful changes, you will need to go and download the update! Servers: binaries are available. Do not forget to update your default resources. Highlights This release includes many additions, improvements, and fixes: New drawing functions dxDrawPrimitive and dxDrawMaterialPrimitive Improved performance Fix swimming speed on higher FPS Skimmers can now lift off water at high FPS New events onClientWorldSound, onClientPedStep, onClientVehicleWeaponHit Surface property functions like engineSetSurfaceProperties and much more! Read the 1.5.7 release notes for a complete set of changes and more information about the improvements listed above. Watch or star our GitHub repository to keep on top of all the things we're working on. Important future script changes From 1.6 onwards we will be making at least the following changes: callRemote callbacks currently set the error code to nil when there is no error. In 1.6, to be consistent with fetchRemote, the error code reported will be 0. See GitHub #294. Since July 2016 if you provide an invalid string like "randomstring" when a function expects a number, the string will be treated as 0 and raise a script warning. In 1.6 this will be an error. You will still be able to provide strings containing numbers (e.g. "100" and "12.34"), this change only affects invalid strings. See GitHub #1043. When providing a width and height of (0, 0) to createBrowser or guiCreateBrowser you will encounter a script error instead of a warning. The warning was introduced Feb 2019. See GitHub #1069. Some functions expect only unsigned integers (positive numbers), and since Jan 2016 providing negative numbers would be a warning. This will now be an error. See GitHub #1070. Since Aug 2015, we replaced the custom mtalocal:// URL scheme with http://mta/resourceName/blah.html. This mtalocal:// URL scheme will now be removed. See GitHub #1071. This list is inconclusive and we may introduce more changes later. What's next? Multi Theft Auto depends on community input and contributions. To keep a project like MTA going we need LOTS of people. You can help in the following areas: Designing We are looking for a web designer to help us create a new website. Testing and bug reporting Whenever you encounter a bug or recognise a need for improvement, we can't fix it until you tell us your problem! We're continually working on new features and fixes for MTA, and this always needs testing. Join our Nightly release stream (Settings -> Advanced -> Update build type) and make sure you keep in touch with on Discord and report issues on GitHub. Programming If you know C++ you may be interested in helping improve Multi Theft Auto's client. Working on open-source software may seem scary, but the best way is to try! Read GitHub's open source guide, and then find an itch to scratch, or scratch your own! Documentation Documentation is important, but also time consuming. If you enjoy writing and have some knowledge of English, or you would like to translate the English version to your native language, you’re very welcome to do so. Just head over to our wiki, create an account, and start editing! Support Do you like people? Can you give calm and thought-out responses to users needing help? Then you can spend some time providing support to those who need it. Many answers can be found on our wiki, so make sure to take some time to read it. Then, either join our chat or forums (linked below), or simply help us sort out issues and answer questions on the GitHub repository. Translation Want to translate MTA to your own language? Awesome! Visit us on Pootle. As soon as your translation is approved, it will be pushed to our repository for use in future releases. Donations Keeping the MTA downloads, master server and websites alive costs money! If you want to help us sustain our financial expenses, please donate! Thank you! Thank you to the following community members for their donations this year: Arran, [RUS] Artem Smirnov, Atti, (SAUR)Castillo, CEKfile, .:CiBeR:., Dmi7ry, HACKER99, Malone, Nero, Nicolae Vlad, pentaflops, Platin, -ffs-Sniper, Tapleto-Hos Thank you very much to the following community members for their work towards this release: Addlibs, Arran, CrosRoad95, Dezash, Dutchman101, FileEx, forkerer, Haxardous, lex128, lopezloo, LopSided, Neproify, nonamenoname, ricksterhd123, samr46, StrixG, tederis, TheNormalnij, xerox8521, xLuxy and many others who contributed to our wiki and helped out with issues. (If your name is missing or you want to change your entry above, please let us know on Discord!) You could be on this list! We're always on the lookout for new contributors. Contribute on GitHub, and chat with us on Discord. We have channels for scripting, general support (bugs), mod development, and many more! Finally, please give a 👋 to our newest contributor @myonlake and our newest addition to the MTA team @botder! Hope you've had a great summer! — MTA Team
  2. 27 points
    Hello. 2019 is nearing to an end, so here is our traditional "A year in Recap" post for you. Below you can find the summary of what has happened this year - along with the current status of an entry (where applicable) and other things that might be interesting to you. 📰 2019 in Recap Late January, we have refreshed our Forum Rules - we gave them a new look and rephrased a bunch of paragraphs to make them more clear and easier to follow. In May, we have decided to drop support for Windows XP and Vista in our future releases. These operating systems are no longer supported by Microsoft and only a handful of our players still use them. We have advised our players to upgrade their PCs to newer Windows versions. While Windows 7 support will be soon ended by Microsoft as well, we still intend to support it in MTA:SA for a while. In July, we have opened an User Guides section on our forums, which aims to provide our users with quality guides and tutorials for various MTA-related topics. We are still looking into improving this concept. On 31st of August, we have released Multi Theft Auto: San Andreas 1.5.7. This release was focused on performance improvements, minor scripting additions and bugfixes. It is still the current release and, as mentioned above, is the last main release for Windows XP and Vista. On the same day, we have asked you guys to help us re-design our community website. The work on the new community is currently on hold however. Later in September, Rockstar Games has released GTA: San Andreas for free on their launcher app (for a limited time). We have added support for it in MTA:SA shortly after. 26th of October marked the 15th anniversary of Grand Theft Auto: San Andreas original release on PS2. While it was not the game we started with, it was the game that allowed us to make MTA the successful mod it is today. 📺 A bunch of interesting MTA:SA-related YouTube videos from this year MTA SA: SAPDFR Online Gameplay 171 (Flaming in the Cold) - server SAPDFR.org, video by Armor23OnPatrol [DM] NeiT ft. Gteatero ft. nX_ - Demons Skills 3 - video by GercszTV FBX replace per element feature - concept and video by CrosRoad95 [MTA SA] Let's play S.T.A.L.K.E.R. - server ex-zone.ru, video by TEDERIs MTA:SA - Legend Mercy Tactics - video by TheGam3r23 MTA:SA Hydra Stunts 2019 [SW]Supa Innovation - video by SupaHotFire 📈 Current player counts and version fragmentation statistics Type Amount of players Date / Time Recent peak number of concurrent unique players 31808 players 2019.12.15 (at 17.30 GMT) Highest recorded number of concurrent unique players 34653 players 2018.02.03 (at 17.30 GMT) Recent number of daily unique players 132450 players 2019.12.21 (Saturday) Highest recorded number of daily unique players 185818 players 2018.02.03 (Saturday) Recent number of monthly unique players 531728 players November, 2019 Highest recorded number of monthly unique players 805903 players January, 2018 Player counts were lower than the ones from last year, but they're still large. Again, it's great to see that so many players are still interested in GTA:SA even though it's over 15 years old now! MTA:SA Version or series Percentage of players using that version or series as of 22nd of December, 2019 1.6.0 (old-alpha) 0.1% 1.5.7 97.80% 1.5.6 1.20% 1.5.5 (and older) 0.70% 1.4.x 0.1% 1.3.x 0.1% The latest stable version is the most popular one - and that's good. 📟 Status updates Not much to say at the moment. Things have slowed down a bit, but we are working towards the next release. That's it for now. ☃️❄️Happy Holidays and best wishes to all of you in 2020! 🥂🎆 -- MTA Team
  3. 19 points
    Hey, i reworked mta community webpage. I apologize in advance for my bad english ❤️ Russia power!
  4. 15 points
    For long time i considered to do something with physics in mta. For now doing even simplest things such falling box, tree on flat area looks cartoonish. In my history of i saw few attempts of doing simple physics, mostly it was in closed area without bigger interactions with poor performance due you just can't calculate collision in other way than processLineOfSight, isLineOfSightClear or read directly .col file as Tederis did. I started with something to render things, thats how FBX https://github.com/multitheftauto/mtasa-blue/pull/1093 to bypass default rendering to handle future i'll introduce in future. That's how bullet physics project born, first idea how to use react physics, works simillar but is lighter and general smaller project but 0x416c69 suggested to use bullet. I'll use this topic also to prepare long list of features it contains for future copy paste to PR and wiki page The main assumption is to allow for create multiple world with completly independed simulations, get and set detailed information about current step of simulation, fully control how everything is simulated, quality of collision tests, speed and a lot more. i'm trying keep amount of functions low, because if that most stuff is packed into one function. Syntax and name of some function might change in future or along suggestions. Not all properties supports every physics element, some are only get, other set only, however most of them are set/get Current stage: I already implemented function such a: physics physicsCreateWorld() - responsible for creating new world for simulations, return element which will use later. physics-rigidbody physicsCreateRigidBody( shape-type, mixed arguments ) - creates rigid body which is use to simulation bahaviour of non-static shapes, collisions ( currently only few models in mta can do this in simple way ). physics-rigidbody physicsCreateRigidBodyFromModel( model ) - used to create rigid body directly from collision data taken from gta model. physics-static-collision physicsCreateStaticCollision( shape-type, mixed arguments ) - creates static collision which will not move at all ( it is still possible to move it by Lua script ) physics-shape physicsAddShape( shape-type, mixed arguments ) - if you create compound shape, this function let you add more shapes into static collision or rigid body bool physicsSetProperties( any physics element, physics-property, mixed arguments ) - main function to control physics, rigid bodies, static collisions, shapes. Works in simillar way as handling functions. mixed physicsGetProperties( any physics element, physics-property ) - same as above, but getting properties bool physicsDrawDebug( physics ) - use to visualization of world, must be used in render function bool physicsSetDebugMode( physics-debug-mode, enabled ) - use to turn off/on debugging features bool physicsBuildCollisionFromGTA( physics ) - used to create static collisions in specified world from original collisions, doesn't create whole world instantly, require to move player around world to load collision data. physics-constraint physicsCreateConstraint( physics, physics-rigid-body, physics-rigid-body, constraint-type, mixed arguments ) - use to connecting two or more rigid bodies into one entity bool physicsApplyForce( physics-rigid-body, vector from, vector to ) - pushing rigid body in particular point you choosed. bool physicsApplyCentralForce( physics-rigid-body, vector direction ) - apply force from central position of rigid, it's more like "accelereate", should be used more than once at the some period of time bool physicsApplyCentralImpulse( physics-rigid-body, vector direction ) - setting position from center of rigid bool physicsApplyDamping( physics-rigid-body, float force ) - i'm not sure, but it should slow down velocity and rotation of model by specified amount of units physicsApplyImpulse( physics-rigid-body, vector direction ) - i'm not sure how it works physicsApplyTorque( physics-rigid-body, vector rotation ) - same as physicsApplyCentralForce but for rotation physicsApplyTorqueImpulse( physics-rigid-body, vector rotation ) - setting rotation speed physics-properties: "mass", "position" ,"rotation", "sleepingthresholds", "restitution", "scale" "debugcolor", "filtermask", "filtergroup", "stiffness" `sleepingthresholds` means how slow rigid must move/rotate to sleep, it makes stops moving at all but still can be pushed by other rigids `restitution` bounciness, between 0-1 but accept any value above `stiffness` - for fixed constraint `filtermask` i still figuring out how it work, but should let you use 32 bit mask to set which rigid with which should collide Bullet documentation: https://github.com/bulletphysics/bullet3/blob/master/docs/Bullet_User_Manual.pdf page 13 contains useful information when which shape should be used physics-constraints: "pointtopoint", "hidge", "fixed", "slider" Physics-shapes: "box", "sphere", "capsule", "cone", "cylinder", "heightfieldterrain", "compound", "trianglemesh", "convexhull" `compound` is used for constructing rigid made of various shapes Plans for future: "heightfieldterrain" shape type accept black-white texture for faster creation Support for cloths, soft bodies Media: Videos are availiable at my youtube channel https://www.youtube.com/channel/UC95MpsQ1JppDNpMvl_7c1rg screenshots and gifs of current progress: Documentation i use: https://pybullet.org/Bullet/BulletFull I'm waiting for your suggestions Topic not finished
  5. 14 points
    Today i proudly present to you: OSWS (OpenSourceWaterShader) for MTA: San Andreas! What is this? This resource is a project that i started long ago in order to finally (!) get a decent water shader working for MTA that benefits everybody. The main goal is to get an amazing shader where everyone should contribute to make it the very best looking water that we can get for this game engine. The code is pretty well optimized and the performance should be good for everyone, but a shader model 3.0 graphics card is REQUIRED for this resource! The effect is applied to the water texture itself. It is NOT a post-processing water shader. This means that we do not have to deal with any issues that come with post-processing, for example smoke and any other effect that is rendering behind the drawn water. The downside of this method is the fact that we can not (as far as i know) add refraction to the stuff that is below the water surface. But maybe some genius knows a way to make it happen, or fix the rendering issues of post-processed water. Stuff like that is the main reason why i decided to make this resource a community project, improvements for everyone! Features: Water reflections, surface refraction: Shore fading, shore foam: Dynamic_sky support with sun + moon specular lighting: DOWNLOAD: https://community.mtasa.com/index.php?p=resources&s=details&id=18239 DOWNLOAD DYNAMIC_SKY RESOURCE BY @Ren_712: https://community.mtasa.com/index.php?p=resources&s=details&id=6828
  6. 13 points
    Draw distance v1.0.2 This resource improves the draw distance of all your resources that make use of map files. It makes your maps 10x more beautiful in my opinion! Greatly improves the draw distance of map objects Maxed out the draw-distance for peds and vehicles. (See MTA settings > video: Render vehicles always in high detail + Render peds always in high detail ) Multi-resources support (this effect is applied on every mapRoot element) Parallel loading method is used, but the loading speed is in that case reduced to improve performance. The effect is not only applied on resources that are starting, but also resources that are already running. Download here This resource is uncompiled! Repository: https://gitlab.com/IIYAMA12/draw-distance Video - Created by @Anx1ty Comparison Starting at 200 units distance 400 units distance (this is the distance where a lot of objects will be unloaded, but in this case switched with lowLOD objects) And even on 600 units distance, it is technically visible -> (while the fog is slowly eating it up... ) Download here Can all hardware run this? --> I have no idea... most likely 😷. Just give it a try.
  7. 11 points
    ServerIP: Our Discord: https://discord.gg/aR4kGxY OUR FORUM: https://forum.redcountyrp.net/ TEAMSPEAK: 116.202.33.23 Sky Roleplay is made to create the ultimate roleplay experience. Sky Roleplay is a medium/heavy roleplay server, based in Red County. Sky Roleplay has many custom interiors, unique mappings, many unique scripts and last but not least, realistical roleplay experience. Features: Vehicle Sounds Mappings Interiors ETC.. ______________________________________________________________________________________________________________________________________________________________ We Also have host alot of different events for the players with rewards and try to spice up the player experience. Screenshots from the server: DMV: FD: Hospital: The Montgomery Park: The Town Hall:
  8. 10 points
    I'm excited to show you my latest tool. This time it is something different than my previous tools. It is a bigger project which came to my mind over 2 years ago. I failed at first time because I had trouble with rotations (built in mta function doesn't work well so I had to use quaternions which caused problems as well). Moreover one of devs was working on new editor and he was going to add multi selection option but he cancelled the project. After 2 years I decided to finally write it and also add few additional features. Many hours spent on the tool, thousands lines of code but here is it. I hope you like it and find it useful. Personally I think it should speed up your mapping a lot. Few features might look complicated (actually they are easy to use) so I advice watching or reading tutorial carefully. Features Let's see what this tool is capable of! Create groups of elements using various selection tools and element filters a. edit their position and rotation around all axes b. change their properties - all popular element types are supported c. clone / delete options d. large group support enables you to move / edit whole parts or even maps Duplicate 2 groups Change pivot position Add groups to library a. browser with search and sort options b. loading big groups enables you to join many maps into 1 c. import option which adds all MSTU groups from a given map Cover groups a. create your own cover variations or object compositions b. default cover settings makes covering even faster Customize tool settings on your own needs Download More info and full tutorial you will find here: https://www.thecrewgaming.com/forum/showthread.php?tid=2467&pid=12255#pid12255 Support me If you want to support me leave feedback and also you can buy me a coffee so I won't starving. Thanks a lot! Buy Coffee Feel free to ask questions below or via PM/discord. I'm also opened for script requests. I will keep updating the tool in case you find some bugs. Discord: https://discordapp.com/invite/C4TRxr8
  9. 10 points
    Hello MTA:SA community, i release now all my Selfmade Gamemodes and Scripts. INFO: You have a error, warning or otherwise? Then write me a DM(Direct Message) or add me on Discord (DorteY#3099) and write a DM there. Hud (Script): https://github.com/DorteY/mtasa-selfmadehud Cops 'n' Robbers (Gamemode): https://github.com/DorteY/mtasa-copsNrobbers (Updated: 10.12.2019) Zombie Apocalypse (Gamemode) https://github.com/DorteY/mtasa-Apocalypse (Updated: 12.12.2019) Lakeside Reallife (German) (Gamemode) https://github.com/DorteY/mtasa-LakesideGER (Updated: 25.12.2019)
  10. 10 points
    Lua tutorial for absolute beginners 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.
  11. 9 points
    About We hear you, “another role-play server? Guess it’s an edit again” – but that’s not the case. Advanced Gaming is, back again, getting things ready to provide our loyal players with what we do best: next level scripts with a nice balance between realism and fun in each and every script. With at least 10 years of experience on the MTA platform and countless sleepless nights, we present to you: A role-play script written from scratch! If you remember us from back in 2015, hi there! If you don’t, no worries. We’ve been here before and life got in the way, we took over a project (SAPD:FR) which required less of our attention and made it possible for us to get a few things straight as a community but also in our personal lives. Now that we're back we're more than ready to finally put full dedication into this project and bring you guys a brand new twist into the MTA:SA Roleplay scene with a brand new script with some never before seen features, so without further ado let's go on with what we have to offer! Features Since a role-play gamemode requires constant changes, new features and removal of features... we’re not going to list all of our features (we know, it’s a lot, we all hate reading). To give you a glance of what we got to offer, we would love to invite you to our server and just give it a shot (when it’s released), if you want to know what our deal is, here’s a glance of what we got to offer: Realistic Vehicle System: We've put countless hours into the details of our vehicle system which allowed us to implement numerous hidden features which we will not yet release to the public, they'll sure blow your mind when you find out about all of it. After hours and hours of study and at least 4 years of experience we've made a perfect balance between the game's engine and physics system to carefully recreate real-life vehicle models in-game regarding handlings which includes top speeds, accelerations, realistic fuel tank capacities and consumptions. FPS-friendly UI: We’ve written our very own custom GUI (graphical user interface) system to create windows, labels, images and what not with ease without frying your CPU and GPU. Balanced Economy: Our economy has been built in a way to promote player to player interaction. How so? Simple, you can forget about getting rich by doing the default jobs, if you want to get yourself some more cash then you're simply going to have to join one of many player ran companies or perhaps even go down the dark path and join a gang? That's up to you, we won't tell anyone and especially not the cops! Jobs and companies, how do they work?: Simple, the entire server will be running on companies instead of default jobs. The default jobs have been made useful for new players (deliveries from our very own storage units, a government funded bus or a taxi driver) but the real fun starts with real people, in real companies. Hurr Durr I’m a big guy on another server, can I..: let me stop you right there, we don’t care about your previous progress on other servers, your entire track list of bans and offenses. Everyone is fair and square as a new player on our server, no advantages and no labels. Items and products: From snacks to meals, from coca-cola cans to glasses of wine, property keys to theory certificates. We've got it all built in with effect, if any. Users are able to purchase some items, other items have to be earned. You'll get a theory certificate after completing your theory for a driving license, a receipt after purchasing something or an empty can after drinking your coca cola. Illegal activities / gameplay: It’s a tough scene, you want to start your own gang or clap your neighbors, we get it. Since the illegal role-play defines or breaks a server, we’re taking close care of the scene with constant monitoring with a team of people. Guns will be distributed passively, drugs will be taken care of (and tested before distribution…). In the trash(bin)! Attention to detail in every script, want to get rid of the annoying receipt you recieved from the store and don't even need it? Simply throw it into one of the many trash bins present around town and let the garbage collectors take care of your junk for you! Police & Criminals: Tired of officers having super cars, heavy duty weapons like AR-15 or server owner-run departments? So are we, which we why we've given the department normal vehicles with fitting handlings which decreases their advantage, increases the experience of both roleplaying as well as the thrill of being a criminal or officer. They're forced to think tactically and plan their actions, their equipment is distributed on a monitored basis to only the higher ranks in the department where we see fit. Giving the illegal roleplay scene space to grow and feel alive And much more!: You want more? We got more! Two number 9s, a number 9 large, a number 6... oh, you meant features? We have a tight schedule of daily bugfixes, weekly updates and weekly announcements regarding progress. Want to see what we're made of? Check us out.. when we've launched! (sorry, I know..) Screenshots Note: This is still Work in Progress, final product may look different! DMV System Trash Bin System Shopping Vehicle Plate System - more info here. Other Where to find us? Since we’re still getting things ready, you’re more than welcome to join us on our discord server. We’re working on the forums, lots of script changes and making sure that you’re getting something new and fun, rather than just another edit. Server IP: Still in development, release date on Friday, April 17 at 21:00 GMT+2 (20:00 for faction leaders) Website: mta.advanced-gaming.org Forums: forum.mta.advanced-gaming.org Discord: https://discord.gg/g3ytB7h Launch Date: Friday, April 17 at 21:00 GMT+2 (20:00 for faction leaders) Note: This thread was written using the Dark Theme, if you spot any issues on the default theme please let us know!
  12. 9 points
    Reason: SERIAL CHANGING + BOT TESTING Serial: 0F51EF5D01C9C9ACAD6B3592A5E62233 Some time ago I coopareted with you @Dutchman101 about my server project "Twoj Serwer MTA" and with duhack we helped u with some problems, and now when I wanted to join to my server I saw this reason. I have no idea what is the reason, maybe thats why cause of using a VPN. But I have never using any type of bot because my mission is to invite new people to play MTA on my YouTube channel: https://www.youtube.com/channel/UCU-21oVPvbBwNSicUcVfItw I hope to get unban asap to create next video Cheers
  13. 9 points
    As one of the developers behind SAES:RPG, the server in question appears to not use any leaked scripts from SAES:RPG (I did a brief check). And it's not like SAES has patented / has a trademark on the idea of our gamemode, so anyone is free to make a gamemode in the same general spirit / idea. With that said, I wish you guys the best of luck.
  14. 9 points
    السيرفر الوحيد اللي اشوف كل واحد يجي يقول مود الوزاره كأن اللعبه مافيها غير السيرفر دا 😅
  15. 9 points
    السلام عليكمم ورحمةة الله وبرككاتههء كيف الححال؟؟ بما إن الحساب الاول مدري ما يبغي يفتح سويت واحد جديد المهم .. سويت مود جديد واخذ الفكرة من مود السوات الى عن طريق المؤشر يسحب ويقتل كذا بس بفكرة ثانية ,, هي ان تحدد علي اللاعب بالماوس وتضغط كليك يمين تسحب كل الرتب حقته وتعطيه رتبة اسمها Admin_Ex يمديك تغير اسم الرتبة من الكلينت وتضغط كليك يسار تفك مخالفته وتسحب منه رتبة الادمن اكس وطبعا فيه حماية من سحب رتب الكونسيل , خلينا نشوف صور طبعا المؤشر يظهر للي معه رتبة اسمها Acl_Ex ويفتح عن طريق الضغط علي حرف M نجي للـتحميل اضغط هنا لتحميل السكربت لازم تحط المود بقروب الأدمن علشان يسحب رتب ويعطي مخالفة * رأيكم يهمني.. إهداء لـ @!#NssoR_) @!#DesTroyeR_,) @N3xT @+Source|> @Mr.Solo @Kareem Amer @Abdul KariM ولكل الموجودين #-
  16. 8 points
    Ok, this was a hard decision to take (regarding privacy and drama), but because we noticed that you made a video in which you're implying MTA made a bad decision, we will now offer some more transparency towards the community to reveal what we suspect you, TheVarus, of doing: See below picture Mirrors (you're probably going to want it gone): Since you have also spread the link to this ban appeal by yourself, I hope this will let your 'blind followers' (who believe your "my serial has been with me for 5 years" claim is something that proves you're right with everything) look at our side of the story as well. Even though the botting and mass serial-changing involvement (which the MTA anti-cheat was fully aware of, and linked back to you) is already enough to permaban you, for the scale of it, lord knows what the things we feel are really going on with your manipulation of the Polish MTA scene would mean for your ban. At least 1 thing is clear, that you won't return, and that there are very good reasons for it. By the way, MTA now made sure your serial changing method no longer works, so you can no longer uphold your botting industry, which in turn (as we can reasonably assume) funds your virtual currency sales industry from the 'mining' proceeds, etcetera etcetera. All to destabilize the 4Life / PyLife ingame economy to benefit the kickstart of your own server. We will protect these MTA communities against someone like you, striving to use their influence for such dirty games.
  17. 8 points
    Project trains This resource creates multiple trains driving around the map and make them drive automatic. It makes San Andreas a little bit more alive. You can set-up how much trains are created, how fast they go, minimal/maximal amount of trainscarts they are pulling and some more. Versions Version 1.0.0 Serverside time synced trains for multiplayer Admin panel settings Version 2.0.0 Uncompiled Better optimised than previous versions. CPU (3,5-3,9 GHz) 4 trains +/- 1.22% usage 40 trains +/- 7.05% usage Overkill Cleaned up a lot of the old code (I wrote this in 2015.. , never the less it is still ugly :C) Added some custom train-cart designs. Fixed all known bugs. Trains won't stop, even in this version. But you can try to make that yourself... Improved bandwidth You can design your own traincarts in the map editor, see documentation after clicking on the lazy download link Bugs: GTA spawn bug: Incorrect train spawn, see documentation. Repository Lazy <you> transport Armed to the teeth Admin panel settings Building your own traincarts with the map editor Download here - project trains 2.0.0
  18. 8 points
    Eai pessoal tudo bom? Eu percebi que muitas das duvidas que o pessoal posta aqui no fórum e também na comunidade, são duvidas muito simples, principalmente com erros de logica, ou mau uso dos recursos da linguagem. Então decidi desenvolver um curso básico para auxiliar quem está começando, nesse curso básico vou abordar os seguintes assuntos: Lógica de Programação & Algoritmo; Condicionais & Variáveis (Básico); Sintaxe & Indentação; Boas Praticas de Programação; Como usar a Wiki; Funções(); Tabelas (Arrays); Scripts voltado ao MTA; Exercícios. Antes que venham falar "Quem é você para fazer um curso?", vou me apresentar: Eu me chamo Marcelo, trabalho com programação a cerca de 7 anos, já trabalhei com desenvolvimento, back-end e front-end. Atualmente eu trabalho na área de SI (Segurança da Informação) prestando serviço como pentester e consultor a uma empresa. Comecei a me envolver com Lua, por que joguei MTA por muito tempo, e percebi que a maioria dos servidores não atendia as minhas expectativas, então junto com um amigo, decidimos criar um novo servidor, o New Dream's Roleplay. Mas como o assunto aqui é o Tutorial, vou me ater apenas a ele, e deixo para falar do servidor outra hora. Lógica de Programação & Algoritmo Para deixar bem claro, vou usar as minhas definições das palavras durante o curso, porque acredito ser mais didática dessa forma. Antes de mais nada vamos deixar bem claro algumas coisas: Programação é lógica, a linguagem e etc, são apenas ferramentas para organizar e dar sentido a essa lógica. Portanto se você dominar a lógica de programação, poderá aplicar ela a qualquer linguagem. Tendo isso em mente, a aplicação da lógica podemos chamar de algoritmo. O Algoritmo por sua vez é uma sequencia de instruções, para a execução de uma tarefa. Claro que levando em consideração que o algoritmo conta com verificações, iterações e etc. Pois bem eu acredito que lógica só se aprenda fazendo, então vamos com alguns exemplos: Para facilitar a vida de alguns de vocês na compreensão, vou utilizar o Portugol como "linguagem" nesses exemplos, e recomendo que usem também nos exercícios. Para acessar o Portugol utilizem o link: http://lite.acad.univali.br/portugol/. Vamos começar pelo código mais repetido do mundo o "Olá Mundo" algoritmo OlaMundo; -- Aqui nos definimos o nome do Algoritmo inicio -- Aqui damos inicio ao mesmo imprima("Olá, Mundo!"); -- Aqui solicitamos que o Computador imprima a frase "Olá, Mundo!" fim -- Aqui encerramos Como podem reparar, toda a formação obedece uma lógica simples, você define, inicia, executa e encerra. Para termos um exemplo mais lúdico, vou usar linguagem padrão e descrever a seguinte situação: Acordar e sair para o trabalho. 01. Abrir os olhos; 02. Olhar o relógio; 03. Levantar da cama; 04. Ir ao banheiro; 05. Sair do quarto, e ir a cozinha; 06. Preparar o café da manha; 07. Sentar a mesa; 08. Comer o café da manha; 09. Lavar a louça do café da manha; 10. voltar ao quarto; 11. Vestir a roupa 12. Sair do Apartamento; 13. Descer o elevador; 14. Entrar no carro; 15. Ir ao trabalho. O exemplo acima é um algoritmo em linguagem padrão, quero que vocês percebam como ele utiliza uma sequencia lógica para executar uma tarefa. Agora, mais a frente iremos ver condicionais e verificações, mas já quero apresentar uma introdução sobre a mesma, nesse exemplo a cima, vamos adicionar uma verificação básica ali em cima na linha 02 01. Abrir os olhos; 02. Olhar o relógio CASO o relógio marque = 6:30 ENTÂO Faça a linha 03. CASO CONTRARIO espere até dar 06:30; 03. Levantar da cama; ... Nesse exemplo colocamos uma verificação simples, caso o horário seja o qual nos queremos, então vamos continuar com o algoritmo, isso é uma condição verdadeira ou falsa, e uma condição única, poderíamos adicionar outra condições por exemplo: 01. Abrir os olhos; 02. Olhar o relógio CASO o relógio marque = 6:30 && NÂO SEJA sabado OU domingo ENTÂO Faça a linha 03; 03. Levantar da cama; ... Aqui estamos adicionando outra verificação, e ambas precisam ser verdadeiras para que a sequencia se complete. Com esses exemplos em mente, vou deixar alguns exercícios para vocês, podem fazer tanto em linguagem padrão como em portugol (recomendo mais o portugol). 1. Acordar e ir ao trabalho; 2. Lavar o carro; 3. Um robô que pegue caixas; 4. Planejar uma viagem; 5. Jogar um jogo. Caso queiram, podem postar o código nesse tópico, e caso tenham alguma duvida, deixem logo a baixo. Só lembrando ao pessoal que já entende do assunto, ou pelo menos sabe o básico, vamos ajudar quem ta começando, todo mundo começou sem saber quase nada. Parte 02:
  19. 8 points
    بسم الله الرحمن الرحيم السلام عليكم ورحمة الله وبركاتة أخبار الشباب عساكم طيبين , اول مساهمة تقريبا وثالث موضوع لي المهم حبيت اطرح ماب الاستراحة لسيرفر كنق الطارة الماب محوله من 2018 وركبته بالسيرفر تقريبا سنه وشوي وقررت اطرحه للعموم وأحول شيء جديد المهم مالكم بالطويلة الماب من تصميمي والمجسم من تحويلي والتكستر من اختياري الماب جاهز ماعليك الا انك تركبة بالاستضافة وتشغله والتعديل مفتوح سواء عالصور او اضافات عالمجسم ورجاءا حفظ الحقوق صور للماب او المجسم مادري اذا الصور بتظهر زمان عالمنتديات طبعا المركبات الي بالصور مو من ضمن الماب ذي عشان تعطي موارد للصورة رابط تحميل الماب و المجسم لااله الا الله,محمد رسول اللة وسلامتكم فأمان الله ورعايته حسابي انستقرام :jn_i ip Server:149.202.89.124:22003 ......
  20. 8 points
    Dear MTA community, I have been spending my last 8 weeks on mathematical problems. One of them is the 3D Frustum-Plane intersection that is used by GPUs to draw triangles onto your screen. If you want to learn more about this please consider reading this thread. Promotional Video: https://www.youtube.com/watch?v=RQy3Q4Xe110 Prerequisites This tutorial is aimed at people who are capable of scientific thinking and are willing to playfully learn with Lua code. To execute steps in this tutorial minimal knowledge of Linear Algebra and Lua is required. Required MTA Resource: https://github.com/quiret/mta_lua_3d_math Description of the math Imagine that we have got a frustum and a plane in a 3D room described by coordinates plus their boundaries. By intersecting both you obtain all coordinates on a screen along with their depth values. Now think about how your vision works. You see distant objects smaller than closer ones. You rotate your eyes to angles of vision. If we were to put this concept into terms of math we could say: the plane of vision is bigger in the distance than in close proximity. The frustum is a seamless row of vision planes starting from the pyramid tip to the bottom. How to use the MTA Resource Just download the GitHub repository into a folder of your MTA Resources, name it "math_3d_nonlin" and start it. You can execute the following commands for quick testing: send_bbuf: draws a simple depth test draw_model: draws the DFF file "gfriend.dff" Now we have got the basics out of the way. Time to start coding. Please create a new "_math_test.Lua" script file in the resource and include it server-side at the bottom of meta.xml. Tutorial: software rendering a plane on screen Open your _math_test.Lua and include the following code: local viewFrustum = createViewFrustum( createVector(0, 0, 0), -- position createVector(10, 0, 0), -- right createVector(0, 0, 10), -- up createVector(0, 20, 0) -- front ); local plane = createPlane( createVector(-3, 10, -3), createVector(6, 0, 0), createVector(0, 0, 6) ); local function task_draw_scene(thread) local bbuf = create_backbuffer(640, 480, 255, 255, 0, 50); local dbuf = createDepthBuffer(640, 480, 1); local time_start = getTickCount(); do local gotToDraw, numDrawn, numSkipped = draw_plane_on_bbuf(viewFrustum, bbuf, dbuf, plane, true); if ( gotToDraw ) then outputDebugString( "drawn " .. numDrawn .. " pixels (skipped " .. numSkipped .. ")" ); end end local time_end = getTickCount(); local ms_diff = ( time_end - time_start ); outputDebugString( "render time: " .. ms_diff .. "ms" ); taskUpdate( 1, "creating backbuffer color composition string" ); local bbuf_width_ushort = num_to_ushort_bytes( bbuf.width ); local bbuf_height_ushort = num_to_ushort_bytes( bbuf.height ); local pixels_str = table.concat(bbuf.items); local bbuf_string = pixels_str .. ( bbuf_width_ushort .. bbuf_height_ushort ); taskUpdate( false, "sending backbuffer to clients (render time: " .. ms_diff .. "ms)" ); local players = getElementsByType("player"); for m,n in ipairs(players) do triggerClientEvent(n, "onServerTransmitImage", root, bbuf_string); end outputDebugString("sent backbuffer to clients"); end addCommandHandler( "testdraw", function(player) spawnTask(task_draw_scene); end ); Result: Try executing the "testdraw" command. At the top of file you see the definition of our frustum cone as well as a plane. By calling the function "draw_plane_on_bbuf" we put color information into bbuf for exactly the pixels that make up the rectangle. If you change the plane definition to... local plane = createPlane( createVector(-2, 10, -4), createVector(6, 0, 3), createVector(-2, 0, 6) ); you instead get this image: Try changing around the coordinates of frustum and plane to obtain different pictures! Tutorial: software rendering a triangle on screen Take the same code as in the tutorial above but change line 19 to: local gotToDraw, numDrawn, numSkipped = draw_plane_on_bbuf(viewFrustum, bbuf, dbuf, plane, true, "tri"); This way we have changed the primitive type to triangle (rectangle is the default). Try executing the "testdraw" command again to inspect the new result! Tutorial: drawing a DFF file onto screen Instead of writing triangle definitions by hand we can take them from a DFF file instead. DFF files are storage of triangle and vertex information along with 3D rotation and translation information. By extacting the triangles from the DFF file we can put them into our algorithm to software-render them! Here is a related excerpt from math_server.Lua: local modelToDraw = false; do local modelFile = fileOpen("gfriend.dff"); if (modelFile) then modelToDraw = rwReadClump(modelFile); fileClose(modelFile); end end local function task_draw_model(thread) local bbuf = create_backbuffer(640, 480, 255, 255, 0, 50); local dbuf = createDepthBuffer(640, 480, 1); local time_start = getTickCount(); local num_triangles_drawn = 0; if (modelToDraw) then -- Setup the camera. local geom = modelToDraw.geomlist[1]; local mt = geom.morphTargets[1]; local centerSphere = mt.sphere; local camPos = viewFrustum.getPos(); camPos.setX(centerSphere.x); camPos.setY(centerSphere.y - 3.8); camPos.setZ(centerSphere.z); local camFront = viewFrustum.getFront(); camFront.setX(0); camFront.setY(5 + centerSphere.r * 2); camFront.setZ(0); local camRight = viewFrustum.getRight(); camRight.setX(centerSphere.r * 2); camRight.setY(0); camRight.getZ(0); local camUp = viewFrustum.getUp(); camUp.setX(0); camUp.setY(0); camUp.setZ(centerSphere.r * 2); local triPlane = createPlane( createVector(0, 0, 0), createVector(0, 0, 0), createVector(0, 0, 0) ); local vertices = modelToDraw.geomlist[1].morphTargets[1].vertices; local triangles = modelToDraw.geomlist[1].triangles; local tpos = triPlane.getPos(); local tu = triPlane.getU(); local tv = triPlane.getV(); for m,n in ipairs(triangles) do taskUpdate( m / #triangles, "drawing triangle #" .. m ); local vert1 = vertices[n.vertex1 + 1]; local vert2 = vertices[n.vertex2 + 1]; local vert3 = vertices[n.vertex3 + 1]; tpos.setX(vert1.x); tpos.setY(vert1.y); tpos.setZ(vert1.z); tu.setX(vert2.x - vert1.x); tu.setY(vert2.y - vert1.y); tu.setZ(vert2.z - vert1.z); tv.setX(vert3.x - vert1.x); tv.setY(vert3.y - vert1.y); tv.setZ(vert3.z - vert1.z); local gotToDraw, numDrawn, numSkipped = draw_plane_on_bbuf(viewFrustum, bbuf, dbuf, triPlane, false, "tri"); if (gotToDraw) and (numDrawn >= 1) then num_triangles_drawn = num_triangles_drawn + 1; end end end local time_end = getTickCount(); local ms_diff = ( time_end - time_start ); (...) end The code first loads a DFF file called "gfriend.dff" and stores it inside the "modelToDraw" variable. Once you execute the "draw_model" command the code looks up the first geometry in the DFF file and fetches all triangles associated with it. The rendering camera is set up to point at the middle of the model. Then all triangles are drawn one-by-one. https://twitter.com/rplgn/status/1230650912345067520 Try swapping the DFF file for another one, like biker.dff, and examine the results! Maybe extract a different DFF file from GTA:SA and replace gfriend.dff with that one. External references: math calculation on paper example: https://imgur.com/gallery/rLvln3X German thread on mta-sa.org: https://www.mta-sa.org/thread/38693-3d-frustum-ebene-schneidung-in-Lua/ Do you have any questions related to the math or the implementation? Do not shy away from asking! I want to provide you with as much insight as I can.
  21. 8 points
    السلامم عليكمم ورحمة الله وبرككاته سويت سكربت فكرته هي فيه مقر حق جيش يتم الانتقال اليه وسرقته طبعا الموضوع يختلف , كيف؟ يعني مثلا فيه فرق بين السرقة.. واحد ما معه رتبة VIP يجي يسرق المقر يوم يدخل المنطقة يظهر للي معه الرتبة انه دخل ويتجمد لمدة من 5 الى 20 ثانية علشان يقدر يدخل او يخرج من المقر وطبعا فيه مميزات للي معه الرتبة وهي: ء - يقدر يراقب المقر لمدة دقيقة عبر كتابة كلمة مراقبة بف8 - يقدر ينتقل بسهولة الى المقر عن طريق فتح لوحة عبر كتابة كلمة open بف8 - يقدر يدخل المقر ويخرج بدون ما يتجمد - يوم ينتقل الى المقر من اللوحة ياخذ سلاح ودم - يقدر يعرف من اللوحة مين دخل المقر ومين خرج وهل انسرق ام لا - يوم يسرق المقر ياخذ مبلغ بين 50,000 و 100,000 بينما الشخص العادي بياخذ بين 5,000 و 10,000 وفيه كمان مميزات يمديك تشوفها بنفسكك بس انا قلت اغير من فكرة سرقة البنك الى منشورة كثير يكون شيء جديد وله مميزات حلووهه ء الصور فيه مشاكل فى رفعها صراحة بس بحاول بعدين اعدل علي المنشور وبحط الصور كلمة فتح اللوحة للي معه الرتبة هي : open كلمة مراقبة المقر للي معه الرتبة هي : مراقبة الرتبة الى تحتاجها بفتح اللوحات وتجربة الخصائص هي : VIP حط السكربت بقروب الادمن علشان يشتغل كويس * رابط التحمييل : إضغط هنا لعيؤون @!#NssoR_) @N3xT @!#DesTroyeR_,) @+Source|> @AcTioN_PRO @Mr.Solo @Kareem Amer @Abdul KariM وكل المنتدي ..
  22. 8 points
    MTA-Communication-Enchantment This is an enchantment that allows you to communicate between clientside and serverside a bit easier. If you know how to work with events, then you probably do not need this, but it has some nice features which allows you to sit back and write less code + achieve some nice results. Note: It is important to keep in mind that this is an enchantment. Which means it is just an layer on top of the basic functionalities of MTA. And most enchantments come with a cost, in this case that is bit of performance. I will keep the information of topic to the minimal, as I have written most of the information already on the repository. You can find the repository here. Examples Syntax Installation What can you do with it? Calling from clientside to serverside Client callServer("hello") Server function hello () outputChatBox("Hello client!") end Calling from serverside to clientside Server addCommandHandler("callclient", function (player) -- An addCommandHandler is needed, because the client hasn't loaded it's scripts yet. callClient(player, "hello") end, false, false) Client function hello () outputChatBox("Hello server!") end Ok, ok, that was boring. The next one this is a bit nicer! Hello are you there? Just Call-me-back... I miss(ed) you too Callback Client callServer( "callbackMe", "argument", function (argument) -- < This is the callback function outputChatBox(argument) end ) Server function callbackMe (argument) return argument .. " < I looked at it :)" end Callback + internal arguments Sometimes you have arguments that you simply can't send over. > functions Or arguments that shouldn't be send over. > LARGE quantities of database data Internal arguments can be used to pass information to a callback without exposing it to the other side(client/server). Client callServer( "callbackMe", -------------------------------- -- arguments that are send over "argument", -- -------------------------------- function (internalArgument, argument) -- < This is the callback function. outputChatBox(internalArgument) outputChatBox(argument) end, -------------------------------- -- arguments that are not send over "internalArgument" -- < internal argument -- -------------------------------- ) Server function callbackMe (argument) return argument .. " < I looked at it :D" end Ha! Serverside what is that? No need for complicated things! Communicate between clients without writing a single line of serverside. Magic! Note: There is serverside used behind the scenes, you just don't have to write it. Client function smile (player) outputChatBox((isElement(player) and getPlayerName(player) or "[unknown]") .. " has send you a: :)") local x, y, z = getElementPosition(localPlayer) setElementPosition(localPlayer, x, y, z + 100) end addRemoteClientAccessPoint(smile) -- < This function allows other clients to call this function. --------------------------------------- -- -- function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end -- Author: TAPL -- https://wiki.multitheftauto.com/wiki/GetPlayerFromPartialName -- -- --------------------------------------- addCommandHandler("smile", function (cmd, playerName) local player = getPlayerFromPartialName(playerName) if player then outputChatBox("Sending smile!") callRemoteClient(player, "smile", player) else outputChatBox("Can't find player!") end end) Turtle, I will wait for you to catch up. So don't worry, you are still cute. Await functions When a player has joined the server, he or she doesn't have download + loaded his scripts yet. This means that you can't deliver your love letter yet and all your work will be for nothing. But what if you don't have to worry about that? You can just wait now! Server addEventHandler("onPlayerJoin", root, function () callClientAwait(source, "testCallClientAwait") end) Client function testCallClientAwait () outputChatBox("Yes this works!") end Security Worried about security issues? Remote calls for C++/MTA functions have been blocked. There is a whitelist feature included, if enabled your code can only remote-call whitelisted functions. (this is disabled by default) Read the docs for that. Here and here
  23. 7 points
    السلام عليكم ورحمة الله تعالى وبركته ( اللهم صلي وسلم على سيدنا محمد عليه الصلاة و السلام ) [AMONG US IN MTA:SA] ( اللعبة الاصلية ( شرح و طريقة لعب هي لعبة مسلية ومليئة بالحركية والإثارة. انظم إلى طاقم قايدة سفينة بينما يتحركون عبر الفضاء... واكتشف أن هناك دخيلا تسلل إلى السفينة بهدف التخلص من طاقمها وتدميرها Among Us! تجري كل الأحداث في لعبة متن سفينة فضاء تتكون من وحدات مختلفة. ابدأ لعبة جديدة -إما على الإنترنت أو ضد الحاسوب- وستحصل إما على دور عضو الطاقم أو دور الدخيل، والذي سيبقى غير مكشوف بالنسبة للاعبين الآخرين. إذا حصلت على دور الدخيل، فإن هدفك سيكون هو التخلص من كافة الطاقم من خلال التسلل إلى السفينة والضغط على زر القتل. أما إذا حصلت على دور عضو في الطاقم، فإنه سينبغي عليك تجنب الدخيل ومحاولة اكتشاف من يكون... قبل فوات الأوان! لهذا الغرض، فإن غرفة محادثة تجمع كل اللاعبين ستظهر بعد الأحداث، وهناك سيكون بإمكانهم مناقشة شكوكهم حول الدخيل بناء على ما عاينوه خلال اللعبة، لينظموا بعد ذلك تصويتا حول الأمر. يمكن للاعبين كذلك التفاعل مع بعض الأشياء التي توجد في غرف السفينة أثناء اللعب. وعلى العموم، فإن لعبة Among Us هي لعبة لاعبين متعددين مذهلة، سواء ألعبتها مع أصدقائك أو مع لاعبين من مختلف أنحاء العالم. اركب السفينة وعش الإحساس باكتشاف المتسلل في كل لعبة! source بعض صور داخل الخادم و هناك الكثير من الشياء الاضافية نظام التصويت - نظام العملة (COIN) - تستطيع انشاء خادم داخل خادم بشراء سيرفر و الطريقة تلقائية - (package) تسطيع فتح صناديق عشوائية نظام - الدخول بطريقة تلقائية حساب عشوائي و كلمة سطر عشوائية - تغير اسم الحساب يتطلب منك مبلغ مالي - يمكنك متابعة احدث الإظافات و الاخبار على الديسكورد - S4CCn6Q يشرفنا و جودك معنا و السلام عليكم و رحمة الله تعالى وبركته
  24. 7 points
    Map files Table of contents: Introduction How to read a map file? Broken map file, what to do? Editor bugged, what to do? Modify your maps outside of MTA Extra links Introduction A map-file! What is that? The name already gives away the definition. It is a file which contains a MTA map. The format makes maps portable, so that you can send them over to your friends. You can recognize map-files by the extension: .map Here is an example of a map: Syntax highlight When you open a map file in your text editor. The syntax highlight you should use is XML (HTML will work as well, but the semantic is different and could cause issues with auto complete features, that is if you have enabled those). Changing syntax highlight in for example Visual Studio Code. How to read a map file? Before we start, this is what we call a node: <tagName></tagName> If we take a closer look to the following map file: <map> <object id="object (bevgrnd03b_law) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="6094" scale="1" dimension="0" posX="635.234375" posY="-3827.2275390625" posZ="5" rotX="0" rotY="0" rotZ="0"></object> <object id="object (gaz9_law) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="6133" scale="1" dimension="0" posX="625.49114990234" posY="-3771.6955566406" posZ="11.479743003845" rotX="0" rotY="0" rotZ="0"></object> <object id="object (CE_grndPALCST03) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="13120" scale="1" dimension="0" posX="573.09802246094" posY="-3847.013671875" posZ="3.6442375183105" rotX="0" rotY="22" rotZ="352"></object> <object id="object (CE_grndPALCST03) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="13120" scale="1" dimension="0" posX="572.64624023438" posY="-3769.0698242188" posZ="4.9519920349121" rotX="0" rotY="21.99462890625" rotZ="343.24649047852"></object> <object id="object (CE_grndPALCST03) (3)" interior="0" collisions="true" alpha="255" doublesided="false" model="13120" scale="1" dimension="0" posX="669.66534423828" posY="-3856.0627441406" posZ="3.6442375183105" rotX="0" rotY="63.99462890625" rotZ="175.99389648438"></object> </map> > we see in there the map node: <map></map> When the map is loaded <map></map> will become our map element. And inside of the map node we see more nodes: <object id="object (bevgrnd03b_law) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="6094" scale="1" dimension="0" posX="635.234375" posY="-3827.2275390625" posZ="5" rotX="0" rotY="0" rotZ="0"></object> <object id="object (gaz9_law) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="6133" scale="1" dimension="0" posX="625.49114990234" posY="-3771.6955566406" posZ="11.479743003845" rotX="0" rotY="0" rotZ="0"></object> In this case these two nodes will become two in-game objects. Tagname <tagName></tagName> Each node in the map file will become an element in game. !important A node has a tag name. In this case I gave it the name: "tagName" This tag name specifies in MTA the element type. For example: If it has the name <object></object>, the element-type is an object. If it has the name <ped></ped>, the element-type is a ped. What if the tag name is not matching with one of these entities? (The list is not complete, the rest can be found in this class list, only if the XML syntax is implemented) Then the elements are considered custom elements. They are not visible in game. Custom elements Custom elements have their own purposes. You often see those custom elements used in game modes, for example stealth: <mercenaryspawn id="mercenaryspawn (1)" posX="635.58117675781" posY="-3770.458984375" posZ="18.97974395752" rotX="0" rotY="0" rotZ="0"></mercenaryspawn> The tagname for this node is "mercenaryspawn". The element that is produced after loading the map, is used as a spawnpoint for in a stealth map. Custom elements are invisible. Custom elements do have an orientation. The getElementsByType function can be used to get custom elements. Attributes Attributes are properties applied to a node. They are used to attach data to an element. Example: <entity name="IIYAMA" age="5" type="device" resolutionX="1920" resolutionY="1080" displaySize="31"></entity> An attribute exist out of two parts: <entity name="value"></entity> Name Value The name specifies if the node has the attribute. <entity name></entity> <entity age></entity> If the name is "name", then the node has the attribute "name". And if the name is "age", then the node has the attribute "age". The value will be used for the data for each attribute. <entity name="IIYAMA" age="5"></entity> Identifiers (ID) Every elements can have an identifier attribute, which is used to make an accessible for scripting functions. <tagName id="identifier"></tagName> The identifier of an element can be used in getElementByID to grant access to it. Even though identifiers normally should be unique for each individual, it is not the end of the world if they are not in MTA. They might also be considered as unnecessary for map files without scripts. Element specific attributes There are some attributes that do more than just applying properties. They will change the element appearance and orientation. For example this object: <object interior="0" collisions="true" alpha="255" doublesided="false" model="6094" scale="1" dimension="0" posX="635.234375" posY="-3827.2275390625" posZ="5" rotX="0" rotY="0" rotZ="0"></object> It will be created in interior 0. It will have collisions. (You can walk on it) Alpha. It's opacity is 100%. It is not doublesided. (When you stand inside of the object you can look through it. If doublesided is enabled the same colors/paint from the other side will be applied.) It's model is 6094. It is scaled 100%. (0.5 = 50%, 2 = 200%) Etc. If you want to know which attributes do have influence on the elements appearance and orientation, you have to look that up on the wiki. Here a small list of some those attributes: Broken map file, what to do? If your map file is broken. Step 1 Make a backup. + Always make a backup when re-editing your map. Settings can get lost! Step 2 The first thing you want to do, is just open it in a text-editor. Just give it a quick look and check for anything strange. The file could be empty or some strange values could be used. Do you want to know all the syntax rules (XML)? You can find a list right here: http://www.adobepress.com/articles/article.asp?p=1179145 Step 3 Remove the editor definition. This definition could cause problems in case of invalid characters. From: <map edf:definitions="COBDEF,editor_main"> <!-- Map elements --> </map> To: <map> <!-- Map elements --> </map> Step 4 If you can't find the problem, then you could validate the file. There are services out there that validate XML files. They can help you to find out where your file is broken. Validation tool by W3C: https://validator.w3.org/#validate_by_input Note: You need to do step 3 first. Else you can't parse the file. Step 5 In case of re-opening map files in the editor, but doesn't want to get open. Make a backup. Remove custom elements. See chapter How to read? Retry to open the file. Editor is bugged, what to do? Your editor could be bugged and you are not able to save the map or open a new one. The first thing you want to do is backup the editor_dump folder in your server. This folder is located between all your resources. server\mods\deathmatch\resources\editor_dump Rename the folder name. editor_dump > my_broken_map Stop the map editor. Check if there is a new editor_dump folder. If there is, rename that one as well. Start the map editor again. Modify your maps outside of MTA Sometimes you want to modify your maps without going back in to the editor. Your text-editor is in most cases the way to go. For example you want to move all objects to a new dimension. In Notepad++: Make a backup! (if you are new to this) Select in your file the part you want to replace: dimension="0" Commando: ctrl + H (replacement overlay) Fill in the replace field: dimension="1" Click on: replace ALL. Moving your map? There is a nice online tool that can help you with that: http://mta.dzek.eu/mmove/ Edit your map with the DOM (Document Object Model) Knowing JavaScript? Your browser inspector can be used to modify your maps at a higher level. (If you so desire) Extra links: Parent, child and how this is reflected in MTA https://wiki.multitheftauto.com/wiki/XML https://wiki.multitheftauto.com/wiki/Element_tree Elementdata <sync_map_element_data /> https://wiki.multitheftauto.com/wiki/Meta.xml Load maps (manually + including in meta.xml) https://wiki.multitheftauto.com/wiki/Meta.xml https://wiki.multitheftauto.com/wiki/LoadMapData Save maps https://wiki.multitheftauto.com/wiki/SaveMapData
  25. 7 points
    Post Anterior: Eai pessoal tudo bom? Continuando o Curso básico, hoje vamos falar sobre Condicionais, Iteração e Variáveis: Para vocês irem se familiarizando eu vou começar a utilizar trechos de código em Lua. Nos exemplos anteriores além de utilizamos apenas linguagem padrão, e portugol, nos utilizamos apenas execuções sequenciais, ou seja, o algoritmo poderia apenas executar uma vez, e em uma sequencia, da linha 01 até a última, mesmo com o exemplo básico de verificação que nos fizemos, ainda sim, era uma execução sequencial. Para mudar isso, vou apresentar a vocês os principais condicionais e como utilizar o mesmo, e uma breve explicação sobre variáveis. Vamos começar pelas variáveis que são mais simples em grande parte. Diferente de outras linguagem as variáveis de Lua não são de tipo fixo, elas podem receber qualquer tipo de valor, as mesmo assim, elas respeitam a logica de combinação como por exemplo: local nome = "Dev" -- Atribuímos a um espaço de memoria o valor "Dev" e nomeamos esse espaço como "nome". local numero = 1 -- Atribuímos a um espaço de memoria o valor "1" e nomeamos esse espaço como "numero". Se fossemos utilizar outra linguagem, como C por exemplo, nos teríamos que definir o tipo de variavel, por exemplo: char nome = "dev"; int numero = 1; Em C no caso nós devemos nos prender a sintaxe padrão, e a utilização dos tipos: Sintaxe: <tipo> <nome_da_variável> ; int: armazena valores numéricos inteiros. char: armazena caracteres. float: armazena números com ponto flutuante (reais) com precisão simples. double: armazena números com ponto flutuante, com precisão dupla, ou seja normalmente possui o dobro da capacidade de uma variável do tipo float. E os principais tipos de dados seriam: Inteiro: armazena números inteiros Real: armazena números com casas decimais, são as variáveis de ponto flutuante; No caso de Lua essa lógica ainda existe. E ainda podemos armazenar dados do tipo Boolean (true/false) & nil. Como vocês puderam perceber as variáveis em Lua, funcionam de uma maneira muito pratica, porque você simples insere o valor nela, e automaticamente, ela entende o tipo e organiza a memoria dessa forma. Tendo isso em mente, vamos a algum exemplos básicos. Iguais combinam com iguais. Isso significa que se eu puxar a minha variável dev e a variável numero, e tentar unir as duas vai retornar um erro, pelo fato do tipo das duas serem diferentes. Imagem ilustratva: https://imgur.com/a/n0u9pL5 Para executar o print(dev + numero), teríamos que modificar o valor de numero para uma string. Com a utilização de tostring(numero); Para mudar o tipo de inteiro para string. Prestem atenção nisso, porque um numero pode ser um string por exemplo local numero = "1"; no caso esse 1 seria uma string e não um numero, oque impossibilitaria operações matemáticas com o mesmo. Nesse caso também poderia usar o tonumber(numero); para mudar o tipo. Caso tenham duvida sobre o valor de uma variável podem utilizar type(var); para saber qual tipo ela seria, por exemplo: local num = 1; --> Number/Integer local nam = "2"; --> String local status = false --> Boolean Caso desse um print(type(var)); e cada uma dessas receberia os valores citados acima. Caso você tente utilizar em uma var que não foi atribuída ira retornar o valor nil que significa que não há nada ali, não tem memoria atribuída nem valor a essa var. Condicionais Iniciando em condicionais vamos começar pela mais usada e básica de todas o if. O if funciona da seguinte maneira: if expressão_lógica then -- bloco de comandos end **Lembrando, o IF deve sempre ser fechado com o END, não se esqueçam disso.** Se ficar mais facil pode-se ler if como SE, então ficaria da seguinte forma SE expressão_lógica ENTÂO. Agora oque seria essa expressão lógica? Essa é a verificação que deve ser executada antes de se dar continuidade ao código, no nosso exemplo em linguagem padrão nos utilizamos o SE o relógio marcar = 6:30 ENTÂO, no caso a expressão_lógica será relógio marcar = 6:30 que só poderia retornar true ou false, no caso de uma verificação o valor true é sempre tido como condição principal a não ser que você exemplifique o contrario por exemplo: local nome = "dev"; if nome then -- código end A verificação aqui é simples, SE existir nome ENTÂO. Porque a condição é true, agora eu poderia usar: local nome = "dev"; if not nome then -- código end A verificação aqui é ao contrario da anterior, no estamos utilização a condição not como negação a existência da var então ficaria SE NÂO existir nome ENTÂO. Para vocês terem uma ideia melhor das expressão_lógicas vamos listar cada uma delas: Igual a | == | -- Verifica se os valores são iguais. Diferente de | ~= | -- Verifica se os valores são diferentes. Maior que | > | -- Verifica se o 1 valor é maior que o 2. Menor que | < | -- Verifica se o 1 valor é menor que o 2. Maior ou igual a | >= | -- Verifica se o 1 valor é maior OU igual ao 2. Menor ou igual a | <= | -- Verifica se o 1 valor é menor OU igual ao 2. As principais são true e false, exemplos: local x = 10; local y = 50; if x == y then -- Aqui estamos verificando se X é igual a Y, oque obviamente é uma mentira então o retorno será false, e o código abaixo não será executado. if x > y then -- Aqui também estamos em uma verificação False, portanto o código não ira executar, porem se usarmos not if not x > y then -- Aqui no caso o retorno é verdadeiro, então o código abaixo ira executar. Outro tipo de condição que nos podemos usar são os de concatenação: Conjunção | and | -- Verifica se duas ou mais condições são atendidas. Disjunção | or | -- Verifica se uma ou qualquer outra condição é atendida. Negação | not | -- Verifica se alguma condição não é atendida. Alguns exemplos: local x = 10; local y = 50; local nome = "dev"; local status = true; if nome == "dev" and status == true then -- Aqui verificamos se a var nome possui o valor "dev", e se a var status possui true, caso ambas sejam atendidas, o código executa. if status == false or x < y then -- Aqui estamos verificando se alguma das condições são verdadeiras, no caso o x é < que o y então o código executa. if not status == true or x > y or type(nome) == string then -- Aqui estamos passando mais de uma verificação com o OR e caso alguma delas seja verdadeira o código ira executar. Com essa regras básica em mente, eu sugiro que vocês, façam códigos simples utilizando esses conceitos para gravarem eles melhor. Continuando a falar sobre o if. O if ainda possui uma condição negativa por padrão que é chamada de else, da seguinte forma: if expressão_lógica then -- Bloco de comandos else -- Bloco de comandos end Dessa vez no fazemos uma verificação e caso ela não seja atendida nos executando outro bloco de código por exemplo: local x = 10; local y = 50; if x > y then print('X é maior que Y') else print('X é menor que Y') end Nesse caso nossa verificação não ira retornar true porque x não é maior que y, então o bloco 1 do código não será executado, porem com o else, o bloco dois será. Ainda no IF no temos o elseif que é uma segunda condicional dentro da primeira por exemplo: local x = 10; local y = 50; if x > y then print('X é maior que Y') else print('X é menor que Y') end Nesse caso nossa verificação não ira retornar true porque x não é maior que y, então o bloco 1 do código não será executado, porem com o else, o bloco dois será. Ainda no IF no temos o elseif que é uma segunda condicional dentro da primeira por exemplo: local x == 10; local y == 50; if x > y then -- bloco 1 elseif x < y then -- bloco 2 else -- bloco 3 end Nesse caso a primeira verificação é falsa, então a sequencia continua, a segunda verificação retorna true e então é executada, caso nenhuma das duas seja true, seria executado o bloco 3 do else. ** Lembrando o elseif sempre vem ante do else, e não tem limite de uso, apesar de não ser uma boa pratica de programação, enfiar um monte de if/elseif no código.** Iterações As iterações são estruturas de repetição, elas são o for / while e repeat. Vamos começar pelo while e repeat que são bem semelhantes: a sintaxe do while consiste em: while condição do -- código end Seguindo essa lógica a condição de entrada em um loop de while é definida antes do inicio. Para ficar mais simples pode-se ler while como: ENQUANTO condição FAÇA -- código FIM Vamos ao exemplo: local x = 1; local y = 10; while x < y do x = x + 1 end Nesse caso estamos executando um loop, da seguinte forma: ENQUANTO x for menor que Y FAÇA PEGUE x e Adicione X + 1 FIM Caso a gente desse um print(x) nesse caso a saida seria: 1 2 3 ... Até o 10. Ou seja o while significa **repita tal ação até que a condição seja verdadeira.** o repeat funciona semelhante ao while porem a condição de saida/verificação é posta no final, com a seguinte sintaxe: repeat -- bloco de código until(condição) Vamos usar o mesmo exemplo acima: local x = 1; local y = 10; repeat print(x) x = x + 1 until(x == y) O for pode ser ler PARA valor, max/min incremento FAÇA, a diferença do for para o while/repeat é que o for você tem um numero máximo e mínimo de execuções, que deve ser definidas no inicio da condicional por exemplo: for i=1, 10, 1 do print(i) end Aqui vamos ir do 1 ao 10 somando sempre 1 ao numero anterior, com uma saída de 1,2,3,4,5..10. Poderíamos utilizar 2, 3, -1 e qual numero quiséssemos no acréscimo Dentro de variáveis ainda temos os Arrays (tabelas), mas vou deixar para explicar depois de funções, já que tabelas em luas são bem extensas e com muitas funcionalidades. Exercícios 1. Faça um programa que verifique as medias dos alunos, em 2 cursos, e retorne aprovado ou reprovado baseado em média geral superior a 5. 2. Faça um programa que se repete até uma condição numérica retorne verdadeira, condição essa superior a 10. 3. Faça um programa que imprima na tela, tipos de variáveis utilizando um for. 4. Faça um programa que muda o tipo de variáveis e imprima elas. 5. Faça um programa que leia oque o usuário digitou e retorne na tela. Site que podem ser Uteis: https://www.Lua.org/portugues.html https://www.tutorialspoint.com/Lua/index.htm Caso queiram, podem postar o código nesse tópico, e caso tenham alguma duvida, deixem logo a baixo. Só lembrando ao pessoal que já entende do assunto, ou pelo menos sabe o básico, vamos ajudar quem ta começando, todo mundo começou sem saber quase nada. Parte 03:
  26. 7 points
    Introduction This guide intends to teach 3ds Max users the basics and more advanced ways of working with Vertex Colors, in order to achieve lighting solutions for enhanced quality of game models, or blend several textures together using Vertex alpha. A lot of games utilises vertex colors to accomplish lighting or blending effects, which usually impacts the performance less than model shaders. Types of shaders such as Texture Splatting are pixel based techniques for rendering multiple textures onto a model, where each texture e.g earth, grass, gravel, has their own color on the splat map. This however may use up significantly more resources than its alternatives in some cases. As result, game developers may move their aim towards Vertex Alpha and Color rather than geometry shaders. Vertex Color works almost the same way, however it renders per vertex and not per pixel unlike shaders do. This may result in very poor results if the geometry is not subdivided at the places it is painted at. Besides texture blending, vertex colors are also widely used in games for fake lighting baked into models. This is due to some game engines not supporting Ray Tracing or other rendering, or they simply prefer using vertex colors over per-pixel lighting. In GTA:SA the only light rendering is done by vertex colors and 2DFX. In the days that the game was developed, vertex colors was a more sustainable rendering method over other options. Table of contents Different model lighting depending on game time Importance of vertex colors Importance of vertex illumination Basics of per-vertex Radiosity workflow Hard surface prelighting Faking ambient occlusion Texture blending with Vertex Alpha The vertexPaint modifier Extracting channel info Working with several VertexPaint modifiers Different model lighting depending on game time Game models use two vertex channels for lighting. Vertex color is displayed around 06:00 - 20:00. Vertex illumination is displayed outside that timeframe, that is, between 20:00 and 06:00. Between these timeframes, the two channels blends into eachother, creating a realistic daytime and nighttime visualization of the map. Remembering which channel is used for what can be a little troubling, on top of the many other things. Artists could consider Vertex Color = daytime, Vertex Illumination = nighttime. Below are various demonstrations of vertex color and illumination channels. Importance of vertex colors Below video demonstrates the effects of not prelighting game models for GTA:SA. The results are very easy to differ from prelit models, as the only depth seen on the models is made by the diffuse maps, which usually does not add sufficient shadows. That is where the artist may consider prelighting his model. As seen on the video, first footage is of San Fierro chunk without diffuse maps (textures) nor vertex colors. This results in completely white meshes. If however, the artist decides to utilise vertex colors, the model will have a lot greater depth added, without the need to bake light into textures at the expense of computer memory. The video's contents are 1:1 to how San Fierro would be rendered in-game around 12:00. No post processing or edits made to the models. Compression methods, post processing, sky and fog done by the Renderware engine will make it a tad different though. Below screenshot is taken from a Dust2 model ripped from Counter Strike. It shows how the vertex channel brings shadows and ambient occlusion into the model. If it did not have the vertex channel changes made, it would be completely flat, corridors would have no depth whatsoever, only some by the difference between the textures. Importance of vertex illumination Not all models use fancy colors like the pirate assets by Las Venturas strip. A lot of models use the same, though slightly darkened, version of vertex colors for the vertex illumination channel. The result of this is a darker object during night and brighter during day. Perhaps some has some highlights that are cast from streetlights and other light sources that appear during nighttime. Some models, notably light objects use vertex colors in conjunction with 2DFX in order to create realistic light with a real light source. Below example is a runway light. The white version is during day time, where the inner light mesh (the extruded part) is grey to represent an deactivated light. The red version is during night time, where the top surface has light reflected onto it, together with a corona image, more commonly known as 2D billboard or sprites. The corona acts as the light source and creates a bloom alike effect. (Not seen in image) Basics of per-vertex To get a somewhat understanding of how vertex colors work, below demonstration should be helpful. The triangle's top left vertex is painted blue, top right painted green and bottom painted red. This creates an RGB blend display of the triangle. The planar model has its bottom vertices painted black while the top ones are white. This creates more of a gradient across the entire model.To put the difference between per-vertex lighting and per-pixel lighting short, Vertex based lighting creates a gradient from one vertex towards the nearest one(s), and stops there. If a model has only 4 vertices, it is not possible to have circular or very detailed IES-like lighting, as the model would have only 4 points that can have light data. Pixel based lighting can have as many abstract details as artist wishes. It works as if there is a grayscale image on top of the model with a different blend mode, or dynamic lighting based on world models, hence the two are called per-vertex and per-pixel. Radiosity workflow Tired of painting vertex colors onto models with silly brushes all day? 3ds Max has an amazing light renderer, which can produce stunning renders and best of all, stunning prelights. As if it was made for GTA:SA era games! Not to forget, a 3rd party Max script was made to make the workflow a lot less difficult - can be found on: http://www.scriptspot.com/3ds-max/scripts/vertex-color-tools-1. With this script, artists can with a few clicks create a skylight, ground plane (for AO), then render a radiosity solution in less than a minute total. No more setting up radiosity settings, only a few adjustments to your likings if needed. I use it all the time myself, and in fact, I learned to create beautiful prelights by using this tool with radiosity rendering. Before moving on, ParoXum's Radiosity tutorial and the Radiosity wikipedia page contains extra information that is not covered in this thread, for instance particular use of point lights. For that reason they may be benefitable to read through. WARNING! Pressing the AO button on the Vertex Color Tool script, ALL materials will be reset to standard. This can not be reversed! Adding to the above. Make sure to create a backup Max project file prior to working with Radiosity. Use the backup Max project file for vertex colors, leave original file for modeling! This process is covered in the guide. Hard surface prelighting Most artists starting out with vertex colors have probably grown tired of selecting faces of a model, then painting a different value onto each to replicate a hard surface look. As it turns out, this is not an efficient way. The model will look odd if the artist has not put enough time (hours with sweat) into it. That is where automating it with Radiosity rendering is a fantastic solution. To get started, download the following FBX scene https://cdn.discordapp.com/attachments/308956559201796097/632340906170908673/demo.zip. Each point contains a spoiler with a video clip. For those who would like to mess around with the final result of mine, download FBX here: https://cdn.discordapp.com/attachments/308956559201796097/632559814387695626/demo_result.zip (video below) Important thing to note, when using Radiosity for prelights, the shading/lighting which is baked into the model entirely depends on the smoothing of the model. If it's set to Auto Smooth value 2 the shading will resemble 3ds Max's shading 'facets', while if the model has only one smoothing group, the shading will be incredibly smooth and generally won't have any facet shading. San Andreas models generally had very low smoothing value for its models at their creation, judging by their hard surface appearence. If a modeler were to create models that blend in with the game environment, they should strongly consider the above. Video tutorial: Text tutorial: Import the file Click the 3ds max upper left corner, at Import hover over the arrow for a drop down menu to appear. Click Import. Click the demo.FBX. Ensure to include Smoothing Groups on import, and units setup in Meters. Reset X, Y, Z positions to 0, 0, 0. At import the model is not centered. Create light Navigate to Create tab, click the gears icon, finally select the Daylight button. Max will ask if it can set an exposure control flag (not a country flag bleh), click Yes. Click anywhere, this sets the compass. Then, drag the mouse up into the sky, press LMB to spawn the daylight system. The compass position is not important. Alter light Navigate to Modify tab, change Sunlight from Standard to IES Sun. Likewise for sky, make it IES Sky. On Sun Parameters uncheck Shadows. Ensure the sun's state is On. On IES Sky Parameters it is possible to modify the intensity of the sky, as well as the sun. Some of the settings that affect the sun is whether the weather is clear or clouded. Leave default. On hierarchy list, select the Daylight001 item. While on Modify tab, click the Setup button for setting the scene weather. As the light system works like real daylight, the lower the number of hours, the darker the scene. Set hours at 9, month at 9, orbital scale at 320-360. Initiate the radiosity solution by running Vertex Color Tools Ver1.0. Press the AO button. Keep in mind, that this will remove all materials and cannot be reversed with undo. The render setup window opens. Another window from Rendering > Exposure Control is needed. On Exposure Control, change from none to Logarithmic. Tick on the Exterior daylight checkbox, which is required due to scene using a daylight system. Optionally, start rendering previews via the Exposure Control window. These previews are very low resolution and may help visualise the lighting. Or, real renders by SHIFT Q, although this may take significantly more time and processing power. On Render Setup window, reset value of Indirect Lighting Filtering. Increase the Direct Lighting Filtering to a value of 8. Under Radiosity Meshing Parameters tick the Include Skylight checkbox. Under Rendering Parameters select Re-Use Direct Illumination from Radiosity Solution. On Render Setup window, make sure to press Reset, to then start a clean rendering with the updated settings. Click Start. This may be an incredibly slow process, even on high end computers. If it gets stuck, set quality to less. It does not really have much of an impact for GTA:SA light anyway. Voila, done. The final result will be displayed in viewport. The result is equal to what is seen in-game during day hours. If something looks off, go back and tweak settings. Bake Radiosity lighting solution into vertex channel. Navigate to Utility tab, click More..., select Assign Vertex Colors. Upon scrolling down the utility tab, the Vertex Colors settings appear. Vertex Color is for day time, Vertex Illumination is for night time. Choose Vertex Color. Set light model as Lighting + Diffuse. Set Color Assignment as whichever seen fit. On Rendering options, enable Mapping and Radiosity, Reuse Direct Illum. from solution. Finally, click Assign to Selected View vertex color result in viewport. On the VertexPaint modifier, select the channel that was just modified. On the VertexPaint GUI, click the shaded box to the left. This displays the model with only vertex channel rendering, no other 3D shading will be used. Further tweaking If one wishes night time lighting, the best to do is render a new radiosity solution with less sun and daylight intensity, in order to darken the scene. Eventually change to clouded or mess with weather settings. The new radiosity solution will be equally the same as the one for daytime, although a tad darker. When rendered, assign to illumination channel. The letters can be painted for night time to look extra cool. This is where painting by buckets onto face selections of the mesh can come in handy, using the VertexPaint modifier. Odd looking shadows can be fixed up with the blur brush (VertexPaint modifier). Those who are able to get results with the above Radiosity workflow, may utilise their knowledge and take prelighting a next step with other types of lights, in order to create environment lights such as shadows for light poles, torches, buildings etc. Point lights, more specifically Free Light, were used a lot in the ship model further down the topic. Scene lighting is generally hit and miss. There are many settings which may need to be changed e.g scale of daylight and smoothing groups of models, in order to get the right look. Faking ambient occlusion Vertices can easily store ambient occlusion details, negating the need for geometry shaders. Some models may require additional geometry through subdividing the mesh, in order to achieve proper ambient occlusion details with vertex colors. The type of light used is usually skylight or daylight, this creates subtle shadows around corners and creaks, as well as maintaining global lighting. The below model has vertex AO baked by using a Skylight with the following settings. *you can eventually utilise a plane as ground for the ambient occlusion to calculate a lot better. The above practise can be used for GTA:SA assets as well, some settings may require to be tweaked first though. Prelighting in general is trial and error unless the artist has a solid background with lighting and rendering. Generally though, ambient occlusion should not be the only layer for lighting a model. Hard surface lighting as well as adding point lights is highly recommended. Without these, models with AO will still look rather flat in most cases, as there is not much definition between corners, other than soft shadows. Adding point lights to radiosity render will also give the lighting a more natural feeling, this can be done by adjusting the temporature of the light or its color. Combining point lights (free light, omni light, etcetera) with 2DFX can give stunning results. Texture blending with Vertex Alpha Texture blending on MTA was thought to only be possible by shaders, e.g texture splatmap. Instead, we can now blend textures using Vertex Alpha channel. On December 27 2019 we discovered that Vertex Alpha works without need for additional scripting (MTA Discord #modelling). We also need to thank Deniska for writing this guide (gtamaps) on vertex alpha plus creating a maxscript that exports vAlpha channel! Vertex Alpha works based on grayscale values just like alpha masks. Any vertex that's black will not be rendered - any vertex that's not black will be rendered. White is fully opaque, while the greyer it gets, the more transparency is made. Vertex Alpha will not render water behind its faces, so it's important to place an opaque object behind the vertex alpha mesh. This must be a separate model, not part of the mesh that uses vertex alpha. As with vertex prelights, vertex alpha needs geometry to work with. It's highly recommended to turbosmooth/subdivide the mesh so that you can paint in more detail. In the video below, I show how quickly the vertex alpha can be added to your models, and once that's done, you can export the model using the script from this page. Create a plane primitive. Give it 16x16 segments. Convert it to editable mesh. Give it the material that needs to blend using alpha. Set opacity of material to 98. Add a VertexPaint modifier. Select the vertex alpha channel. Use paint bucket with black color, 100 intensity, to paint entire mesh black. Add a secondary vertexpaint modifier. Grab your brush, adjust its size and strength. Begin painting a path from one end to another. Use the blur brush to finetune the semi-transparent edges of your path. Sharp edges ain't good. Looks OK? Start the export-script. You don't need to collapse your modifiers when exporting. Keep them in stack for later adjustments. Export with MMC. Remember to always set alphaTransparency enabled when replacing the model, or else only part of alpha will show. If you want to use another DFF script (for a higher quality dff), simply copy paste the sections e.g "Extra Vertex Colors" via RWanalyze. (Script will break (in which case, close script and run again) if you try to export vertex colors without having first assigned vertex colors/illumination to the model via its respective channels) List of model ID's that use the flag 68 (NO_ZBUFFER_WRITE(64) + DRAW_LAST(4)), which is required for Vertex Alpha: 2728, 3872, 3910, 4227, 4636, 4637, 7892, 9831, 9896, 9897, 11678, 11679, 11680, 11681, 13494, 13495, 13496, 13497, 13498, 13499, 13500, 13501, 13502, 13503, 13504, 13505, 13506, 13507, 13508, 13509, 13510, 13511, 13512, 13513, 13514, 13515, 13516, 13517, 13518, 13519, 13520, 13521, 13522, 13523, 13524, 13525, 13526, 13527, 13528, 13529, 13530, 13531, 13532, 13533, 13534, 13535, 13536, 13537, 13538, 13539, 13540, 13541, 13542, 13543, 13544, 13545, 13546, 13547, 13548, 13549, 13550, 13551, 13552, 13553, 13554, 13555, 13556, 13557, 13558, 13559, 13560, 13561, 13563, 16375, 16445, 16498, 16623, 16676, 16677, 16733, 16734, 16753, 16754, 16756, 16757, 16758, 16783, 16784, 17436, 17437, 17438, 17439, 17440, 17441, 17442, 17443, 17444, 17448, 17450, 17451, 17451, 17452, 17458, 17459, 17460, 17461, 17462, 17463, 17464, 17465, 17466, 17467, 17468, 17469, 17470, 17474, 17524, 18073, 18112, 18610, 18611, 18612, 18613, 18614, 18615, 18616, 18617, 18618, 18619, 18620, 18621, 18622, 18623, 18624, 18625, 18626, 18627, 18628, 18629, 18630, List of model ID's that use the flag 64 (NO_ZBUFFER_WRITE(64)) which are not tested, but might work for Vertex Alpha: 1315, 2981, 4712, 4724, 4554, 8004, 8044, 11306, 14765, Below are a few examples of how vertex alpha can be used to blend several textures together. Above image courtesy: worsas @ project tamriel (see link for more) 128x128 textures, 8192 polygons (can be a lot less!) You can probably create something a lot better than this. Time to get creative! If you're looking for additional inspiration, see the videos in spoiler. Note: The below spoiler contains information that does not apply to vertex alpha method, but instead to vertex colors. This requires shaders, since SA uses the colors for lighting, but is a decent alternative if the model use lighting shaders. The vertexPaint modifier VertexPaint is the modifier that houses the WIP vertex colors, illumination and alpha modifications. It may be accessed on Modifiers tab. While it is open, it allows the artist to do various changes to the vertex channels. Ranging from painting with the use of brushes, to refining vertex colors by blurring, adjusting hue, saturation, lightness etcetera. This is a very powerful tool, despite not having been updated for years. To get started, the modifier works with a float GUI with all of its necessary functions in it. It is worth noting that the modifier can not change existing vertex channel data, only the data that is stored in the modifier. That means it is not possible to import a GTA:SA asset and modify the hue of the vertex color channel. For an exhaustive list of what the modifier offers, check Autodesk's page on the VertexPaint Modifier. Brief explanation of what the modifier has to offer, from top to bottom: Extracting channel info For whatever reason, an artist may want to copy the vertex channel data, that is, the custom vertex information, and paste that onto their latest version of the mesh. This could be due to an irreversible action that would prevent the artist from undoing the lighting changes on present model, resulting in work lost and having to redo it all over again. Although this may seem like a promising solution to regain old channel data, it can generate problems if the two models contain different geometry counts. Below steps explains how to copy/paste data. Navigate to Utilities tab, click the More button, after which, click Channel info. At last, press the button that appeared on the bottom of the utilities tab. At first, the Channel Info GUI may seem complicated; but it really is not. The only information to look out for is the ID column and Channel Name column. The Num Verts, Faces etc. are only important to verify that the two model contains the same model geometry count. In the above example, the model has no custom channel data. The -2:Alpha, -1:Illum and 0:vc are the types of channel info's that are relevant for GTA:SA, although the Alpha data currently isn not compatible with MTA. To copy data, simply select either of the rows and press the Copy button. Then, highlight the present model, select the corresponding channel and paste. Working with several VertexPaint modifiers On more advanced tasks it may be necessary to use multiple VertexPaint modifiers stacked onto the model. Artist may find it helpful if they are doing several versions of prelighting for their model and wants to go through each result, picking the one that suits them the most. This means that each type of radiosity lighting solution will be stored in its own modifier, allowing artists to go through all of them and delete the poor ones. Having multiple modifiers on stack can also improve workflow by utilising each modifiers for each element of the model, such as Modifier1 for bonfire logs, Modifier2 for bonfire shadows, Modifier3 for ambient occlusion, Modifier4 for moonlight etc. Modifiers can also be renamed to quickly tell the artist what they are representing. The model can have as many modifiers in its stack as the artist wishes (or until the software times out), and they do not require to be collapsed when exporting the model to MTA. This means that the modeler simply needs to select the model, export it and load into MTA. Modifiers can then be collapsed to stack when job's done, however, it is strongly recommended to keep them in stack for future, in case of parts requiring rework. Below model may give a good look into just how much it helps to utilise multiple modifiers. The ship has its own modifier for virtually any type of light emmitting source. The rectangular screens to the right are symmetrical on the other side, so there is one modifier that represents those 6 rectangular emmissive screens. Same goes for the cyan U-shaped engravement, which uses its own independant modifier, and so on. This allowed to change the engravement prelight from initially dark blue to cyan, by not affecting other lights when modifying the hue, as the modifier was only used by that particular area. The stack works like so: By clicking the bottom modifier, only that one's layer will show. If clicking the one above it, assuming it is same channel, it will show both of them. Now, if clicking the top modifier, it will show all layers e.g the rest 4 that are associated with Vertex Illum channel. It will only display the channel that is selected on the right most panel. (This depends on version of Max)
  27. 7 points
    Introduction Modding is a term used when modifying components, files and what not, in this particular case modifying game installation files in order to achieve unique results not seen in the vanilla game. GTA:SA is 3D era, where modding the game requires special 3D packages. Older games such as GTA:II uses a 2D engine, which means that modding the game was commonly done with image editing applications. We will cover some aspects of modding game textures and models. This guide intends on introducing those inexperienced with modding and 3D as a whole, on how to obtain 3D software and their recommended tools. It also introduces ways to import and export models, basic workflows for 3ds Max, texturing and creating models. TOC 3D packages, helpful tools and how to obtain them Extracting game assets How each type of game model works Limitations - MTA vs GTA Working with 3ds Max Texturing a game-ready cube 3D packages, helpful tools and how to obtain them There are various applications being used for modding. Although some has more tools available, there really isn't one that tops the others. In this section there'll be lists of a few 3D packages and tools used for modding. 3ds Max, arguably the most used program with the greatest amount of third-party plugins and scripts for various games. For GTA:SA, this program is favored by many modders due to it having 3rd party scripts for dealing with animations, collisions, lighting, modeling etcetera. There isn't much that 3ds Max can't, that other programs can, when it comes to GTA:SA modding. Although this can be expensive to run on a longer term, there are education licenses available which last for 3 years. These do not allow commercial use, and is marked purely as "educational use only". View more. Kam's (vanilla) max scripts, the first official script package for modding GTA:SA with 3ds Max. After the release of his scripts, a lot of others has developed scripts of their own, some of which are more optimized and less prone to issues. Even despite Kam's scripts having overseen issues, it is still to this day widely used for tasks such as, but not limited to; IPL map generation and import, collisions, animations, characters, vehicles, environment modeling. View more. Kam's (2018) max scripts, a modified version of Kam's vanilla scripts for 3ds Max. Notable features that were added are; DK22pac's Normal map plugin support, reflection map support for environment models, 2dfx panel for lights such as aircraft lights or street lamps. View more. The Hero's RW importer/exporter, a modern plugin that works extremely well with vehicles and environment models. Due to its simplified layout it is very easy to get used to. It's far recommended to use for vehicle model import/export due to its quality handling and materials, which are based on RW formats (renderware, the engine GTA:SA runs off). With the plugin using different model material formats from Kam's, it comes with a maxscript to convert scene materials from GTA_MTL to RW_MTL and vice versa, if needed by the modeler. View more. Deniska's max scripts, a pack for various types of GTA:SA modding, some features are obsolete for MTA users due to IPL and IDE modification required. Although, the pack does come with a few tools that may be useful to MTA modders, such as prelight tools to set the vertex colors and illumination to fixed values. View more. DexX's 2dfx export script, a standalone 3ds Max script that exports Omni and Dummy informations to .sae file formats, to then be added to the .dff using RW analyzer. With this script it's possible to integrate lights and particles into custom models, e.g flashing aircraft lights, street lights, fire and smoke, etcetera. With the release of Kam's 2018 scripts, this script is used less as using Kam's may be less work for some cases. View more. Blender 3D, a freeware (yes, completely free, no paid watermarks or any limitations), not as favored by modders throughout the years until recently, where a developer has released his script 'DragonFF' on GTAforums. Although it is WIP, modders has already binned 3ds Max and moved permanently to Blender. Although Blender is free, it actually combines several programs into one, allowing a Blender user to sculpt, paint, do lighting, professional rendering and modeling in one. A recent update in 2019 changes the RMB selection to LMB and UI among other things, making for a potential alternative to 3ds Max. View more (Blender). View more (Blender GTA script) Zmodeler, not as commonly used as the aforementioned programs, although it is being used very frequently by modders in various games, most notably for GTA:games. It does not have support for skinned characters, although it is being commonly used for vehicles, and sometimes environment modeling as well. This is a fairly inexpensive solution, but lacks tools for more broad modding. View more. Sketchup, a 3D application that focuses on architecture. For modding, it is a rather uncommon, though has a free and paid version and can be used for seemingly OK modeling. It does not have access to any 3rd party scripts for GTA:SA, hence its only use is modeling and then exporting model files to then import into 3ds Max or Blender. View more. Photoshop, mainly used for graphic design, but can also produce 3D models, video, GIF and textures for assets. Photoshop is the most favored by modders in regards to working with textures e.g paintjobs and retexturing. Although there are alternative image editors in the market, Photoshop definitely hits the top in terms of usable scripts (user-customized scripts as well) and ease of workflow. View more. DFF Viewer, a 3D graphics engine that is used for visualising GTA:SA models and supports .DFF and .TGA formats. Only single dff's can be loaded at a time. Though this is rarely used by those who has access to 3ds Max and Blender, it is commonly used for troubleshooting/testing work that involves retexturing a model e.g changing the clothing textures of a character. This program is entirely free and available from various GTA modding sites. View more. TXD Workshop, a texture dictionary editor that has been around for years, only since recent years to be succeeded by Magic TXD. Though TXD Workshop may not be the best for setting up TXD files, it has a built-in IMG archive editor, allowing one to browse all of the contents of gta3.img. View more. MagicTXD, a new texture dictionary editor with features for mass exporting .TXD contents from folders into image subfolders, texture compression, mipmaps, resizing textures etcetera. This is broadly used for .txd files and almost took over TXD workshop when it comes to working with texture dictionaries. View more. RW Analyze, a multi-use program with notable features being; ability to lock/unlock game files, add data to game models e.g 2dfx and vertex colors information extracted from other DFF files. View more. Extracting game assets In order to start modding GTA, access to the files is required. The files in question are commonly found in parent files that require some sort of program to open. In this case, TXD Workshop or any IMG editor and optionally Magic TXD for later on will work just fine. The below steps shows one way to extract all models and their texture dictionaries. For IMG editors (e.g Alci's IMG Editor): Open the editor. Under File, select Open. Find gta3.IMG stored in GTA SA directory\models. Highlight the first file in the list, then scroll down to the very bottom and SHIFT+LMB click the file on the bottom. This highlights every file in GTA3.IMG. Right click the list of files and select Export. On the popup window, find and select, or create a new folder on desktop called GTA SA ASSETS. Click enter to proceed. ((For cases where specific files are wanted, use the search field to find the necessary files and export them individually)) For TXD Workshop users: Open TXD Workshop. In the toolbar it says Open IMG. Click this, then find and select gta3.IMG stored in GTA SA directory\models. Highlight the first file in the list, then scroll down to the very bottom and SHIFT+LMB click the file on the bottom. This highlights every file in GTA3.IMG. Right click the list of files, select Extract. On the window, find and select, or create a new folder on desktop called GTA SA ASSETS. Click enter to proceed. ((For cases where specific files are wanted, use the search field to find the necessary files)) Now the folder GTA SA ASSETS contains nearly every .dff, .col, .txd and so on used by the game. Assuming one would like having all of the textures in PNG, DDS, TGA or any other common image format, they may follow the below steps using Magic TXD. Inside GTA SA ASSETS create a new folder named IMAGES. Open any .txd file found in GTA SA ASSETS using Magic TXD. Navigate to the toolbar. On Tools, click Mass export. Export settings are as following. Game root = root folder containing TXD's Output root = folder where images goes Image format = self explanatory With texture names only = exports images directly to folder and duplicate named ones gets replaced by one another Pre-pended with TXD name = exports images with TXD prefix In separate folders = makes new folder(s) for every TXD's contents Hit export. This process may take some time. Note that this process is the same for other .IMG archives such as player.img. There are also .txd and .dff files elsewhere, such as \models\generic\generic.txd, which is the vehicle shared texture dictionary file. How each type of game model works Models used on GTA SA uses different rendering techniques and data hierarchy than others. This section will introduce the features that some models has that others don't. Vehicles: Vehicle model components utilises hierarchies, where each component is linked to a dummy (helper) and each dummy is linked to parent dummies e.g chassis_dummy, for them to be registered in the hierarchy. In order for vehicles to not look flat or cartoon, a few steps are made in the model; Diffuse material is given a grunge texture or AO map, this helps telling the depth of the vehicle as well as giving it a feel of realism, so it isn't just clean. A specular lighting image is applied to the vehicle surface material, giving it a fake shine when looking from certain angles. If the vehicle has hard edges (smoothing), this image can increase the visibility of the normals, retaining its original look rather than being flat without visible difference in geometry. An environment (ENV) map is applied to the vehicle surface material, producing a fake reflection that is animated horizontally as the vehicle travels. Vehicles also has a lot of hardcoded features such as headlights, brake lights, emissive lights, taxi/aircraft lights, rotatable components and dynamic collisions for special vehicles like Forklift. Vehicles are also the only dff models that uses baked collisions, which means they are stored in the .dff itself. Below is a detailed hierarchy used for cars, and special components used by a number of vehicles (click the spoiler). Skin characters: Ped skin characters uses bones (dummy objects) that are connected to each other and linked to the character model. These bones are not visible in-game. In order for the bones to know what part of the 3D model they're responsible for, the skin needs to be rigged. Character rigging for GTA:SA is done by applying weigh on vertices. Using heatmap display, colors go through blue-red, low-high respectively. Values go from 0 to 100. If the value is 0, it means that the vertex is not used for any bone. This can cause issues. If the value is < 100, it means that the vertex is used for multiple bones. This results in smooth animations ingame, as the 3D model transitions smoothly through each bone. If the value is 100, it means that the vertex is only responsible for one bone. Skin rigging is generally something that is being avoided by modelers and makes Skin modeling the most difficult on GTA. Bones are as shown: CJ character: Carl Johnson's 3D model is split into several pieces in order to be compatible with the clothing script used to let the player customize CJ. These models uses a function known as multiclump to support 3 meshes per dff; normal, ripped and fat. This is for CJ's health stats to physically show in-game. Other than multiclump and additional bones, modding CJ skin is essentially the same as any other ped skin. Map environment: World objects .dff contains only single models, though they do support omni and dummy objects for 2d effects. These types of models uses Vertex Colors/Face Colors. This requires the modeler to paint colors onto the model which is then stored in the vertex colors channel (daytime) and vertex illumination channel (nighttime). Although uncommonly used by R*, these models do support reflection maps like vehicles use. Goldfish's modified version of Kam's scripts is excellent for exporting with reflection maps. GTA SA utilises multiple collision archives (.col) for every IPL district, being responsible for all of the world objects' collisions. However, on MTA, collision archives are not supported, so custom collision files are single models per .col. Not every object uses collisions though, some merely has their bounding space. These objects can not be selected with MTA map editor, thus requires additional scripting or modding. Limitations - MTA vs GTA Speaking of native support, MTA currently is behind in several places. Notable features that aren't available on MTA, but on GTA are as following. Item Placement (IPL) - another type of mapping file, but contains a lot more functions such as zones for real-time reflections as seen in interiors. Item definition (IDE) - a file used to but not exclusively, define settings for models, enabling alpha flags, disabling backface cull, enable breakable effect and much more. Limit adjuster - a rework of the game that allows for adding more ID's and bypass common limits. This however is being developed by one of MTA's contributors. There are various limitations such as polys per model, max dimensions for models and collisions, (very) strict size limits for collisions and CPU usage that can easily cause issues for modders. Not to mention the majority of the game data files which most MTA servers likes to force original, else the player won't be able to connect. These limits all has potential solutions being developed as with the limit adjuster. Working with 3ds Max As described above, 3ds Max is without a doubt the most common program for GTA modding. It's also used by professionals within architecture and visualisation and film industry. What's amazing about this program is that whatever is created in 3ds Max can ultimately be added to the game. A modeler made a square - it can get added right away, no adjustments required. That's the charm of 3ds Max. There's no need for additional tools to process the model for it to be compatible with GTA. It is also the primary program that Rockstar's developers used for creating the environment in GTA:SA. At a first glance, the program may seem rather intimidating. The main functions of the program that a beginner should be aware of are listed below. Shows the default home screen with 4 viewports. Left, Top, Front and Perspective. The 3 side ones are Orthographic viewports while Perspective is in regular mode. It is also the most common one to use. Highlighting a viewport and pressing (left)ALT W will full screen the viewport. In order to rotate camera view, the user must click and drag the square in the upper right corner. Its face also tells which side the camera is viewing e.g Top. If one wishes to see viewport statistics such as polygons per model, vertex amount etc., clicking: [ + ] icon on the upper left side > Configure Viewport > Statistics > Total + Selection > Apply > Clicking 7 on keyboard shows the statistics. This feature is extremely useful for modelers who are limited in polygons per model, or simply wants to see how many polys a car is. Common keyboard shortcuts F1: Opens Autodesk help section in new browser tab F2: Displays blue overlay on models F3: Displays models in wireframe F4: Displays edges on models F10: Opens render setup 9: Shows viewport statistics Q: Select objects W: Select and move E: Rotate R: Select and (mode) scale U: Orthographic viewport mode P: Perspective viewport mode A: Toggle angle snap S: Enable snap D: Disable viewport G: Enable/disable grid J: Display bounding edges LALT X: Xray mode for model Ctrl Z: Undo action Ctrl Y: Redo action In a heavy program like 3ds Max, being able to change preferences to one's likings is important. Do so by going to Customize > Preferences. Performance, file settings and such can all be configured in there. For GTA:SA modding, knowing how to subdivide and add geometry to existing GTA models is very important. Below is a list with actions that may come in handy. No-brainer: Editable Mesh is inferior to Editable Poly. Use Poly, poly, poly, poly... Editable mesh modeling Vertex selection mode Edit Geometry section Attach: attaches another model in the scene to the selected mesh Chamfer: chamfer selection of vertices; creates additional geometry Weld: merges vertices together within a specified threshold Surface Properties section Edit Vertex Colors: sets the color and illumination of selected vertices Edge selection mode Edit Geometry section Divide: divides an edge, adding a new vertex where it was divided/split Extrude: create and pull a new face out from existing edges (keyboard shortcut: LSHIFT + LMB-drag) Face selection mode Edit Geometry section Divide: creates a new face Extrude: pulls the select face(s) outwards or inwards and creates new geometry off that Bevel: essentially an Extrude followed by scaling of the face Surface Properties section Flip: flips a face 180 degrees Smoothing groups: defines the smoothing of the model. Autosmooth is in many cases OK, but may not fulfil everyone's expectations Editable poly modeling Vertex selection mode Edit Vertices Connect: selecting 4 verts on a box side and using this function will triangulate the side. Edge selection mode Edit Edges Connect: creates an edge between the selected edges, as in a bridge between two cliff sides (use the 'Settings' to choose between multiple or one edge on creation) Polygon selection mode Edit Polygons Inset: places a new polygon inside the selected, allowing to be scaled Bridge: connects two opposing polygons by creating a bridge between them (can be used for walls and gaps) Edit Geometry Slice Plane: enables the user to create a perfect cut on the model, can be rotated by degrees Rendering scene Modelers working on projects for companies or friends might want to show what they've accomplished, but a regular screenshot may not suffice. Talking of a screenshot like this: Instead, the modeler might want to show the scene with textures. Perhaps more than just textures - lighting? reflections? transparency? - this is where 3D rendering comes into play, and can be done by simply pressing SHIFT + Q on the keyboard. This can also by default use alpha channel. However, the quality could improve. The quality of the render depends on the scene assets (models, materials, lights), the Renderer and its settings. By default, 3ds Max utilises Scanline Renderer. This is not a production quality render, but rather meant for test shots and demos. Though the quality isn't great, it's still possible to produce seemingly interesting renders. The following render took merely 8 seconds. Using 3ds Max allows modders to bring GTA:SA into modern graphics, easily comparable or even superior to ENB's. It also enables modelers to share visualizations of their models to help the customer understand how it could potentially look for their game. In the above render, a Skylight is used with Scanline Renderer. A very basic render, though interesting and contains lots of depth. In order to replicate this result, below are the steps to follow: On the Create panel, where one would normally find boxes and spheres, click the toolbar Lights. Where it says Photometric change that to Standard. Click the Skylight and place it in the 3ds Max scene. Settings for Skylight explained Multiplier: intensity of the light Sky color: the color of the light Cast shadows: enable to produce shadows, though this is more of an Ambient Occlusion than actual shadows Rays per sample: quality of the shadow, ideally keep at <5 for tests and 15-20 for final shots In the actual render above, a sample of 5 was used, creating grainy shadows but quick render. Backface culling was enabled to avoid slowing down the render time. Skylight is great light source and is generally used to illuminate an entire scene and not particular models. In the same Lights tab, one may find use of Omni or Free lights, which both works great. These are great point lights, which as opposed to skylight, are able to illuminate parts of the scene e.g acting as street lights. Modifiers When modeling, modifiers can come in use and save the modeler a lot of time. The following modifiers are highly suggested for beginners to know about. Bend: bends the model, effect depends on the differences in the geometry Mirror: copies the mesh and mirrors it on the other side, commonly used for vehicles using symmetrical geometry Smooth: generates and applies smoothing to the model, generally the lower values makes for higher file sizes Symmetry: essentially the same modifier as 'Mirror' Turbosmooth: Smoothens the mesh, adding geometry, uses iterations Unwrap UVW: advanced UV editing, commonly used for preparing textures for models like characters and game assets UVW map: basic UV editing, X/Y/Z projection mapping as well as spherical, box and planar mapping Vertexpaint: allows for painting colors onto vertices and faces, these colors are rendered during either ingame or night time Texturing a game-ready cube Modeling has to start somewhere. Using standard 3D primitives is a good place to start. For the purpose of this guide, a Cube will be created in 3ds Max and textured in Paint.net, a free image editing software. Video tutorial: To start off, navigate to 3ds Max's Create tab on the right hand side panel, as shown below. Shows the Create tab on the panel. For this guide, click on Box (Cube). Use LMB and click and drag the mouse in the viewport to create the cube. Now that the Cube primitive is spawned in the viewport, on the same panel that it was created from, go to Modify tab and set its dimension parameters to 5,0, 5,0, 5,0 and 1 segment for all 3. Convert the model to Editable Poly by right clicking it in the Viewport > Convert to > Editable Poly. Go into Polygon selection mode and scroll down until the following buttons are visible: With viewport selected, on the keyboard press `CTRL A` to select all faces on the cube. Now, where it says `Color`, click the bar and on `Value` set it to 100, then do the same for `Illumination` but value at 35. What this does is it sets the vertex colors so that the model won't be overexposed during day/night time. Exit polygon selection mode and on Modifier List, click that and find Unwrap UVW. This applies a modifier stacked on top of the Editable Poly mesh. Under Edit UVs click Open UV Editor. This allows the user to make changes to the UV coordinates which tells the model how textures are projected onto the model. On the editor, ensure that Polygon selection is enabled. While in the UV editor, press `CTRL A` to select all UV islands. On the top of the editor click Mapping, then Unfold Mapping.... Keep it as Walk to closest face and enable Normalize Clusters. Click OK. The result should remind the user of how a simple cardboard box in real life looks when it's yet to be folded into a box. With the model unwrapped, on the toolbar on the UV editor, click Tools > Render UVW Template. The export settings below are ideal for this particular task. If one wishes to know exact dimensions of each square, enable Seam Edges. After exporting, on the modifier stack, press Collapse to. This saves the new UV's. The width and height should be on a 1:1 ratio to avoid stretching issues. 1024x1024 is more than enough. On the rendered image window, click the Save button and find a location to save it in, name it Cube_unwrapped and use Alpha channel (optionally). Now open Paint.net and insert the image. Once happy with the result, export as cube_diffuse. Diffuse map generated with the help of a UVW template. In order to apply the texture on the model, simply drag and drop the image from file browser onto the model in the Viewport. Although the example above is not textured properly in regards to rotations, it shows what can be done by using UVW templates, and how easy it really is to produce textures for models made from scratch. The model can be directly exported as DFF. Materials are not required to be GTA or RW, they can be standard and still show ingame. Some exporters wants the model in Editable Mesh however, so converting it may be required. Thanks for reading this guide, we hope it helps and we wish you the best of luck with modelling! For questions on modding, please refer to MTA's modding FAQ or MTA discord #modelling channel.
  28. 6 points
    Salutări tuturor, Având în vedere contextul actual din cadrul comunității românești la nivelul platformei, am decis să desfășor un sondaj de opinie pentru a observa și înțelege mai bine unde se situează diferite aspecte ale comunității din punctul vostru de vedere. Prezentare generală a demersului Sondajul de opinie se desfășoară prin intermediul unui chestionar compus din cinci secțiuni scurte, majoritatea cuprinzând întrebări închise cu unul sau mai multe răspunsuri prestabilite (cu posibilitatea de a adăuga un răspuns propriu). În urma și pe baza răspunsurilor primite vom putea avea cu toții o imagine concretă cu privire la o parte dintre subiectele care în prezent sunt, după caz, de mare interes la nivelul comunității românești. Prezentul sondaj de opinie nu reprezintă un demers oficial aferent echipei administrative MTA. Tocmai din acest motiv, aveți în vedere faptul că desfășurarea acestui sondaj de opinie nu înseamnă neapărat și o schimbare în viitorul apropiat asupra aspectelor aduse în discuție prin intermediul întrebărilor din chestionar, însă poate deveni un punct important de referință pe viitor. Perioada și modalitatea de completare & publicarea rezultatelor Intenționez să mențin deschisă participarea în cadrul sondajului de opinie până în data de 5 iulie 2020, ora 09:00. Ulterior voi reveni cu o actualizare care să cuprindă rezultatele propriu-zise, cât și analiza acestora și eventuale concluzii pe care le putem trage de pe urma lor. Răspunsurile acordate în lipsă de seriozitate nu vor fi luate în considerare. Analiza și interpretarea rezultatelor se va face în mod colectiv, toate răspunsurile acordate vor fi tratate în mod anonim tocmai pentru a încuraja completarea chestionarului în mod sincer și fără bariere. Chestionarul poate fi completat accesând următorul link: https://forms.gle/w8nawZqn4jQFoDGN7 Distribuirea chestionarului Vă invit pe toți cei interesați să distribuiți mai departe chestionarul către persoanele despre care știți că activează în mod constant pe comunitățile românești de MTA și care pot trata acest demers cu seriozitate. Deși este important să obținem cât mai multe puncte de vedere, este important să punem accent și pe calitatea răspunsurilor tocmai pentru a nu periclita acuratețea rezultatelor. Vă mulțumesc pentru interesul acordat!
  29. 6 points
    pDownloader version 1.0 Better looking progress bar and players can play while downloading files. Video: https://streamable.com/bedf40 How to use If you want to enable pDownloader for a resource. (for example for the vehiclemodels) 1) Open vehiclemodels/meta.xml. 2) Add <pDownloader>true</pDownloader> tag to enable it. 3) Disable downloading for every file, which you want to download with pDownloader, instead of the default one. Example: (vehiclemodels/meta.xml) <meta> <pDownloader>true</pDownloader> <!-- STEP 2 - enable pDownloader --> <script src="client.Lua" type="client" /> <!-- STEP 3 - disable downloading with download="false" attribute --> <file src="files/infernus.txd" download="false" /> <file src="files/infernus.dff" download="false" /> </meta> (IMPORTANT) You can load models just after when every file was downloaded. (when pOnDownloadComplete called) Example: (vehiclemodels/client.Lua) Note: use resouceRoot for event's source addEvent("pOnDownloadComplete", true) addEventHandler("pOnDownloadComplete", resourceRoot, function() local txd = engineLoadTXD("files/infernus.txd") engineImportTXD(txd, 411) local dff = engineLoadDFF("files/infernus.dff") engineReplaceModel(dff, 411) end) Thats all, now if somebody connect to your server, selected files are downloaded by pDownloader. Events pOnFileDownloaded (client) Called when: file downloaded successfully. Event's source is: root element of the resource that downloaded file. Parameters: - path: File's path. pOnDownloadComplete (client) Called when: every file downloaded successfully inside a resource. Event's source is: root element of the resource that downloaded file. pOnDownloadFailed (server) Called when: file download failed and player get kicked. Event's source is: player who can't download the file. Parameters: - path: File's path. Download Priority You can set the priority in meta.xml by replace true to a number. Resources with higher priority are downloaded before others. Note: default priority is 1 (when value is just `true`) <pDownloader>10<pDownloader> ⬇️ Download from Community Please rate the resource on community.
  30. 6 points
    Hi everyone! I want to offer for sale a new sims based interior customizing system that can be a perfect DLC for your server. Basic informations The system contains a lot of individual models More than 340 different furnitures (with corrected offsets) More than 130 different walltextures More than 100 floortextures Userfriendly, sims based interface Optimized systems, that is by modern methode The script is easy to install Possibility for microtransaktion (Premium Points) Adjustable interior size (2x2 - 10x10) Tutorial Video Price: 108 € via Paypal Buy it fast and safe here: https://payhip.com/b/hfNz Contact For more information you can contact me there: Facebook: facebook.com/stevenscottmta E-MAIL: stevenscottmta@gmail.com Forum: @</Steve>
  31. 6 points
    Hello, As many of you know we are working on a new community website, and we need your help to design it! We are looking for a UI developer who: can design a website in Photoshop, Sketch, or another prototyping tool HTML/CSS experience is a plus, but not necessary would be open to further working with us to design a new homepage and forum design has an eye for good UX and good accessibility From you, we need: a new community website design that is suitable for the modern web not a redesign of the MTA logo Since we are an open source project, we all volunteer our time towards developing and moderating Multi Theft Auto. All of our donations go to server costs, therefore we are unable to pay for a designer. Here's what we can give you: a contributor rank on the forums a spot in the credits We understand that this is a lot of work, so we're primarily interested in working with you continuously over the next several months. How to apply Each submission should include: links to a redesign of a single MTA page of your choosing this can be any webpage on the MTA network (homepage, community, forum, nightly) an image or a sketch is enough (no HTML required!) For bonus points (optional), you can include: a couple sentences explaining your background/interest this can be anything relating to your activity in MTA or stuff you do in your spare time examples / a portfolio of your previous work (links are great!) If you are interested in working with us, please respond to this topic by the end of September with the above info & suitable links. If you have any questions, feel free to respond to this topic or contact us on Discord. After all the designs have been submitted we'll contact the author of the best submission. Incomplete submissions will not be considered. I'm not a web designer, how can I help? At the moment we are NOT currently looking for other contributors. Feel free to give feedback and vote on submissions. Please be considerate when using the quote feature (do not include large images in quotes). Thank you!
  32. 6 points
    Hi, You are a dedicated tester of the 4Life / PyLife bot that is being described at these 2 topics: 1) https://forum.mtasa.com/topic/125549-banned-by-mta/ (you work for him, as a tester) 2) https://forum.mtasa.com/topic/125545-banned-by-mta/ (read my post there) We initially banned you for 1 month (due to higher involvement with the bot, as a tester, not just an user) on serial 4995B3E3EADBA4BE8EA58259A54B0602 (where you ran the bot), but later found out that you are a massive serial changer, who knows how to change their MTA serial solidly and as a result has generated over 20 serials during a certain period. The serial changing practises have facilitated various types of abuse that are detrimental to the polish community, such as the case of testing a bot for its developer and easily bypassing any potential bans that would come from it. The combination of these made your ban turn permanent. In addition, we will soon deploy measures to prevent your particular changing method, after which any further serials will also get swiftly banned. I doubt that is you, but I won't even begin trying to confirm it, because it wouldn't matter who you are, or how many subscribers you have. MTA knows what you did, including on all of your other serials, and that if you really are that Youtuber, you'd have a double agenda of cheat testing (and who knows even promotion), abuse, besides it. For us, you are simply a player that did bad things. Ban appeal denied, @Varus@onet.eu Update: we believe that you are involved in a massive scheme that aims to hurt 4Life / PyLife reputation in favor of a server that you're starting up yourself, this is achieved through significant involvement in things (such as the mining bot industry) that are deceptive and manipulative, and leveraging your influence in the Polish community to exacerbate the damaging effects (on the reputation of 4Life / PyLife) of your scheme. The details of which are found in your PM, but won't be posted publicly due to your privacy and its severity.
  33. 6 points
    bengines provides custom engine sounds for vehicles. The resource is not focused to be ultra realistic, it is designed to use for casual servers. Not useful for me anymore so sharing with community. Used on old project. Sounds are copyrighted content not owned by me. Features: ready to use, chooses the best engine for vehicle depending on handling! easy to customize & expand for Lua programmers 30 soundpacks for vehicles (buses, bikes, sport cars etc.) stable code with quite high performance used on server with 600 players ALS effect (exhaust flames) Turbo (satisfying whistle and blow-off sounds) Videos: https://streamable.com/n7k40 https://streamable.com/lp14t https://streamable.com/q5e9g Download: Github: https://github.com/brzys/bengines (feel free to send pull requests) Community: to-do For programmers: --[[ Element datas used by resource [array] vehicle:engine - stores basic info about engine type, sound pack etc. (synced) [string] vehicle:type - used for engine calculation, useful for servers. Available: Bus, Truck, Sport, Casual, Muscle, Plane, Boat, Motorbike (synced) [string] vehicle:fuel_type - customized for each engine. Useful for servers. Available: "diesel", "petrol" (synced) You can use setElementData(vehicle, "vehicle:upgrades", {turbo=true, als=true}) to add turbo or ALS. --]] --[[ Exported functions --]] exports.bengines:getVehicleRPM(vehicle) -- returns RPM of given vehicle exports.bengines:getVehicleGear(vehicle) -- returns current gear of given vehicle exports.bengines:toggleEngines(bool) -- true / false, restore GTA engine sounds
  34. 6 points
    السلام عليكم ورحمة الله وبركاته اسعد الله اوقاتكم بكل خير ، وأسأل المولى عزوجل أن يقينا ويقيكم شر كل داء ويحفظنا بحفظه .انه لمن دواعي سروري أن اكتب موضوعي هذا مبينا فيه السلسلة التاريخية لسيرفرنا والتي قد مرت بأزمات وصعاب ولكن بفضل من الله ثم بعزيمتنا تصدينا لها ولا أخفيكم انه من اهداف موضوعي هذا اود ايصال رسالة شكر لكل من ساهم في نجاح السيرفر منذ تأسيسه الى وقتنا الحاضر وكلنا نعلم أن من لايشكر الناس لا يشكر الرحمن . بداية تم تأسيس السيرفر ع يد -Mr-Wael -EBDA3 حيث أنهم قد استمروا الى حين انضمام المبرمج @Mr.Talal07 ولايخفى عليكم انه كان شمعة من شموع البرمجه واسم لامع حيث قاد هؤلاء الثلاثة السيرفر الى ان اصبح سيرفرا منافسا بعد ذلك بسبب ظروف المؤسسين فقد تم اعتزالهم وقمت انا محدثكم MAX-511 باستلام السيرفر سنتين انضم خلال هذه الفترة وبعد اعتزال المبرمج انذاك mrdk-ly @Do_De<3 حيث انهم قاموا بمجهودات عظيمة يصعب ان يتم جحدها او نكرانها بينت وفائهم لاصدقائهم وصدقهم واخلاصهم توقفت انا بسبب تخرجي وعدم القدرة على التفرغ الى تسليم ia7bk حيث كان مثالا للصبر والحكمة ولكن بسبب الظروف نفسها للسابقين فقد اعتزل وتسلمت الامور الى Howlywood والذي هو مستمر في فترته الحالية دون توقف في هذه الفترة انضم المبرمج نصور والذي هو السبب بعد الله في نجاح السيرفر هذه الفترة وذلك لما يقدمه من مودات وبرمجه ولمسات سحرية يعجز اللسان ان يصف جمالها كما لا ننسى شخصين من افضل مصممين المابات M3LM SHB7 تصميمهم الابداعي ولمساتهم الجميلة في المابات تزيد جمال السيرفر فلذلك ان كل مادفعني اليه الامر الى ايصال شكري لهؤلاء الاشخاص الذين حق لي فخرا ان اذكرأنني قمت بالعمل معهم حيث كانوا كالرجل الواحد وبالكلمه الواحدة حيث انني اريد رد الجميل لما يقدمونه ويسهرون ويتعبون ولكن لكل منهم دعوة اخويه في ظهر الغيب لا يعلمونها وفي النهاية اعتذر عن الاطاله ونوعدكم بالافضل دام مبرمجنا نصور ومصممينا موجودين مع احتمالية عودة صاحب السيرفر وائل والمبرمج السابق انكسار ضض والسلام عليكم ورحمة الله وبركاته تقبلوا تحياتي
  35. 6 points
    Installation: extract files to C:\Program Files (x86)\MTA San Andreas 1.5\MTA\cgui\images replace & launch the game. Mediafire Dropbox Google Drive
  36. 6 points
    مبارك عليكم الشهر الكريم , وكل عام وانتم بخير
  37. 6 points
    Post Anterior: Comentando o Código Antes de mais nada, boas praticas de programação, não são uma regra fixa que não pode mudar, mas sim, praticas (como o nome já diz), que facilitam o desenvolvimento, e o trabalho em equipe em um código. A principal boa pratica de programação é comentar o código, em Lua os comentários podem ser feitos da seguinte forma. Para comentar linhas únicas se utiliza ( "--" ) da seguinte forma. if condição then -- Comentário do IF. Para comentar em blocos se utiliza --[[ Bloco a ser comentado ]] Tentem manter ao máximo a pratica de comentar oque cada função faz, variáveis e etc, assim fica mais fácil para você se encontrar no código, e para quem estiver trabalhando junto com você no código. Desenvolvimento & Identação Sempre que forem programar tente manter em mente que seu código deve ser: 1. Simples - Deve ser de fácil compreensão; 2. Direto - Deve executar aquilo que é proposto, sem rodeios, e sem funções desnecessárias e sem utilidade; 3. Organizado - Deve seguir uma ordem de organização (mais a baixo vou exemplificar uma organização.) 4. Sem duplicidade - não faz o que outra parte do código já faz; 5. Elegante e Único - Seu código deve ser algo que você se orgulhe de ter feito, que seja elegante, e funcional e que principalmente seja seu. Um dos pilares para organização do código e para facilitar a visualização do mesmo, seria a utilização de uma boa identação, como por exemplo: Código sem identação: addEventHandler( "onPlayerWasted", getRootElement( ),function() setTimer( spawnPlayer, 2000, 1, source, 0, 0, 3 ) end) Mesmo ainda sendo legível o exemplo básico de código logo acima, se ele for identado fica melhor a compreensão do mesmo. Código Identado: addEventHandler( "onPlayerWasted", getRootElement( ), function() setTimer( spawnPlayer, 2000, 1, source, 0, 0, 3 ) end) Pode parecer algo besta, só alguns tabs para organização, mas em um código com mais de 300 linhas, isso faz muita diferença. **Só para lembrar, Lua não necessariamente precisa de identação já que tem then/do e etc, mesmo assim é uma boa pratica.** Nome de Variáveis e Outras boas Praticas Outra boa pratica de programação é a forma como se nomeia as variáveis e funções, não há uma regra definidas mas existem padrões em outras linguagens para facilitar a leitura, por exemplo: Variáveis se escrevem com nome_nome = valor Funções se escrevem com nome_nome() Eu recomendo que nomeiem as funções dessa forma ou nomeNome = valor; nomeNome(); Além disso recomendo que sempre utilizem nomes que façam sentido por exemplo: local nomeJogador = getPlayerName(source) -- Vou explicar quando usar Source/Player/thePlayer na parte de Script. Caso fosse uma função poderia ser obterNomeJogador() ou obter_nomeJogador(), o importante é que seja legível e você consiga identificar oque ela faz. Alguns podem se perguntar, porque não utilizar tudo minúsculo e junto, bom quando você começa a trabalhar com letras iguais isso se torna um problema por exemplo: local casaamarela = x, y, z Nesse caso seria recomendável uma separação, por padrão eu sugerido que sempre usem minusco e _ dessa forma casa_amarela = x, y, z; Assim mesmo que as letras sejam iguais, você não teria que se preocupar com descobrir oque aquele variável faz. Um pratica que eu não recomendo de forma alguma é abreviação ou o uso de letras por exemplo: local obter_nomeJogador() Que passaria a ser local onj() Para você que esta programando pode fazer o maior sentido agora, mas para outras pessoas ficam muito confuso, além de que você pode se esquecer ou nomear funções com as mesmas letras mais a frente no código, oque geraria conflito com a informação. Outra boa pratica de programação seria a de utilização de parênteses () em verificações, eu pessoalmente não me atenho muito a isso, porem facilita muito a vida de quem esta começando exemplo: local x = 10; local y = 50; if x < y then Passaria a ser: if (x < y) then Essa pratica torna a condição muito mais visível, e facilita o entendimento da verificação. ** Porem no caso de Lua assim como o ; ao final das var não é de uso obrigatório, outras linguagens podem ser.** Loops e Condicionais Como foi explicado no post passado, os loops e condicionais são muito uteis e fazem grande parte da programação, porque querendo ou não, temos que verificar coisas, e agir de acordo com elas. Tendo isso em mente, vou dar uma dica básica, evite chamar funções em loops ou condicionais complexas, principalmente em loops. Oque acontece aqui é que mesmo um while/repeat executa varias vezes um mesmo bloco de código, até prover uma condição favorável a saída, e isso pode parecer Simples, mas imagine você chamando 10,20 ou 30 vezes uma mesma função, que atribui valores locais na memoria, e executa. Em Lua isso não se torna um problema muito grande, mas em outras,linguagens como C ou mesmo JS isso pode causar um crash na aplicação muito fácil, então para evitarmos que esses problemas possam acontecer, evitem ao máximo chamar funções dentro de l ops ou condições complexas. Negações no IF Outra pratica que e interessante se evitar, é utilizar as condicionais no negativo, por exemplo o if not. Lembre-se que uma condição, só é executada quando a condição se torna verdadeira, e um if not é uma negativa verdadeira, parece algo besta, mas você poderia lidar com ela no else, isso é mais uma recomendação mesmo, trate as verificações sempre como produtos verdadeiros e lide com os negativos no processo, não faça uma negativa verdadeira. Organização de Código No começo do código, geralmente é recomendável a importação de bibliotecas, funções externas, e etc. Depois a atribuição de variáveis globais se necessário. Podem seguir esse modelo básico: Variáveis globais e Datas; Objetos e Afins; Funções e Condicionais; Exports e Imports; Handles e eventos. Pode parecer meio confuso agora, mas quando chegarmos na parte de Script de MTA, vamos seguir essa organização e garanto que tudo vai ficar mais fácil. Como esse post trata de praticas de programação, eu recomendo que você retorne em seus códigos antigos e tentem refazer eles utilizando essas técnicas, e organizar o seu código da melhor maneira possível. O único exercício que eu vou deixar aqui, é que vocês tentem diminuir a quantidade de linhas nos seus código antigos, sem perder funcionalidade. Caso queiram, podem postar o código nesse tópico, e caso tenham alguma duvida, deixem logo a baixo. Só lembrando ao pessoal que já entende do assunto, ou pelo menos sabe o básico, vamos ajudar quem esta começando, todo mundo começou sem saber quase nada. Parte 04:
  38. 6 points
    Main page Animation Homepage
  39. 6 points
    - طابت أوقاتكم أخواني الأعزاء - يسعدني و يسرني أن أقدم لكم مجموعة سيرفرات شبكة فينكس تعريف عن الشبكة شبكة فينكس هي شبكة نشأت هذا العام و بداية نشأتها كانت في سيرفر تيم سبيك يجمع لاعبين من جميع الألعاب , حيث أنه يوجد في سيرفر التيم سبيك فوق ال100 عضو , و أيضاً هذه الشبكة تدعم بعض الألعاب مثل MineCraft , GTA FiveM و MTA SA التابعة لشبكة فينكس MTA حيث أنه يوجد طاقم مخصص حالياً لبرمجة سيرفرات و هذا الطاقم مكون من مبرمجين و مصممين و إداريين ذوي كفائة عالية في اللعبة مما يساهم في تقديم كل شيء يساعد اللاعبين على الاستمتاع في السيرفر التابعة لشبكة فينكس MTA سيرفرات < هجولة > < حرب عصابات > < زومبي > < ريس > التابعة لشبكة فينكس MTA طاقم سيرفرات @DRRB-3 @[Anon]SaRaB11 @wSky @#Moha @Mr3b المبرمجين المشاركين @NX_CI @Abdul KariM @[T]|O|[P]George مصممين (مابات , اوبجكتات و صور) @KasaNoVa @MR.Saleh[Tito] @#-DR-[M]AN- @wSky طبعاً الحين شغالين بالمودات و التصاميم و بنزل لكم التحديثات كل فترة و بنعلن لكم متى افتتاح كل سيرفر تشرفونا و تنورونا بزيارتكم بنزل لكم كل جديد و التحديثات الي شغالين عليها ~ ترقبوا الإفتتاح ~ TeamSpeak Fenix Server [ ts.fx-n.net ]
  40. 6 points
    Introduction A collision model is used by the game to understand the impact between two entities to then calculate physics. These models are physical based, opposed to game models which are visual based. A collision model can generate particles when interacted with by being assigned surface materials. This guide is 3D modeling based and does not cover any procedures that require scripting. Table of Contents Importing collision models from the base game Patching and correcting default game collisions Primitives and why they're beneficial General limitations Surface materials Volumetric shadows Vehicle collisions Importing collision models from the base game Collision files from the base game are stored in large collision archives. These archives have the ability to stores numerous collision files, although custom archives aren't compatible with MTA. In order to find these files, it is recommended to have extracted all game models. Reading the section Extracting game assets on this thread is necessary as a first step. The best way of getting the name and location of an object's collision is using SAMP Editor. Simply double clicking the object shows the name of the collision and which .col it's stored inside. It's possible to have an instance of MTA running and then open SAMP Editor, by having a separate gta sa installation specifically for SAMP Editor. Collision files are named according to their area in the map, where lae_1 is Los Santos East part 1. Although SAMP Editor option is often better, Prineside also offers a way of getting to know the collision name. Clicking any object on Prineside shows its IDE name (item definition) which is the same name used for the collision file. For instance, ID 16003 drvin_ticket belongs in countn2.ide - this means that its collision is stored in countn2_1-20.col (has 20 files from that area). Finding which one contains collision-model drvin_ticket is like finding the needle in a haystack. Using Steve M's Collision Editor may speed up the process of finding the file containing the collision model. Using collisions from the base game and then modifying can be beneficial as they're often very optimised, and uses a lot more materials for both material brightness and various different surface properties. Such results may take a lot longer than one wishes to spend on a collision. Most collision models comes with primitives which are great to use and is explained in next part. Patching and correcting default game collisions Mappers might often enough come across of furniture objects which pivots around empty air rather than the corner or center of mass. Rockstar did this a lot, especially for beds. As if this wasn't the only issue, Rockstar actually added several broken collisions to the game leading to blue hell (void). These can be patched by 3D modelers. To get started with patching a broken collision model, find and load in vegasw_4.col to 3ds Max by following the above part of the guide. Scroll through and locate downvgnbild1 and import said collision. The problem with downvgnbild1's collision is that the store windows can be climbed over, as the ceiling and walls are nor solid. Every Default's are primitives - that is spheres or boxes. They can be adjusted in height, width, length and radius as well as segments. In this case, from bottom, number 4 and number 5 Default are models that represents the store windows - which are the ones causing the glitch. What exactly causes the glitch? The collision primitives representing the store windows are not tall enough to cover the walls, which essentially means anything can sneak through the gaps. From bottom to top, the 4th Default needs be raised in Z from a value of 3,8659m to 7,2524m. Exact same procedure needs be done for 5th Default. Now the collision is solid in every way, preventing characters from climbing in behind the store windows. To export this collision, follow below steps. Open COL IO. Where it says Export Setting ensure COL3 is highlighted. This is required for GTA SA collisions. The collision contains a collision mesh named CM_downvgnbild1. This must be registered as mesh by clicking the button Collision Mesh and then clicking the CM_downvgnbild1. Same procedure for Shadow Mesh if it has any (this doesn't). The Collision Mesh button should now read as CM_downvgnbild1. In the scene, select everything that's part of the collision. On COL IO there's a text field above the button Export. Here the collision model's name can be defined. Just name it downvgnbild1. Hit Export and find a place to save it. The file can be named anything the user likes. Primitives and why they're beneficial Most 3D applications has a library of basic 3D models; primitives. They are common shapes which on creation can have their quality modified and then remodeled afterwards. For GTA San Andreas, collisions support Box and Sphere as collision primitives. Primitives costs a lot less in terms of file sizes, as example, the below sphere's collision model would be 10.4 kb with collision mesh sphere, and 140 bytes with collision primitive sphere - both collision results are equal. Tall buildings with lots of details e.g support beams tend to use collision primitives as otherwise the collision would sky rocket in file size and polyrates. Some warehouses even use primitives for their gates, exterior fences and walls, while the more complex base models requires a collision mesh. Primitives are named 'Default', though, on export they can be named anything. General limitations Collision models has certain limits which may explain crashes and strange behavior of models. Collision models can be a maximum of 512 height, 512 width and 512 length. In short, a 512 radius sphere or cube would reach the dimensions limit. Polygon rates of collision meshes (not to be confused with primitives!) should reach no more than 3000. In cases of such high rates, the modeler should either split into multiple files or optimise the mesh further. A collision file can contain up to 65535 spheres, boxes and faces. Collision archives are not supported in MTA unlike in GTA. There are cases where invisible collisions appear even after following the rules of thumb for exporting collisions. Isolated edges and vertices can be contributors to invisible collision walls. For reproduction steps follow this Discord channel link to MTA discord. Surface materials GTA SA engine uses materials for collisions. These materials define what type of surface that the model represents. Kam's COL MTL has 179 ID's. Ranging from tarmac, destroyed tarmac, dry mud, wet mud to sea floor and grass. These surface properties generate sound fx and particle fx when walked, driven or shot upon. Collision material also has brightness setting, where 0 is dark and 150+ is bright. Entities affected by this setting are peds and vehicles. The below spoiler contains a list of all surface materials and their ID's. Volumetric shadows World objects and vehicles are able to cast shadows - dynamic ones. These are meshes stored inside the collision file. Generally the shadow mesh should be slightly smaller than the game mesh, as otherwise it'll glitch on the corners of the model. The setting to display shadows are found in MTA video settings. Vehicle collisions Where world objects uses separate .col files, vehicles require their collisions to be embedded or baked in the DFF. These collision models consists of mostly spheres but may also be found to contain boxes and of course their collision mesh (prefixed CM_vehicleName). The collisions use spheres due to the engine's ease of calculating physics with those primitives. They are named that of the material Brightness/Part section, e.g Boot or Rear bumper. Ones that are not used by vehicle components are named Default. In below screenshot, the white lines represents the collision mesh of a Tornado. Usually the collision meshes will suffice with 12 faces total for the hood, windshields, roof, boot and bottom.
  41. 5 points
    السلام عليكم ورحمة الله تعالى وبركته لوحة تسجيل لدخول للرولي بلاي تصميم جديد و ميجيب لاق رابط التحميل في الفيديو BY MR POP
  42. 5 points
  43. 5 points
    Ah, the long awaited accusation. I don't blame you, I too was indoctrinated to think that the RPG was something SAES 'owned' however, it's just another game-mode. I've had my fair amount of time playing there, throughout the early years of it's blossom, namely 2012 - 2016. However let me run you down on what the Creative Gaming RPG server actually is. It's our view on the Roleplay Gaming game-mode in MTA. All of the scripts you see and experience on our server are crafted by our experienced developers, believe me a simple housing system, spaw-nmenu and other jobs namely 'trucker' that you mentioned are nothing but a very basic stem of the RPG. - Keep in mind, we are only in OpenBeta. The basic scripts you see currently are nothing but a temporary template to have the players experience an entirely different management, community and view of the RPG in MTA. We have nothing against SAES, even so I thank that community for providing me with years of entertainment, however we deemed it is time to step it up on our own accord and make a new version and feel to the RPG in MTA as you and I know it. The community receives that which the player wants, and we know what the player wants due to our experience in the RPG sense, so countless of updates have been implemented into the 'regular' RPG that you perhaps know to love. I do not however, belittle your opinion regarding your defense about SAES, since there has been plenty of copycats throughout the years which have indeed used 'leaked scripts and editing them' - This is a different story however and we would like you to see how our server blossoms. ===================== In the hands of an experienced .Lua developer, these basic accusations of using 'leaked scripts and editing them' has been completely thrown out of the window, because our development has taken ages to launch and in-return have bugs still yet to be discovered, thats why our OpenBeta playerbase is our first line of Quality Assurance when it comes to our scripts and functions. ===================== We all hope to see you ingame to have a delightful experience in our server, Head Admin Russell.
  44. 5 points
    سلام عليكم .. هذا اصدار اولي بس ، مسويه زمان مشاهدة ممتعة ~
  45. 5 points
    Good news, everyone! I think some of you had already heard about my project Oblivion Lost: Online(or The Exclusion Zone now). Today I have decided to release all the things around this project. All the resources are published right now. Enjoy it because it was made with LOVE! Comes with batteries included! The link: https://github.com/tederis/theexzone
  46. 5 points
    Introduction This guide intends to teach 3ds Max users the basics, and more advanced ways, of working with (environment) animations and rigs to enhance atmosphere of the game. Animations, moving images or however you name it, they are there, everywhere in games. GTA San Andreas and its predecessors do utilize animations, however to a limited extent; most environment models were kept frozen in the dark days of PC games to save computer resources. Few objects like mechanical oil drills and food store mascots are animated. Today we're past those days and have advanced in technology to exceed limits, and integrate known resource demanding features into our games without much of a performance impact. It's important to keep in mind that the Renderware engine has various limitations associated with models/3D assets. These limitations do apply very harsh on what this guide covers. Table of contents Demo reel - Custom rigs and animations Prerequisites Recommended Character skeleton Basics to skinning Simulation conversion to bones workflow Demo reel - Custom rigs and animations Prerequisites Must have Autodesk 3ds Max of any desired version. 2017+ needed to speed up cloth rigging. Must have Kam's Maxscripts. Must have Animation Manager tool. Recommended You can use virtually any modeling or animation software e.g Blender or Cinema 4D to do 90% of the work. 3ds Max is required to export to GTA formats IFP and DFF. It's recommended to have experience in game modding and 3D modeling software of choice. It's highly recommended to use Shagg_E's anim/char helper for easy setup of bones and animation. For those who calculate bone hierarchy, add SPunknown = 4 to Root bone's object property. It's possible to use ARKTOS Tools VertexToBones for converting vertex-baked animations to bone animations. It should be noted however that this does not create bone hierarchy the desired way. It creates bones that aren't linked to each other, only the root, so it generates the animation for each bone to move, not rotate, and thus the majority of the animation relies on position keys, where SA animations only support rotation keys. Character skeleton San Andreas uses bones for its character animations. These bones are linked together, forming a skeleton with joints that can be rotated. Motion capture data can be transferred onto bones to ease the creation of character and more detailed animations. This was done for GTA cutscene models primarily. On 3ds Max, bones can be virtually anything, ranging from camera's to dummies. When exporting to GTA formats, the bone objects are automatically converted into dummies (helpers). This is how bones worked in early 2000's and/or 90's. If you desire to convert a helper or model into a dummy, follow this CGTalk post's instructions. For creating a skeleton, place all bones around the inner mesh of the model. Everything must be in a hierarchy and bones can have as many children as desired. Naming conventions are only recommended for easier overview, however they can be named according to one's desire e.g Bone_0 - Bone_12. To have the bones show the way the imported skins ones do, head to Display Panel under Links, and check both boxes. Make sure this is done for every bone. This will display joint links in correct hierarchy in viewport. Some games may use vertex baked animations, thus negating the need for bones. This is often seen on models such as all types of clothing. For game engines that do not support vertex animation or dynamic cloth, bones will be used instead. Below is a spoiler of valid bone ID's for regular ped models. There are 31 functional bone ID's, 32 with Root included. Once again, bones does not have to use same naming convenience as presented below. They also don't have to use same order of ID's or bone hierarchy, so for instance, Pelvis and Jaw ID's can be exchanged, as long as Root ID = 0. Or, the Head bone can be child of R Hand, not necessarily the Neck. Basics to skinning Although not hugely covered in this guide; Skinned models use a different system from vehicles and map objects. Besides having their 3D mesh, they have a skeleton. A skeleton is made of bone joints linked to each other, so that when the shoulder moves, the lower arm does as well. A bone will only affect part of the mesh that it's weighed to. If you weigh all vertices of the player's hat to the Head bone, then the hat will move according to the head bone. If you weigh all of the hat's vertices to the Pelvis bone, then the hat will stay static in air while the head moves. All vertices must be affiliated with at least one bone. Although a skin can have 32 bones, it'll work just fine if you weigh all vertices to only 3 bones. Not all bones require to be affiliated with a vertex. If you try to export a skinned model where 1 vertex is not weighted, the exporter will reject your request to export or your game will crash. A skin can have as few as 2 bones (root and children), so if your model has only 8 vertices, there's really no point having 32 bones when only 8 are functional. Below image (credits: IamObama) shows the basics to weighing joints to a character mesh. While this doesn't show all of the bones, it can prove very helpful as a lookup while weighing vertices to your skin. You can also load in a GTA ped to reference its miscellaneous bones e.g facial and fingers. Simulation conversion to bones workflow Note: The following process or techniques may apply for Blender/Maya users as well. 3ds Max has inbuilt cloth physics. These can simulate with help of gravity, wind, etc. and is a great way to generate animations for cloth-like elements. With help of tracking markers, you can track a bone to follow the orientation of a marker, which can then be baked into keyframes. The process is incredibly simple, you just have to understand the basics of cloth physics and object constraints. Video tutorial: Text tutorial: Create your model simulation model Be mindful about geometry and bone count when creating your model. The fewer polygons, the more rough the animation will be. The more polygons, the more cloth-like it'll look. The more bones with keyframes, the larger the file size (lots) of your IFP. For flags, one bone should never have full influence of a vertex. A vertex should always be affected by 2 or more different bones for a nice blend. It may be an idea to load in a GTA model so that you can somewhat reference the scale, if you don't have access to a dimension ruler. For the purpose of the guide (assuming you follow along the video), create a plane (primitive) with 8 segments in both directions. Make it length: 1,280 meter, width: 848 millimeters. Prepare your simulation model Convert the primitive to either editable mesh or editable poly. Polygon mode is more sustainable for modeling, but it needs to be in Mesh mode once you export it. Enable angle snap (default: A) and rotate it so it stands vertically. On the Hierarchy tab, reset transform to reset rotation values to 0. Add a Cloth modifier to your model. Go to sub-object level group of cloth modifier. Select the vertices that you want to act as solid points (e.g ones attached to flagpole). Click Drag as group mode. Simulate the model Head to Create tab > Space warps. Create a wind. Its position doesn't matter, only the rotation which represents the direction, matters. The default settings of the wind are usually too high. Try setting strength: 0,12, Turbulence: 0,8, Frequency: 0,05. Select the simulation model. On the cloth modifier, select Cloth forces and choose the wind. On the same interface, select Object properties. Select the model's name, then select Cloth, then pick a preset of your preference. Try silk or cashmere. You can optionally use Edge springs. I'm not fully sure what it represents, but I believe it's got to do with keeping the edges intact and not stretching them (which you don't want for bone animations). Try simulating the model. You may want to increase the timeline to a more reasonable duration, but be cautious as the higher it goes, the more your potato will suffer. If you aren't happy with the simulation, erase it and it'll let you try resimulate it. If you're unlucky enough to get the infamous error message dT increased/decreased you may want to start a new 3ds max project file... Create your real model In most cases you'll simply clone the simulated model, name the clone skin_mesh (name can be anything, but for easier scene management, name it something related). Remove the cloth modifier from your "real" model. For the simulated model, select the create keys button in cloth modifier. This will collapse your modifier and bake animation into keyframes, can NOT be reverted! Move the simulated model a bit away from the skin mesh, so that it'll make it significantly easier for a later procedure. Make sure to center the skin mesh to 0,0,0 or you'll get real trouble later. Convert the model to editable mesh. When you need to export later, it doesn't want it as editable poly. Create bones for your model Apply a Skin modifier to your model. This is used to carry the skeleton bones for later on. To make the bone creation and setup a whole lot easier, run Shagg_E's animation tools (link in top of thread). If you simply choose to create a set of dummies, his script won't recognise them as bones and you'll have to add all the object properties manually. So do yourself a favor and use his tool. Navigate to the Char helper section on the interface. Click create root, this'll create a dummy in center of the scene, assuming it corresponds to the model's center. Click create children, this'll create a dummy linked to the root. Drag it out from the model and title it "Pelvis" (again naming doesn't matter, can be "sampsucks" and samp modders will know once they load in your skin!). This bone is usually needed to keep part of the model's verts (abbreviation for vertices) in place, e.g flag pole attachments. Keep creating children bones until you reach your desired amount. It's a good idea to enable snaps (to vertex) so that you can magnet position bones directly onto the vertices. Select any bone in hierarchy and click Calculate for all hierarchy. This calculates bone ID's, bone index and bone type. If you were to set this yourself, you would need to understand how they work, on top of this it would be very time consuming. So we can all thank Shagg_E for making this wonderful script. Select the root bone, head to object properties, in user defined add to the string SPunknown = 4 or else your skin won't work as intended. Prepare motion tracking Create motion tracking markers. Head to create tab -> helpers -> point helper. Keep their scale at .2 or so. Spawn the amount equivalent to the amount of functional bones (excluding root and pelvis). Select all of the point helpers. Under the Animation rollout, select constraint -> attachment constraint -> select the simulated model. Go to Motion tab. The positions are based on triangle points, so you have to insert either 0 or 1 on A and B, then pick a face. It'll make more sense if you watch the video. You need to position the point helpers to the vertices where the bones are positioned at. I don't know of any more efficient way of doing this. On the model's skin modifier, add all functional bones (except root and pelvis). If you're running Max 2017+, you can use Voxel Solver to automate rigging (rough solution) and works great for simulated models. Use setting: falloff 0,2, max influence 3, max resolution 128. Try rotating some bones and hopefully they should affect the skin mesh. Now add the rest of the bones which you didn't rig to the model. If the model is a flag, then select a few vertices that you want to be solid in place, and weight those to pelvis at 100 weight. Track the motion of the simulated model Select all point helpers, click E for rotate, click F12 for rotate transforms and reset all 3 axis to 0. If you don't, some of your bones will be rotated massively (undesired). Apply an orientation constraint to all of your bones, 1 by 1, to their point helper counterpart. This tracks the rotations of the point helpers onto the dummy bones. You can add a shortcut to speed this up a tad... Select all the functional bones. Go to motion tab, click trajectories. This is where you bake the orientation constraints into keyframes for your bone animation. Settings below. Start time = 0 by default, or the first frame of your timeline End time = last frame of timeline OR whenever you desire Samples = amount of keys for the animation. If Start = 0, End = 1500, you can add 1500 samples to have 1500 keys generated, or 150 to have 150 keys generated. Don't use much more than 200 samples or you'll get in serious trouble. You'll have to optimize your keyframes at some point. You can change the keyframe tangent mode (i prefer auto or spline) to change the velocity of the keyframes. Once everything is set, click collapse. This generates keyframes. Animation is now made. Making the cloth simulation seamless/loop is another story. Finishing up Custom model and custom IFP is essentially done now. In order to export animation from 3ds Max, simply select all bones, find an IFP file on your computer and clone it, on 3ds Max run the IFP script, click "load IFP" and then save your custom animation to the cloned IFP file. You can remove excess IFP animations from the IFP archive by using Animation Manager Tool. Have fun with it! There was a recent update where MTA made a couple dozens of unused ped ID's available for servers to use. This is what inspired me to make this guide, since you could use those ID's to "add" new models, of which could be environment models to bring life to the world. Custom IFP's can simply be added into the server, they don't need to replace existing ID's. It's important to note that by changing bone ID's, you change the way that the custom model reacts to default animations. As such, models like banners will appear incredibly distorted. In those cases it's suggested to create some idle, walkstyle and run animations. It's also important to note that you can create LOD animations, since there's really no limit for how many IFP's a server can have. LOD animations may be very handy for animations that have highly dense simulations applied, so the further away the player goes, the less keyframes will be processed.
  47. 5 points
    If you're having issues with models or are looking for help on how to achieve certain results, feel free to ask in here. Note: Please check the Guide section before asking questions in here. Frequently Asked Questions on GTA modding the FAQ is on 3DS Max, though can be applied for various app's Lighting and Shading #1 Why can't I change the smoothing of my model? Your model contains duplicate vertices - this is a typical issue within GTA importers. They tend to break the vertices/split the edges on import, requiring to be welded. View the spoiler for a potential fix. #2 My map model is overexposed in day and night time. Your model lacks vertex color and illumination respectively. The GTA engine uses vertex color information to define lighting which is baked into the model. View spoiler for a potential fix. #3 Why is my Infernus model so bright? GTA engine calculates brightness of vehicles based on map objects collision brightness (that it's standing on) and the vehicle surface properties. View the spoiler for a potential fix. #4 My striped Bullet has different brightness for primary and secondary colors. GTA engine uses different lighting techniques for vehicles than map objects. Some of which are specular lighting, which in short brings a fake highlight onto the vehicle surface, illuminating it. View spoiler for a potential fix. Modeling #5 Certain polygons are not visible ingame, but looks fine on 3D editor. GTA engine among most other game engines uses backface culling, which kills the faces that are not facing/are blocked by ones facing the camera. This procedure is done to save memory. View the spoiler for a potential fix. #6 Can I make scissor doors for my vehicle without requiring scripts? It is possible to modify how vehicle doors appear in their open phase. It involves changing the rotations of dummies and their children objects, the doors. View the spoiler for a potential method. #7 How does vehicle reflections and chrome work? GTA vehicles uses 2 UV channels; first for diffuse, second for env and chrome mapping. If the secondary UV channel is not unwrapped properly, the env/chrome will either not work or flashes too often. View the spoiler for a potential method. #8 I can see through my vehicle chassis when looking at the police decals, why is that? Materials that are responsible for alpha needs to be last in the multimaterial list. If this is not done, textures like police decals will not render parts of the vehicle behind the alpha. View the spoiler for a potential fix. #9 How do I make a vehicle paintable? GTA SA requires models to have a certain colorcoded material applied to the surface of vehicles that needs to be paintable. It also needs (optionally if using textures) a texture that is not black. As anything that isn't black will be. If parts of the texture is grey, the color ingame will look sort of dirty or old. View the spoiler for a method. Miscellaneous #10 I have imported des_sherrifsgn1.dff into 3ds and extracted the textures into a folder, but they aren't displayed. It is not enough to extract the images, you'll have to tell the program where your textures are stored for it to apply them on the model. View the spoiler for a potential solution. #11 I want to remove Wuzimu's glasses and export it to my game. How do I do this? You're going to need a GTA formats importer. I prefer Kam's vanilla tools for skins due to its decent support for bones and skinned models. View the spoiler for a potential method. #12 What file types are worth to know about? GTA has many, many file types, and a lot of them are not natively available in MTA unless you modify your server's anti-cheat system to allow locally custom data files etcetera. So if we're going with MTA friendly files, there are a few. View the spoiler. #13 Where do I find shared vehicle textures, and what's each their use? You can locate the .txd for shared textures in GTA SA dir\models\generic\vehicle.txd. It stores textures which are used for SA vehicle lights, lighting and many more textures, which are used across hundreds of vehicles. As these textures are found in your local files, none of them are required to be added to custom vehicle .txd files, making for potentially very low file sizes. View the spoiler for a full list. #14 I have downscaled my model, but in-game it remains the same size as before. If your model's scale values says something like 76,144, 76,144, 76,144, it will reset to 100, 100, 100 on export. To correct this, go to Utilities panel, click Reset xForm, Reset selected, then right click the modifier and collapse to. Now your model will have its new scale applied. #15 I have converted a Counterstrike map and turned the main mesh into a collision which is 250kb. I am getting invisible walls, why is that? GTA has a very low polycount limit in regards to collision models. Not to be confused with collision primitive models, which are spheres or boxes, but the CM itself. If it is above or around 5000 (needs additional sources...) polygons, issues will occur, such as invisible walls or as if there's a large box blocking the entire model off. Another culprit for collision issues is the pivot point and position that the collision is exported at. You need to set the collisions to 0, 0, 0 and pivot point needs to resemble that of the main model, otherwise they will not line up properly. #16 My character movement is bugging on custom modeled stairs. GTA III, VC and SA do not have support for advanced staircase collisions, and so they require a different approach, which is a planar ramp or slope if you will. This may not look very good when the character steps on the stairs, however it is the most performance and bug-less method around. **Please feel free to contribute to the FAQ by leaving a comment here or through PM. It will be greatly appreciated.** little note for colors #B8E0B6 #4A4A4A
  48. 5 points
    اول هدية مني ل @KillerX اي حد ليه طلبات يأمرني بس ما حد يطلب شئ سويته لحد اخر
  49. 5 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 "onPedRanOver" 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
  50. 5 points
    This topic contains the MTA global ban policy, information on how to appeal your ban and instructions on how to file a report (see bottom of topic) ** Different language versions ** Russian (русский): КЛИКНИТЕ СЮДА Для русскоязычных пользователей Portuguese (Português) CLIQUE AQUI Versão em português Arabic النسخة العربية (عربي) انقر هنا Romanian (Română) APĂSAȚI AICI Versiunea în limba română This board is for global MTA bans only ("You have been banned by MTA"). It's not to be used for when you get banned from a server. In the case of server bans, please contact the admin of that server or use their website/forums to appeal if they have one. If you want to appeal a global ban, then please create a new topic HERE (click) that includes atleast your MTA serial. How to find your serial: launch MTA, press the F8 key and write ``serial`` into it. Now, select your serial and copy it using CTRL + C, then paste it into your appeal topic. If you received a global ban, you can appeal it under certain circumstances. Examples: - The ban is permanent, or has a pretty long duration (a month or more). * If a ban is permanent, no duration (ban time left) is shown in the ban message. - The ban is custom. This is the case when your ban message shows a reason that is not "TRAINER" or "DLL INJECTOR". * This can happen when you got banned as a result of illegal conduct on MTA. * The possibility to appeal bans mostly exists for these situations, where your appeal will prompt us to review if you can be unbanned, based on the offense and its severity. If you post an appeal and your ban doesn't fall under the above circumstances, then it may be removed rather than being answerred (although we more often do our best to make people understand the specific reason of their ban). This is because of the sheer volume of appeals for automated bans (for trying to run old, detected cheats or 1-hour bans for DLL injectors) would otherwise be insane. If it's a short-duration ban, then please just wait for the ban to expire. Important: if you re-post a ban appeal (or post after having already been told the outcome) because you don't agree with our decision which is final, or evade forum bans in order to keep posting appeals, they won't even be read - and will be instantly deleted upon getting noticed. Any account that posts appeals fitting this profile, risks getting banned.. so sending your friends to do it for you is also a bad idea. We don't like persistent people and will do all it takes to stop them and their spam. Explanation of the most common ban types and categories of bans they cover: "TRAINER" - Bans related to cheating: - If the ban is temporary (a few hours to a couple of days), then you attempted to run a detected cheat or used it while it was still working. * In the case of high-impact cheats, the ban duration can be a couple of weeks to a month. The same goes for paid (or subscription-based) cheats. * It is also possible that MTA AC's heuristics flagged you for custom cheating, such as amateuristic attempts to modify memory or use your own little cheat. This can sometimes also result in a temporary ban. - If the ban is permanent (note: with the type "TRAINER"), or for more than 2 months, then there can be several possibilities: * We know that you're a cheat developer, and we took efforts to remove you from our platform in order to stop you from messing with MTA and its anti-cheat. In this case, you have played your entitlements and we can deny your appeal on our discretion. However, we are always willing to give your case a fresh look. If you think that you've learned from your mistakes, and are willing to use our Bug Bounty program (click) in the future instead, you may be given another chance. So you're always welcome to appeal your ban. * You used a particularly serious (intrusive) cheat, one that we would call 'serious hackage', for example one that allowed you to ruin the game for everyone on a server or set out to harm a server or its integrity. This also goes for attacks aimed at a server or its playerbase that were packaged as executable code that you loaded & used in a cheat-like fashion. "REASON" - Custom bans that give a hint of the reason in your ban message. If you engage in illegal activities, we consider it our duty to keep the rest of MTA safe from people such as yourself. Under no circumstance will we allow MTA to be used as a platform for illegal or malicious actions. Besides that, although this policy covers most situations and possible ban reasons, MTA staff can use their discretion to ban for any reason that can reasonably be considered as illegal, harmful, or damaging to MTA as a platform or its users. You will most definately be able to figure why you got banned from the ban reason text, and if you don't, you can always make an appeal to get further explanation. Also please note, if you post a ban appeal topic (for a ban about illegal conduct), you automatically agree that said topic, its content and any later posts in it won't ever be removed from the MTA forums. Reason being that while the ban was to protect MTA and its users/server owners from illegal conduct (malicious people such as yourself), if you later return to MTA others can be informed about you and your past to be prepared against falling victim to illegal conduct themselves. It helps for case-building (future offenses or moderators in need of referencing). We also reserve the right to add in (at most) MTA serial(s) to appeal topics. Common examples: * "DDOS" If you carry out DDoS/network attacks against MTA servers or other players, then you do not belong on MTA, and we will ban you to protect others on MTA against you and put consequences to it. Therefore, when we receive a substantiated report about you, we may decide to ban you if there's overwhelming evidence, or ban you indefinitely for our investigation to proceed (read below for details). * "RAT" If you (try to) infect the PC of MTA players with viruses or (remote control) trojan, which are called RATs. The most common way is for someone to share infected file (links) in a server's chat, or directly to a person that you have a relation to because of MTA. We ban those that engage in illegal activities like this as well, because MTA will not be a platform for such acts; if someone deliberately tries to inflict harm or digital safety risks to another player, we believe that person doesn't belong on MTA. * "EMAIL: ADDRESS" e.g "EMAIL: CCW808@GMAIL.COM" or "EMAIL: MCAK105@OUTLOOK.COM" This ban message means you got banned to allow us to investigate something you were involved in. If you see this, then please send a message to the e-mail address that is mentioned, which belongs to the MTA staff member willing to investigate you. It can be a result of a report against you (illegal activity, for example as described earlier) or (unknown/custom) cheats/hackage that you seem to have used and of which we want to learn more. We may even desire to know more if MTA anti-cheat managed to block & detect your attempts. For this reason, sometimes, temporary "TRAINER" bans may turn into this ban type or become extended/permanent. Also, doing suspicious things while not getting banned (like only kicked by advanced AC heuristics) can have you confronted with such a ban when you launch MTA at a later point. If there's overwhelming evidence for what you're suspected of doing, you may aswell see a hint of the reason followed by the e-mail address. Ex. "DDOS [EMAIL: ADDRESS]" This means we're confident that you did it, but that we're still interested in talking to you anyways. It merely offers you a way out, perhaps to get unbanned (early) by cooperating with us, express regret, or share your side of the story. At the same time, this type of ban message is also an encouragement to just accept your mistakes and move on, by understanding you did what the hint points to and that it got you caught. Unlike the ban message saying "EMAIL: ADDRESS", the variation with "REASON [EMAIL: ADDRESS]" can aswell be temporary and be unbanned at a set date. So if you recognize and accept your mistake, just wait for it to expire. * "CHANGE" / "SERIAL CHANGE" This ban message means that your serial (the one that got banned) isn't authentic: you (attempted to) change your MTA serial, and this got detected. Using technical measures to try manipulate MTA into generating a new serial results in a ban on said serial if it appears to succeed. Because they get banned, it's not succesfull after all, because you now cannot use it. If you return to using your original serial (undo the tampering that you tried getting it changed with), in most cases you will be able to play again. If you cannot figure it out/are convinced that you didn't try to serial-change, then feel free to create a ban appeal topic and we'll check on your case. * "BACKDOOR" This ban message means that you included a backdoor (or hidden commands with destructive or abusive functionality) in any script or gamemode that you (re)distributed, advertised or sold to any party. Investigation would result in a clear indication that you are in control of said backdoor. There are no excuses for the use of backdoors in MTA scripts. Justifications like "security" or "it's to protect from our gamemode being leaked" are invalid, because your actions in such a case would be an illegal action in itself (ex. using a command to set your own admin level would be considered hacking, using a command to shutdown/dump the server would be an hacking intrusion to the server infrastructure.. answerring immoral or bad acts with illegal acts isn't the right solution and will get you banned). Even though we now motivated this, we do realize that this excuse will be used to cover the intentions of 90% of the people who implant backdoors into their scripts and gamemodes, and still we do not believe this by default. But as you can see, such excuses would be invalid anyways. * "[SERVICE] ABUSE" / ex. "FORUMS ABUSE" In extreme cases of abuse on MTA services (such as forums, discord, community page), we may decide to global-ban you. For example: - if you're constantly evading bans on forums/discord, becoming a pest to our moderation team - if you're uploading resources with backdoors/exploits (such as hidden commands or destructive functionality) to the community page - if you're malicious towards the MTA infrastructure or intend to inflict MTA serious harm - if you engage in unacceptable behavior towards MTA staff, such as blackmailing or threathening them or their surroundings, because they are doing their job Please always remember that MTA: San Andreas is made and ran by volunteers that devote their free time offering you a game to play on and have fun. You're a guest, and not definately entitled to using our services; that's a favor. If you become very disruptive, causing us a lot of trouble, or soaking up moderation team resources to deal with the problems you cause us, then don't be surprised if you're no longer welcome to play on the platform we offered you. *Note: the above text refers directly to the "SERVICE ABUSE" paragraph. While the purpose of this topic is to explain why someone that wants to appeal may have been banned, it also contains our banning policy and a list of common bannable offenses. So as a side note, perhaps as a victim of something, you want to report someone that has engaged in activity listed in here, then feel free to send a message to Dutchman101 and/or ccw (you could add both into the same conversation, but make sure to at least send it to Dutchman101 to ensure timely handling of your report). If the matter pertains to DDoS, then please use this form instead of PMing us: https://docs.google.com/forms/d/e/1FAIpQLSevcWQ2EM4O9rmwLEtNiuXheEhtRYPa5yTPBqnwe1PFDK7B6g/viewform