fix(resources): load config when player spawns

this is a solution for standalone
This commit is contained in:
Christopher committed 2021-05-20 16:42:34 +02:00
1 parent d279b31b8f
commit 2f0f83a17e
2 files changed
+10 -6

No files matched your search

+9 -5
View File
@@ -21,12 +21,20 @@ let isUiReady = false;
*
* * * * * * * * * * * * */
function fetchOnInitialize() {
sendMessage('PHONE', PhoneEvents.SET_CONFIG, config);
emitNet(ContactEvents.GET_CONTACTS);
emitNet(MessageEvents.FETCH_MESSAGE_GROUPS);
emitNet(TwitterEvents.GET_OR_CREATE_PROFILE);
sendMessage('PHONE', PhoneEvents.SET_CONFIG, config);
}
if (!config.general.enableMultiChar) {
on('playerSpawned', fetchOnInitialize);
}
onNet(PhoneEvents.ON_INIT, () => {
fetchOnInitialize();
});
RegisterKeyMapping('phone', 'Open Phone', 'keyboard', 'f1');
const getCurrentGameTime = () => {
@@ -130,10 +138,6 @@ onNet(PhoneEvents.SEND_CREDENTIALS, (number: string) => {
sendMessage('SIMCARD', PhoneEvents.SET_NUMBER, number);
});
onNet(PhoneEvents.ON_INIT, () => {
fetchOnInitialize();
});
// DO NOT CHANGE THIS EITHER, PLEASE - CHIP
// ^ AND WHAT ARE YOU GOING TO DO HUH? - KIDZ
+1 -1
View File
@@ -131,7 +131,7 @@ class _PlayerService {
playerLogger.debug(newPlayer);
// Emit to client that player is ready
emitNet(PhoneEvents.ON_INIT, pSource);
/*emitNet(PhoneEvents.ON_INIT, pSource);*/
}
/**