cleopatra Posted December 30, 2018 Share Posted December 30, 2018 MTA Lua Custom Data System What is this?: MTA's own functions create a high of cpu and high of usage ram. Therefore I keep the element data with the table system. How can I use?: sync_element.lua paste to the file script you want to use, Then add meta.xml: <script src='sync_element.lua' type='shared' /> Note: You can only return data from scripts where you use the library. Download Link: Download Here - GitHub 1 1 1 Link to comment
Tony Brand Posted December 30, 2018 Share Posted December 30, 2018 it is great bro but can you add some examples too? Link to comment
cleopatra Posted December 30, 2018 Author Share Posted December 30, 2018 (edited) First download the script and open files, find the files: sync_element.lua And import the your third party resource, then use: getElementData(element, data, value) setElementData(element, data, value) removeElementData(element, data, value) or you can use export: exports.custom_data:getElementData(element, data, value) exports.custom_data:setElementData(element, data, value) exports.custom_data:removeElementData(element, data, value) Edited December 30, 2018 by yourpalenes 1 Link to comment
AlexRazor Posted January 6, 2019 Share Posted January 6, 2019 Any exapmles with performance before and after? Link to comment
[IR-DK] Mr Player Posted January 11, 2019 Share Posted January 11, 2019 Can i use this method for save the players money and skin and .... ?? Link to comment
cleopatra Posted February 5, 2019 Author Share Posted February 5, 2019 (edited) function getPlayerMoney(player) return exports.custom_data:getElementData(player, "money") end function setPlayerMoney(player, value) return exports.custom_data:setElementData(player, "money", value) end Edited February 5, 2019 by yourpalenes Link to comment
Zorono Posted August 18, 2020 Share Posted August 18, 2020 Please can you update the download link ?? Link to comment
Moderators Patrick Posted August 19, 2020 Moderators Share Posted August 19, 2020 The repository is no longer available. I'm gonna close this thread to avoid future inconveniences/bumps. @yourpalenes Please send me a private message, if you want to reopen it, thanks. Link to comment
Recommended Posts