undefined Posted May 7, 2014 Share Posted May 7, 2014 (edited) Hi Guys. I have a problem. Im make this but i can't save this with setElementData. When the players exit the server all the entries disappear. Help pls. It's not give warning or error on debugscript ... Code Removed Edited May 11, 2014 by Guest Link to comment
JR10 Posted May 7, 2014 Share Posted May 7, 2014 Element data works throughout the player session, when he quits, the element no longer exists, so it's totally logical that the element's data will be lost. You need a different way to save the data. You can use SQL for this. Read more here and on the wiki. dbQuery dbPoll dbConnect dbFree dbExec Link to comment
undefined Posted May 7, 2014 Author Share Posted May 7, 2014 (edited) I have no idea of how to do. Can you give me simple example on my code? Edited May 7, 2014 by Guest Link to comment
JR10 Posted May 7, 2014 Share Posted May 7, 2014 Your code is not clear, and obviously you don't even want to invest some time trying to learn, I posted a tutorial and the functions for you. Look around for codes that uses SQL, like the house_system on the community, it will give you a basic example. The wiki has examples too, try to learn from it. What you need is to have the data you want to save server-side and then use the SQL functions to save it. Try something and then post for help with the code. Link to comment
undefined Posted May 7, 2014 Author Share Posted May 7, 2014 (edited) Mysql is very tangled. Im make this on accountData. But it's save only HPLev1 button. Where is the problem? Client-Side Code Removed Server-Side Code Removed Edited May 11, 2014 by Guest Link to comment
JR10 Posted May 7, 2014 Share Posted May 7, 2014 It probably does save but the problem is you're not removing the old account data, so it's still being checked and will return true. You should use something like setAccountData(account, 'hp', 1) setAccountData(account, 'hp', 2) And up to 6, that way you will only have the current one and will not have to worry about the old ones. You should also use root in triggerServerEvent and client on server-side as the player, afaik there are security risks with using source. triggerServerEvent ( "HPStats1", root) And server: function HPLev1 () local playerAccount = getPlayerAccount( client ) ... end Link to comment
undefined Posted May 7, 2014 Author Share Posted May 7, 2014 Its my new code: Code Removed I do not understand how to use it! Code Removed Link to comment
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