tweak(resources): use 'custom appMessageEvent'

This commit is contained in:
Christopher committed 2021-03-15 10:53:02 +01:00
1 parent 5c9f36f754
commit 458839488e
4 files changed
+17 -95

No files matched your search

+4 -24
View File
@@ -1,5 +1,6 @@
import events from '../utils/events';
import { Delay } from '../utils/fivem';
import { sendMessage, sendCameraEvent } from '../utils/messages';
const SCREENSHOT_BASIC_TOKEN = GetConvar('SCREENSHOT_BASIC_TOKEN', 'none');
const exp = (global as any).exports;
@@ -8,26 +9,12 @@ let inCameraMode = false;
function closePhoneTemp() {
SetNuiFocus(false, false);
SendNuiMessage(
//Hides phone
JSON.stringify({
app: 'PHONE',
method: 'setVisibility',
data: false,
}),
);
sendMessage('PHONE', 'setVisibility', false);
}
function openPhoneTemp() {
SetNuiFocus(true, true);
SendNuiMessage(
//Opens phone
JSON.stringify({
app: 'PHONE',
method: 'setVisibility',
data: true,
}),
);
sendMessage('PHONE', 'setVisibility', true);
}
function CellFrontCamActivate(activate: boolean) {
@@ -89,14 +76,7 @@ const handleCameraExit = () => {
};
onNet(events.CAMERA_SEND_PHOTOS, (photos: string[]) => {
// console.log(photos);
SendNuiMessage(
JSON.stringify({
app: 'CAMERA',
method: 'setPhotos',
data: photos,
}),
);
sendCameraEvent('setPhotos', photos);
});
function takePhoto() {