mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-02 22:17:39 +00:00
47 lines
1.0 KiB
Lua
47 lines
1.0 KiB
Lua
ESX = nil
|
|
|
|
Citizen.CreateThread(function()
|
|
while ESX == nil do
|
|
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
|
|
Citizen.Wait(0)
|
|
end
|
|
end)
|
|
|
|
--RegisterCommand('phone:get', function(source, args, rawCommand)
|
|
-- TriggerServerEvent('phone:server:getCredentials')
|
|
--end, false)
|
|
|
|
RegisterCommand('phone:open', function(source, args, rawCommand)
|
|
SendNUIMessage(
|
|
{
|
|
app = 'PHONE',
|
|
method = 'setVisibility',
|
|
data = true
|
|
}
|
|
)
|
|
SetNuiFocus(true, true)
|
|
end, false)
|
|
|
|
|
|
RegisterCommand('phone:hide', function(source, args, rawCommand)
|
|
SendNUIMessage(
|
|
{
|
|
app = 'PHONE',
|
|
method = 'setVisibility',
|
|
data = false
|
|
}
|
|
)
|
|
SetNuiFocus(false, false)
|
|
end, false)
|
|
|
|
RegisterNetEvent('phone:client:sendCredentials')
|
|
AddEventHandler('phone:client:sendCredentials', function(number)
|
|
print("My number is " .. number)
|
|
SendNUIMessage(
|
|
{
|
|
app = "SIMCARD",
|
|
method = "setNumber",
|
|
data = number
|
|
}
|
|
)
|
|
end) |