mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
Feat(Contact): SQL fetching/inserting
This commit is contained in:
1 parent
2335d2e6df
commit
4fde35eb32
1 file changed
+2
-8
@@ -20,18 +20,12 @@ ESX.RegisterServerCallback('phone:getContacts', function(source, cb)
|
|||||||
end)
|
end)
|
||||||
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')
|
RegisterServerEvent('phone:addContacts')
|
||||||
AddEventHandler('phone:addContacts', function(source, display, number)
|
AddEventHandler('phone:addContacts', function(display, number)
|
||||||
local _source = source
|
local _source = source
|
||||||
local xPlayer = ESX.GetPlayerFromId(_source)
|
local xPlayer = ESX.GetPlayerFromId(_source)
|
||||||
local _identifier = xPlayer.getIdentifier()
|
local _identifier = xPlayer.getIdentifier()
|
||||||
|
print(display, number)
|
||||||
MySQL.Async.execute('INSERT INTO phone_contacts (`identifier`, `number`, `display`) VALUES (@identifier, @number, @display)',
|
MySQL.Async.execute('INSERT INTO phone_contacts (`identifier`, `number`, `display`) VALUES (@identifier, @number, @display)',
|
||||||
{
|
{
|
||||||
identifier = _identifier,
|
identifier = _identifier,
|
||||||
|
|||||||
Reference in new issue
Block a user