mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 14:38:45 +00:00
Prettified Code!
This commit is contained in:
1 parent
8d100a5ebd
commit
4fe3229bb7
3 files changed
+36
-35
No files matched your search
@@ -18,7 +18,7 @@ export const CallModal = () => {
|
||||
|
||||
const handleAcceptCall = () => {
|
||||
Nui.send('phone:acceptCall', {
|
||||
phoneNumber: call.phone_number
|
||||
phoneNumber: call.phone_number,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
+34
-33
@@ -1,5 +1,5 @@
|
||||
import { ESX } from "./client";
|
||||
import events from "../utils/events";
|
||||
import { ESX } from './client';
|
||||
import events from '../utils/events';
|
||||
|
||||
const exp = (global as any).exports;
|
||||
|
||||
@@ -9,42 +9,43 @@ 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, isTransmitter: boolean, id: any) => {
|
||||
console.log(`You are talking to ${target} who has the number ${phoneNumber}`);
|
||||
//exp["mumble-voip"].SetCallChannel(id+1);
|
||||
SendNuiMessage(
|
||||
JSON.stringify({
|
||||
app: "CALL",
|
||||
method: "callModal",
|
||||
data: true
|
||||
})
|
||||
)
|
||||
SendNuiMessage(
|
||||
JSON.stringify({
|
||||
app: "CALL",
|
||||
method: "setCaller",
|
||||
data: {
|
||||
target: target,
|
||||
caller: phoneNumber,
|
||||
transmitter: isTransmitter,
|
||||
accepted: false
|
||||
}
|
||||
})
|
||||
)
|
||||
});
|
||||
|
||||
onNet(
|
||||
events.PHONE_START_CALL,
|
||||
(target: string, phoneNumber: string, isTransmitter: boolean, id: any) => {
|
||||
console.log(
|
||||
`You are talking to ${target} who has the number ${phoneNumber}`
|
||||
);
|
||||
//exp["mumble-voip"].SetCallChannel(id+1);
|
||||
SendNuiMessage(
|
||||
JSON.stringify({
|
||||
app: 'CALL',
|
||||
method: 'callModal',
|
||||
data: true,
|
||||
})
|
||||
);
|
||||
SendNuiMessage(
|
||||
JSON.stringify({
|
||||
app: 'CALL',
|
||||
method: 'setCaller',
|
||||
data: {
|
||||
target: target,
|
||||
caller: phoneNumber,
|
||||
transmitter: isTransmitter,
|
||||
accepted: false,
|
||||
},
|
||||
})
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
RegisterNuiCallbackType(events.PHONE_ACCEPT_CALL);
|
||||
on(`__cfx_nui:${events.PHONE_ACCEPT_CALL}`, (data: any) => {
|
||||
emitNet(events.PHONE_ACCEPT_CALL, data.phoneNumber)
|
||||
})
|
||||
emitNet(events.PHONE_ACCEPT_CALL, data.phoneNumber);
|
||||
});
|
||||
|
||||
onNet('phone:callAccepted', (id: number) => {
|
||||
exp["mumble-voip"].SetCallChannel(id);
|
||||
})
|
||||
|
||||
|
||||
|
||||
exp['mumble-voip'].SetCallChannel(id);
|
||||
});
|
||||
|
||||
/* onNet(events.PHONE_CALL_WAS_ENDED, () => {
|
||||
console.log("Call ended");
|
||||
|
||||
@@ -85,6 +85,6 @@ onNet(events.PHONE_ACCEPT_CALL, async (phoneNumber: string) => {
|
||||
// client that is being called
|
||||
emitNet('phone:callAccepted', targetPlayer.source, channelId);
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user