Fix: prettier config in resources\ not being standard.

This commit is contained in:
Taso committed 2021-01-13 20:36:03 -05:00
1 parent d56112a0cb
commit ec1451a9aa
28 files changed
+349 -349

No files matched your search

+9 -9
View File
@@ -1,10 +1,10 @@
import events from "../utils/events";
import events from '../utils/events';
onNet(events.BANK_SEND_TRANSFERS, (transfer: any) => {
SendNuiMessage(
JSON.stringify({
app: "BANK",
method: "setTransaction",
app: 'BANK',
method: 'setTransaction',
data: transfer,
})
);
@@ -13,8 +13,8 @@ onNet(events.BANK_SEND_TRANSFERS, (transfer: any) => {
onNet(events.BANK_SEND_CREDENTIALS, (credentials: any) => {
SendNuiMessage(
JSON.stringify({
app: "BANK",
method: "setCredentials",
app: 'BANK',
method: 'setCredentials',
data: credentials,
})
);
@@ -33,8 +33,8 @@ onNet(events.BANK_ADD_TRANSFER_SUCCESS, () => {
onNet(events.BANK_TRANSACTION_ALERT, (bool: boolean) => {
SendNuiMessage(
JSON.stringify({
app: "BANK",
method: "setAlert",
app: 'BANK',
method: 'setAlert',
data: bool,
})
);
@@ -43,8 +43,8 @@ onNet(events.BANK_TRANSACTION_ALERT, (bool: boolean) => {
onNet(events.BANK_TRANSACTION_NOTIFICATION, (transfer: any) => {
SendNuiMessage(
JSON.stringify({
app: "BANK",
method: "setNotification",
app: 'BANK',
method: 'setNotification',
data: transfer,
})
);
+5 -5
View File
@@ -1,10 +1,10 @@
import events from "../utils/events";
import events from '../utils/events';
onNet(events.CONTACTS_SEND_CONTACTS, (contacts: any) => {
SendNuiMessage(
JSON.stringify({
app: "CONTACTS",
method: "setContacts",
app: 'CONTACTS',
method: 'setContacts',
data: contacts,
})
);
@@ -45,8 +45,8 @@ onNet(events.CONTACTS_DELETE_CONTACT_SUCCESS, () => {
onNet(events.CONTACTS_ACTION_RESULT, (result: string) => {
SendNuiMessage(
JSON.stringify({
app: "CONTACTS",
method: "setAlert",
app: 'CONTACTS',
method: 'setAlert',
data: result,
})
);
+52 -52
View File
@@ -1,17 +1,17 @@
import { ESX } from "../client/client";
import config from "../utils/config";
import { Delay } from "../utils/fivem";
import events from "../utils/events";
import { ESX } from '../client/client';
import config from '../utils/config';
import { Delay } from '../utils/fivem';
import events from '../utils/events';
RegisterCommand(
"phone:close",
'phone:close',
(source: any, args: string[], raw: any) => {
phoneCloseAnim();
SetNuiFocus(false, false);
SendNuiMessage(
JSON.stringify({
app: "PHONE",
method: "setVisibility",
app: 'PHONE',
method: 'setVisibility',
data: false,
})
);
@@ -22,7 +22,7 @@ RegisterCommand(
let prop = 0;
let isPhoneOpen = false;
let propCreated = false;
let phoneModel = "prop_amb_phone"; // Refered to in newphoneProp function. Requires custom phone being streamed.
let phoneModel = 'prop_amb_phone'; // Refered to in newphoneProp function. Requires custom phone being streamed.
const newPhoneProp = async () => {
//Function for creating the phone prop
@@ -31,7 +31,7 @@ const newPhoneProp = async () => {
RequestModel(phoneModel);
while (!HasModelLoaded(phoneModel)) {
await Delay(1);
console.log("MODEL HASNT LOADED");
console.log('MODEL HASNT LOADED');
}
const playerPed = PlayerPedId();
@@ -65,9 +65,9 @@ const newPhoneProp = async () => {
true
); //-- Attaches the phone to the player.
propCreated = true;
console.log("prop created");
console.log('prop created');
} else if (propCreated) {
console.log("prop already created");
console.log('prop already created');
}
};
@@ -78,7 +78,7 @@ function deletePhone() {
DeleteEntity(prop);
prop = 0;
propCreated = false;
console.log("prop destroyed");
console.log('prop destroyed');
}
}
@@ -92,19 +92,19 @@ async function loadAnimDict(dict: any) {
async function phoneOpenAnim() {
//Phone Open Animation
console.log("phoneOpenAnim"); //Left for testing purposes.
console.log('phoneOpenAnim'); //Left for testing purposes.
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";
const dict = 'anim@cellphone@in_car@ps';
ClearPedTasks(GetPlayerPed(-1));
await loadAnimDict(dict);
TaskPlayAnim(
GetPlayerPed(-1),
dict,
"cellphone_text_in",
'cellphone_text_in',
8.0,
-1,
-1,
@@ -118,14 +118,14 @@ async function phoneOpenAnim() {
await newPhoneProp(); //Creates the phone and attaches it.
} else {
//While not in a vehicle it will use this dict.
const dict = "cellphone@";
const dict = 'cellphone@';
ClearPedTasks(GetPlayerPed(-1));
await loadAnimDict(dict);
TaskPlayAnim(
GetPlayerPed(-1),
dict,
"cellphone_text_in",
'cellphone_text_in',
8.0,
-1,
-1,
@@ -142,14 +142,14 @@ async function phoneOpenAnim() {
async function phoneCloseAnim() {
//Phone Close Animation
console.log("phoneCloseAnim"); //Left for testing purposes.
console.log('phoneCloseAnim'); //Left for testing purposes.
const flag = 50; //https://runtime.fivem.net/doc/natives/?_0xEA47FE3719165B94
const anim = "cellphone_text_out";
const anim = 'cellphone_text_out';
if (IsPedInAnyVehicle(GetPlayerPed(-1), true)) {
//true refers to at get in.
const dict = "anim@cellphone@in_car@ps";
const dict = 'anim@cellphone@in_car@ps';
StopAnimTask(GetPlayerPed(-1), dict, "cellphone_text_in", 1.0); //Stop the pull out animation
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
@@ -170,9 +170,9 @@ async function phoneCloseAnim() {
StopAnimTask(GetPlayerPed(-1), dict, anim, 1.0); //clears the animation
} else {
//While not in a vehicle it will use this dict.
const dict = "cellphone@";
const dict = 'cellphone@';
StopAnimTask(GetPlayerPed(-1), dict, "cellphone_text_in", 1.0); //Stop the pull out animation
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(
@@ -197,24 +197,24 @@ async function phoneCloseAnim() {
async function carryingPhone(cb: any) {
if (ESX === null) return cb(0);
ESX.TriggerServerCallback(
"phone:getItemAmount",
'phone:getItemAmount',
(qtty: number) => {
cb(qtty > 0);
},
"phone"
'phone'
);
}
function noPhone() {
if (ESX === null) return;
ESX.ShowNotification("Oi Mate, No El Telephono", false, false, 1);
ESX.ShowNotification('Oi Mate, No El Telephono', false, false, 1);
}
function sendPhoneConfig() {
SendNuiMessage(
JSON.stringify({
app: "PHONE",
method: "phoneConfig",
app: 'PHONE',
method: 'phoneConfig',
data: config,
})
);
@@ -246,20 +246,20 @@ setTick(() => {
async function Phone() {
if (config.PhoneAsItem) {
console.log("CONFIG ON");
console.log('CONFIG ON');
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.
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",
app: 'PHONE',
method: 'setVisibility',
data: true,
})
);
@@ -271,8 +271,8 @@ async function Phone() {
SendNuiMessage(
//Hides phone
JSON.stringify({
app: "PHONE",
method: "setVisibility",
app: 'PHONE',
method: 'setVisibility',
data: false,
})
);
@@ -286,18 +286,18 @@ async function Phone() {
}
});
} else if (!config.PhoneAsItem) {
console.log("CONFIG OFF");
console.log('CONFIG OFF');
if (!isPhoneOpen) {
isPhoneOpen = true;
await phoneOpenAnim(); // Animation starts before the phone is open
emitNet("phone:getCredentials");
console.log("Sellout fetched from client side");
emitNet('phone:getCredentials');
console.log('Sellout fetched from client side');
SetCursorLocation(0.936, 0.922); //Experimental
let res = GetActiveScreenResolution();
SendNuiMessage(
JSON.stringify({
app: "PHONE",
method: "setVisibility",
app: 'PHONE',
method: 'setVisibility',
data: true,
})
);
@@ -309,8 +309,8 @@ async function Phone() {
SendNuiMessage(
//Hides phone
JSON.stringify({
app: "PHONE",
method: "setVisibility",
app: 'PHONE',
method: 'setVisibility',
data: false,
})
);
@@ -352,7 +352,7 @@ on(`__cfx_nui:${events.OPEN_APP_CAMERA}`, () => {
});
RegisterCommand(
"phone",
'phone',
() => {
//-- Toggles Phone
Phone();
@@ -360,17 +360,17 @@ RegisterCommand(
false
);
RegisterNuiCallbackType("phone:close");
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()) {
SendNuiMessage(
JSON.stringify({
app: "PHONE",
method: "setVisibility",
app: 'PHONE',
method: 'setVisibility',
data: false,
})
);
@@ -386,11 +386,11 @@ AddEventHandler("onResourceStop", function (resource: string) {
function countPhone(cb: any) {
if (ESX === null) return cb(0);
ESX.TriggerServerCallback(
"phone:getItemAmount",
'phone:getItemAmount',
(qtty: number) => {
cb(qtty > 0);
},
"phone"
'phone'
);
}
@@ -416,11 +416,11 @@ let destroyedPhone = false;
// }
// });
onNet("phone:sendCredentials", (number: string) => {
onNet('phone:sendCredentials', (number: string) => {
SendNuiMessage(
JSON.stringify({
app: "SIMCARD",
method: "setNumber",
app: 'SIMCARD',
method: 'setNumber',
data: number,
})
);
+3 -3
View File
@@ -1,6 +1,6 @@
import events from "../utils/events";
import { Message, MessageGroup } from "../../phone/src/common/typings/messages";
import { sendMessageEvent } from "../utils/messages";
import events from '../utils/events';
import { Message, MessageGroup } from '../../phone/src/common/typings/messages';
import { sendMessageEvent } from '../utils/messages';
/**
* Messages get message groups
+3 -3
View File
@@ -1,10 +1,10 @@
import events from "../utils/events";
import events from '../utils/events';
onNet(events.NOTE_SEND_NOTE, (notes: any) => {
SendNuiMessage(
JSON.stringify({
app: "NOTES",
method: "setNotes",
app: 'NOTES',
method: 'setNotes',
data: notes,
})
);
+17 -17
View File
@@ -1,6 +1,6 @@
import events from "../utils/events";
import { Delay } from "../utils/fivem";
const SCREENSHOT_BASIC_TOKEN = GetConvar("SCREENSHOT_BASIC_TOKEN", "none");
import events from '../utils/events';
import { Delay } from '../utils/fivem';
const SCREENSHOT_BASIC_TOKEN = GetConvar('SCREENSHOT_BASIC_TOKEN', 'none');
const exp = (global as any).exports;
@@ -8,8 +8,8 @@ function closePhoneTemp() {
SendNuiMessage(
//Hides phone
JSON.stringify({
app: "PHONE",
method: "setVisibility",
app: 'PHONE',
method: 'setVisibility',
data: false,
})
);
@@ -19,8 +19,8 @@ function openPhoneTemp() {
SendNuiMessage(
//Opens phone
JSON.stringify({
app: "PHONE",
method: "setVisibility",
app: 'PHONE',
method: 'setVisibility',
data: true,
})
);
@@ -29,7 +29,7 @@ function openPhoneTemp() {
let takingPhoto = false;
function CellFrontCamActivate(activate: any) {
return Citizen.invokeNative("0x2491A93618B7D838", activate);
return Citizen.invokeNative('0x2491A93618B7D838', activate);
}
RegisterNuiCallbackType(events.CAMERA_TAKE_PHOTO);
@@ -57,7 +57,7 @@ on(`__cfx_nui:${events.CAMERA_TAKE_PHOTO}`, async () => {
} else if (IsControlJustPressed(1, 176)) {
takePhoto();
await Delay(200);
console.log("phone closing");
console.log('phone closing');
DestroyMobilePhone();
CellCamActivate(false, false);
@@ -96,8 +96,8 @@ onNet(events.CAMERA_SEND_PHOTOS, (photos: string[]) => {
console.log(photos);
SendNuiMessage(
JSON.stringify({
app: "CAMERA",
method: "setPhotos",
app: 'CAMERA',
method: 'setPhotos',
data: photos,
})
);
@@ -106,18 +106,18 @@ onNet(events.CAMERA_SEND_PHOTOS, (photos: string[]) => {
function takePhoto() {
const [width, height] = GetActiveScreenResolution();
// Return and log error if screenshot basic token not found
if (SCREENSHOT_BASIC_TOKEN === "none") {
if (SCREENSHOT_BASIC_TOKEN === 'none') {
return console.error(
"Screenshot basic token not found. Please set in server.cfg"
'Screenshot basic token not found. Please set in server.cfg'
);
}
exp["screenshot-basic"].requestScreenshotUpload(
"https://api.imgur.com/3/image",
"imgur",
exp['screenshot-basic'].requestScreenshotUpload(
'https://api.imgur.com/3/image',
'imgur',
{
headers: {
authorization: `Client-ID ${SCREENSHOT_BASIC_TOKEN}`,
"content-type": "multipart/form-data",
'content-type': 'multipart/form-data',
},
},
(data: string) => {
+4 -4
View File
@@ -1,10 +1,10 @@
import events from "../utils/events";
import events from '../utils/events';
onNet(events.SELLOUT_SEND_LISTING, (listing: any) => {
SendNuiMessage(
JSON.stringify({
app: "SELLOUT",
method: "setListings",
app: 'SELLOUT',
method: 'setListings',
data: listing,
})
);
@@ -17,6 +17,6 @@ on(`__cfx_nui:${events.SELLOUT_ADD_LISTING}`, (data: any) => {
setTimeout(() => {
emitNet(events.SELLOUT_FETCH_LISTING);
console.log("Fetched");
console.log('Fetched');
}, 500);
});
+2 -2
View File
@@ -1,5 +1,5 @@
import events from "../utils/events";
import { sendTwitterMessage } from "../utils/messages";
import events from '../utils/events';
import { sendTwitterMessage } from '../utils/messages';
/**
* Twitter get or create profile
+10 -10
View File
@@ -1,18 +1,18 @@
import { Client } from "esx.js";
import { Client } from 'esx.js';
import "./cl_main";
import "./cl_twitter";
import "./cl_contacts";
import "./cl_sellout";
import "./cl_bank";
import "./cl_notes";
import "./cl_photo";
import "./cl_messages";
import './cl_main';
import './cl_twitter';
import './cl_contacts';
import './cl_sellout';
import './cl_bank';
import './cl_notes';
import './cl_photo';
import './cl_messages';
export let ESX: Client = null;
setTick(() => {
while (ESX === null) {
emit("esx:getSharedObject", (obj: Client) => (ESX = obj));
emit('esx:getSharedObject', (obj: Client) => (ESX = obj));
}
});