Jump to content

[WIP] MTA Account Classes! Storing data's never been easier!


Taalasmaa

Recommended Posts

Hello,

I started to work with mta account libraries.

Now everybody can store datas so easily.

The script is automated storage system, players can save their datas maybe too easily. Very good for newbies.

So basically, it just storage your datas automatically:

Some examples how to use classes:

Example1:

function quitData(player)
storeQuitData(player,"money")
-- or -- 
storeQuitData(player,"wanted")
-- or --
storeQuitData(player,"weapons")
end
addEventHandler("onPlayerQuit",getRootElement(),quitData)

Example2:

function cmd1(player)
storeCommandData(player,"money")
end
addCommandHandler("storeMyMoney",cmd1)

Example3:

function loginData(player)
loadLoginData(player,"money")
-- automatically sets the player money! --
end
addEventHandler("onPlayerLogin",getRootElement(),loginData)

The script is still work in progress.

Leave a comment if you want to give some ideas etc.

Hope you like it

Regards

Taalasmaa

Edited by Guest
Link to comment
I think its easy for beginners but i can´t see any Classes :o

Where you want to store your Data ?

Into a SQL Database, MySQL, Stylesheets (xml), Accountstylesheet (Account.xml) or in .txt´s ?

Of course you dont see.. Resource is WIP and classes will be released in release version.

The datas will be stored to mta accounts.

Link to comment
I think its easy for beginners but i can´t see any Classes :o

Where you want to store your Data ?

Into a SQL Database, MySQL, Stylesheets (xml), Accountstylesheet (Account.xml) or in .txt´s ?

Of course you dont see.. Resource is WIP and classes will be released in release version.

The datas will be stored to mta accounts.

Mhm..maybe you should swap to SQL or MySQL.

It´s working much faster than storing everything in a Stylesheet

and the Mta Server wont lose CPU for storing/requesting data indeed

Good luck mate :wink:

Link to comment
I think its easy for beginners but i can´t see any Classes :o

Where you want to store your Data ?

Into a SQL Database, MySQL, Stylesheets (xml), Accountstylesheet (Account.xml) or in .txt´s ?

Of course you dont see.. Resource is WIP and classes will be released in release version.

The datas will be stored to mta accounts.

Mhm..maybe you should swap to SQL or MySQL.

It´s working much faster than storing everything in a Stylesheet

and the Mta Server wont lose CPU for storing/requesting data indeed

Good luck mate :wink:

Thank you, but I have no idea how SQL works :D I'm pro in storing the datas to mta accounts, but i've never learned SQL.

Link to comment

Thank you, but I have no idea how SQL works :D I'm pro in storing the datas to mta accounts, but i've never learned SQL.

I was having same problem. Once upon a time all accounts on my server were suddenly deleted so i decided to implement a new account data system. May be SQL seems hard on the first view, but I have explored out all basic queryes over one night. Well, you can try to play with querys, its pretty much flexible than XML (imo) :wink:

Link to comment

Bueh... It's nothing with openframe's account classes

local Acc = of.account:fromName("Example")
Acc.data.money = 12333 -- amount of money, example 

Someone can make a class which makes it automatically... I must write these classes fast and make a tutorial :P

Link to comment

I'm always missing the point :P

You can make a normal class or make exported functions... Then it can be like:

local AccountLib = exports.account_libraries
 
...
AccountLib:BlahBlahMethod()
...

or something like it... It will be a lot easier to use

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