Jump to content

[QUESTION] About default resources


koragg

Recommended Posts

OK, so i wanted to write this a long time ago and the time has come. 

Why are MTA's default resources made in such a hard way?

Why is every single thing connected to ten thousand other things and each of them is connected to another thousand things?

Why do functions have ':' in their name? This makes it impossible to export those functions because of the two dots in their name.

Can't things be done in an easy to understand way without links to hundreds of other functions and so on?

I needed to get the 'getAll ()' function from the 'racemap.lua' file to use in my resource but that task became impossible the moment i saw how that function is created. Couldn't all needed things be included inside of it or atleast made in a simpler way to understand?

And lastly, why do all default resources use OOP even on places where normal lua code can be used?

Link to comment

MTAs default resources are made by experienced programers. They like it that way. Also if you check the default resources, you can see that it is really complex. I don't mean the code, I mean the resource in runtime. To achieve that complexity so you can do a lot of things it can be necessary for everything to be connected to everything. 

About OOP. It is much more clear, if you "speak" OOP you can see that it is more effective and more simple. What you can make in OOP in 10 lines, CAN take up to 30 in not OOP. 

  • Like 1
Link to comment
5 hours ago, Randomly said:

OOP is based on objects.

So like vehicle is an object and the vehicle object has a create function. It is basically createVehicle() just in OOP(Vehicle.create())

On wiki there's the OOP syntax too for every function. There's also an OOP tutorial on MTA wiki. 

Hm...still looks harder than normal lua, I'll read a bit, we'll see.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...