mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-18 07:07:32 +08:00
g_fiber_pool twice (#348)
This commit is contained in:
parent
bf87449d35
commit
ea7e189a20
@ -40,27 +40,25 @@ namespace big
|
|||||||
|
|
||||||
static char model[32];
|
static char model[32];
|
||||||
components::input_text_with_hint("Model Name###player_ped_model", "Player Model Name", model, sizeof(model), ImGuiInputTextFlags_EnterReturnsTrue, [] {
|
components::input_text_with_hint("Model Name###player_ped_model", "Player Model Name", model, sizeof(model), ImGuiInputTextFlags_EnterReturnsTrue, [] {
|
||||||
g_fiber_pool->queue_job([] {
|
const Hash hash = rage::joaat(model);
|
||||||
const Hash hash = rage::joaat(model);
|
|
||||||
|
|
||||||
for (uint8_t i = 0; !STREAMING::HAS_MODEL_LOADED(hash) && i < 100; i++)
|
for (uint8_t i = 0; !STREAMING::HAS_MODEL_LOADED(hash) && i < 100; i++)
|
||||||
{
|
{
|
||||||
STREAMING::REQUEST_MODEL(hash);
|
STREAMING::REQUEST_MODEL(hash);
|
||||||
|
|
||||||
script::get_current()->yield();
|
|
||||||
}
|
|
||||||
if (!STREAMING::HAS_MODEL_LOADED(hash))
|
|
||||||
{
|
|
||||||
g_notification_service->push_error("Self", "Failed to spawn model, did you give an incorrect model ? ");
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PLAYER::SET_PLAYER_MODEL(PLAYER::GET_PLAYER_INDEX(), hash);
|
|
||||||
PED::SET_PED_DEFAULT_COMPONENT_VARIATION(self::ped);
|
|
||||||
script::get_current()->yield();
|
script::get_current()->yield();
|
||||||
STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(hash);
|
}
|
||||||
});
|
if (!STREAMING::HAS_MODEL_LOADED(hash))
|
||||||
|
{
|
||||||
|
g_notification_service->push_error("Self", "Failed to spawn model, did you give an incorrect model ? ");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
PLAYER::SET_PLAYER_MODEL(PLAYER::GET_PLAYER_INDEX(), hash);
|
||||||
|
PED::SET_PED_DEFAULT_COMPONENT_VARIATION(self::ped);
|
||||||
|
script::get_current()->yield();
|
||||||
|
STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(hash);
|
||||||
});
|
});
|
||||||
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user