Added table module, thanks to Gizz

Co-Authored-By: Jérémie N'gadi <jeremie.ngadi@gmail.com>
This commit is contained in:
ElPumpo
2019-04-13 23:00:26 +02:00
parent 51b2df94af
commit 17cbed0263
3 changed files with 137 additions and 2 deletions
+3 -2
View File
@@ -17,7 +17,7 @@ AddEventHandler('es:playerLoaded', function(source, _player)
table.insert(tasks, function(cb)
MySQL.Async.execute('UPDATE `users` SET `name` = @name WHERE `identifier` = @identifier', {
['@identifier'] = player.getIdentifier(),
['@name'] = userData.playerName
['@name'] = userData.playerName
}, function(rowsChanged)
cb()
end)
@@ -28,7 +28,6 @@ AddEventHandler('es:playerLoaded', function(source, _player)
MySQL.Async.fetchAll('SELECT * FROM `user_accounts` WHERE `identifier` = @identifier', {
['@identifier'] = player.getIdentifier()
}, function(accounts)
for i=1, #Config.Accounts, 1 do
for j=1, #accounts, 1 do
if accounts[j].name == Config.Accounts[i] then
@@ -38,6 +37,8 @@ AddEventHandler('es:playerLoaded', function(source, _player)
label = Config.AccountLabels[accounts[j].name]
})
end
break
end
end