TRANE152 Posted November 13, 2013 Share Posted November 13, 2013 Need to set the data for the player(client-side), but I am afraid that the data (setElementData) will be reset if the player reconnect, or die. Link to comment
tosfera Posted November 13, 2013 Share Posted November 13, 2013 setElementData will be kept as long as the element is not destroyed. So, when someone reconnects the player's ped will be deleted, just like his elementData. If you're using accountData, you'll be using the built-in account system from MTA. Which allows users to login and get their data back. If you want to save weapons for reconnects etc, use setAccountData and getAccountData. Link to comment
TRANE152 Posted November 13, 2013 Author Share Posted November 13, 2013 (edited) If you want to save weapons for reconnects etc, use setAccountData and getAccountData. What a choice for save level of work? --client setElementData(source,"Paramedic", 2) Edited November 14, 2013 by Guest Link to comment
tosfera Posted November 13, 2013 Share Posted November 13, 2013 CIT is using a MySQL or sqlite not sure which. To keep data save and secure Arran wrote an own account-system. There for, you do need quite a few months of experience in lua and knowledge in other languages for ideas how to get it working etc. For a starter, I would recommend doing; setAccountData ( getPlayerAccount ( thePlayer / source ), "ParamedicLevel", 2 ) Link to comment
TRANE152 Posted November 13, 2013 Author Share Posted November 13, 2013 (edited) Oh, sorry for my fail > Edited November 14, 2013 by Guest Link to comment
TRANE152 Posted November 13, 2013 Author Share Posted November 13, 2013 For a starter, I would recommend doing; setAccountData ( getPlayerAccount ( thePlayer / source ), "ParamedicLevel", 2 ) The fact that I'm learning lua and still not very well get a hold of triggerClientEvent or triggerServerEvent (addEvent etc.) By the way, I touched on this topic due to the fact that you had to get an account(getPlayerAccount(Server-only function)), but the script is written in a client-side. Sorry for bad English skills. Link to comment
Dealman Posted November 13, 2013 Share Posted November 13, 2013 setAccountData would be the choice to go with as Element Data is not permanent, where as Account Data is. For example, if you use setElementData on a player, that data will be lost when the player disconnects. Link to comment
tosfera Posted November 13, 2013 Share Posted November 13, 2013 For a starter, I would recommend doing; setAccountData ( getPlayerAccount ( thePlayer / source ), "ParamedicLevel", 2 ) The fact that I'm learning lua and still not very well get a hold of triggerClientEvent or triggerServerEvent (addEvent etc.) By the way, I touched on this topic due to the fact that you had to get an account(getPlayerAccount(Server-only function)), but the script is written in a client-side. Sorry for bad English skills. you can get the account server sided and trigger it, it wouldn't be that hard to do. It only takes a few minutes before you will understand it fully, since you should also set the elementdata server sided, cause else it wont be synced with the other players. So ya, you should use some triggers. Link to comment
فاّرس Posted November 13, 2013 Share Posted November 13, 2013 You can use 'resourceRoot' and its won't reset except when restart the resource. setElementData(resourceRoot,...) Link to comment
tosfera Posted November 13, 2013 Share Posted November 13, 2013 You can use 'resourceRoot' and its won't reset except when restart the resource. setElementData(resourceRoot,...) Why the hell would you set the data to the resource if it's about a playerbased system?._.' Link to comment
TRANE152 Posted November 13, 2013 Author Share Posted November 13, 2013 you can get the account server sided and trigger it, it wouldn't be that hard to do. It only takes a few minutes before you will understand it fully, since you should also set the elementdata server sided, cause else it wont be synced with the other players. So ya, you should use some triggers. Does not work >< Can you write like this? Link to comment
tosfera Posted November 13, 2013 Share Posted November 13, 2013 I can, but you would not learn alot from it. There are some nice saving systems on the community, maybe you could learn something from them. Link to comment
TRANE152 Posted November 13, 2013 Author Share Posted November 13, 2013 Learn from my mistakes? Well, you are right 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