tweak(player): Altered PLAYER_IS_READY event to emit a bool

This will set the client var to true when NPWD loads a player and false when NPWD unloads a player.
This commit is contained in:
Taso committed 2021-04-18 15:38:50 -04:00
1 parent 268bd4f4a4
commit 949ea4ba4b
3 files changed
+21 -11

No files matched your search

+3 -7
View File
@@ -9,7 +9,6 @@ import { NotesEvents } from '../../typings/notes';
import { BankEvents } from '../../typings/bank';
import { PhotoEvents } from '../../typings/photo';
import { CallEvents } from '../../typings/call';
import { MatchEvents } from '../../typings/match';
import { config } from './client';
let isPhoneOpen = false;
@@ -109,12 +108,9 @@ async function Phone(): Promise<void> {
}
}
// triggerd when the player is ready
onNet(PhoneEvents.PLAYER_IS_READY, () => {
isPlayerReady = true;
if (isUiReady) {
fetchOnInitialize();
}
// Set the global depending on the response from event
onNet(PhoneEvents.PLAYER_IS_READY, (ready: boolean) => {
isPlayerReady = ready;
});
AddEventHandler('onResourceStop', function (resource: string) {