mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Prettified Code!
This commit is contained in:
1 parent
5766da5c66
commit
bcdab48bdb
2 files changed
+14
-14
No files matched your search
@@ -1,10 +1,10 @@
|
|||||||
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;
|
||||||
|
|
||||||
RegisterCommand(
|
RegisterCommand(
|
||||||
'call',
|
"call",
|
||||||
(source: number, args: string[], raw: any) => {
|
(source: number, args: string[], raw: any) => {
|
||||||
emitNet(events.PHONE_BEGIN_CALL, args[0]);
|
emitNet(events.PHONE_BEGIN_CALL, args[0]);
|
||||||
},
|
},
|
||||||
@@ -12,10 +12,10 @@ RegisterCommand(
|
|||||||
);
|
);
|
||||||
|
|
||||||
setImmediate(() => {
|
setImmediate(() => {
|
||||||
emit('chat:addSuggestion', '/call', 'Call a player', [
|
emit("chat:addSuggestion", "/call", "Call a player", [
|
||||||
{
|
{
|
||||||
name: 'Phone Number',
|
name: "Phone Number",
|
||||||
help: 'The phone number to call',
|
help: "The phone number to call",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
@@ -28,10 +28,10 @@ on(`__cfx_nui:${events.PHONE_BEGIN_CALL}`, (data: any) => {
|
|||||||
onNet(events.PHONE_START_CALL, (target: string, phoneNumber: string) => {
|
onNet(events.PHONE_START_CALL, (target: string, phoneNumber: string) => {
|
||||||
console.log(`You are talking to ${target} who has the number ${phoneNumber}`);
|
console.log(`You are talking to ${target} who has the number ${phoneNumber}`);
|
||||||
// Temporary for testing
|
// Temporary for testing
|
||||||
exp['mumble-voip'].SetCallChannel(1);
|
exp["mumble-voip"].SetCallChannel(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(events.PHONE_CALL_WAS_ENDED, () => {
|
onNet(events.PHONE_CALL_WAS_ENDED, () => {
|
||||||
console.log('Call ended');
|
console.log("Call ended");
|
||||||
exp['mumble-voip'].SetCallChannel(0);
|
exp["mumble-voip"].SetCallChannel(0);
|
||||||
});
|
});
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { ESX } from './server';
|
import { ESX } from "./server";
|
||||||
import events from '../utils/events';
|
import events from "../utils/events";
|
||||||
import { getIdentifierByPhoneNumber, getPhoneNumberFromID } from './functions';
|
import { getIdentifierByPhoneNumber, getPhoneNumberFromID } from "./functions";
|
||||||
import { XPlayer } from 'esx.js/@types/server';
|
import { XPlayer } from "esx.js/@types/server";
|
||||||
/**
|
/**
|
||||||
* Returns the player phoneNumber for a passed identifier
|
* Returns the player phoneNumber for a passed identifier
|
||||||
* @param identifier The players phone number
|
* @param identifier The players phone number
|
||||||
@@ -20,7 +20,7 @@ function getPlayerFromIdentifier(identifier: string): Promise<XPlayer> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rej(new Error('Call Target Identifier was not found in xPlayers array'));
|
rej(new Error("Call Target Identifier was not found in xPlayers array"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user