Piorun Posted February 16, 2016 Share Posted February 16, 2016 Hi, I'm working now on PHP. One thing i really like is OOP in this lang. We have simple classes, objects and also inheritance, interfaces etc. It would be awesome if it would be possible for ex. create PoliceVehicle class which gets all methods and variables from Vehicle class and work like a normal vehicle. It would improve iterations (cause i don't need to do getElementsByType('vehicle') and iterate all vehicle but simple getElementsByType('policevehicle')) and speed up searching. And also it would optimalize code. One more thing - improve OOP in Lua by adding class() function or some constructor() for constructor etc. It would be really pro and awesome! Link to comment
Noki Posted February 18, 2016 Share Posted February 18, 2016 http://lua-users.org/wiki/MetamethodsTutorial https://forum.multitheftauto.com/viewtopic.php?f ... ds#p779995 https://forum.multitheftauto.com/viewtopic.php?f ... ds#p774460 You can create your own class. Link to comment
Piorun Posted February 23, 2016 Author Share Posted February 23, 2016 I still have no clue how to extend / implement class made by me for ex. from Vehicle class or any other MTA created class. Link to comment
Recommended Posts