mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 06:28:51 +00:00
fix(resources): load config when player spawns
this is a solution for standalone
This commit is contained in:
1 parent
d279b31b8f
commit
2f0f83a17e
2 files changed
+10
-6
No files matched your search
@@ -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
|
||||
|
||||
|
||||
@@ -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);*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user