Jump to content

OOP functions


IIYAMA

Recommended Posts

  • Moderators
Posted

I have heard some things about the OOP system, about that it is faster etc.

But is this all ready possible and able to use?

If "yes" were can I find how to use it? Because I have never seen an OOP system.

Thank you

  • Moderators
Posted

Meta tables, hmm I have never tried to use them because they never had any extra use for me.

I always did things like this:

local myTable Information = Table1[variable] or Table2[vaiable] 

So it is possible to set a meta table from client to serverside?

Bedankt!

Posted

hahaha that randomly dutch word there. xD

Ehh I'm not sure. I have never used the OOP shizzle for MTA. It's worth a try I guess? Let me know how it turned out ( if you're going to try, I'll try it too in a sec )

  • Moderators
Posted

To be honest I have no idea how to connect those tables. When you send them over with triggerClientEvent, only a copie remains of the table from serverside.

Also when you set the lua file as client and serverside, you also will have a copie.

But I will try to find this secret.

Ik weet niet hoever dit mogelijk is.

Posted

As far as I know, MTA will have OOP in a future version, example ( I think ):

local vehicle = createVehicle ( ) 
vehicle:position ( 0, 0, 0 ) 
vehicle:health ( 500 ) 

Posted
As far as I know, MTA will have OOP in a future version, example ( I think ):
local vehicle = createVehicle ( ) 
vehicle:position ( 0, 0, 0 ) 
vehicle:health ( 500 ) 

is that already built in, or will that be update. If so, Can't wait to rewrite everything! :D

Posted
As far as I know, MTA will have OOP in a future version, example ( I think ):
local vehicle = createVehicle ( ) 
vehicle:position ( 0, 0, 0 ) 
vehicle:health ( 500 ) 

MTA 1.4 will have an OOP alternative which can be enabled in the metadata file, yes. I'm working on the official OOP documentation but haven't finished it yet.

local vehicle = Vehicle.create(411, 0, 0, 0) 
vehicle:setPosition(Vector3(0, 20, 0)) 
vehicle:setHealth(500) 
  
-- or 
  
local vehicle = Vehicle.create(411, 0, 0, 0) 
vehicle.position = Vector3(0, 20, 0) 
vehicle.health = 500 

The 1st link mentioned by Jesseunit is the documentation of all classes and their members, which might be outdated now. I'll update it soon and start working on examples.

EDIT: It looks like qaisjp had to mess up with it so I need to fix this later.

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...