Moderators IIYAMA Posted November 10, 2013 Moderators Posted November 10, 2013 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 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
tosfera Posted November 10, 2013 Posted November 10, 2013 As far as I know, LUA doesn't have a way to be used in an OOP. Wish they made it, gawd that would be awesome. But it's not up to the MTA team to do so, it's up to the creators of LUA. Excuse me, LUA does have the ability to be used in an OOP-application. ._.' It is just... different haha http://lua-users.org/wiki/ObjectOrientationTutorial If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Moderators IIYAMA Posted November 10, 2013 Author Moderators Posted November 10, 2013 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! Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
tosfera Posted November 10, 2013 Posted November 10, 2013 hahaha that randomly dutch word there. 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 ) If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Moderators IIYAMA Posted November 10, 2013 Author Moderators Posted November 10, 2013 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. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
tosfera Posted November 10, 2013 Posted November 10, 2013 as far as I came, I couldn't recall the class in the other side ( created it in client-side, server side couldn't recall it ). If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Moderators IIYAMA Posted November 10, 2013 Author Moderators Posted November 10, 2013 yes, I had same result. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Castillo Posted November 10, 2013 Posted November 10, 2013 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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
tosfera Posted November 10, 2013 Posted November 10, 2013 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! If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Castillo Posted November 10, 2013 Posted November 10, 2013 It'll be in a future release if I'm right. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TAPL Posted November 10, 2013 Posted November 10, 2013 From the wiki meta: https://wiki.multitheftauto.com/wiki/Meta.xml FROM VERSION 1.4.0 r5313 ONWARDS todo. false: todo. true: todo.
Jesseunit Posted November 10, 2013 Posted November 10, 2013 https://wiki.multitheftauto.com/wiki/Cl ... ng_Classes https://wiki.multitheftauto.com/wiki/Cr ... ss_Example
tosfera Posted November 10, 2013 Posted November 10, 2013 AWwwwwyeah! <33 If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
ixjf Posted November 10, 2013 Posted November 10, 2013 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. I used to know how to code, but then I took an arrow in the knee. Project Redivivus - Remaking Old School MTA With New Code MTA 0.6 Nightly 1 released
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now