Jump to content

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


Taalasmaa

Recommended Posts

Posted (edited)

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
Posted
These are not classes in any way. I'd like to know what you mean by classes?

Well not classes, but libraries.. These makes yhe Data storing much easier for newbies ;)

Posted
So it's basically an automated storage system for GTASA Player data, such as their weapons, clothes, money etc?

I think making that more clear in the topic would be handy.

Yes, that's right.

And it will be much more easier for newbies.

Posted

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 ?

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

Posted
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:

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

Posted

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:

Posted

Nice one! That could be good if I want to store my weapon skill, money, stats, etc.

I hope you release one! (as before I haven't seen the topic xD)

Posted

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

Posted
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

You're missing the point.

Posted

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

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