Use a database (and manager resource).
There are some community resources out there that can help you with that.
For example this one (which is not official released on the community resource since I am still building on it, but never the less feel free to use it.
https://gitlab.com/IIYAMA12/asyncdatabase
Read the readme
Modify the config and set to SQLite
Check the examples
Others:
https://community.multitheftauto.com/index.php?p=resources&s=details&id=17541
https://community.multitheftauto.com/index.php?p=resources&s=details&id=6313
Search query:
https://community.multitheftauto.com/index.php?p=resources&s=list&name=data&descr=&category=