mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 22:16:54 +00:00
Feat(Contact): SQL fetching/inserting
This commit is contained in:
1 parent
2335d2e6df
commit
4fde35eb32
1 file changed
+3
-9
@@ -20,18 +20,12 @@ ESX.RegisterServerCallback('phone:getContacts', function(source, cb)
|
||||
end)
|
||||
end)
|
||||
|
||||
RegisterCommand('add_contact', function(source, args, rawCommand)
|
||||
local _source = source
|
||||
local display = args[1]
|
||||
local number = args[2]
|
||||
TriggerEvent('phone:addContacts', source, display, number)
|
||||
end)
|
||||
|
||||
RegisterServerEvent('phone:addContacts')
|
||||
AddEventHandler('phone:addContacts', function(source, display, number)
|
||||
AddEventHandler('phone:addContacts', function(display, number)
|
||||
local _source = source
|
||||
local xPlayer = ESX.GetPlayerFromId(_source)
|
||||
local _identifier = xPlayer.getIdentifier()
|
||||
print(display, number)
|
||||
MySQL.Async.execute('INSERT INTO phone_contacts (`identifier`, `number`, `display`) VALUES (@identifier, @number, @display)',
|
||||
{
|
||||
identifier = _identifier,
|
||||
@@ -39,4 +33,4 @@ AddEventHandler('phone:addContacts', function(source, display, number)
|
||||
display = display
|
||||
}, function()
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
Reference in new issue
Block a user