more formatting

This commit is contained in:
Christopher committed 2021-03-02 20:45:41 +01:00
1 parent 046447b0fb
commit f552c1212c
157 files changed
+635 -1579

No files matched your search

+4 -4
View File
@@ -7,7 +7,7 @@ onNet(events.BANK_SEND_TRANSFERS, (transfer: any) => {
app: 'BANK',
method: 'setTransaction',
data: transfer,
})
}),
);
});
@@ -17,7 +17,7 @@ onNet(events.BANK_SEND_CREDENTIALS, (credentials: any) => {
app: 'BANK',
method: 'setCredentials',
data: credentials,
})
}),
);
});
@@ -37,7 +37,7 @@ onNet(events.BANK_TRANSACTION_ALERT, (result: IAlertProps) => {
app: 'BANK',
method: 'setAlert',
data: result,
})
}),
);
});
@@ -47,6 +47,6 @@ onNet(events.BANK_TRANSACTION_NOTIFICATION, (transfer: any) => {
app: 'BANK',
method: 'setNotification',
data: transfer,
})
}),
);
});
+8 -8
View File
@@ -27,9 +27,9 @@ onNet(
isTransmitter: isTransmitter,
accepted: false,
},
})
}),
);
}
},
);
RegisterNuiCallbackType(events.PHONE_ACCEPT_CALL); // Fires when the TARGET accepts.
@@ -54,9 +54,9 @@ onNet(
isTransmitter: isTransmitter,
accepted: true,
},
})
}),
);
}
},
);
RegisterNuiCallbackType(events.PHONE_CALL_REJECTED); // Fires when cancelling and rejecting a call.
@@ -79,7 +79,7 @@ onNet(events.PHONE_CALL_WAS_REJECTED, () => {
accepted: false,
active: false,
},
})
}),
);
});
@@ -109,7 +109,7 @@ onNet(events.PHONE_CALL_WAS_ENDED, () => {
accepted: false,
active: false,
},
})
}),
);
});
@@ -119,7 +119,7 @@ function openCallModal(show: boolean) {
app: 'CALL',
method: 'callModal',
data: show,
})
}),
);
}
@@ -129,6 +129,6 @@ onNet(events.PHONE_CALL_SEND_HISTORY, (calls: ICall) => {
app: 'DAILER',
method: 'setHistory',
data: calls,
})
}),
);
});
+2 -2
View File
@@ -6,7 +6,7 @@ onNet(events.CONTACTS_SEND_CONTACTS, (contacts: any) => {
app: 'CONTACTS',
method: 'setContacts',
data: contacts,
})
}),
);
});
@@ -46,6 +46,6 @@ onNet(events.CONTACTS_ACTION_RESULT, (alert: any) => {
app: 'CONTACTS',
method: 'setAlert',
data: alert,
})
}),
);
});
+7 -7
View File
@@ -22,7 +22,7 @@ const showPhone = async (): Promise<void> => {
app: 'PHONE',
method: 'setVisibility',
data: true,
})
}),
);
SetNuiFocus(true, true);
};
@@ -35,7 +35,7 @@ const hidePhone = async (): Promise<void> => {
app: 'PHONE',
method: 'setVisibility',
data: false,
})
}),
);
await phoneCloseAnim();
SetNuiFocus(false, false);
@@ -52,7 +52,7 @@ RegisterCommand(
async () => {
await hidePhone();
},
false
false,
);
RegisterCommand(
@@ -61,7 +61,7 @@ RegisterCommand(
//-- Toggles Phone
await Phone();
},
false
false,
);
RegisterCommand(
@@ -69,7 +69,7 @@ RegisterCommand(
async () => {
await showPhone();
},
false
false,
);
/* * * * * * * * * * * * *
@@ -99,7 +99,7 @@ AddEventHandler('onResourceStop', function (resource: string) {
app: 'PHONE',
method: 'setVisibility',
data: false,
})
}),
);
SetNuiFocus(false, false);
removePhoneProp(); //Deletes the phone incase it was attached.
@@ -113,7 +113,7 @@ onNet('phone:sendCredentials', (number: string) => {
app: 'SIMCARD',
method: 'setNumber',
data: number,
})
}),
);
});
+4 -7
View File
@@ -13,12 +13,9 @@ on(`__cfx_nui:${events.MESSAGES_FETCH_MESSAGE_GROUPS}`, (): void => {
onNet(
events.MESSAGES_FETCH_MESSAGE_GROUPS_SUCCESS,
(messageGroups: MessageGroup[]): void => {
sendMessageEvent(
events.MESSAGES_FETCH_MESSAGE_GROUPS_SUCCESS,
messageGroups
);
sendMessageEvent(events.MESSAGES_FETCH_MESSAGE_GROUPS_SUCCESS, messageGroups);
emitNet(events.MESSAGES_FETCH_MESSAGE_GROUPS_SUCCESS);
}
},
);
onNet(events.MESSAGES_FETCH_MESSAGE_GROUPS_FAILED, () => {
@@ -34,7 +31,7 @@ on(
({ phoneNumbers, label }: any, cb: Function): void => {
emitNet(events.MESSAGES_CREATE_MESSAGE_GROUP, phoneNumbers, label);
cb();
}
},
);
onNet(events.MESSAGES_CREATE_MESSAGE_GROUP_SUCCESS, (result: any): void => {
@@ -55,7 +52,7 @@ on(
({ groupId }: any, cb: Function): void => {
emitNet(events.MESSAGES_FETCH_MESSAGES, groupId);
cb();
}
},
);
onNet(events.MESSAGES_FETCH_MESSAGES_SUCCESS, (messages: Message[]): void => {
+5 -7
View File
@@ -14,7 +14,7 @@ function closePhoneTemp() {
app: 'PHONE',
method: 'setVisibility',
data: false,
})
}),
);
}
@@ -26,7 +26,7 @@ function openPhoneTemp() {
app: 'PHONE',
method: 'setVisibility',
data: true,
})
}),
);
}
@@ -95,16 +95,14 @@ onNet(events.CAMERA_SEND_PHOTOS, (photos: string[]) => {
app: 'CAMERA',
method: 'setPhotos',
data: photos,
})
}),
);
});
function takePhoto() {
// Return and log error if screenshot basic token not found
if (SCREENSHOT_BASIC_TOKEN === 'none') {
return console.error(
'Screenshot basic token not found. Please set in server.cfg'
);
return console.error('Screenshot basic token not found. Please set in server.cfg');
}
exp['screenshot-basic'].requestScreenshotUpload(
'https://api.imgur.com/3/image',
@@ -118,7 +116,7 @@ function takePhoto() {
(data: string) => {
const imageLink = JSON.parse(data).data.link;
emitNet(events.CAMERA_UPLOAD_PHOTO, imageLink);
}
},
);
}
+2 -2
View File
@@ -8,7 +8,7 @@ onNet(events.SELLOUT_SEND_LISTING, (listing: MarketplaceListing) => {
app: 'SELLOUT',
method: 'setListings',
data: listing,
})
}),
);
});
@@ -30,6 +30,6 @@ onNet(events.SELLOUT_ACTION_RESULT, (alert: IAlertProps) => {
app: 'SELLOUT',
method: 'setAlert',
data: alert,
})
}),
);
});
+3 -6
View File
@@ -52,12 +52,9 @@ onNet(events.TWITTER_FETCH_TWEETS_FAILURE, () => {
* Twitter fetch filtered tweets
*/
RegisterNuiCallbackType(events.TWITTER_FETCH_TWEETS_FILTERED);
on(
`__cfx_nui:${events.TWITTER_FETCH_TWEETS_FILTERED}`,
(searchValue: string) => {
emitNet(events.TWITTER_FETCH_TWEETS_FILTERED, searchValue);
}
);
on(`__cfx_nui:${events.TWITTER_FETCH_TWEETS_FILTERED}`, (searchValue: string) => {
emitNet(events.TWITTER_FETCH_TWEETS_FILTERED, searchValue);
});
onNet(events.TWITTER_FETCH_TWEETS_FILTERED_SUCCESS, (tweets: any) => {
sendTwitterMessage(events.TWITTER_FETCH_TWEETS_FILTERED_SUCCESS, tweets);
+2 -7
View File
@@ -25,18 +25,13 @@ export default class ClientUtils {
};
}
public emitNetPromise<T = any>(
eventName: string,
...args: any[]
): Promise<T> {
public emitNetPromise<T = any>(eventName: string, ...args: any[]): Promise<T> {
return new Promise((resolve, reject) => {
let hasTimedOut = false;
setTimeout(() => {
hasTimedOut = true;
reject(
`${eventName} has timed out after ${this._settings.promiseTimeout} ms`
);
reject(`${eventName} has timed out after ${this._settings.promiseTimeout} ms`);
}, this._settings.promiseTimeout);
// Have to use this as the regular uuid refused to work here for some
+6 -33
View File
@@ -21,15 +21,7 @@ const newPhoneProp = async () => {
const playerPed = PlayerPedId();
const [x, y, z] = GetEntityCoords(playerPed, true);
prop = CreateObject(
GetHashKey(phoneModel),
x,
y,
z + 0.2,
true,
true,
true
);
prop = CreateObject(GetHashKey(phoneModel), x, y, z + 0.2, true, true, true);
//prop = CreateObject(GetHashKey(phoneModel), 1.0, 1.0, 1.0, 1, 1, 0)
const boneIndex = GetPedBoneIndex(playerPed, 28422);
AttachEntityToEntity(
@@ -47,7 +39,7 @@ const newPhoneProp = async () => {
false,
true,
1.0,
true
true,
); //-- Attaches the phone to the player.
propCreated = true;
} else if (propCreated) {
@@ -96,7 +88,7 @@ const handleOpenVehicleAnim = async (playerPed: number): Promise<void> => {
0,
false,
false,
false
false,
);
await Delay(300);
await newPhoneProp();
@@ -120,7 +112,7 @@ const handleOpenNormalAnim = async (playerPed: number): Promise<void> => {
0,
false,
false,
false
false,
);
await Delay(300);
await newPhoneProp();
@@ -174,28 +166,9 @@ const handleCallEndNormalAnim = async (playerPed: number): Promise<void> => {
const DICT = 'cellphone@';
const ANIM = 'cellphone_call_to_text';
if (
IsEntityPlayingAnim(
playerPed,
'cellphone@',
'cellphone_call_listen_base',
49
)
) {
if (IsEntityPlayingAnim(playerPed, 'cellphone@', 'cellphone_call_listen_base', 49)) {
await loadAnimDict(DICT);
TaskPlayAnim(
playerPed,
DICT,
ANIM,
2.5,
8.0,
-1,
50,
0,
false,
false,
false
);
TaskPlayAnim(playerPed, DICT, ANIM, 2.5, 8.0, -1, 50, 0, false, false, false);
}
};