Vadlmok Posted February 23, 2019 Share Posted February 23, 2019 (edited) Good evening. When creating the script, there was a question, variable pInfo.money be one character (on the server side) or will it be global for everyone? If it is global, how to make individual? Thanks for the reply. I apologize for my English, my native language, Russian pInfo = { password = {}, money = {}, login = {}, level = {}, exp = {}, online = {} } addEventHandler("onPlayerJoin", root, function () triggerClientEvent ( source, "Login_User", source, active_login_system) end) addEventHandler ( "onPlayerQuit", root, function() if(pInfo.online[6] == 1) then local Query = dbQuery(connect_db, "UPDATE `account` SET \ `Money` = ?,\ `Level` = ?, `Exp` = ?\ WHERE `Name` = ?", pInfo.money[2], pInfo.level[4], pInfo.exp[5], pInfo.login[3]) dbFree(Query) end end ) Edited February 23, 2019 by Vadlmok Link to comment
Mr.Loki Posted February 24, 2019 Share Posted February 24, 2019 Create a table for each player pinfo[player] = { money = 6969, login = "loki", level = 9000, exp = 94, online = "Probably" } Use passwordHash/passwordVerify when saving passwords to a database for security reasons. 1 Link to comment
Vadlmok Posted February 24, 2019 Author Share Posted February 24, 2019 (edited) 8 hours ago, Mr.Loki said: Создайте таблицу для каждого игрока. Pinfo [player] = {money = 6969, login = "loki", level = 9000, exp = 94, online = "Вероятно"} Используйте passwordHash / passwordVerify при сохранении паролей в базе данных по соображениям безопасности. Thank you for your advice. A question about player need to either declare? As for security, I have already used these functions An error appeared, "attempt to index global 'info' (a nil value) " Edited February 24, 2019 by Vadlmok 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