mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 06:28:51 +00:00
feat(calling): working state
This commit is contained in:
1 parent
034d996b25
commit
0f10eac796
2 files changed
+2
-22
No files matched your search
@@ -32,8 +32,6 @@ let calls: Map<string, ICall> = new Map()
|
||||
onNet(events.PHONE_INITIALIZE_CALL, async (phoneNumber: string) => {
|
||||
const _source = (global as any).source;
|
||||
|
||||
console.log("BIG DICK FOR LISA ANN")
|
||||
|
||||
// the client that is calling
|
||||
const xTransmitter = ESX.GetPlayerFromId(_source);
|
||||
const transmitterNumber = await usePhoneNumber(xTransmitter.getIdentifier());
|
||||
@@ -95,29 +93,16 @@ onNet(events.PHONE_CALL_REJECTED, (transmitterNumber: string) => {
|
||||
})
|
||||
|
||||
onNet(events.PHONE_END_CALL, (transmitterNumber: string) => {
|
||||
console.log("TRANSMITTER NUMBER:", transmitterNumber)
|
||||
try {
|
||||
const pSource = (global as any).source
|
||||
const currentCall = calls.get(transmitterNumber)
|
||||
|
||||
console.log("CURRENT CALL", currentCall)
|
||||
|
||||
console.log("SOURCE:", pSource)
|
||||
console.log("TRANSMITTER:", currentCall.transmitterSource)
|
||||
console.log("RECEIVER:", currentCall.receiverSource)
|
||||
|
||||
// player who is being called
|
||||
emitNet(events.PHONE_CALL_WAS_ENDED, currentCall.receiverSource)
|
||||
emitNet(events.PHONE_CALL_WAS_ENDED, pSource)
|
||||
|
||||
// player who is calling
|
||||
emitNet(events.PHONE_CALL_WAS_ENDED, currentCall.transmitterSource)
|
||||
if (pSource === currentCall.transmitterSource) {
|
||||
console.log("I am the transmitter")
|
||||
}
|
||||
|
||||
|
||||
//calls.delete(transmitterNumber)
|
||||
|
||||
calls.delete(transmitterNumber)
|
||||
|
||||
|
||||
} catch (error) {
|
||||
|
||||
Reference in new issue
Block a user