mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Merge pull request #83 from project-error/cleanup/game-scripts
Cleanup/game scripts - Misc. cleanup of game scripts
This commit is contained in:
6 files changed
+334
-360
No files matched your search
@@ -21,9 +21,9 @@ onNet(events.BANK_SEND_CREDENTIALS, (credentials: any) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.BANK_ADD_TRANSFER);
|
RegisterNuiCallbackType(events.BANK_ADD_TRANSFER);
|
||||||
on(`__cfx_nui:${events.BANK_ADD_TRANSFER}`, (data: any) => {
|
on(`__cfx_nui:${events.BANK_ADD_TRANSFER}`, (data: any, cb: Function) => {
|
||||||
const transfer = data;
|
emitNet(events.BANK_ADD_TRANSFER, data);
|
||||||
emitNet(events.BANK_ADD_TRANSFER, transfer);
|
cb();
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(events.BANK_ADD_TRANSFER_SUCCESS, () => {
|
onNet(events.BANK_ADD_TRANSFER_SUCCESS, () => {
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ import { ICall } from '../../phone/src/common/typings/call';
|
|||||||
const exp = (global as any).exports;
|
const exp = (global as any).exports;
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.PHONE_INITIALIZE_CALL);
|
RegisterNuiCallbackType(events.PHONE_INITIALIZE_CALL);
|
||||||
on(`__cfx_nui:${events.PHONE_INITIALIZE_CALL}`, (data: any) => {
|
on(`__cfx_nui:${events.PHONE_INITIALIZE_CALL}`, (data: any, cb: Function) => {
|
||||||
const start = Date.now();
|
const start = Date.now();
|
||||||
|
|
||||||
emitNet(events.PHONE_INITIALIZE_CALL, data.number, start);
|
emitNet(events.PHONE_INITIALIZE_CALL, data.number, start);
|
||||||
|
cb();
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(
|
onNet(
|
||||||
@@ -31,8 +31,9 @@ onNet(
|
|||||||
);
|
);
|
||||||
|
|
||||||
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, cb: Function) => {
|
||||||
emitNet(events.PHONE_ACCEPT_CALL, data.transmitterNumber);
|
emitNet(events.PHONE_ACCEPT_CALL, data.transmitterNumber);
|
||||||
|
cb();
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(
|
onNet(
|
||||||
@@ -56,9 +57,10 @@ onNet(
|
|||||||
);
|
);
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.PHONE_CALL_REJECTED);
|
RegisterNuiCallbackType(events.PHONE_CALL_REJECTED);
|
||||||
on(`__cfx_nui:${events.PHONE_CALL_REJECTED}`, (data: any) => {
|
on(`__cfx_nui:${events.PHONE_CALL_REJECTED}`, (data: any, cb: Function) => {
|
||||||
const end = Date.now();
|
const end = Date.now();
|
||||||
emitNet(events.PHONE_CALL_REJECTED, data.transmitterNumber, end);
|
emitNet(events.PHONE_CALL_REJECTED, data.transmitterNumber, end);
|
||||||
|
cb();
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(events.PHONE_CALL_WAS_REJECTED, () => {
|
onNet(events.PHONE_CALL_WAS_REJECTED, () => {
|
||||||
@@ -79,9 +81,10 @@ onNet(events.PHONE_CALL_WAS_REJECTED, () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.PHONE_END_CALL);
|
RegisterNuiCallbackType(events.PHONE_END_CALL);
|
||||||
on(`__cfx_nui:${events.PHONE_END_CALL}`, (data: any) => {
|
on(`__cfx_nui:${events.PHONE_END_CALL}`, (data: any, cb: Function) => {
|
||||||
const end = Date.now();
|
const end = Date.now();
|
||||||
emitNet(events.PHONE_END_CALL, data.transmitterNumber, end);
|
emitNet(events.PHONE_END_CALL, data.transmitterNumber, end);
|
||||||
|
cb();
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(events.PHONE_CALL_WAS_ENDED, () => {
|
onNet(events.PHONE_CALL_WAS_ENDED, () => {
|
||||||
|
|||||||
@@ -11,11 +11,12 @@ onNet(events.CONTACTS_SEND_CONTACTS, (contacts: any) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.CONTACTS_ADD_CONTACT);
|
RegisterNuiCallbackType(events.CONTACTS_ADD_CONTACT);
|
||||||
on(`__cfx_nui:${events.CONTACTS_ADD_CONTACT}`, (data: any) => {
|
on(`__cfx_nui:${events.CONTACTS_ADD_CONTACT}`, (data: any, cb: Function) => {
|
||||||
const display = data.name;
|
const display = data.name;
|
||||||
const number = data.number;
|
const number = data.number;
|
||||||
const avatar = data.avatar;
|
const avatar = data.avatar;
|
||||||
emitNet(events.CONTACTS_ADD_CONTACT, number, display, avatar);
|
emitNet(events.CONTACTS_ADD_CONTACT, number, display, avatar);
|
||||||
|
cb();
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(events.CONTACTS_ADD_CONTACT_SUCCESS, () => {
|
onNet(events.CONTACTS_ADD_CONTACT_SUCCESS, () => {
|
||||||
@@ -23,20 +24,20 @@ onNet(events.CONTACTS_ADD_CONTACT_SUCCESS, () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.CONTACTS_UPDATE_CONTACT);
|
RegisterNuiCallbackType(events.CONTACTS_UPDATE_CONTACT);
|
||||||
on(`__cfx_nui:${events.CONTACTS_UPDATE_CONTACT}`, (data: any) => {
|
on(`__cfx_nui:${events.CONTACTS_UPDATE_CONTACT}`, (data: any, cb: Function) => {
|
||||||
const contact = data;
|
emitNet(events.CONTACTS_UPDATE_CONTACT, data);
|
||||||
emitNet(events.CONTACTS_UPDATE_CONTACT, contact);
|
cb();
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(events.CONTACTS_UPDATE_CONTACT_SUCCESS, () => {
|
onNet(events.CONTACTS_UPDATE_CONTACT_SUCCESS, () => {
|
||||||
emitNet(events.CONTACTS_GET_CONTACTS);
|
emitNet(events.CONTACTS_GET_CONTACTS);
|
||||||
console.log("did you update the contact??????????????????");
|
console.log('did you update the contact??????????????????');
|
||||||
});
|
});
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.CONTACTS_DELETE_CONTACT);
|
RegisterNuiCallbackType(events.CONTACTS_DELETE_CONTACT);
|
||||||
on(`__cfx_nui:${events.CONTACTS_DELETE_CONTACT}`, (data: any) => {
|
on(`__cfx_nui:${events.CONTACTS_DELETE_CONTACT}`, (data: any, cb: Function) => {
|
||||||
const contact = data;
|
emitNet(events.CONTACTS_DELETE_CONTACT, data);
|
||||||
emitNet(events.CONTACTS_DELETE_CONTACT, contact);
|
cb();
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(events.CONTACTS_DELETE_CONTACT_SUCCESS, () => {
|
onNet(events.CONTACTS_DELETE_CONTACT_SUCCESS, () => {
|
||||||
|
|||||||
+256
-288
@@ -1,12 +1,22 @@
|
|||||||
import { ESX } from '../client/client';
|
|
||||||
import config from '../utils/config';
|
import config from '../utils/config';
|
||||||
import { Delay } from '../utils/fivem';
|
import { Delay } from '../utils/fivem';
|
||||||
import events from '../utils/events';
|
import events from '../utils/events';
|
||||||
|
|
||||||
|
let prop = 0;
|
||||||
|
let isPhoneOpen = false;
|
||||||
|
let propCreated = false;
|
||||||
|
let phoneModel = 'prop_amb_phone'; // Refered to in newphoneProp function. Requires custom phone being streamed.
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * *
|
||||||
|
*
|
||||||
|
* Register Command and Keybinding
|
||||||
|
*
|
||||||
|
* * * * * * * * * * * * */
|
||||||
|
|
||||||
RegisterCommand(
|
RegisterCommand(
|
||||||
'phone:close',
|
'phone:close',
|
||||||
(source: any, args: string[], raw: any) => {
|
async (source: any, args: string[], raw: any) => {
|
||||||
phoneCloseAnim();
|
await phoneCloseAnim();
|
||||||
SetNuiFocus(false, false);
|
SetNuiFocus(false, false);
|
||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
@@ -19,19 +29,38 @@ RegisterCommand(
|
|||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
let prop = 0;
|
RegisterCommand(
|
||||||
let isPhoneOpen = false;
|
'+phone',
|
||||||
let propCreated = false;
|
async () => {
|
||||||
let phoneModel = 'prop_amb_phone'; // Refered to in newphoneProp function. Requires custom phone being streamed.
|
//-- Toggles Phone
|
||||||
|
await Phone();
|
||||||
|
},
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
RegisterCommand(
|
||||||
|
'phone:open',
|
||||||
|
async () => {
|
||||||
|
await Phone();
|
||||||
|
},
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
RegisterKeyMapping('+phone', 'Open Phone', 'keyboard', 'f1');
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * *
|
||||||
|
*
|
||||||
|
* Prop Deletion/Creation handling
|
||||||
|
*
|
||||||
|
* * * * * * * * * * * * */
|
||||||
|
|
||||||
const newPhoneProp = async () => {
|
const newPhoneProp = async () => {
|
||||||
//Function for creating the phone prop
|
removePhoneProp(); //deletes the already existing prop before creating another.
|
||||||
deletePhone(); //deletes the already existing prop before creating another.
|
|
||||||
if (!propCreated) {
|
if (!propCreated) {
|
||||||
RequestModel(phoneModel);
|
RequestModel(phoneModel);
|
||||||
|
|
||||||
while (!HasModelLoaded(phoneModel)) {
|
while (!HasModelLoaded(phoneModel)) {
|
||||||
await Delay(1);
|
await Delay(1);
|
||||||
console.log('MODEL HASNT LOADED');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const playerPed = PlayerPedId();
|
const playerPed = PlayerPedId();
|
||||||
@@ -71,14 +100,13 @@ const newPhoneProp = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function deletePhone() {
|
function removePhoneProp() {
|
||||||
//-- Triggered in newphoneProp function. Only way to destory the prop correctly.
|
//-- Triggered in newphoneProp function. Only way to destory the prop correctly.
|
||||||
if (prop != 0) {
|
if (prop != 0) {
|
||||||
//Citizen.invokeNative(0xAE3CBE5BF394C9C9 , Citizen.pointerValueIntInitialized(prop))
|
//Citizen.invokeNative(0xAE3CBE5BF394C9C9 , Citizen.pointerValueIntInitialized(prop))
|
||||||
DeleteEntity(prop);
|
DeleteEntity(prop);
|
||||||
prop = 0;
|
prop = 0;
|
||||||
propCreated = false;
|
propCreated = false;
|
||||||
console.log('prop destroyed');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,274 +118,175 @@ async function loadAnimDict(dict: any) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function phoneOpenAnim() {
|
/* * * * * * * * * * * * *
|
||||||
//Phone Open Animation
|
*
|
||||||
console.log('phoneOpenAnim'); //Left for testing purposes.
|
* Animations
|
||||||
const flag = 50; //https://runtime.fivem.net/doc/natives/?_0xEA47FE3719165B94
|
*
|
||||||
deletePhone(); //Deleting before creating a new phone where itll be deleted again.
|
* * * * * * * * * * * * */
|
||||||
if (IsPedInAnyVehicle(GetPlayerPed(-1), true)) {
|
|
||||||
//-- true refers to at get in.
|
|
||||||
const dict = 'anim@cellphone@in_car@ps';
|
|
||||||
|
|
||||||
ClearPedTasks(GetPlayerPed(-1));
|
const handleOpenVehicleAnim = async (playerPed: number): Promise<void> => {
|
||||||
await loadAnimDict(dict);
|
const dict = 'anim@cellphone@in_car@ps';
|
||||||
TaskPlayAnim(
|
|
||||||
GetPlayerPed(-1),
|
|
||||||
dict,
|
|
||||||
'cellphone_text_in',
|
|
||||||
8.0,
|
|
||||||
-1,
|
|
||||||
-1,
|
|
||||||
flag,
|
|
||||||
0,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
await Delay(300); //Gives time for animation starts before creating the phone
|
|
||||||
await newPhoneProp(); //Creates the phone and attaches it.
|
|
||||||
} else {
|
|
||||||
//While not in a vehicle it will use this dict.
|
|
||||||
const dict = 'cellphone@';
|
|
||||||
|
|
||||||
ClearPedTasks(GetPlayerPed(-1));
|
ClearPedTasks(playerPed);
|
||||||
await loadAnimDict(dict);
|
await loadAnimDict(dict);
|
||||||
TaskPlayAnim(
|
TaskPlayAnim(
|
||||||
GetPlayerPed(-1),
|
playerPed,
|
||||||
dict,
|
dict,
|
||||||
'cellphone_text_in',
|
'cellphone_text_in',
|
||||||
8.0,
|
8.0,
|
||||||
-1,
|
-1,
|
||||||
-1,
|
-1,
|
||||||
flag,
|
50,
|
||||||
0,
|
0,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
await Delay(300); //Gives time for animation starts before creating the phone
|
await Delay(300); //Gives time for animation starts before creating the phone
|
||||||
await newPhoneProp(); //Creates the phone and attaches it.
|
await newPhoneProp(); //Creates the phone and attaches it.
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleOpenNormalAnim = async (playerPed: number): Promise<void> => {
|
||||||
|
//While not in a vehicle it will use this dict.
|
||||||
|
const dict = 'cellphone@';
|
||||||
|
|
||||||
|
ClearPedTasks(playerPed);
|
||||||
|
await loadAnimDict(dict);
|
||||||
|
TaskPlayAnim(
|
||||||
|
playerPed,
|
||||||
|
dict,
|
||||||
|
'cellphone_text_in',
|
||||||
|
8.0,
|
||||||
|
-1,
|
||||||
|
-1,
|
||||||
|
50,
|
||||||
|
0,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
await Delay(300); //Gives time for animation starts before creating the phone
|
||||||
|
await newPhoneProp(); //Creates the phone and attaches it.
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCloseVehicleAnim = async (playerPed: number): Promise<void> => {
|
||||||
|
//true refers to at get in.
|
||||||
|
const DICT = 'anim@cellphone@in_car@ps';
|
||||||
|
const ANIM = 'cellphone_text_out';
|
||||||
|
|
||||||
|
StopAnimTask(playerPed, DICT, 'cellphone_text_in', 1.0); //Stop the pull out animation
|
||||||
|
removePhoneProp(); //Deletes the prop early incase they get out of the vehicle.
|
||||||
|
await Delay(250); //lets it get to a certain point
|
||||||
|
await loadAnimDict(DICT); //loads the new animation
|
||||||
|
TaskPlayAnim(playerPed, DICT, ANIM, 8.0, -1, -1, 50, 0, false, false, false); //puts phone into pocket
|
||||||
|
await Delay(200); //waits until the phone is in the pocket
|
||||||
|
StopAnimTask(playerPed, DICT, ANIM, 1.0); //clears the animation
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCloseNormalAnim = async (playerPed: number): Promise<void> => {
|
||||||
|
const DICT = 'cellphone@';
|
||||||
|
const ANIM = 'cellphone_text_out';
|
||||||
|
StopAnimTask(playerPed, DICT, 'cellphone_text_in', 1.0); //Stop the pull out animation
|
||||||
|
await Delay(100); //lets it get to a certain point
|
||||||
|
await loadAnimDict(DICT); //loads the new animation
|
||||||
|
TaskPlayAnim(playerPed, DICT, ANIM, 8.0, -1, -1, 50, 0, false, false, false); //puts phone into pocket
|
||||||
|
await Delay(200); //waits until the phone is in the pocket
|
||||||
|
StopAnimTask(playerPed, DICT, ANIM, 1.0); //clears the animation
|
||||||
|
removePhoneProp(); //Deletes the prop.
|
||||||
|
};
|
||||||
|
|
||||||
|
async function phoneOpenAnim(): Promise<void> {
|
||||||
|
const playerPed = PlayerPedId();
|
||||||
|
removePhoneProp(); //Deleting before creating a new phone where itll be deleted again.
|
||||||
|
if (IsPedInAnyVehicle(playerPed, true)) {
|
||||||
|
return await handleOpenVehicleAnim(playerPed);
|
||||||
}
|
}
|
||||||
|
return await handleOpenNormalAnim(playerPed);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function phoneCloseAnim() {
|
async function phoneCloseAnim() {
|
||||||
//Phone Close Animation
|
const playerPed = PlayerPedId();
|
||||||
console.log('phoneCloseAnim'); //Left for testing purposes.
|
if (IsPedInAnyVehicle(playerPed, true)) {
|
||||||
const flag = 50; //https://runtime.fivem.net/doc/natives/?_0xEA47FE3719165B94
|
return await handleCloseVehicleAnim(playerPed);
|
||||||
const anim = 'cellphone_text_out';
|
|
||||||
if (IsPedInAnyVehicle(GetPlayerPed(-1), true)) {
|
|
||||||
//true refers to at get in.
|
|
||||||
const dict = 'anim@cellphone@in_car@ps';
|
|
||||||
|
|
||||||
StopAnimTask(GetPlayerPed(-1), dict, 'cellphone_text_in', 1.0); //Stop the pull out animation
|
|
||||||
deletePhone(); //Deletes the prop early incase they get out of the vehicle.
|
|
||||||
await Delay(250); //lets it get to a certain point
|
|
||||||
loadAnimDict(dict); //loads the new animation
|
|
||||||
TaskPlayAnim(
|
|
||||||
GetPlayerPed(-1),
|
|
||||||
dict,
|
|
||||||
anim,
|
|
||||||
8.0,
|
|
||||||
-1,
|
|
||||||
-1,
|
|
||||||
flag,
|
|
||||||
0,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false
|
|
||||||
); //puts phone into pocket
|
|
||||||
await Delay(200); //waits until the phone is in the pocket
|
|
||||||
StopAnimTask(GetPlayerPed(-1), dict, anim, 1.0); //clears the animation
|
|
||||||
} else {
|
|
||||||
//While not in a vehicle it will use this dict.
|
|
||||||
const dict = 'cellphone@';
|
|
||||||
|
|
||||||
StopAnimTask(GetPlayerPed(-1), dict, 'cellphone_text_in', 1.0); //Stop the pull out animation
|
|
||||||
await Delay(100); //lets it get to a certain point
|
|
||||||
loadAnimDict(dict); //loads the new animation
|
|
||||||
TaskPlayAnim(
|
|
||||||
GetPlayerPed(-1),
|
|
||||||
dict,
|
|
||||||
anim,
|
|
||||||
8.0,
|
|
||||||
-1,
|
|
||||||
-1,
|
|
||||||
flag,
|
|
||||||
0,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false
|
|
||||||
); //puts phone into pocket
|
|
||||||
await Delay(200); //waits until the phone is in the pocket
|
|
||||||
StopAnimTask(GetPlayerPed(-1), dict, anim, 1.0); //clears the animation
|
|
||||||
deletePhone(); //Deletes the prop.
|
|
||||||
}
|
}
|
||||||
|
await handleCloseNormalAnim(playerPed);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function carryingPhone(cb: any) {
|
|
||||||
if (ESX === null) return cb(0);
|
|
||||||
ESX.TriggerServerCallback(
|
|
||||||
'phone:getItemAmount',
|
|
||||||
(qtty: number) => {
|
|
||||||
cb(qtty > 0);
|
|
||||||
},
|
|
||||||
'phone'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function noPhone() {
|
|
||||||
if (ESX === null) return;
|
|
||||||
ESX.ShowNotification('Oi Mate, No El Telephono', false, false, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
setTick(() => {
|
|
||||||
if (IsControlJustPressed(1, config.KeyTogglePhone)) {
|
|
||||||
Phone();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// setTick(() => {
|
// setTick(() => {
|
||||||
// if (isPhoneOpen) {
|
// if (IsControlJustPressed(1, config.KeyTogglePhone)) {
|
||||||
// DisableControlAction(0, 1, true)
|
// Phone();
|
||||||
// DisableControlAction(0, 2, true)
|
|
||||||
// DisableControlAction(0, 24, true)
|
|
||||||
// DisableControlAction(0, 257, true)
|
|
||||||
// DisableControlAction(0, 25, true)
|
|
||||||
// DisableControlAction(0, 263, true)
|
|
||||||
// } else {
|
|
||||||
// EnableControlAction(0, 1, true)
|
|
||||||
// EnableControlAction(0, 2, true)
|
|
||||||
// EnableControlAction(0, 24, true)
|
|
||||||
// EnableControlAction(0, 257, true)
|
|
||||||
// EnableControlAction(0, 25, true)
|
|
||||||
// EnableControlAction(0, 263, true)
|
|
||||||
// }
|
// }
|
||||||
// })
|
// });
|
||||||
|
|
||||||
async function Phone() {
|
/* * * * * * * * * * * * *
|
||||||
if (config.PhoneAsItem) {
|
*
|
||||||
console.log('CONFIG ON');
|
* Phone Visibility Handling
|
||||||
carryingPhone(async (carryingPhone: any) => {
|
*
|
||||||
if (carryingPhone) {
|
* * * * * * * * * * * * */
|
||||||
if (!isPhoneOpen) {
|
|
||||||
isPhoneOpen = true;
|
|
||||||
await phoneOpenAnim(); // Animation starts before the phone is open
|
|
||||||
emitNet('phone:getCredentials');
|
|
||||||
console.log('Sellout fetched from client side'); // Gets the credentials. Will eventually most likely only get the phone number and name, idk.
|
|
||||||
SetCursorLocation(0.9, 0.922); //Experimental
|
|
||||||
let res = GetActiveScreenResolution();
|
|
||||||
SendNuiMessage(
|
|
||||||
JSON.stringify({
|
|
||||||
app: 'PHONE',
|
|
||||||
method: 'setVisibility',
|
|
||||||
data: true,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
SetNuiFocus(true, true);
|
|
||||||
//SetNuiFocusKeepInput(true)
|
|
||||||
} else {
|
|
||||||
isPhoneOpen = false;
|
|
||||||
SendNuiMessage(
|
|
||||||
//Hides phone
|
|
||||||
JSON.stringify({
|
|
||||||
app: 'PHONE',
|
|
||||||
method: 'setVisibility',
|
|
||||||
data: false,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
SetNuiFocus(false, false);
|
|
||||||
//SetNuiFocusKeepInput(false)
|
|
||||||
|
|
||||||
await phoneCloseAnim(); // Animation starts after the UI is closed.
|
const showPhone = async (): Promise<void> => {
|
||||||
}
|
isPhoneOpen = true;
|
||||||
} else {
|
await phoneOpenAnim(); // Animation starts before the phone is open
|
||||||
noPhone();
|
emitNet('phone:getCredentials');
|
||||||
}
|
SetCursorLocation(0.9, 0.922); //Experimental
|
||||||
});
|
SendNuiMessage(
|
||||||
} else if (!config.PhoneAsItem) {
|
JSON.stringify({
|
||||||
console.log('CONFIG OFF');
|
app: 'PHONE',
|
||||||
if (!isPhoneOpen) {
|
method: 'setVisibility',
|
||||||
isPhoneOpen = true;
|
data: true,
|
||||||
await phoneOpenAnim(); // Animation starts before the phone is open
|
})
|
||||||
emitNet('phone:getCredentials');
|
);
|
||||||
console.log('Sellout fetched from client side');
|
sendPhoneConfig();
|
||||||
SetCursorLocation(0.936, 0.922); //Experimental
|
SetNuiFocus(true, true);
|
||||||
let res = GetActiveScreenResolution();
|
};
|
||||||
SendNuiMessage(
|
|
||||||
JSON.stringify({
|
|
||||||
app: 'PHONE',
|
|
||||||
method: 'setVisibility',
|
|
||||||
data: true,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
SetNuiFocus(true, true);
|
|
||||||
//SetNuiFocusKeepInput(true)
|
|
||||||
} else {
|
|
||||||
isPhoneOpen = false;
|
|
||||||
SendNuiMessage(
|
|
||||||
//Hides phone
|
|
||||||
JSON.stringify({
|
|
||||||
app: 'PHONE',
|
|
||||||
method: 'setVisibility',
|
|
||||||
data: false,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
SetNuiFocus(false, false);
|
|
||||||
//SetNuiFocusKeepInput(false)
|
|
||||||
|
|
||||||
await phoneCloseAnim(); // Animation starts after the UI is closed.
|
const hidePhone = async (): Promise<void> => {
|
||||||
}
|
isPhoneOpen = false;
|
||||||
|
SendNuiMessage(
|
||||||
|
//Hides phone
|
||||||
|
JSON.stringify({
|
||||||
|
app: 'PHONE',
|
||||||
|
method: 'setVisibility',
|
||||||
|
data: false,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
await phoneCloseAnim();
|
||||||
|
SetNuiFocus(false, false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const togglePhoneVisible = async (): Promise<void> => {
|
||||||
|
if (isPhoneOpen) {
|
||||||
|
await hidePhone();
|
||||||
|
} else {
|
||||||
|
await showPhone();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * *
|
||||||
|
*
|
||||||
|
* Misc. Helper Functions
|
||||||
|
*
|
||||||
|
* * * * * * * * * * * * */
|
||||||
|
|
||||||
|
async function Phone(): Promise<void> {
|
||||||
|
if (config.PhoneAsItem) {
|
||||||
|
// TODO: Do promise callback here
|
||||||
|
// const hasPhoneItem = await emitNetPromise('phone:hasPhoneItem')
|
||||||
|
// if (!hasPhoneItem) return
|
||||||
|
return await togglePhoneVisible();
|
||||||
|
}
|
||||||
|
await togglePhoneVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
// DO NOT CHANGE THIS EITHER, PLEASE - CHIP
|
function sendPhoneConfig() {
|
||||||
|
SendNuiMessage(
|
||||||
// contacts app
|
JSON.stringify({
|
||||||
RegisterNuiCallbackType(events.OPEN_APP_CONTACTS);
|
app: 'PHONE',
|
||||||
on(`__cfx_nui:${events.OPEN_APP_CONTACTS}`, () => {
|
method: 'phoneConfig',
|
||||||
emitNet(events.CONTACTS_GET_CONTACTS);
|
data: config,
|
||||||
});
|
})
|
||||||
|
);
|
||||||
RegisterNuiCallbackType(events.OPEN_APP_LISTINGS);
|
}
|
||||||
on(`__cfx_nui:${events.OPEN_APP_LISTINGS}`, () => {
|
|
||||||
emitNet(events.SELLOUT_FETCH_LISTING);
|
|
||||||
});
|
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.OPEN_APP_NOTES);
|
|
||||||
on(`__cfx_nui:${events.OPEN_APP_NOTES}`, () => {
|
|
||||||
emitNet(events.NOTE_FETCH_ALL_NOTES);
|
|
||||||
});
|
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.OPEN_APP_BANK);
|
|
||||||
on(`__cfx_nui:${events.OPEN_APP_BANK}`, () => {
|
|
||||||
emitNet(events.BANK_FETCH_TRANSACTIONS);
|
|
||||||
emitNet(events.BANK_GET_CREDENTIALS);
|
|
||||||
});
|
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.OPEN_APP_CAMERA);
|
|
||||||
on(`__cfx_nui:${events.OPEN_APP_CAMERA}`, () => {
|
|
||||||
emitNet(events.CAMERA_FETCH_PHOTOS);
|
|
||||||
});
|
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.OPEN_APP_DAILER);
|
|
||||||
on(`__cfx_nui:${events.OPEN_APP_DAILER}`, () => {
|
|
||||||
emitNet(events.CONTACTS_GET_CONTACTS);
|
|
||||||
emitNet(events.PHONE_CALL_FETCH_CALLS);
|
|
||||||
});
|
|
||||||
|
|
||||||
RegisterCommand(
|
|
||||||
'phone',
|
|
||||||
() => {
|
|
||||||
//-- Toggles Phone
|
|
||||||
Phone();
|
|
||||||
},
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
RegisterNuiCallbackType('phone:close');
|
|
||||||
on(`__cfx_nui:phone:close`, () => {
|
|
||||||
Phone();
|
|
||||||
}); // Called for when the phone is closed via the UI.
|
|
||||||
|
|
||||||
AddEventHandler('onResourceStop', function (resource: string) {
|
AddEventHandler('onResourceStop', function (resource: string) {
|
||||||
if (resource === GetCurrentResourceName()) {
|
if (resource === GetCurrentResourceName()) {
|
||||||
@@ -369,26 +298,75 @@ AddEventHandler('onResourceStop', function (resource: string) {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
SetNuiFocus(false, false);
|
SetNuiFocus(false, false);
|
||||||
deletePhone(); //Deletes the phone incase it was attached.
|
removePhoneProp(); //Deletes the phone incase it was attached.
|
||||||
ClearPedTasks(GetPlayerPed(-1)); //Leave here until launch as it'll fix any stuck animations.
|
ClearPedTasks(PlayerPedId()); //Leave here until launch as it'll fix any stuck animations.
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//
|
onNet('phone:sendCredentials', (number: string) => {
|
||||||
//Phone Destory When Wet
|
SendNuiMessage(
|
||||||
//
|
JSON.stringify({
|
||||||
function countPhone(cb: any) {
|
app: 'SIMCARD',
|
||||||
if (ESX === null) return cb(0);
|
method: 'setNumber',
|
||||||
ESX.TriggerServerCallback(
|
data: number,
|
||||||
'phone:getItemAmount',
|
})
|
||||||
(qtty: number) => {
|
|
||||||
cb(qtty > 0);
|
|
||||||
},
|
|
||||||
'phone'
|
|
||||||
);
|
);
|
||||||
}
|
});
|
||||||
|
|
||||||
let destroyedPhone = false;
|
|
||||||
|
|
||||||
|
// DO NOT CHANGE THIS EITHER, PLEASE - CHIP
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * *
|
||||||
|
*
|
||||||
|
* NUI Service Callback Registration
|
||||||
|
*
|
||||||
|
* * * * * * * * * * * * */
|
||||||
|
|
||||||
|
// contacts app
|
||||||
|
RegisterNuiCallbackType(events.OPEN_APP_CONTACTS);
|
||||||
|
on(`__cfx_nui:${events.OPEN_APP_CONTACTS}`, (data: any, cb: Function) => {
|
||||||
|
emitNet(events.CONTACTS_GET_CONTACTS);
|
||||||
|
cb();
|
||||||
|
});
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(events.OPEN_APP_LISTINGS);
|
||||||
|
on(`__cfx_nui:${events.OPEN_APP_LISTINGS}`, (data: any, cb: Function) => {
|
||||||
|
emitNet(events.SELLOUT_FETCH_LISTING);
|
||||||
|
cb();
|
||||||
|
});
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(events.OPEN_APP_NOTES);
|
||||||
|
on(`__cfx_nui:${events.OPEN_APP_NOTES}`, (data: any, cb: Function) => {
|
||||||
|
emitNet(events.NOTE_FETCH_ALL_NOTES);
|
||||||
|
cb();
|
||||||
|
});
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(events.OPEN_APP_BANK);
|
||||||
|
on(`__cfx_nui:${events.OPEN_APP_BANK}`, (data: any, cb: Function) => {
|
||||||
|
emitNet(events.BANK_FETCH_TRANSACTIONS);
|
||||||
|
emitNet(events.BANK_GET_CREDENTIALS);
|
||||||
|
cb();
|
||||||
|
});
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(events.OPEN_APP_CAMERA);
|
||||||
|
on(`__cfx_nui:${events.OPEN_APP_CAMERA}`, (data: any, cb: Function) => {
|
||||||
|
emitNet(events.CAMERA_FETCH_PHOTOS);
|
||||||
|
cb();
|
||||||
|
});
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(events.OPEN_APP_DAILER);
|
||||||
|
on(`__cfx_nui:${events.OPEN_APP_DAILER}`, (data: any, cb: Function) => {
|
||||||
|
emitNet(events.CONTACTS_GET_CONTACTS);
|
||||||
|
emitNet(events.PHONE_CALL_FETCH_CALLS);
|
||||||
|
cb();
|
||||||
|
});
|
||||||
|
|
||||||
|
RegisterNuiCallbackType('phone:close');
|
||||||
|
on(`__cfx_nui:phone:close`, async (data: any, cb: Function) => {
|
||||||
|
await Phone();
|
||||||
|
cb();
|
||||||
|
}); // Called for when the phone is closed via the UI.
|
||||||
|
|
||||||
// setTick(async () => {
|
// setTick(async () => {
|
||||||
// while (config.SwimDestroy) {
|
// while (config.SwimDestroy) {
|
||||||
@@ -409,13 +387,3 @@ let destroyedPhone = false;
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
onNet('phone:sendCredentials', (number: string) => {
|
|
||||||
SendNuiMessage(
|
|
||||||
JSON.stringify({
|
|
||||||
app: 'SIMCARD',
|
|
||||||
method: 'setNumber',
|
|
||||||
data: number,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
});
|
|
||||||
@@ -34,8 +34,9 @@ emitNet(events.MESSAGES_FETCH_MESSAGE_GROUPS);
|
|||||||
RegisterNuiCallbackType(events.MESSAGES_CREATE_MESSAGE_GROUP);
|
RegisterNuiCallbackType(events.MESSAGES_CREATE_MESSAGE_GROUP);
|
||||||
on(
|
on(
|
||||||
`__cfx_nui:${events.MESSAGES_CREATE_MESSAGE_GROUP}`,
|
`__cfx_nui:${events.MESSAGES_CREATE_MESSAGE_GROUP}`,
|
||||||
({ phoneNumbers, label }: any): void => {
|
({ phoneNumbers, label }: any, cb: Function): void => {
|
||||||
emitNet(events.MESSAGES_CREATE_MESSAGE_GROUP, phoneNumbers, label);
|
emitNet(events.MESSAGES_CREATE_MESSAGE_GROUP, phoneNumbers, label);
|
||||||
|
cb();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -52,9 +53,13 @@ onNet(events.MESSAGES_CREATE_MESSAGE_GROUP_FAILED, (result: any): void => {
|
|||||||
* Messages fetch messages
|
* Messages fetch messages
|
||||||
*/
|
*/
|
||||||
RegisterNuiCallbackType(events.MESSAGES_FETCH_MESSAGES);
|
RegisterNuiCallbackType(events.MESSAGES_FETCH_MESSAGES);
|
||||||
on(`__cfx_nui:${events.MESSAGES_FETCH_MESSAGES}`, ({ groupId }: any): void => {
|
on(
|
||||||
emitNet(events.MESSAGES_FETCH_MESSAGES, groupId);
|
`__cfx_nui:${events.MESSAGES_FETCH_MESSAGES}`,
|
||||||
});
|
({ groupId }: any, cb: Function): void => {
|
||||||
|
emitNet(events.MESSAGES_FETCH_MESSAGES, groupId);
|
||||||
|
cb();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
onNet(events.MESSAGES_FETCH_MESSAGES_SUCCESS, (messages: Message[]): void => {
|
onNet(events.MESSAGES_FETCH_MESSAGES_SUCCESS, (messages: Message[]): void => {
|
||||||
sendMessageEvent(events.MESSAGES_FETCH_MESSAGES_SUCCESS, messages);
|
sendMessageEvent(events.MESSAGES_FETCH_MESSAGES_SUCCESS, messages);
|
||||||
@@ -68,8 +73,9 @@ onNet(events.MESSAGES_FETCH_MESSAGES_FAILED, (): void => {
|
|||||||
* Messages send message
|
* Messages send message
|
||||||
*/
|
*/
|
||||||
RegisterNuiCallbackType(events.MESSAGES_SEND_MESSAGE);
|
RegisterNuiCallbackType(events.MESSAGES_SEND_MESSAGE);
|
||||||
on(`__cfx_nui:${events.MESSAGES_SEND_MESSAGE}`, (data: any) => {
|
on(`__cfx_nui:${events.MESSAGES_SEND_MESSAGE}`, (data: any, cb: Function) => {
|
||||||
emitNet(events.MESSAGES_SEND_MESSAGE, data.groupId, data.message);
|
emitNet(events.MESSAGES_SEND_MESSAGE, data.groupId, data.message);
|
||||||
|
cb();
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(events.MESSAGES_SEND_MESSAGE_SUCCESS, (groupId: string) => {
|
onNet(events.MESSAGES_SEND_MESSAGE_SUCCESS, (groupId: string) => {
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ const SCREENSHOT_BASIC_TOKEN = GetConvar('SCREENSHOT_BASIC_TOKEN', 'none');
|
|||||||
|
|
||||||
const exp = (global as any).exports;
|
const exp = (global as any).exports;
|
||||||
|
|
||||||
|
let inCameraMode = false;
|
||||||
|
|
||||||
function closePhoneTemp() {
|
function closePhoneTemp() {
|
||||||
|
SetNuiFocus(false, false);
|
||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
//Hides phone
|
//Hides phone
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
@@ -16,6 +19,7 @@ function closePhoneTemp() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function openPhoneTemp() {
|
function openPhoneTemp() {
|
||||||
|
SetNuiFocus(true, true);
|
||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
//Opens phone
|
//Opens phone
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
@@ -26,74 +30,66 @@ function openPhoneTemp() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let takingPhoto = false;
|
function CellFrontCamActivate(activate: boolean) {
|
||||||
|
|
||||||
function CellFrontCamActivate(activate: any) {
|
|
||||||
return Citizen.invokeNative('0x2491A93618B7D838', activate);
|
return Citizen.invokeNative('0x2491A93618B7D838', activate);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.CAMERA_TAKE_PHOTO);
|
const displayHelperText = () => {
|
||||||
on(`__cfx_nui:${events.CAMERA_TAKE_PHOTO}`, async () => {
|
BeginTextCommandDisplayHelp('TWOSTRINGS');
|
||||||
CreateMobilePhone(1);
|
AddTextComponentString('Exit Camera Mode: ~INPUT_CELLPHONE_CANCEL~');
|
||||||
CellCamActivate(true, true);
|
AddTextComponentString('Toggle Front/Back: ~INPUT_PHONE~');
|
||||||
|
EndTextCommandDisplayHelp(0, true, false, -1);
|
||||||
|
};
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(events.CAMERA_TAKE_PHOTO);
|
||||||
|
on(`__cfx_nui:${events.CAMERA_TAKE_PHOTO}`, async (data: any, cb: Function) => {
|
||||||
|
cb();
|
||||||
|
// Create Phone Prop
|
||||||
|
CreateMobilePhone(1);
|
||||||
|
// Active Camera Change
|
||||||
|
CellCamActivate(true, true);
|
||||||
|
// Hide phone from rendering temporary
|
||||||
closePhoneTemp();
|
closePhoneTemp();
|
||||||
|
|
||||||
SetNuiFocus(false, false);
|
SetNuiFocus(false, false);
|
||||||
|
|
||||||
takingPhoto = true;
|
inCameraMode = true;
|
||||||
|
|
||||||
while (takingPhoto) {
|
while (inCameraMode) {
|
||||||
await Delay(0);
|
await Delay(0);
|
||||||
let frontCam = false;
|
let frontCam = false;
|
||||||
|
displayHelperText();
|
||||||
if (IsControlJustPressed(1, 27)) {
|
if (IsControlJustPressed(1, 27)) {
|
||||||
if (!frontCam) {
|
frontCam = !frontCam;
|
||||||
frontCam = true;
|
CellFrontCamActivate(frontCam);
|
||||||
CellFrontCamActivate(true);
|
|
||||||
} else {
|
|
||||||
frontCam = false;
|
|
||||||
CellFrontCamActivate(false);
|
|
||||||
}
|
|
||||||
} else if (IsControlJustPressed(1, 176)) {
|
} else if (IsControlJustPressed(1, 176)) {
|
||||||
takePhoto();
|
await handleTakePicture();
|
||||||
await Delay(200);
|
|
||||||
console.log('phone closing');
|
|
||||||
DestroyMobilePhone();
|
|
||||||
CellCamActivate(false, false);
|
|
||||||
|
|
||||||
openPhoneTemp();
|
|
||||||
SetNuiFocus(true, true);
|
|
||||||
|
|
||||||
takingPhoto = false;
|
|
||||||
} else if (IsControlJustPressed(1, 177)) {
|
} else if (IsControlJustPressed(1, 177)) {
|
||||||
DestroyMobilePhone();
|
handleCameraExit();
|
||||||
CellCamActivate(false, false);
|
|
||||||
|
|
||||||
openPhoneTemp();
|
|
||||||
SetNuiFocus(true, true);
|
|
||||||
|
|
||||||
takingPhoto = false;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ClearHelp(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
//setTick(async () => {
|
const handleTakePicture = async () => {
|
||||||
// while (takingPhoto) {
|
takePhoto();
|
||||||
// await Delay(0);
|
await Delay(200);
|
||||||
//
|
DestroyMobilePhone();
|
||||||
// if (IsControlReleased(1, 177)) {
|
CellCamActivate(false, false);
|
||||||
// DestroyMobilePhone();
|
openPhoneTemp();
|
||||||
// CellCamActivate(false, false);
|
inCameraMode = false;
|
||||||
// takingPhoto = false;
|
};
|
||||||
// SetNuiFocus(true, true);
|
|
||||||
// break;
|
const handleCameraExit = () => {
|
||||||
// }
|
DestroyMobilePhone();
|
||||||
// }
|
CellCamActivate(false, false);
|
||||||
//})
|
openPhoneTemp();
|
||||||
|
inCameraMode = false;
|
||||||
|
};
|
||||||
|
|
||||||
onNet(events.CAMERA_SEND_PHOTOS, (photos: string[]) => {
|
onNet(events.CAMERA_SEND_PHOTOS, (photos: string[]) => {
|
||||||
console.log(photos);
|
// console.log(photos);
|
||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
app: 'CAMERA',
|
app: 'CAMERA',
|
||||||
@@ -104,7 +100,6 @@ onNet(events.CAMERA_SEND_PHOTOS, (photos: string[]) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function takePhoto() {
|
function takePhoto() {
|
||||||
const [width, height] = GetActiveScreenResolution();
|
|
||||||
// Return and log error if screenshot basic token not found
|
// Return and log error if screenshot basic token not found
|
||||||
if (SCREENSHOT_BASIC_TOKEN === 'none') {
|
if (SCREENSHOT_BASIC_TOKEN === 'none') {
|
||||||
return console.error(
|
return console.error(
|
||||||
@@ -129,13 +124,14 @@ function takePhoto() {
|
|||||||
|
|
||||||
onNet(events.CAMERA_UPLOAD_PHOTO_SUCCESS, () => {
|
onNet(events.CAMERA_UPLOAD_PHOTO_SUCCESS, () => {
|
||||||
emitNet(events.CAMERA_FETCH_PHOTOS);
|
emitNet(events.CAMERA_FETCH_PHOTOS);
|
||||||
})
|
});
|
||||||
|
|
||||||
// delete photo
|
// delete photo
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.CAMERA_DELETE_PHOTO);
|
RegisterNuiCallbackType(events.CAMERA_DELETE_PHOTO);
|
||||||
on(`__cfx_nui:${events.CAMERA_DELETE_PHOTO}`, (data: any) => {
|
on(`__cfx_nui:${events.CAMERA_DELETE_PHOTO}`, (data: any, cb: Function) => {
|
||||||
emitNet(events.CAMERA_DELETE_PHOTO, data);
|
emitNet(events.CAMERA_DELETE_PHOTO, data);
|
||||||
|
cb();
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(events.CAMERA_DELETE_PHOTO_SUCCESS, () => {
|
onNet(events.CAMERA_DELETE_PHOTO_SUCCESS, () => {
|
||||||
|
|||||||
Reference in new issue
Block a user