alexxnder Posted September 7, 2020 Share Posted September 7, 2020 Hello how can i load data from MySQL to a player variable ? i searched on google and i didn't found anything to help me Link to comment
Tekken Posted September 7, 2020 Share Posted September 7, 2020 local data = dbPoll("your data to be returned using normal MySQL"); for i,v in ipairs(data) do v["var_name_in_db"] end Please note that this is a simple example for better understanding please read dbPoll wiki page. Link to comment
alexxnder Posted September 7, 2020 Author Share Posted September 7, 2020 9 minutes ago, Tekken said: local data = dbPoll("your data to be returned using normal MySQL"); for i,v in ipairs(data) do v["var_name_in_db"] end Please note that this is a simple example for better understanding please read dbPoll wiki page. Ok, but how can i assign the data from mysql to a player variable ? Link to comment
Tekken Posted September 7, 2020 Share Posted September 7, 2020 What do you mean by player variable ? Link to comment
alexxnder Posted September 7, 2020 Author Share Posted September 7, 2020 (edited) 6 minutes ago, Tekken said: What do you mean by player variable ? like this: local data = dbPoll("your data to be returned using normal MySQL"); for i,v in ipairs(data) do player_variable = v["var_name_in_db"] end or for i,v in ipairs(data) do skin = v["var_name_in_db"] end I don't know if you understand what i want to say, i don't have a good english. Edited September 7, 2020 by alexxnder Link to comment
Tekken Posted September 7, 2020 Share Posted September 7, 2020 Well you should use a tabel to store player element like this playersTable = {} and after to store it you do this playersTable[thePlayer] = v[1] you got it? Link to comment
alexxnder Posted September 7, 2020 Author Share Posted September 7, 2020 Just now, Tekken said: Well you should use a tabel to store player element like this playersTable = {} and after to store it you do this playersTable[thePlayer] = v[1] you got it? Yes, i got it, thank you bro btw the peoples from this forum are really great and friendly and i'm glad to see that! Link to comment
Tekken Posted September 7, 2020 Share Posted September 7, 2020 You’re welcome. You can also do tablePlayers[player]["skin"] = skinid for a better way of storing data than get/setElementData 1 Link to comment
alexxnder Posted September 7, 2020 Author Share Posted September 7, 2020 (edited) 6 minutes ago, Tekken said: You’re welcome. You can also do tablePlayers[player]["skin"] = skinid for a better way of storing data than get/setElementData Got it (Mersi) In caz de o sa mai am nevoie de ajutor o sa te mai contactez daca nu te deranjeaza chiar sunt surprins de cate chestii poti face pe acest client Edited September 7, 2020 by alexxnder 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