Jump to content

setAccountData or setElementData?


TRANE152

Recommended Posts

Posted

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.

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

Posted (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 by Guest
Posted

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 )

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

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

Posted

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.

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

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

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

Posted
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?._.'

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

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

Posted

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.

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

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