mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +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 = () => {
|
const handleAcceptCall = () => {
|
||||||
Nui.send('phone:acceptCall', {
|
Nui.send('phone:acceptCall', {
|
||||||
phoneNumber: call.phone_number
|
phoneNumber: call.phone_number,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+34
-33
@@ -1,5 +1,5 @@
|
|||||||
import { ESX } from "./client";
|
import { ESX } from './client';
|
||||||
import events from "../utils/events";
|
import events from '../utils/events';
|
||||||
|
|
||||||
const exp = (global as any).exports;
|
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);
|
emitNet(events.PHONE_BEGIN_CALL, data.number);
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(events.PHONE_START_CALL, (target: string, phoneNumber: string, isTransmitter: boolean, id: any) => {
|
onNet(
|
||||||
console.log(`You are talking to ${target} who has the number ${phoneNumber}`);
|
events.PHONE_START_CALL,
|
||||||
//exp["mumble-voip"].SetCallChannel(id+1);
|
(target: string, phoneNumber: string, isTransmitter: boolean, id: any) => {
|
||||||
SendNuiMessage(
|
console.log(
|
||||||
JSON.stringify({
|
`You are talking to ${target} who has the number ${phoneNumber}`
|
||||||
app: "CALL",
|
);
|
||||||
method: "callModal",
|
//exp["mumble-voip"].SetCallChannel(id+1);
|
||||||
data: true
|
SendNuiMessage(
|
||||||
})
|
JSON.stringify({
|
||||||
)
|
app: 'CALL',
|
||||||
SendNuiMessage(
|
method: 'callModal',
|
||||||
JSON.stringify({
|
data: true,
|
||||||
app: "CALL",
|
})
|
||||||
method: "setCaller",
|
);
|
||||||
data: {
|
SendNuiMessage(
|
||||||
target: target,
|
JSON.stringify({
|
||||||
caller: phoneNumber,
|
app: 'CALL',
|
||||||
transmitter: isTransmitter,
|
method: 'setCaller',
|
||||||
accepted: false
|
data: {
|
||||||
}
|
target: target,
|
||||||
})
|
caller: phoneNumber,
|
||||||
)
|
transmitter: isTransmitter,
|
||||||
});
|
accepted: false,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.PHONE_ACCEPT_CALL);
|
RegisterNuiCallbackType(events.PHONE_ACCEPT_CALL);
|
||||||
on(`__cfx_nui:${events.PHONE_ACCEPT_CALL}`, (data: any) => {
|
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) => {
|
onNet('phone:callAccepted', (id: number) => {
|
||||||
exp["mumble-voip"].SetCallChannel(id);
|
exp['mumble-voip'].SetCallChannel(id);
|
||||||
})
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* onNet(events.PHONE_CALL_WAS_ENDED, () => {
|
/* onNet(events.PHONE_CALL_WAS_ENDED, () => {
|
||||||
console.log("Call ended");
|
console.log("Call ended");
|
||||||
|
|||||||
@@ -85,6 +85,6 @@ onNet(events.PHONE_ACCEPT_CALL, async (phoneNumber: string) => {
|
|||||||
// client that is being called
|
// client that is being called
|
||||||
emitNet('phone:callAccepted', targetPlayer.source, channelId);
|
emitNet('phone:callAccepted', targetPlayer.source, channelId);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user