feat(calling/client|nui): new command and changed event name

This commit is contained in:
Christopher committed 2021-01-17 20:10:32 +01:00
1 parent 88d1cb89fd
commit 085fb778f1
2 files changed
+15 -1

No files matched your search

@@ -51,7 +51,7 @@ export const ContactList = () => {
};
const startCall = (number) => {
console.log(number);
Nui.send('phone:startCall', {
Nui.send('phone:beginCall', {
number,
});
};
+14
View File
@@ -3,6 +3,20 @@ import events from '../utils/events';
const exp = (global as any).exports;
RegisterCommand('call', (source: number, args: string[], raw: any) => {
emitNet(events.PHONE_BEGIN_CALL, args[0])
}, false)
setImmediate(() => {
emit('chat:addSuggestion', '/call', 'Call a player', [
{
name: 'Phone Number',
help: 'The phone number to call'
}
])
})
RegisterNuiCallbackType(events.PHONE_BEGIN_CALL);
on(`__cfx_nui:${events.PHONE_BEGIN_CALL}`, (data: any) => {
emitNet(events.PHONE_BEGIN_CALL, data.number)