JAY.ANN Posted August 15, 2022 Share Posted August 15, 2022 (edited) What's better to use? setaccountdata and internal.db or to create own database and execute it? Edited August 31, 2022 by Vinyard added the solved tag Link to comment
JAY.ANN Posted August 16, 2022 Author Share Posted August 16, 2022 (edited) It's pretty comfortable to use standard MTA accounts databases but does it have performance issues as setElementData or smth? Edited August 16, 2022 by JAY.ANN Link to comment
Tails Posted August 29, 2022 Share Posted August 29, 2022 (edited) On 16/08/2022 at 13:01, JAY.ANN said: It's pretty comfortable to use standard MTA accounts databases but does it have performance issues as setElementData or smth? SetElementData is data stored on the player temporarely, if the player logs off, or the server shuts down, you will lose that information. It is stored inside GTA memory and is synced with all players and the server unless specified otherwise. SetAccountData only allow you to insert key/value pairs into a fixed db. You have no real control over it, and with lots of data this could be bad for performance because it'd need to do a lot of queries (via getAccountData) for each key/value pair that you saved to a player account. MySQL allows you to structure your database and gives you control over what you put in your database and how you modify and query the data. You can also access the data from other places like a website. This will give you the best optimization. If you're new or uncomfortable with MySQL you could try using SQLite instead, which creates a new .db file for you which you gives you similar control over it as MySQL except that you don't have a address from which you can access it. I recommend this if you're new and want to try out MySQL for the first time. You don't have to install MySQL to your desktop or server with this option. You can use setAccountData for small gamemodes if you don't need to store a ton of data per user, otherwise use MySQL or SQLite. Hope this helps. Edited August 29, 2022 by Tails 1 Link to comment
JAY.ANN Posted August 30, 2022 Author Share Posted August 30, 2022 On 29/08/2022 at 05:43, Tails said: SetElementData is data stored on the player temporarely, if the player logs off, or the server shuts down, you will lose that information. It is stored inside GTA memory and is synced with all players and the server unless specified otherwise. SetAccountData only allow you to insert key/value pairs into a fixed db. You have no real control over it, and with lots of data this could be bad for performance because it'd need to do a lot of queries (via getAccountData) for each key/value pair that you saved to a player account. MySQL allows you to structure your database and gives you control over what you put in your database and how you modify and query the data. You can also access the data from other places like a website. This will give you the best optimization. If you're new or uncomfortable with MySQL you could try using SQLite instead, which creates a new .db file for you which you gives you similar control over it as MySQL except that you don't have a address from which you can access it. I recommend this if you're new and want to try out MySQL for the first time. You don't have to install MySQL to your desktop or server with this option. You can use setAccountData for small gamemodes if you don't need to store a ton of data per user, otherwise use MySQL or SQLite. Hope this helps. That's the information i was looking for. Thank you! 1 Link to comment
Moderators Vinyard Posted August 31, 2022 Moderators Share Posted August 31, 2022 Locking this as the issue was resolved. Link to comment
Recommended Posts