diff --git a/scripts/client/event.js b/scripts/client/event.js index d38cc572..387cd000 100644 --- a/scripts/client/event.js +++ b/scripts/client/event.js @@ -16,9 +16,6 @@ function initEventScript() { // =========================================================================== function addAllEventHandlers() { - addEventHandler("OnResourceStart", onResourceStart); - addEventHandler("OnResourceReady", onResourceReady); - addEventHandler("OnResourceStop", onResourceStop); addEventHandler("OnProcess", onProcess); addEventHandler("OnKeyUp", onKeyUp); addEventHandler("OnDrawnHUD", onDrawnHUD); @@ -94,8 +91,11 @@ function onResourceStop(event, resource) { function onResourceReady(event, resource) { if (resource == thisResource) { logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.Event] onResourceReady called - Sending signal to server`); - loadLocaleConfig(); - sendResourceReadySignalToServer(); + + setTimeout(function () { + initClientScripts(); + sendResourceReadySignalToServer(); + }, 500); } } diff --git a/scripts/client/startup.js b/scripts/client/startup.js index 172a83c3..73fe48e7 100644 --- a/scripts/client/startup.js +++ b/scripts/client/startup.js @@ -25,6 +25,11 @@ function initClientScripts() { initPayPhoneScript(); initTimersScript(); initJobScript(); + initItemScript(); + initBusinessScript(); + initHouseScript(); + + loadLocaleConfig(); addAllNetworkHandlers(); @@ -203,6 +208,8 @@ function setUpInitialGame() { // =========================================================================== -initClientScripts(); +addEventHandler("OnResourceStart", onResourceStart); +addEventHandler("OnResourceReady", onResourceReady); +addEventHandler("OnResourceStop", onResourceStop); -// =========================================================================== +// =========================================================================== \ No newline at end of file