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.

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 )

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

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

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?

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