mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
(Continued): Unfinished phone calling
This commit is contained in:
1 parent
95e8050d16
commit
dd89131d10
2 files changed
+55
-6
No files matched your search
@@ -7,33 +7,67 @@ Citizen.CreateThread(function()
|
||||
end
|
||||
end)
|
||||
|
||||
-----
|
||||
--END OF ESX
|
||||
-----
|
||||
local isPhoneOpen = false
|
||||
local inCall = false
|
||||
RegisterNUICallback('phone:startCall', function(data)
|
||||
print('Start call with ' .. data.number)
|
||||
local phoneNumber = data.number
|
||||
startCall(phoneNumber)
|
||||
end)
|
||||
|
||||
--[[RegisterCommand('answer', function(source) -- Toggles Phone
|
||||
RegisterNetEvent("phone:acceptCall")
|
||||
AddEventHandler("phone:acceptCall", function(phoneNumber, initiator)
|
||||
print("should accept")
|
||||
if inCall == false then
|
||||
inCall = true
|
||||
|
||||
exports["mumble-voip"]:SetCallChannel(infoCall.id+1)
|
||||
end
|
||||
if isPhoneOpen == false then
|
||||
isPhoneOpen = true
|
||||
phoneOpenAnim()
|
||||
SetCursorLocation(0.936, 0.922) -- Experimental
|
||||
local res = GetActiveScreenResolution()
|
||||
--print(res)
|
||||
SendNUIMessage( -- Shows phone
|
||||
{
|
||||
app = 'PHONE',
|
||||
method = 'setVisibility',
|
||||
data = true
|
||||
}
|
||||
)
|
||||
SetNuiFocus(true, true)
|
||||
TriggerServerEvent('phone:getCredentials', source)
|
||||
end
|
||||
end)
|
||||
|
||||
end, false)]]
|
||||
RegisterCommand('answer', function(source) -- Toggles Phone
|
||||
local rocko = 2222222
|
||||
local chip = 1111111
|
||||
acceptCall (rocko)
|
||||
print(rocko)
|
||||
end, false)
|
||||
|
||||
function startCall (phoneNumber)
|
||||
TriggerServerEvent('phone:startCall', phoneNumber)
|
||||
end
|
||||
|
||||
function acceptCall (phoneNumber)
|
||||
TriggerServerEvent('phone:acceptCall', infoCall, rtcAnswer)
|
||||
TriggerServerEvent('phone:acceptCall', phoneNumber)
|
||||
print(phoneNumber)
|
||||
end
|
||||
|
||||
function rejectCall(phoneNumber)
|
||||
TriggerServerEvent('phone:rejectCall', infoCall)
|
||||
end
|
||||
|
||||
RegisterNetEvent('phone:waitingCall')
|
||||
RegisterNetEvent('phone:waitingCall') -- Done for caller/ reciever
|
||||
AddEventHandler('phone:waitingCall', function(phoneNumber)
|
||||
local playerPed = PlayerPedId()
|
||||
print(phoneNumber)
|
||||
--print(phoneNumber)
|
||||
print("oi")
|
||||
TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 0.5, 'cellCall', 0.4)
|
||||
--TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 0.5, 'cellCall', 0.4)
|
||||
end)
|
||||
Reference in new issue
Block a user