mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2024-12-22 20:17:24 +08:00
Fixed commands not working in single player. (#2980)
* Fixed commands not working in single player. * Code review changes.
This commit is contained in:
parent
3e5f4f5639
commit
51cd6e37ff
@ -32,11 +32,11 @@ namespace big
|
||||
return;
|
||||
}
|
||||
|
||||
const auto spawn_location =
|
||||
vehicle::get_spawn_location(ctx->get_sender()->id() == self::id ? g.spawn_vehicle.spawn_inside : false,
|
||||
hash,
|
||||
PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(ctx->get_sender()->id()));
|
||||
const auto spawn_heading = ENTITY::GET_ENTITY_HEADING(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(ctx->get_sender()->id()));
|
||||
auto id = ctx->get_sender()->id();
|
||||
|
||||
const auto spawn_location = vehicle::get_spawn_location(id == self::id ? g.spawn_vehicle.spawn_inside : false,
|
||||
hash, PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(id));
|
||||
const auto spawn_heading = ENTITY::GET_ENTITY_HEADING(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(id));
|
||||
|
||||
auto veh = vehicle::spawn(hash, spawn_location, spawn_heading);
|
||||
|
||||
|
@ -36,7 +36,7 @@ namespace big
|
||||
{
|
||||
if (g.window.gui.format_money)
|
||||
{
|
||||
auto arg0 = src->get_arg<int>(0);
|
||||
auto arg0 = src->get_arg<int>(0);
|
||||
Hash casino_chips = self::char_index ? "MP1_CASINO_CHIPS"_J : "MP0_CASINO_CHIPS"_J;
|
||||
int player_chips;
|
||||
|
||||
|
@ -127,7 +127,10 @@ namespace big
|
||||
|
||||
uint8_t player::id() const
|
||||
{
|
||||
return m_net_game_player == nullptr ? -1 : m_net_game_player->m_player_id;
|
||||
if (*g_pointers->m_gta.m_is_session_started)
|
||||
return m_net_game_player == nullptr ? -1 : m_net_game_player->m_player_id;
|
||||
else
|
||||
return self::id;
|
||||
}
|
||||
|
||||
bool player::is_host() const
|
||||
|
@ -152,13 +152,16 @@ namespace big::vehicle
|
||||
|
||||
Vehicle spawn(Hash hash, Vector3 location, float heading, bool is_networked, bool script_veh)
|
||||
{
|
||||
if (is_networked && !*g_pointers->m_gta.m_is_session_started)
|
||||
is_networked = false;
|
||||
|
||||
if (entity::request_model(hash))
|
||||
{
|
||||
auto veh = VEHICLE::CREATE_VEHICLE(hash, location.x, location.y, location.z, heading, is_networked, script_veh, false);
|
||||
|
||||
STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(hash);
|
||||
|
||||
if (is_networked && *g_pointers->m_gta.m_is_session_started)
|
||||
if (is_networked)
|
||||
{
|
||||
set_mp_bitset(veh);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user