Jump to content

OOP functions


IIYAMA

Recommended Posts

  • Moderators

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!

Link to comment
  • Moderators

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.

Link to comment
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.

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