inital ts commit

This commit is contained in:
Christopher committed 2021-01-11 19:10:20 +01:00
1 parent a1f0d7a289
commit 8266b473a5
3 files changed
+49 -19

No files matched your search

-19
View File
@@ -1,19 +0,0 @@
ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)
RegisterNUICallback('phone:startCall', function(data)
local phoneNumber = data.number
TriggerServerEvent('phone:beginCall', phoneNumber)
end)
RegisterNetEvent('phone:startCall')
AddEventHandler('phone:startCall', function(partner, phoneNumber, id)
print('You are talking to ' .. partner .. ', who has the number: ' .. phoneNumber);
exports["mumble-voip"]:SetCallChannel(id+1)
end)
+15
View File
@@ -0,0 +1,15 @@
import { ESX } from './client';
import events from '../utils/events';
const exp = (global as any).exports;
RegisterNuiCallbackType(events.PHONE_BEGIN_CALL);
on(`__cfx_nui:${events.PHONE_BEGIN_CALL}`, (data: any) => {
emitNet(events.PHONE_BEGIN_CALL, data.number)
})
onNet(events.PHONE_START_CALL, (target: string, phoneNumber: string, id: any) => {
console.log(`You are talking to ${target} who as the number ${phoneNumber}`);
exp["mumble-voip"].SetCallChannel(id+1)
})