#region Local Var
	var uLocal_0 = 0;
	var uLocal_1 = 0;
	int iLocal_2 = 0;
	int iLocal_3 = 0;
	int iLocal_4 = 0;
	int iLocal_5 = 0;
	int iLocal_6 = 0;
	int iLocal_7 = 0;
	int iLocal_8 = 0;
	int iLocal_9 = 0;
	int iLocal_10 = 0;
	int iLocal_11 = 0;
	var uLocal_12 = 0;
	var uLocal_13 = 0;
	float fLocal_14 = 0f;
	var uLocal_15 = 0;
	var uLocal_16 = 0;
	int iLocal_17 = 0;
	var uLocal_18 = 0;
	var uLocal_19 = 0;
	char* sLocal_20 = NULL;
	float fLocal_21 = 0f;
	var uLocal_22 = 0;
	var uLocal_23 = 0;
	var uLocal_24 = 0;
	float fLocal_25 = 0f;
	float fLocal_26 = 0f;
	var uLocal_27 = 0;
	int iLocal_28 = 0;
	int iLocal_29 = 0;
	int iLocal_30 = 0;
	float fLocal_31 = 0f;
	vector3 vLocal_32 = { 0f, 0f, 0f };
	int iLocal_35 = 0;
	int iLocal_36 = 0;
	int iLocal_37 = 0;
	int iLocal_38[6] = { 0, 0, 0, 0, 0, 0 };
	int iLocal_45 = 0;
	int iLocal_46 = 0;
	int iLocal_47 = 0;
	int iLocal_48 = 0;
	int iLocal_49 = 0;
	vector3 vLocal_50 = { 0f, 0f, 0f };
	int iLocal_53 = 0;
	int iLocal_54 = 0;
	vector3 vLocal_55 = { 0f, 0f, 0f };
	float fLocal_58 = 0f;
	int iLocal_59 = 0;
	var uLocal_60 = 0;
	var uLocal_61[5] = { 0, 0, 0, 0, 0 };
	var uLocal_67[5] = { 0, 0, 0, 0, 0 };
	var uLocal_73 = 5;
	var uLocal_74 = 0;
	var uLocal_75 = 0;
	var uLocal_76 = 0;
	var uLocal_77 = 0;
	var uLocal_78 = 0;
	int iLocal_79 = 0;
	int iLocal_80 = 0;
	int iLocal_81 = 0;
#endregion

void __EntryFunction__()//Position - 0x0
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	iLocal_2 = 1;
	iLocal_3 = 134;
	iLocal_4 = 134;
	iLocal_5 = 1;
	iLocal_6 = 1;
	iLocal_7 = 1;
	iLocal_8 = 134;
	iLocal_9 = 1;
	iLocal_10 = 12;
	iLocal_11 = 12;
	fLocal_14 = 0.001f;
	iLocal_17 = -1;
	sLocal_20 = "NULL";
	fLocal_21 = 0f;
	fLocal_25 = -0.0375f;
	fLocal_26 = 0.17f;
	fLocal_31 = 1E+07f;
	vLocal_32 = { 2134.06f, 4780.69f, 41.664f };
	iLocal_35 = -1;
	vLocal_50 = { 2136.133f, 4780.563f, 39.9702f };
	vLocal_55 = { 2149.737f, 4798.472f, 40.1071f };
	fLocal_58 = 55.4847f;
	if (player::has_force_cleanup_occurred(82))
	{
		func_172();
	}
	func_171(17);
	func_170();
	iVar0 = 0;
	iVar1 = 0;
	iVar2 = 0;
	while (true)
	{
		if (func_169() == 309)
		{
			iLocal_37 = true;
		}
		else
		{
			iLocal_37 = false;
		}
		if (func_156())
		{
			if (!entity::is_entity_dead(player::player_ped_id(), 0))
			{
				fLocal_31 = system::vdist2(entity::get_entity_coords(player::player_ped_id(), 1), vLocal_32);
			}
			func_154(&iVar1);
			func_29(&iVar2);
			if (iLocal_47 > 3)
			{
				if (fLocal_31 < 600f)
				{
					if (func_26(0) == 0 && (gameplay::get_game_timer() - iLocal_81) > 2000)
					{
						iLocal_81 = gameplay::get_game_timer();
						func_3();
					}
				}
			}
			iVar0 = 0;
		}
		else
		{
			if (!iLocal_46)
			{
				if (func_2(105))
				{
					func_1(105, 0, 0);
					Global_101553.f_18838.f_14 = 0;
				}
			}
			else
			{
				Global_101553.f_18838.f_14 = 0;
			}
			if (!iLocal_46)
			{
				if (func_2(106))
				{
					func_1(106, 0, 0);
					Global_101553.f_18838.f_13 = 0;
				}
			}
			else
			{
				Global_101553.f_18838.f_13 = 0;
			}
			iVar0 = 1000;
		}
		system::wait(iVar0);
	}
}

void func_1(int iParam0, int iParam1, int iParam2)//Position - 0x1A4
{
	int iVar0;
	int iVar1;
	
	iVar0 = iParam0;
	if ((iVar0 < 0 || iVar0 >= 263) || iParam0 == 263)
	{
		return;
	}
	if (!iParam2)
	{
		iVar1 = gameplay::is_bit_set(Global_25497[iVar0 /*23*/].f_11, 15);
		if (iVar1 == iParam1)
		{
			return;
		}
	}
	if (iParam1 != gameplay::is_bit_set(Global_25497[iVar0 /*23*/].f_11, 0))
	{
		gameplay::set_bit(&(Global_25497[iVar0 /*23*/].f_11), 18);
		if (Global_25494 == 1)
		{
			Global_25495 = 1;
		}
		Global_25494 = 1;
	}
	if (iParam1)
	{
		gameplay::set_bit(&(Global_25497[iVar0 /*23*/].f_11), 0);
		gameplay::set_bit(&(Global_25497[iVar0 /*23*/].f_11), 15);
		gameplay::set_bit(&(Global_25497[iVar0 /*23*/].f_11), 3);
	}
	else
	{
		gameplay::clear_bit(&(Global_25497[iVar0 /*23*/].f_11), 0);
		gameplay::clear_bit(&(Global_25497[iVar0 /*23*/].f_11), 15);
	}
	if (!gameplay::is_bit_set(Global_25497[iVar0 /*23*/].f_11, 0))
	{
		if (ui::does_blip_exist(Global_25497[iVar0 /*23*/].f_19))
		{
			gameplay::set_this_script_can_remove_blips_created_by_any_script(1);
			ui::remove_blip(&(Global_25497[iVar0 /*23*/].f_19));
			gameplay::set_this_script_can_remove_blips_created_by_any_script(0);
		}
	}
}

int func_2(int iParam0)//Position - 0x2AD
{
	int iVar0;
	
	iVar0 = iParam0;
	if ((iVar0 < 0 || iVar0 >= 263) || iParam0 == 263)
	{
		return false;
	}
	return ui::does_blip_exist(Global_25497[iVar0 /*23*/].f_19);
}

void func_3()//Position - 0x2E9
{
	func_4(&(Global_93489.f_2311), &Global_93489, 0, 1, 1, 0);
}

void func_4(var uParam0, var uParam1, int iParam2, int iParam3, int iParam4, int iParam5)//Position - 0x304
{
	int iVar0;
	
	if (iParam2 == 0)
	{
		iParam2 = player::player_ped_id();
	}
	if (entity::does_entity_exist(iParam2))
	{
		uParam1->f_5 = func_25(iParam2);
	}
	if (func_18(iParam2, &iVar0, iParam3, iParam5))
	{
		func_5(uParam0, uParam1, iVar0, iParam4);
	}
	else if (entity::does_entity_exist(iVar0))
	{
		if (!entity::is_entity_dead(iVar0, 0))
		{
			if (vehicle::is_vehicle_model(iVar0, joaat("skylift")) && ped::is_ped_in_vehicle(player::player_ped_id(), iVar0, 0))
			{
				func_5(uParam0, uParam1, iVar0, iParam4);
			}
		}
	}
}

bool func_5(var uParam0, var uParam1, int iParam2, int iParam3)//Position - 0x38C
{
	if (vehicle::is_vehicle_driveable(iParam2, 0))
	{
		func_7(uParam0, iParam2, iParam3);
		uParam1->f_4 = iParam2;
		if (func_6(iParam2))
		{
			uParam1->f_3 = 1;
		}
		else
		{
			uParam1->f_3 = 0;
		}
		return true;
	}
	return false;
}

bool func_6(int iParam0)//Position - 0x3CC
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 <= 6)
	{
		if (Global_91406.f_22[iVar0] == iParam0)
		{
			return true;
		}
		iVar0++;
	}
	return false;
}

void func_7(var uParam0, int iParam1, int iParam2)//Position - 0x3FA
{
	func_14(iParam1, &(uParam0->f_12));
	uParam0->f_7 = func_10(iParam1, 145, 0);
	uParam0->f_11 = func_9(iParam1);
	if (!uParam0->f_7)
	{
		if (!uParam0->f_10)
		{
			uParam0->f_10 = func_8(iParam1);
		}
	}
	if (iParam2 == 1)
	{
		*uParam0 = { entity::get_entity_coords(iParam1, 1) };
		uParam0->f_6 = entity::get_entity_heading(iParam1);
		uParam0->f_3 = { entity::get_entity_velocity(iParam1) };
		if (entity::is_entity_in_angled_area(iParam1, -1154.326f, -1523.871f, 3.262189f, -1158.453f, -1517.75f, 6.374244f, 13f, 0, true, 0))
		{
			*uParam0 = { -1160.095f, -1515.407f, 3.1496f };
			uParam0->f_6 = 305.6424f;
		}
		if (Global_69351 == iParam1)
		{
			uParam0->f_9 = 1;
		}
	}
	if (ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
	{
		uParam0->f_8 = 1;
	}
	else
	{
		uParam0->f_8 = 0;
	}
}

bool func_8(int iParam0)//Position - 0x4D6
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < 68)
	{
		if (entity::does_entity_exist(Global_68446.f_484[iVar0]))
		{
			if (iParam0 == Global_68446.f_484[iVar0])
			{
				return true;
			}
		}
		iVar0++;
	}
	return false;
}

int func_9(int iParam0)//Position - 0x518
{
	int iVar0;
	
	if (!entity::does_entity_exist(iParam0))
	{
		return 145;
	}
	if (!vehicle::is_vehicle_driveable(iParam0, 0))
	{
		return 145;
	}
	iVar0 = 0;
	while (iVar0 < 9)
	{
		if (entity::does_entity_exist(Global_89070[iVar0]))
		{
			if (Global_89070[iVar0] == iParam0)
			{
				return Global_89080[iVar0];
			}
		}
		iVar0++;
	}
	return 145;
}

bool func_10(int iParam0, int iParam1, int iParam2)//Position - 0x57B
{
	int iVar0;
	
	if (!entity::does_entity_exist(iParam0))
	{
		return false;
	}
	if (!vehicle::is_vehicle_driveable(iParam0, 0))
	{
		return false;
	}
	iVar0 = 0;
	while (iVar0 < 9)
	{
		if (entity::does_entity_exist(Global_89070[iVar0]))
		{
			if (Global_89070[iVar0] == iParam0)
			{
				if (iParam1 == 145 || iParam1 == Global_89080[iVar0])
				{
					if (iParam2 == 0 || entity::get_entity_model(iParam0) == func_11(iParam1, iParam2))
					{
						return true;
					}
				}
			}
		}
		iVar0++;
	}
	return false;
}

int func_11(int iParam0, int iParam1)//Position - 0x609
{
	struct<82> Var0;
	
	if (func_13(iParam0))
	{
		Var0.f_11 = 12;
		Var0.f_31 = 49;
		Var0.f_81 = 2;
		func_12(iParam0, &Var0, iParam1);
		return Var0;
	}
	else if (iParam0 != 145)
	{
	}
	return 0;
}

void func_12(int iParam0, var uParam1, int iParam2)//Position - 0x64B
{
	int iVar0;
	
	uParam1->f_88 = 1;
	uParam1->f_84 = 255;
	uParam1->f_85 = 255;
	uParam1->f_86 = 255;
	uParam1->f_97 = 1;
	uParam1->f_3 = 1000;
	uParam1->f_1 = 0;
	switch (iParam0)
	{
		case 0:
			iVar0 = joaat("tailgater");
			if (Global_101553.f_7940.f_99.f_58[128] && !Global_101553.f_7940.f_99.f_58[131])
			{
				iVar0 = joaat("premier");
			}
			switch (iVar0)
			{
				case joaat("tailgater"):
					*uParam1 = iVar0;
					uParam1->f_2 = 3f;
					uParam1->f_4 = 0;
					uParam1->f_9 = 1;
					uParam1->f_11[0] = 1;
					StringCopy(&(uParam1->f_27), "5MDS003", 16);
					break;
				
				case joaat("premier"):
					*uParam1 = iVar0;
					uParam1->f_2 = 14.9f;
					uParam1->f_5 = 43;
					uParam1->f_6 = 43;
					uParam1->f_7 = 0;
					uParam1->f_8 = 156;
					uParam1->f_9 = 0;
					StringCopy(&(uParam1->f_27), "880HS955", 16);
					break;
			}
			break;
		
		case 2:
			iVar0 = joaat("bodhi2");
			switch (iVar0)
			{
				case joaat("bodhi2"):
					*uParam1 = iVar0;
					uParam1->f_2 = 14f;
					uParam1->f_5 = 32;
					uParam1->f_6 = 0;
					uParam1->f_7 = 0;
					uParam1->f_8 = 156;
					StringCopy(&(uParam1->f_27), "BETTY 32", 16);
					if (Global_101553.f_7940.f_99.f_58[119])
					{
						uParam1->f_11[1] = 1;
					}
					break;
			}
			break;
		
		case 1:
			if (iParam2 == 1)
			{
				iVar0 = joaat("buffalo2");
			}
			else if (iParam2 == 2)
			{
				iVar0 = joaat("bagger");
			}
			else if (Global_101553.f_7940.f_99.f_58[118])
			{
				iVar0 = joaat("bagger");
			}
			else
			{
				iVar0 = joaat("buffalo2");
			}
			switch (iVar0)
			{
				case joaat("bagger"):
					*uParam1 = iVar0;
					uParam1->f_2 = 6f;
					uParam1->f_5 = 53;
					uParam1->f_6 = 0;
					uParam1->f_7 = 59;
					uParam1->f_8 = 156;
					StringCopy(&(uParam1->f_27), "FC88", 16);
					break;
				
				case joaat("buffalo2"):
					*uParam1 = iVar0;
					uParam1->f_2 = 0f;
					uParam1->f_5 = 111;
					uParam1->f_6 = 111;
					uParam1->f_7 = 0;
					uParam1->f_8 = 156;
					uParam1->f_10 = 1;
					StringCopy(&(uParam1->f_27), "FC1988", 16);
					uParam1->f_11[0] = 1;
					uParam1->f_11[1] = 1;
					uParam1->f_11[2] = 1;
					uParam1->f_11[3] = 1;
					uParam1->f_11[4] = 1;
					uParam1->f_11[5] = 1;
					uParam1->f_11[6] = 1;
					uParam1->f_11[7] = 1;
					uParam1->f_11[8] = 1;
					break;
			}
			break;
		
		default:
			break;
	}
}

int func_13(int iParam0)//Position - 0x8A1
{
	return iParam0 < 3;
}

void func_14(int iParam0, var uParam1)//Position - 0x8AD
{
	int iVar0;
	
	if (vehicle::is_vehicle_driveable(iParam0, 0))
	{
		func_17(uParam1);
		uParam1->f_66 = entity::get_entity_model(iParam0);
		StringCopy(&(uParam1->f_1), vehicle::get_vehicle_number_plate_text(iParam0), 16);
		*uParam1 = vehicle::get_vehicle_number_plate_text_index(iParam0);
		vehicle::get_vehicle_colours(iParam0, &(uParam1->f_5), &(uParam1->f_6));
		vehicle::get_vehicle_extra_colours(iParam0, &(uParam1->f_7), &(uParam1->f_8));
		vehicle::get_vehicle_tyre_smoke_color(iParam0, &(uParam1->f_62), &(uParam1->f_63), &(uParam1->f_64));
		uParam1->f_65 = vehicle::get_vehicle_window_tint(iParam0);
		uParam1->f_67 = vehicle::get_vehicle_livery(iParam0);
		uParam1->f_69 = vehicle::get_vehicle_wheel_type(iParam0);
		uParam1->f_70 = vehicle::get_vehicle_door_lock_status(iParam0);
		vehicle::get_vehicle_custom_secondary_colour(iParam0, &(uParam1->f_71), &(uParam1->f_72), &(uParam1->f_73));
		vehicle::_get_vehicle_neon_lights_colour(iParam0, &(uParam1->f_74), &(uParam1->f_75), &(uParam1->f_76));
		if (vehicle::_is_vehicle_neon_light_enabled(iParam0, 2))
		{
			gameplay::set_bit(&(uParam1->f_77), 28);
		}
		if (vehicle::_is_vehicle_neon_light_enabled(iParam0, 3))
		{
			gameplay::set_bit(&(uParam1->f_77), 29);
		}
		if (vehicle::_is_vehicle_neon_light_enabled(iParam0, 0))
		{
			gameplay::set_bit(&(uParam1->f_77), 30);
		}
		if (vehicle::_is_vehicle_neon_light_enabled(iParam0, 1))
		{
			gameplay::set_bit(&(uParam1->f_77), 31);
		}
		if (uParam1->f_65 == -1 && uParam1->f_66 != joaat("granger"))
		{
			uParam1->f_65 = 0;
		}
		if (vehicle::is_vehicle_a_convertible(iParam0, 0))
		{
			uParam1->f_68 = vehicle::get_convertible_roof_state(iParam0);
		}
		if (vehicle::is_this_model_a_plane(uParam1->f_66))
		{
			if (vehicle::_0x4198AB0022B15F87(iParam0))
			{
				switch (vehicle::get_landing_gear_state(iParam0))
				{
					case 2:
					case 0:
						gameplay::clear_bit(&(uParam1->f_77), 23);
						gameplay::set_bit(&(uParam1->f_77), 22);
						break;
					
					case 3:
					case 1:
						gameplay::clear_bit(&(uParam1->f_77), 23);
						gameplay::clear_bit(&(uParam1->f_77), 22);
						break;
					
					case 4:
						gameplay::set_bit(&(uParam1->f_77), 23);
						break;
				}
			}
			else
			{
				gameplay::set_bit(&(uParam1->f_77), 23);
			}
		}
		if (!vehicle::get_vehicle_tyres_can_burst(iParam0))
		{
			gameplay::set_bit(&(uParam1->f_77), 9);
		}
		if (vehicle::is_vehicle_stolen(iParam0))
		{
			gameplay::set_bit(&(uParam1->f_77), 10);
		}
		if (vehicle::get_is_vehicle_primary_colour_custom(iParam0))
		{
			gameplay::set_bit(&(uParam1->f_77), 13);
			vehicle::get_vehicle_custom_primary_colour(iParam0, &(uParam1->f_71), &(uParam1->f_72), &(uParam1->f_73));
		}
		if (vehicle::get_is_vehicle_secondary_colour_custom(iParam0))
		{
			gameplay::set_bit(&(uParam1->f_77), 12);
		}
		func_16(&iParam0, &(uParam1->f_9), &(uParam1->f_59));
		iVar0 = 0;
		while (iVar0 <= 11)
		{
			if (vehicle::is_vehicle_extra_turned_on(iParam0, iVar0 + 1))
			{
				gameplay::set_bit(&(uParam1->f_77), func_15(iVar0 + 1));
			}
			iVar0++;
		}
		if (graphics::_does_vehicle_have_decal(iParam0, 0))
		{
			gameplay::set_bit(&(uParam1->f_77), 11);
		}
		else
		{
			gameplay::clear_bit(&(uParam1->f_77), 11);
		}
		if (decorator::decor_exist_on(iParam0, "IgnoredByQuickSave") && decorator::decor_get_bool(iParam0, "IgnoredByQuickSave"))
		{
			gameplay::set_bit(&(uParam1->f_77), 27);
		}
		else
		{
			gameplay::clear_bit(&(uParam1->f_77), 27);
		}
	}
}

int func_15(int iParam0)//Position - 0xB57
{
	switch (iParam0)
	{
		case 1:
			return 0;
			break;
		
		case 2:
			return 1;
			break;
		
		case 3:
			return 2;
			break;
		
		case 4:
			return 3;
			break;
		
		case 5:
			return 4;
			break;
		
		case 6:
			return 5;
			break;
		
		case 7:
			return 6;
			break;
		
		case 8:
			return 7;
			break;
		
		case 9:
			return 8;
			break;
		
		case 10:
			return 24;
			break;
		
		case 11:
			return 25;
			break;
		
		case 12:
			return 26;
			break;
	}
	return 0;
}

bool func_16(int iParam0, var uParam1, var uParam2)//Position - 0xC07
{
	int iVar0;
	int iVar1;
	
	if (!vehicle::is_vehicle_driveable(*iParam0, 0))
	{
		return false;
	}
	if (vehicle::get_num_mod_kits(*iParam0) == 0)
	{
		return false;
	}
	iVar0 = 0;
	while (iVar0 < *uParam1)
	{
		iVar1 = iVar0;
		if (((((iVar1 == 17 || iVar1 == 18) || iVar1 == 19) || iVar1 == 20) || iVar1 == 21) || iVar1 == 22)
		{
			(*uParam1)[iVar0] = 0;
			if (vehicle::is_toggle_mod_on(*iParam0, iVar1))
			{
				(*uParam1)[iVar0] = 1;
			}
		}
		else
		{
			(*uParam1)[iVar0] = vehicle::get_vehicle_mod(*iParam0, iVar0) + 1;
			if (iVar0 == 23)
			{
				(*uParam2)[0] = vehicle::get_vehicle_mod_variation(*iParam0, iVar0);
			}
			else if (iVar0 == 24)
			{
				(*uParam2)[1] = vehicle::get_vehicle_mod_variation(*iParam0, iVar0);
			}
		}
		iVar0++;
	}
	return true;
}

void func_17(var uParam0)//Position - 0xCE1
{
	int iVar0;
	
	uParam0->f_66 = 0;
	uParam0->f_77 = 0;
	uParam0->f_65 = 0;
	uParam0->f_62 = 0;
	uParam0->f_63 = 0;
	uParam0->f_64 = 0;
	uParam0->f_74 = 0;
	uParam0->f_75 = 0;
	uParam0->f_76 = 0;
	*uParam0 = 0;
	StringCopy(&(uParam0->f_1), "", 16);
	uParam0->f_5 = 0;
	uParam0->f_6 = 0;
	uParam0->f_7 = 0;
	uParam0->f_8 = 0;
	iVar0 = 0;
	while (iVar0 < 49)
	{
		uParam0->f_9[iVar0] = 0;
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 < 2)
	{
		uParam0->f_59[iVar0] = 0;
		iVar0++;
	}
	uParam0->f_67 = 0;
	uParam0->f_68 = 0;
	uParam0->f_69 = 0;
	uParam0->f_70 = 1;
	uParam0->f_71 = 0;
	uParam0->f_72 = 0;
	uParam0->f_73 = 0;
}

bool func_18(int iParam0, var uParam1, int iParam2, int iParam3)//Position - 0xD91
{
	char* sVar0;
	
	if (entity::does_entity_exist(iParam0))
	{
		if (!ped::is_ped_injured(iParam0))
		{
			if (iParam0 == player::player_ped_id())
			{
				*uParam1 = player::get_players_last_vehicle();
			}
			else
			{
				*uParam1 = ped::get_vehicle_ped_is_in(iParam0, 1);
			}
			if (entity::does_entity_exist(*uParam1))
			{
				if (vehicle::is_vehicle_driveable(*uParam1, 0))
				{
					if (iParam2 == 0 || gameplay::get_distance_between_coords(entity::get_entity_coords(*uParam1, 1), entity::get_entity_coords(iParam0, 1), 1) < 100f)
					{
						if (vehicle::is_vehicle_model(*uParam1, joaat("taxi")))
						{
							if (vehicle::get_ped_in_vehicle_seat(*uParam1, -1, 0) != iParam0 && vehicle::get_ped_in_vehicle_seat(*uParam1, -1, 0) != 0)
							{
								return false;
							}
						}
						if (func_19(*uParam1, func_21(), 1))
						{
							sVar0 = script::get_this_script_name();
							if (!gameplay::are_strings_equal(sVar0, "save_anywhere"))
							{
								return false;
							}
							else if (!ped::is_ped_in_any_vehicle(iParam0, 1))
							{
								return false;
							}
						}
						if (iParam3 == 1)
						{
							if (decorator::decor_exist_on(*uParam1, "IgnoredByQuickSave"))
							{
								if (decorator::decor_get_bool(*uParam1, "IgnoredByQuickSave"))
								{
									return false;
								}
							}
						}
						else if (vehicle::is_vehicle_model(*uParam1, joaat("blimp")))
						{
							return false;
						}
						return true;
					}
				}
			}
		}
	}
	return false;
}

bool func_19(int iParam0, int iParam1, int iParam2)//Position - 0xEBD
{
	int iVar0;
	char* sVar1;
	var uVar9;
	
	if (!entity::does_entity_exist(iParam0) || !vehicle::is_vehicle_driveable(iParam0, 0))
	{
		return false;
	}
	iVar0 = 0;
	while (func_20(iParam1, iVar0, &sVar1, &uVar9))
	{
		if (!iParam2 || gameplay::is_bit_set(Global_101553.f_6084[uVar9], 0))
		{
			if (vehicle::is_vehicle_in_garage_area(&sVar1, iParam0))
			{
				return true;
			}
		}
		iVar0++;
	}
	return false;
}

bool func_20(int iParam0, int iParam1, char* sParam2, var uParam3)//Position - 0xF2E
{
	StringCopy(sParam2, "", 32);
	switch (iParam0)
	{
		case 0:
			if (iParam1 == 0)
			{
				StringCopy(sParam2, "Michael - Beverly Hills", 32);
				*uParam3 = 0;
				return true;
			}
			else if (iParam1 == 1)
			{
				StringCopy(sParam2, "Trevor - Countryside", 32);
				*uParam3 = 1;
				return true;
			}
			break;
		
		case 1:
			if (iParam1 == 0)
			{
				StringCopy(sParam2, "Franklin - Aunt", 32);
				*uParam3 = 5;
				return true;
			}
			else if (iParam1 == 1)
			{
				StringCopy(sParam2, "Franklin - Hills", 32);
				*uParam3 = 6;
				return true;
			}
			break;
		
		case 2:
			if (iParam1 == 0)
			{
				StringCopy(sParam2, "Trevor - Countryside", 32);
				*uParam3 = 2;
				return true;
			}
			else if (iParam1 == 1)
			{
				StringCopy(sParam2, "Trevor - City", 32);
				*uParam3 = 3;
				return true;
			}
			else if (iParam1 == 2)
			{
				StringCopy(sParam2, "Trevor - Stripclub", 32);
				*uParam3 = 4;
				return true;
			}
			break;
	}
	return false;
}

var func_21()//Position - 0xFFF
{
	func_22();
	return Global_101553.f_1991.f_539.f_3549;
}

void func_22()//Position - 0x1018
{
	int iVar0;
	
	if (entity::does_entity_exist(player::player_ped_id()))
	{
		if (func_24(Global_101553.f_1991.f_539.f_3549) != entity::get_entity_model(player::player_ped_id()))
		{
			iVar0 = func_25(player::player_ped_id());
			if (func_13(iVar0) && (!func_23(14) || Global_100505))
			{
				if (Global_101553.f_1991.f_539.f_3549 != iVar0 && func_13(Global_101553.f_1991.f_539.f_3549))
				{
					Global_101553.f_1991.f_539.f_3550 = Global_101553.f_1991.f_539.f_3549;
				}
				Global_101553.f_1991.f_539.f_3551 = iVar0;
				Global_101553.f_1991.f_539.f_3549 = iVar0;
				return;
			}
		}
		else
		{
			if (Global_101553.f_1991.f_539.f_3549 != 145)
			{
				Global_101553.f_1991.f_539.f_3551 = Global_101553.f_1991.f_539.f_3549;
			}
			return;
		}
	}
	Global_101553.f_1991.f_539.f_3549 = 145;
}

int func_23(int iParam0)//Position - 0x1115
{
	return Global_35775 == iParam0;
}

int func_24(int iParam0)//Position - 0x1123
{
	if (func_13(iParam0))
	{
		return Global_101553.f_32740[iParam0 /*29*/];
	}
	else if (iParam0 != 145)
	{
	}
	return 0;
}

int func_25(int iParam0)//Position - 0x114D
{
	int iVar0;
	int iVar1;
	
	if (entity::does_entity_exist(iParam0))
	{
		iVar1 = entity::get_entity_model(iParam0);
		iVar0 = 0;
		while (iVar0 <= 2)
		{
			if (func_24(iVar0) == iVar1)
			{
				return iVar0;
			}
			iVar0++;
		}
	}
	return 145;
}

bool func_26(int iParam0)//Position - 0x118A
{
	if (Global_35775 == 15)
	{
		return false;
	}
	if (func_27(iParam0))
	{
		return false;
	}
	return true;
}

int func_27(int iParam0)//Position - 0x11AC
{
	return func_28(iParam0, Global_35775);
}

bool func_28(int iParam0, int iParam1)//Position - 0x11BD
{
	if (iParam1 == 15)
	{
		return true;
	}
	if (iParam0 == 15)
	{
		return false;
	}
	switch (iParam0)
	{
		case 16:
			switch (iParam1)
			{
				case 9:
				case 10:
				case 7:
				case 13:
				case 14:
					return false;
					break;
			}
			return true;
			break;
		
		case 0:
			switch (iParam1)
			{
				case 5:
				case 17:
					return true;
					break;
			}
			break;
		
		case 2:
		case 3:
			switch (iParam1)
			{
				case 5:
				case 6:
				case 8:
				case 17:
					return true;
					break;
			}
			break;
		
		case 4:
			if (iParam1 == 17)
			{
				return true;
			}
			break;
		
		case 5:
			break;
		
		case 6:
		case 8:
			if (iParam1 == 5)
			{
				return true;
			}
			break;
		
		case 7:
			if (iParam1 == 6)
			{
				return true;
			}
			break;
		
		case 9:
			if (iParam1 == 5)
			{
				return true;
			}
			break;
		
		case 10:
			switch (iParam1)
			{
				case 5:
				case 6:
				case 17:
					return true;
					break;
			}
			break;
		
		case 11:
			if (iParam1 == 5)
			{
				return true;
			}
			break;
		
		case 17:
			switch (iParam1)
			{
				case 17:
				case 12:
				case 5:
					return true;
					break;
			}
			break;
		
		case 18:
		case 12:
			switch (iParam1)
			{
				case 5:
				case 6:
				case 8:
					return true;
					break;
			}
			break;
		
		case 13:
			switch (iParam1)
			{
				case 5:
					return true;
					break;
			}
			break;
		
		case 14:
			switch (iParam1)
			{
				case 5:
					return true;
					break;
			}
			break;
	}
	return false;
}

void func_29(int iParam0)//Position - 0x139E
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	struct<91> Var4;
	var uVar101;
	
	iVar0 = false;
	if (iLocal_53 != 9)
	{
		if (!Global_101553.f_18838.f_13)
		{
			if (Global_101553.f_18838.f_1 == 0 && Global_101553.f_18838.f_2 == 0)
			{
				if (!func_153(Global_101553.f_18838, 32))
				{
					func_150("MG_TRAF_AVAIL", 0, 0, -1, 10000, 7, 0, 0, 0);
					func_148(&(Global_101553.f_18838), 32);
				}
			}
			func_1(106, 1, 0);
			Global_101553.f_18838.f_13 = 1;
			iVar0 = true;
		}
		else
		{
			iVar0 = true;
		}
	}
	else
	{
		func_1(106, 0, 0);
		Global_101553.f_18838.f_13 = 0;
	}
	if (iLocal_53 != 1 && iLocal_53 != 8)
	{
		if (func_147() && !*iParam0)
		{
			func_146(0);
			iLocal_53 = 1;
		}
	}
	switch (iLocal_53)
	{
		case 0:
			iLocal_53 = 1;
			break;
		
		case 1:
			if (!func_147())
			{
				if (fLocal_31 < 50625f)
				{
					iLocal_53 = 2;
				}
				else if (iLocal_37)
				{
					iLocal_53 = 2;
				}
			}
			break;
		
		case 2:
			streaming::request_model(joaat("dune"));
			iLocal_53 = 3;
			break;
		
		case 3:
			if (streaming::has_model_loaded(joaat("dune")))
			{
				gameplay::clear_area_of_vehicles(vLocal_55, 4f, 0, 0, 0, 0, false);
				if (entity::does_entity_exist(iLocal_54))
				{
					vehicle::delete_vehicle(&iLocal_54);
				}
				iLocal_54 = vehicle::create_vehicle(func_145(), vLocal_55, fLocal_58, 1, true);
				audio::set_vehicle_radio_enabled(iLocal_54, false);
				streaming::set_model_as_no_longer_needed(func_145());
				if (entity::does_entity_exist(iLocal_54))
				{
					if (vehicle::does_extra_exist(iLocal_54, 1))
					{
						vehicle::set_vehicle_extra(iLocal_54, 1, true);
					}
					if (vehicle::does_extra_exist(iLocal_54, 2))
					{
						vehicle::set_vehicle_extra(iLocal_54, 2, false);
					}
					if (vehicle::does_extra_exist(iLocal_54, 3))
					{
						vehicle::set_vehicle_extra(iLocal_54, 3, false);
					}
					vehicle::set_vehicle_colours(iLocal_54, 0, 0);
				}
				iLocal_53 = 4;
			}
			break;
		
		case 5:
			if (fLocal_31 >= 50625f && !*iParam0)
			{
				func_146(0);
				iLocal_53 = 1;
				return;
			}
			break;
		
		case 4:
			func_144();
			if (!iLocal_37)
			{
				if (fLocal_31 >= 50625f && !*iParam0)
				{
					func_146(0);
					iLocal_53 = 1;
					return;
				}
			}
			if (!iVar0 && !*iParam0)
			{
				if (!iVar0)
				{
				}
				if (!*iParam0)
				{
				}
				if (!iLocal_59)
				{
					if (ped::is_ped_in_any_vehicle(iLocal_28, 0))
					{
						iVar1 = ped::get_vehicle_ped_is_using(iLocal_28);
						if (iVar1 == iLocal_54)
						{
							iLocal_59 = 1;
							entity::set_vehicle_as_no_longer_needed(&iLocal_54);
							iLocal_53 = 9;
						}
					}
				}
				return;
			}
			if (*iParam0)
			{
				if (!entity::is_entity_dead(player::player_ped_id(), 0) && !entity::is_entity_dead(iLocal_54, 0))
				{
					ped::set_ped_into_vehicle(player::player_ped_id(), iLocal_54, -1);
				}
			}
			if (!entity::is_entity_dead(player::player_ped_id(), 0) && !entity::is_entity_dead(iLocal_54, 0))
			{
				if (ped::is_ped_in_vehicle(player::player_ped_id(), iLocal_54, 1))
				{
					func_143();
				}
			}
			if (!entity::is_entity_dead(iLocal_54, 0) && !entity::is_entity_dead(player::player_ped_id(), 0))
			{
				if (ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
				{
					iVar2 = ped::get_vehicle_ped_is_using(player::player_ped_id());
					if (iVar2 == iLocal_54)
					{
						if (system::vdist2(vLocal_55, entity::get_entity_coords(iLocal_28, 1)) < 100f)
						{
							script::request_script("Traffick_Ground");
							if (entity::does_entity_exist(iLocal_29) && !entity::is_entity_dead(iLocal_29, 0))
							{
								if (entity::get_entity_model(iLocal_29) != joaat("dune") && entity::get_entity_model(iLocal_29) != joaat("cuban800"))
								{
									func_118(iLocal_29, 2142.245f, 4823.463f, 40.2769f, 118.4428f, 24, 0);
								}
								else if (!entity::is_entity_dead(player::player_ped_id(), 0))
								{
									vehicle::set_players_last_vehicle(iLocal_29);
								}
							}
							iLocal_53 = 6;
						}
					}
				}
			}
			break;
		
		case 6:
			if (script::has_script_loaded("Traffick_Ground"))
			{
				iVar3 = 0;
				if (*iParam0)
				{
					iVar3 = 1;
				}
				else
				{
					iVar3 = func_116(&iLocal_35, 6, 9, 0, 0);
					iLocal_45 = 1;
				}
				if (iVar3 == 1)
				{
					if (player::is_player_playing(player::player_id()))
					{
						player::clear_player_wanted_level(player::player_id());
					}
					if (!*iParam0)
					{
						func_80("Traffick_Ground", 0);
					}
					Var4 = -1;
					Var4.f_8 = 4;
					Var4.f_13 = 2;
					Var4.f_16 = 4;
					Var4.f_29 = 4;
					Var4.f_61 = 9;
					Var4.f_71 = 4;
					Var4.f_76 = 8;
					Var4.f_85 = 4;
					Var4.f_90 = 6;
					iLocal_30 = system::start_new_script_with_args("Traffick_Ground", &Var4, 97, 19000);
					func_79(16);
					script::set_script_as_no_longer_needed("Traffick_Ground");
					entity::set_entity_as_mission_entity(iLocal_54, true, 0);
					entity::set_vehicle_as_no_longer_needed(&iLocal_54);
					if (!ped::is_ped_injured(player::player_ped_id()))
					{
						if (Global_36906 == 1)
						{
							func_70(player::player_ped_id());
						}
					}
					iLocal_59 = 0;
					iLocal_53 = 7;
				}
				else if (iVar3 == 0)
				{
					iLocal_45 = 0;
					func_146(0);
					iLocal_53 = 9;
				}
			}
			break;
		
		case 7:
			if (!script::is_thread_active(iLocal_30))
			{
				iLocal_53 = 9;
				if (func_153(Global_100206, 2))
				{
					iLocal_53 = 8;
				}
				else
				{
					func_69(&iLocal_35);
					func_52();
					iLocal_36 = 1;
					uVar101 = func_51();
					func_43(&uVar101, 0, 0, 3, 0, 0, 0);
					Global_101553.f_18838.f_12 = uVar101;
					func_1(106, 0, 0);
					Global_101553.f_18838.f_13 = 0;
				}
				*iParam0 = 0;
				func_41(&Global_100206, 2);
			}
			break;
		
		case 8:
			if (Global_91406 == 10)
			{
				if (Global_91440)
				{
					*iParam0 = 1;
					script::request_script("Traffick_Ground");
					iLocal_53 = 2;
				}
				else
				{
					*iParam0 = 0;
					iLocal_53 = 2;
				}
			}
			else if (Global_91406 == 13)
			{
				func_69(&iLocal_35);
				func_52();
				*iParam0 = 0;
				iLocal_53 = 2;
			}
			break;
		
		case 9:
			if (fLocal_31 >= 50625f && func_30(Global_101553.f_18838.f_12))
			{
				func_146(0);
				iLocal_53 = 1;
			}
			break;
		
		default:
			break;
	}
}

int func_30(int iParam0)//Position - 0x18FC
{
	return func_31(func_51(), iParam0);
}

bool func_31(int iParam0, int iParam1)//Position - 0x190E
{
	int iVar0;
	int iVar1;
	
	if (!func_39(iParam1) || !func_39(iParam0))
	{
		return true;
	}
	iVar0 = func_37(iParam0);
	iVar1 = func_37(iParam1);
	if (iVar0 > iVar1)
	{
		return true;
	}
	else if (iVar0 < iVar1)
	{
		return false;
	}
	iVar0 = func_36(iParam0);
	iVar1 = func_36(iParam1);
	if (iVar0 > iVar1)
	{
		return true;
	}
	else if (iVar0 < iVar1)
	{
		return false;
	}
	iVar0 = func_35(iParam0);
	iVar1 = func_35(iParam1);
	if (iVar0 > iVar1)
	{
		return true;
	}
	else if (iVar0 < iVar1)
	{
		return false;
	}
	iVar0 = func_34(iParam0);
	iVar1 = func_34(iParam1);
	if (iVar0 > iVar1)
	{
		return true;
	}
	else if (iVar0 < iVar1)
	{
		return false;
	}
	iVar0 = func_33(iParam0);
	iVar1 = func_33(iParam1);
	if (iVar0 > iVar1)
	{
		return true;
	}
	else if (iVar0 < iVar1)
	{
		return false;
	}
	iVar0 = func_32(iParam0);
	iVar1 = func_32(iParam1);
	if (iVar0 > iVar1)
	{
		return true;
	}
	return false;
}

int func_32(int iParam0)//Position - 0x1A1A
{
	return system::shift_right(iParam0, 20) & 63;
}

int func_33(int iParam0)//Position - 0x1A2D
{
	return system::shift_right(iParam0, 14) & 63;
}

int func_34(int iParam0)//Position - 0x1A40
{
	return system::shift_right(iParam0, 9) & 31;
}

int func_35(int iParam0)//Position - 0x1A53
{
	return system::shift_right(iParam0, 4) & 31;
}

int func_36(int iParam0)//Position - 0x1A65
{
	return iParam0 & 15;
}

var func_37(int iParam0)//Position - 0x1A72
{
	return (system::shift_right(iParam0, 26) & 31 * func_38(gameplay::is_bit_set(iParam0, 31), -1, 1)) + 2011;
}

int func_38(int iParam0, int iParam1, int iParam2)//Position - 0x1A97
{
	if (iParam0)
	{
		return iParam1;
	}
	return iParam2;
}

bool func_39(int iParam0)//Position - 0x1AAE
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	
	if (iParam0 == -15)
	{
		return false;
	}
	iVar0 = func_32(iParam0);
	if (iVar0 < 0 || iVar0 >= 60)
	{
		return false;
	}
	iVar1 = func_33(iParam0);
	if (iVar1 < 0 || iVar1 >= 60)
	{
		return false;
	}
	iVar2 = func_34(iParam0);
	if (iVar2 < 0 || iVar2 > 23)
	{
		return false;
	}
	iVar3 = func_37(iParam0);
	if ((iVar3 <= 0 || iVar3 > 2043) || iVar3 < 1979)
	{
		return false;
	}
	iVar4 = func_36(iParam0);
	if (iVar4 < 0 || iVar4 > 11)
	{
		return false;
	}
	iVar5 = func_35(iParam0);
	if (iVar5 < 1 || iVar5 > func_40(iVar4, iVar3))
	{
		return false;
	}
	return true;
}

int func_40(int iParam0, int iParam1)//Position - 0x1B8A
{
	if (iParam1 < 0)
	{
		iParam1 = 0;
	}
	switch (iParam0)
	{
		case 0:
		case 2:
		case 4:
		case 6:
		case 7:
		case 9:
		case 11:
			return 31;
			break;
		
		case 3:
		case 5:
		case 8:
		case 10:
			return 30;
			break;
		
		case 1:
			if ((iParam1 % 4) == 0)
			{
				if ((iParam1 % 100) != 0)
				{
					return 29;
				}
				else if ((iParam1 % 400) == 0)
				{
					return 29;
				}
			}
			return 28;
			break;
	}
	return 30;
}

void func_41(var uParam0, int iParam1)//Position - 0x1C2C
{
	func_42(uParam0, iParam1);
}

void func_42(var uParam0, var uParam1)//Position - 0x1C3C
{
	*uParam0 = (*uParam0 - (*uParam0 && uParam1));
}

void func_43(var uParam0, int iParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6)//Position - 0x1C51
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	int iVar6;
	
	iVar0 = func_37(*uParam0);
	iVar1 = func_36(*uParam0);
	iVar2 = func_35(*uParam0);
	iVar3 = func_34(*uParam0);
	iVar4 = func_33(*uParam0);
	iVar5 = func_32(*uParam0);
	if (((((iParam6 == 0 && iParam5 == 0) && iParam4 == 0) && iParam3 == 0) && iParam2 == 0) && iParam1 == 0)
	{
		return;
	}
	if (iParam1 < 0)
	{
		return;
	}
	if (iParam2 < 0)
	{
		return;
	}
	if (iParam3 < 0)
	{
		return;
	}
	if (iParam4 < 0)
	{
		return;
	}
	if (iParam5 < 0)
	{
		return;
	}
	if (iParam6 < 0)
	{
		return;
	}
	iVar5 = (iVar5 + iParam1);
	while (iVar5 >= 60)
	{
		iParam2++;
		iVar5 = (iVar5 - 60);
	}
	iVar4 = (iVar4 + iParam2);
	while (iVar4 >= 60)
	{
		iParam3++;
		iVar4 = (iVar4 - 60);
	}
	iVar3 = (iVar3 + iParam3);
	while (iVar3 >= 24)
	{
		iParam4++;
		iVar3 = (iVar3 - 24);
	}
	iVar2 = (iVar2 + iParam4);
	iVar6 = func_40(iVar1, iVar0);
	while (iVar2 > iVar6)
	{
		iVar1++;
		iVar2 = (iVar2 - iVar6);
		if (iVar1 > 11)
		{
			iVar0++;
			iVar1 = (iVar1 - 12);
		}
		iVar6 = func_40(iVar1, iVar0);
	}
	iVar1 = (iVar1 + iParam5);
	while (iVar1 > 11)
	{
		iParam6++;
		iVar1 = (iVar1 - 12);
	}
	iVar0 = (iVar0 + iParam6);
	func_44(uParam0, iVar5, iVar4, iVar3, iVar2, iVar1, iVar0);
}

void func_44(var uParam0, int iParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6)//Position - 0x1DD3
{
	func_50(uParam0, iParam1);
	func_49(uParam0, iParam2);
	func_48(uParam0, iParam3);
	func_47(uParam0, iParam5);
	func_46(uParam0, iParam4);
	func_45(uParam0, iParam6);
}

void func_45(var uParam0, int iParam1)//Position - 0x1E0B
{
	if (iParam1 <= 0)
	{
		return;
	}
	if (iParam1 > 2043 || iParam1 < 1979)
	{
		return;
	}
	*uParam0 = (*uParam0 - *uParam0 & 2080374784);
	if (iParam1 < 2011)
	{
		*uParam0 = (*uParam0 || system::shift_left((2011 - iParam1), 26));
		*uParam0 |= -2147483648;
	}
	else
	{
		*uParam0 = (*uParam0 || system::shift_left((iParam1 - 2011), 26));
		*uParam0 = (*uParam0 - *uParam0 & -2147483648);
	}
}

void func_46(var uParam0, int iParam1)//Position - 0x1E91
{
	int iVar0;
	int iVar1;
	
	iVar0 = func_36(*uParam0);
	iVar1 = func_37(*uParam0);
	if (iParam1 < 1 || iParam1 > func_40(iVar0, iVar1))
	{
		return;
	}
	*uParam0 = (*uParam0 - *uParam0 & 496);
	*uParam0 = (*uParam0 || system::shift_left(iParam1, 4));
}

void func_47(var uParam0, int iParam1)//Position - 0x1EE2
{
	if (iParam1 < 0 || iParam1 > 11)
	{
		return;
	}
	*uParam0 = (*uParam0 - *uParam0 & 15);
	*uParam0 = (*uParam0 || iParam1);
}

void func_48(var uParam0, int iParam1)//Position - 0x1F15
{
	if (iParam1 < 0 || iParam1 > 24)
	{
		return;
	}
	*uParam0 = (*uParam0 - *uParam0 & 15872);
	*uParam0 = (*uParam0 || system::shift_left(iParam1, 9));
}

void func_49(var uParam0, int iParam1)//Position - 0x1F4F
{
	if (iParam1 < 0 || iParam1 >= 60)
	{
		return;
	}
	*uParam0 = (*uParam0 - *uParam0 & 1032192);
	*uParam0 = (*uParam0 || system::shift_left(iParam1, 14));
}

void func_50(var uParam0, int iParam1)//Position - 0x1F8A
{
	if (iParam1 < 0 || iParam1 >= 60)
	{
		return;
	}
	*uParam0 = (*uParam0 - *uParam0 & 66060288);
	*uParam0 = (*uParam0 || system::shift_left(iParam1, 20));
}

var func_51()//Position - 0x1FC6
{
	var uVar0;
	
	func_50(&uVar0, time::get_clock_seconds());
	func_49(&uVar0, time::get_clock_minutes());
	func_48(&uVar0, time::get_clock_hours());
	func_46(&uVar0, time::get_clock_day_of_month());
	func_47(&uVar0, time::get_clock_month());
	func_45(&uVar0, time::get_clock_year());
	return uVar0;
}

void func_52()//Position - 0x200C
{
	func_68();
	func_61();
	func_57();
	func_56();
	func_55();
	func_54();
	Global_91443 = 0;
	Global_85914 = -1;
	gameplay::clear_bit(&(Global_91406.f_20), 17);
	Global_91441 = 0;
	gameplay::_disable_automatic_respawn(0);
	gameplay::ignore_next_restart(0);
	gameplay::set_fade_in_after_death_arrest(1);
	gameplay::set_fade_out_after_arrest(1);
	gameplay::set_fade_out_after_death(1);
	func_53(0);
}

void func_53(int iParam0)//Position - 0x2065
{
	if (iParam0 == 1)
	{
		gameplay::set_bit(&(Global_91406.f_20), 13);
	}
	else
	{
		gameplay::clear_bit(&(Global_91406.f_20), 13);
	}
}

void func_54()//Position - 0x208E
{
	Global_69857 = { 0f, 0f, 0f };
	Global_69860 = 0f;
	Global_91406.f_21 = 145;
}

void func_55()//Position - 0x20AC
{
	StringCopy(&Global_69849, "", 16);
	StringCopy(&Global_69853, "", 16);
}

void func_56()//Position - 0x20C6
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 <= 6)
	{
		Global_91406.f_22[iVar0] = 0;
		iVar0++;
	}
}

void func_57()//Position - 0x20EB
{
	Global_91406 = 13;
	Global_91406.f_1 = -1;
	Global_91406.f_2 = 0;
	Global_91406.f_30 = 0f;
	gameplay::clear_bit(&(Global_91406.f_20), 25);
	Global_91440 = 0;
	func_60(0);
	func_59();
	func_58();
	Global_91406.f_18 = -1;
	Global_91406.f_19 = -1;
}

void func_58()//Position - 0x213A
{
	gameplay::clear_bit(&(Global_91406.f_20), 22);
	gameplay::clear_bit(&(Global_91406.f_20), 8);
}

void func_59()//Position - 0x215A
{
	if (Global_91406.f_16 != 0)
	{
		graphics::set_scaleform_movie_as_no_longer_needed(&(Global_91406.f_16));
		Global_91406.f_16 = 0;
	}
	if (Global_91406.f_17 != 0)
	{
		graphics::set_scaleform_movie_as_no_longer_needed(&(Global_91406.f_17));
		Global_91406.f_17 = 0;
	}
}

void func_60(int iParam0)//Position - 0x2198
{
	if (iParam0 == 1)
	{
		Global_36324 = 1;
	}
	else
	{
		Global_36324 = 0;
	}
}

void func_61()//Position - 0x21B1
{
	func_62(&Global_95894);
}

void func_62(var uParam0)//Position - 0x21C1
{
	int iVar0;
	int iVar1;
	
	*uParam0 = 145;
	func_67(&(uParam0->f_1));
	uParam0->f_6 = -1;
	uParam0->f_7 = -1;
	uParam0->f_8 = 0f;
	uParam0->f_2 = 0;
	uParam0->f_3 = 0;
	uParam0->f_4 = 0;
	uParam0->f_5 = 145;
	iVar1 = 0;
	while (iVar1 < 3)
	{
		uParam0->f_9[iVar1] = -1;
		uParam0->f_13[iVar1] = 0;
		uParam0->f_17[iVar1] = 0;
		uParam0->f_21[iVar1] = 0;
		func_66(&(uParam0->f_25[0 /*295*/][iVar1 /*98*/]));
		func_66(&(uParam0->f_25[1 /*295*/][iVar1 /*98*/]));
		iVar0 = 0;
		while (iVar0 < 12)
		{
			uParam0->f_616[iVar1 /*65*/][iVar0] = -1;
			uParam0->f_616[iVar1 /*65*/].f_13[iVar0] = -1;
			uParam0->f_616[iVar1 /*65*/].f_26[iVar0] = -1;
			iVar0++;
		}
		uParam0->f_616[iVar1 /*65*/].f_59 = 0;
		uParam0->f_616[iVar1 /*65*/].f_60 = -99;
		uParam0->f_616[iVar1 /*65*/].f_61 = 2;
		uParam0->f_616[iVar1 /*65*/].f_62 = 0;
		uParam0->f_616[iVar1 /*65*/].f_63 = -99;
		uParam0->f_616[iVar1 /*65*/].f_64 = 1;
		iVar0 = 0;
		while (iVar0 < 9)
		{
			uParam0->f_616[iVar1 /*65*/].f_39[iVar0] = -1;
			uParam0->f_616[iVar1 /*65*/].f_49[iVar0] = -1;
			iVar0++;
		}
		iVar0 = 0;
		while (iVar0 < 44)
		{
			uParam0->f_812[iVar1 /*284*/][iVar0 /*3*/].f_1 = 0;
			uParam0->f_812[iVar1 /*284*/][iVar0 /*3*/].f_2 = 0;
			uParam0->f_812[iVar1 /*284*/][iVar0 /*3*/] = 0;
			iVar0++;
		}
		iVar0 = 0;
		while (iVar0 < 50)
		{
			uParam0->f_812[iVar1 /*284*/].f_133[iVar0 /*3*/].f_1 = 0;
			uParam0->f_812[iVar1 /*284*/].f_133[iVar0 /*3*/].f_2 = 0;
			uParam0->f_812[iVar1 /*284*/].f_133[iVar0 /*3*/] = 0;
			iVar0++;
		}
		iVar0 = 0;
		while (iVar0 < 4)
		{
			uParam0->f_1665[iVar1 /*32*/][iVar0] = 0;
			iVar0++;
		}
		iVar0 = 0;
		while (iVar0 < 10)
		{
			uParam0->f_1665[iVar1 /*32*/].f_5[iVar0] = 0;
			iVar0++;
		}
		iVar0 = 0;
		while (iVar0 < 15)
		{
			uParam0->f_1665[iVar1 /*32*/].f_16[iVar0] = 0;
			iVar0++;
		}
		uParam0->f_1762[iVar1] = 0;
		iVar0 = 0;
		while (iVar0 <= 3)
		{
			uParam0->f_2259[iVar1 /*15*/][iVar0] = 0;
			uParam0->f_2259[iVar1 /*15*/].f_5[iVar0] = 0;
			uParam0->f_2259[iVar1 /*15*/].f_10[iVar0] = 0;
			iVar0++;
		}
		iVar0 = 0;
		while (iVar0 <= 2)
		{
			uParam0->f_1766[iVar1 /*164*/][iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_4[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_8[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_12[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_16[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_20[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_24[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_28[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_32[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_36[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_40[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_44[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_48[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_52[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_56[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_60[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_64[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_68[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_72[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_76[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_80[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_84[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_88[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_92[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_96[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_100[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_104[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_108[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_112[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_116[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_120[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_124[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_128[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_132[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_136[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_140[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_144[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_148[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_152[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_156[iVar0] = 0;
			uParam0->f_1766[iVar1 /*164*/].f_160[iVar0] = 0;
			iVar0++;
		}
		iVar1++;
	}
	func_65(&(uParam0->f_2305));
	func_64(&(uParam0->f_2311));
	func_63(&(uParam0->f_2401));
}

void func_63(var uParam0)//Position - 0x2709
{
	*uParam0 = -1;
	uParam0->f_1 = 0;
	uParam0->f_2 = 0;
	uParam0->f_3 = 0;
}

void func_64(var uParam0)//Position - 0x2724
{
	func_17(&(uParam0->f_12));
	*uParam0 = { 0f, 0f, 0f };
	uParam0->f_3 = { 0f, 0f, 0f };
	uParam0->f_6 = 0f;
	uParam0->f_8 = 0;
	uParam0->f_9 = 0;
}

void func_65(var uParam0)//Position - 0x2753
{
	*uParam0 = { 0f, 0f, 0f };
	uParam0->f_3 = 0f;
	uParam0->f_4 = 0;
	uParam0->f_5 = -1;
}

void func_66(var uParam0)//Position - 0x2771
{
	int iVar0;
	
	*uParam0 = 0;
	uParam0->f_1 = 0;
	uParam0->f_2 = 0f;
	uParam0->f_3 = 0;
	uParam0->f_4 = 0;
	uParam0->f_5 = 0;
	uParam0->f_6 = 0;
	uParam0->f_7 = 0;
	uParam0->f_8 = 0;
	uParam0->f_9 = 0;
	uParam0->f_10 = 0;
	iVar0 = 0;
	while (iVar0 <= 11)
	{
		uParam0->f_11[iVar0] = 0;
		iVar0++;
	}
	uParam0->f_24 = 0;
	uParam0->f_25 = 0;
	StringCopy(&(uParam0->f_27), "", 16);
	iVar0 = 0;
	while (iVar0 <= 48)
	{
		uParam0->f_31[iVar0] = 0;
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 <= 1)
	{
		uParam0->f_81[iVar0] = 0;
		iVar0++;
	}
	uParam0->f_84 = 0;
	uParam0->f_85 = 0;
	uParam0->f_86 = 0;
	uParam0->f_87 = 0;
	uParam0->f_88 = 0;
	uParam0->f_89 = 0;
	uParam0->f_90 = 0;
	uParam0->f_91 = 0;
	uParam0->f_93 = 0;
	uParam0->f_94 = 0;
	uParam0->f_95 = 0;
	uParam0->f_92 = 0;
}

void func_67(var uParam0)//Position - 0x2851
{
	*uParam0 = -15;
}

void func_68()//Position - 0x285F
{
	StringCopy(&Global_93481, "", 32);
	func_62(&Global_93489);
}

void func_69(int iParam0)//Position - 0x2878
{
	if (*iParam0 == -1)
	{
		return;
	}
	if (!*iParam0 == Global_35737)
	{
		*iParam0 = -1;
		return;
	}
	*iParam0 = -1;
	Global_35736 = 0;
	Global_35738 = 0;
	Global_35775 = 15;
	Global_55813 = 0;
	Global_55814 = 0;
}

void func_70(int iParam0)//Position - 0x28B5
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	if (iParam0 == 0)
	{
		return;
	}
	if (!entity::does_entity_exist(iParam0))
	{
		return;
	}
	iVar0 = func_78(iParam0);
	if (!iVar0 == -1)
	{
		iVar1 = Global_36709[iVar0 /*5*/];
		func_73(1, iVar1, 1);
		return;
	}
	iVar2 = func_72(iParam0);
	if (iVar2 == -1)
	{
		return;
	}
	func_71(iVar2);
}

void func_71(int iParam0)//Position - 0x290E
{
	if (iParam0 < 0 || iParam0 >= 5)
	{
		return;
	}
	if (!Global_36683[iParam0 /*5*/].f_1 == 0)
	{
		if (Global_36683[iParam0 /*5*/].f_1 == player::player_ped_id())
		{
			Global_36904 = 0;
		}
	}
	Global_36683[iParam0 /*5*/] = 13;
	Global_36683[iParam0 /*5*/].f_1 = 0;
	Global_36683[iParam0 /*5*/].f_2 = 0;
	Global_36683[iParam0 /*5*/].f_3 = 0;
	Global_36683[iParam0 /*5*/].f_4 = 0;
	Global_36682 = (Global_36682 - 1);
	if (Global_36682 < 0)
	{
		Global_36682 = 0;
	}
}

int func_72(int iParam0)//Position - 0x2991
{
	int iVar0;
	
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < 5)
	{
		if (Global_36683[iVar0 /*5*/].f_1 == iParam0)
		{
			return iVar0;
		}
		iVar0++;
	}
	return -1;
}

void func_73(int iParam0, int iParam1, int iParam2)//Position - 0x29C2
{
	func_74(iParam0, iParam1, iParam2, 0, 0);
}

void func_74(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4)//Position - 0x29D6
{
	int iVar0;
	
	if (iParam0 == -1)
	{
		return;
	}
	if (iParam1 == -1)
	{
		return;
	}
	if (iParam2 == 6)
	{
		return;
	}
	if (func_76(iParam0, iParam1, iParam2))
	{
		return;
	}
	iVar0 = func_75();
	if (iVar0 == -1)
	{
		return;
	}
	Global_36790[iVar0 /*5*/] = iParam0;
	Global_36790[iVar0 /*5*/].f_1 = iParam1;
	Global_36790[iVar0 /*5*/].f_2 = iParam2;
	Global_36790[iVar0 /*5*/].f_3 = iParam3;
	Global_36790[iVar0 /*5*/].f_4 = iParam4;
}

int func_75()//Position - 0x2A4D
{
	int iVar0;
	
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < 16)
	{
		if (Global_36790[iVar0 /*5*/].f_2 == 6)
		{
			return iVar0;
		}
		iVar0++;
	}
	return -1;
}

bool func_76(int iParam0, int iParam1, int iParam2)//Position - 0x2A7E
{
	if (func_77(iParam0, iParam1, iParam2) == -1)
	{
		return false;
	}
	return true;
}

int func_77(int iParam0, int iParam1, int iParam2)//Position - 0x2A99
{
	int iVar0;
	
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < 16)
	{
		if (iParam2 == Global_36790[iVar0 /*5*/].f_2)
		{
			if (iParam0 == Global_36790[iVar0 /*5*/])
			{
				if (iParam1 == Global_36790[iVar0 /*5*/].f_1)
				{
					return iVar0;
				}
			}
		}
		iVar0++;
	}
	return -1;
}

int func_78(int iParam0)//Position - 0x2AE5
{
	int iVar0;
	
	if (iParam0 == 0)
	{
		return -1;
	}
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < 16)
	{
		if (!Global_36709[iVar0 /*5*/] == -1)
		{
			if (iParam0 == Global_36709[iVar0 /*5*/].f_1)
			{
				return iVar0;
			}
		}
		iVar0++;
	}
	return -1;
}

void func_79(int iParam0)//Position - 0x2B2E
{
	var uVar0;
	vector3 vVar1[24];
	
	if (gameplay::is_xbox360_version() || gameplay::is_durango_version())
	{
		uVar0 = iParam0;
		network::network_set_rich_presence(8, &uVar0, 1, 1);
	}
	else if (gameplay::is_ps3_version() || gameplay::is_orbis_version())
	{
		StringCopy(&cVar1, "SPMG_", 24);
		StringIntConCat(&cVar1, iParam0, 24);
		StringConCat(&cVar1, "_STR", 24);
		network::_0x3E200C2BCF4164EB(8, &cVar1);
	}
}

void func_80(char[4] cParam0, int iParam1)//Position - 0x2B85
{
	gameplay::clear_bit(&(Global_91406.f_20), 17);
	func_81(cParam0, iParam1, 0);
}

void func_81(char[4] cParam0, int iParam1, int iParam2)//Position - 0x2BA2
{
	if (Global_91406 != 10 && Global_91406 != 9)
	{
		StringCopy(&Global_93481, cParam0, 32);
		func_83(&Global_93489, cParam0, 0, "Start", iParam1, iParam2);
		func_82();
		Global_85917 = 0;
	}
}

void func_82()//Position - 0x2BE6
{
	int iVar0;
	int iVar1;
	
	Global_95894 = Global_93489;
	Global_95894.f_1 = Global_93489.f_1;
	Global_95894.f_6 = Global_93489.f_6;
	Global_95894.f_7 = Global_93489.f_7;
	Global_95894.f_8 = Global_93489.f_8;
	Global_95894.f_2 = Global_93489.f_2;
	Global_95894.f_3 = Global_93489.f_3;
	Global_95894.f_4 = Global_93489.f_4;
	Global_95894.f_5 = Global_93489.f_5;
	iVar1 = 0;
	while (iVar1 < 3)
	{
		Global_95894.f_9[iVar1] = Global_93489.f_9[iVar1];
		Global_95894.f_13[iVar1] = Global_93489.f_13[iVar1];
		Global_95894.f_17[iVar1] = Global_93489.f_17[iVar1];
		Global_95894.f_21[iVar1] = Global_93489.f_21[iVar1];
		Global_95894.f_25[0 /*295*/][iVar1 /*98*/] = { Global_93489.f_25[0 /*295*/][iVar1 /*98*/] };
		Global_95894.f_25[1 /*295*/][iVar1 /*98*/] = { Global_93489.f_25[1 /*295*/][iVar1 /*98*/] };
		iVar0 = 0;
		while (iVar0 < 12)
		{
			Global_95894.f_616[iVar1 /*65*/][iVar0] = Global_93489.f_616[iVar1 /*65*/][iVar0];
			Global_95894.f_616[iVar1 /*65*/].f_13[iVar0] = Global_93489.f_616[iVar1 /*65*/].f_13[iVar0];
			Global_95894.f_616[iVar1 /*65*/].f_26[iVar0] = Global_93489.f_616[iVar1 /*65*/].f_26[iVar0];
			iVar0++;
		}
		Global_95894.f_616[iVar1 /*65*/].f_59 = Global_93489.f_616[iVar1 /*65*/].f_59;
		Global_95894.f_616[iVar1 /*65*/].f_60 = Global_93489.f_616[iVar1 /*65*/].f_60;
		Global_95894.f_616[iVar1 /*65*/].f_61 = Global_93489.f_616[iVar1 /*65*/].f_61;
		Global_95894.f_616[iVar1 /*65*/].f_62 = Global_93489.f_616[iVar1 /*65*/].f_62;
		Global_95894.f_616[iVar1 /*65*/].f_63 = Global_93489.f_616[iVar1 /*65*/].f_63;
		Global_95894.f_616[iVar1 /*65*/].f_64 = Global_93489.f_616[iVar1 /*65*/].f_64;
		iVar0 = 0;
		while (iVar0 < 9)
		{
			Global_95894.f_616[iVar1 /*65*/].f_39[iVar0] = Global_93489.f_616[iVar1 /*65*/].f_39[iVar0];
			Global_95894.f_616[iVar1 /*65*/].f_49[iVar0] = Global_93489.f_616[iVar1 /*65*/].f_49[iVar0];
			iVar0++;
		}
		iVar0 = 0;
		while (iVar0 < 44)
		{
			Global_95894.f_812[iVar1 /*284*/][iVar0 /*3*/] = { Global_93489.f_812[iVar1 /*284*/][iVar0 /*3*/] };
			iVar0++;
		}
		iVar0 = 0;
		while (iVar0 < 50)
		{
			Global_95894.f_812[iVar1 /*284*/].f_133[iVar0 /*3*/] = { Global_93489.f_812[iVar1 /*284*/].f_133[iVar0 /*3*/] };
			iVar0++;
		}
		iVar0 = 0;
		while (iVar0 < 4)
		{
			Global_95894.f_1665[iVar1 /*32*/][iVar0] = Global_93489.f_1665[iVar1 /*32*/][iVar0];
			iVar0++;
		}
		iVar0 = 0;
		while (iVar0 < 10)
		{
			Global_95894.f_1665[iVar1 /*32*/].f_5[iVar0] = Global_93489.f_1665[iVar1 /*32*/].f_5[iVar0];
			iVar0++;
		}
		iVar0 = 0;
		while (iVar0 < 15)
		{
			Global_95894.f_1665[iVar1 /*32*/].f_16[iVar0] = Global_93489.f_1665[iVar1 /*32*/].f_16[iVar0];
			iVar0++;
		}
		Global_95894.f_1762[iVar1] = Global_93489.f_1762[iVar1];
		iVar0 = 0;
		while (iVar0 <= 3)
		{
			Global_95894.f_2259[iVar1 /*15*/][iVar0] = Global_93489.f_2259[iVar1 /*15*/][iVar0];
			Global_95894.f_2259[iVar1 /*15*/].f_5[iVar0] = Global_93489.f_2259[iVar1 /*15*/].f_5[iVar0];
			Global_95894.f_2259[iVar1 /*15*/].f_10[iVar0] = Global_93489.f_2259[iVar1 /*15*/].f_10[iVar0];
			iVar0++;
		}
		iVar0 = 0;
		while (iVar0 <= 2)
		{
			Global_95894.f_1766[iVar1 /*164*/][iVar0] = Global_93489.f_1766[iVar1 /*164*/][iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_4[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_4[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_8[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_8[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_12[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_12[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_16[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_16[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_20[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_20[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_24[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_24[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_28[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_28[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_32[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_32[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_36[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_36[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_40[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_40[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_44[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_44[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_48[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_48[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_52[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_52[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_56[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_56[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_60[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_60[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_64[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_64[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_68[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_68[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_72[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_72[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_76[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_76[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_80[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_80[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_84[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_84[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_88[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_88[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_92[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_92[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_96[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_96[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_100[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_100[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_104[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_104[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_108[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_108[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_112[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_112[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_116[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_116[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_120[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_120[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_124[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_124[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_128[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_128[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_132[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_132[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_136[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_136[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_140[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_140[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_144[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_144[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_148[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_148[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_152[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_152[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_156[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_156[iVar0];
			Global_95894.f_1766[iVar1 /*164*/].f_160[iVar0] = Global_93489.f_1766[iVar1 /*164*/].f_160[iVar0];
			iVar0++;
		}
		iVar1++;
	}
	Global_95894.f_2305 = { Global_93489.f_2305 };
	Global_95894.f_2305.f_3 = Global_93489.f_2305.f_3;
	Global_95894.f_2311 = { Global_93489.f_2311 };
	Global_95894.f_2311.f_3 = { Global_93489.f_2311.f_3 };
	Global_95894.f_2311.f_6 = Global_93489.f_2311.f_6;
	Global_95894.f_2311.f_8 = Global_95894.f_2311.f_8;
	Global_95894.f_2311.f_7 = Global_93489.f_2311.f_7;
	Global_95894.f_2311.f_9 = Global_93489.f_2311.f_9;
	Global_95894.f_2311.f_11 = Global_93489.f_2311.f_11;
	Global_95894.f_2311.f_10 = Global_93489.f_2311.f_10;
	Global_95894.f_2311.f_12 = Global_93489.f_2311.f_12;
	Global_95894.f_2311.f_12.f_1 = { Global_93489.f_2311.f_12.f_1 };
	Global_95894.f_2311.f_12.f_5 = Global_93489.f_2311.f_12.f_5;
	Global_95894.f_2311.f_12.f_6 = Global_93489.f_2311.f_12.f_6;
	Global_95894.f_2311.f_12.f_7 = Global_93489.f_2311.f_12.f_7;
	Global_95894.f_2311.f_12.f_8 = Global_93489.f_2311.f_12.f_8;
	Global_95894.f_2311.f_12.f_9 = { Global_93489.f_2311.f_12.f_9 };
	Global_95894.f_2311.f_12.f_59 = { Global_93489.f_2311.f_12.f_59 };
	Global_95894.f_2311.f_12.f_62 = Global_93489.f_2311.f_12.f_62;
	Global_95894.f_2311.f_12.f_63 = Global_93489.f_2311.f_12.f_63;
	Global_95894.f_2311.f_12.f_64 = Global_93489.f_2311.f_12.f_64;
	Global_95894.f_2311.f_12.f_65 = Global_93489.f_2311.f_12.f_65;
	Global_95894.f_2311.f_12.f_77 = Global_93489.f_2311.f_12.f_77;
	Global_95894.f_2311.f_12.f_66 = Global_93489.f_2311.f_12.f_66;
	Global_95894.f_2311.f_12.f_67 = Global_93489.f_2311.f_12.f_67;
	Global_95894.f_2311.f_12.f_68 = Global_93489.f_2311.f_12.f_68;
	Global_95894.f_2311.f_12.f_69 = Global_93489.f_2311.f_12.f_69;
	Global_95894.f_2311.f_12.f_71 = Global_93489.f_2311.f_12.f_71;
	Global_95894.f_2311.f_12.f_72 = Global_93489.f_2311.f_12.f_72;
	Global_95894.f_2311.f_12.f_73 = Global_93489.f_2311.f_12.f_73;
	Global_95894.f_2311.f_12.f_74 = Global_93489.f_2311.f_12.f_74;
	Global_95894.f_2311.f_12.f_75 = Global_93489.f_2311.f_12.f_75;
	Global_95894.f_2311.f_12.f_76 = Global_93489.f_2311.f_12.f_76;
	Global_95894.f_2401 = Global_93489.f_2401;
	Global_95894.f_2401.f_1 = Global_93489.f_2401.f_1;
	Global_95894.f_2401.f_2 = Global_93489.f_2401.f_2;
	Global_95894.f_2401.f_3 = Global_93489.f_2401.f_3;
}

void func_83(var uParam0, char* sParam1, int iParam2, char* sParam3, int iParam4, int iParam5)//Position - 0x387A
{
	int iVar0;
	int iVar1;
	
	*uParam0 = func_21();
	uParam0->f_1 = func_51();
	gameplay::_get_weather_type_transition(&(uParam0->f_6), &(uParam0->f_7), &(uParam0->f_8));
	if (!ped::is_ped_injured(player::player_ped_id()))
	{
		func_100(&(uParam0->f_2305), 0);
		func_99(player::player_ped_id());
		func_93(player::player_ped_id(), 0);
		weapon::get_current_ped_weapon(player::player_ped_id(), &(uParam0->f_2), 1);
		if (uParam0->f_2 == 0 || uParam0->f_2 == joaat("object"))
		{
			uParam0->f_2 = joaat("weapon_unarmed");
		}
	}
	iVar1 = 0;
	while (iVar1 < 3)
	{
		uParam0->f_17[iVar1] = Global_101553.f_1991.f_539.f_294[iVar1];
		if (iVar1 == func_92())
		{
			func_85(player::player_ped_id(), &(uParam0->f_616[iVar1 /*65*/]), 1);
		}
		else
		{
			iVar0 = 0;
			while (iVar0 < 12)
			{
				uParam0->f_616[iVar1 /*65*/][iVar0] = Global_91196[iVar1 /*65*/][iVar0];
				uParam0->f_616[iVar1 /*65*/].f_13[iVar0] = Global_91196[iVar1 /*65*/].f_13[iVar0];
				iVar0++;
			}
			uParam0->f_616[iVar1 /*65*/].f_59 = Global_91196[iVar1 /*65*/].f_59;
			uParam0->f_616[iVar1 /*65*/].f_60 = Global_91196[iVar1 /*65*/].f_60;
			uParam0->f_616[iVar1 /*65*/].f_61 = Global_91196[iVar1 /*65*/].f_61;
			uParam0->f_616[iVar1 /*65*/].f_62 = Global_91196[iVar1 /*65*/].f_62;
			uParam0->f_616[iVar1 /*65*/].f_63 = Global_91196[iVar1 /*65*/].f_63;
			uParam0->f_616[iVar1 /*65*/].f_64 = Global_91196[iVar1 /*65*/].f_64;
			iVar0 = 0;
			while (iVar0 < 9)
			{
				uParam0->f_616[iVar1 /*65*/].f_39[iVar0] = Global_91196[iVar1 /*65*/].f_39[iVar0];
				uParam0->f_616[iVar1 /*65*/].f_49[iVar0] = Global_91196[iVar1 /*65*/].f_49[iVar0];
				iVar0++;
			}
		}
		iVar0 = 0;
		while (iVar0 < 44)
		{
			uParam0->f_812[iVar1 /*284*/][iVar0 /*3*/] = { Global_101553.f_1991.f_539.f_298[iVar1 /*284*/][iVar0 /*3*/] };
			iVar0++;
		}
		iVar0 = 0;
		while (iVar0 < 50)
		{
			uParam0->f_812[iVar1 /*284*/].f_133[iVar0 /*3*/] = { Global_101553.f_1991.f_539.f_298[iVar1 /*284*/].f_133[iVar0 /*3*/] };
			iVar0++;
		}
		switch (iVar1)
		{
			case 0:
				stats::stat_get_int(joaat("sp0_weap_purch_0"), &(uParam0->f_1665[iVar1 /*32*/][0]), -1);
				stats::stat_get_int(joaat("sp0_weap_purch_1"), &(uParam0->f_1665[iVar1 /*32*/][1]), -1);
				stats::stat_get_int(joaat("sp0_weap_addon_purch_0"), &(uParam0->f_1665[iVar1 /*32*/].f_5[0]), -1);
				stats::stat_get_int(joaat("sp0_weap_addon_purch_1"), &(uParam0->f_1665[iVar1 /*32*/].f_5[1]), -1);
				stats::stat_get_int(joaat("sp0_weap_addon_purch_2"), &(uParam0->f_1665[iVar1 /*32*/].f_5[2]), -1);
				stats::stat_get_int(joaat("sp0_weap_addon_purch_3"), &(uParam0->f_1665[iVar1 /*32*/].f_5[3]), -1);
				stats::stat_get_int(joaat("sp0_weap_addon_purch_4"), &(uParam0->f_1665[iVar1 /*32*/].f_5[4]), -1);
				stats::stat_get_int(joaat("sp0_weap_tint_purch_0"), &(uParam0->f_1665[iVar1 /*32*/].f_16[0]), -1);
				stats::stat_get_int(joaat("sp0_weap_tint_purch_1"), &(uParam0->f_1665[iVar1 /*32*/].f_16[1]), -1);
				stats::stat_get_int(joaat("sp0_weap_tint_purch_2"), &(uParam0->f_1665[iVar1 /*32*/].f_16[2]), -1);
				stats::stat_get_int(joaat("sp0_weap_tint_purch_3"), &(uParam0->f_1665[iVar1 /*32*/].f_16[3]), -1);
				stats::stat_get_int(joaat("sp0_weap_tint_purch_4"), &(uParam0->f_1665[iVar1 /*32*/].f_16[4]), -1);
				stats::stat_get_int(joaat("sp0_weap_tint_purch_5"), &(uParam0->f_1665[iVar1 /*32*/].f_16[5]), -1);
				stats::stat_get_int(joaat("sp0_weap_tint_purch_6"), &(uParam0->f_1665[iVar1 /*32*/].f_16[6]), -1);
				stats::stat_get_int(joaat("sp0_weap_tint_purch_7"), &(uParam0->f_1665[iVar1 /*32*/].f_16[7]), -1);
				stats::stat_get_int(joaat("sp0_weap_tint_purch_8"), &(uParam0->f_1665[iVar1 /*32*/].f_16[8]), -1);
				stats::stat_get_int(joaat("sp0_weap_tint_purch_9"), &(uParam0->f_1665[iVar1 /*32*/].f_16[9]), -1);
				stats::stat_get_int(joaat("sp0_weap_tint_purch_10"), &(uParam0->f_1665[iVar1 /*32*/].f_16[10]), -1);
				stats::stat_get_int(joaat("sp0_weap_tint_purch_11"), &(uParam0->f_1665[iVar1 /*32*/].f_16[11]), -1);
				break;
			
			case 1:
				stats::stat_get_int(joaat("sp1_weap_purch_0"), &(uParam0->f_1665[iVar1 /*32*/][0]), -1);
				stats::stat_get_int(joaat("sp1_weap_purch_1"), &(uParam0->f_1665[iVar1 /*32*/][1]), -1);
				stats::stat_get_int(joaat("sp1_weap_addon_purch_0"), &(uParam0->f_1665[iVar1 /*32*/].f_5[0]), -1);
				stats::stat_get_int(joaat("sp1_weap_addon_purch_1"), &(uParam0->f_1665[iVar1 /*32*/].f_5[1]), -1);
				stats::stat_get_int(joaat("sp1_weap_addon_purch_2"), &(uParam0->f_1665[iVar1 /*32*/].f_5[2]), -1);
				stats::stat_get_int(joaat("sp1_weap_addon_purch_3"), &(uParam0->f_1665[iVar1 /*32*/].f_5[3]), -1);
				stats::stat_get_int(joaat("sp1_weap_addon_purch_4"), &(uParam0->f_1665[iVar1 /*32*/].f_5[4]), -1);
				stats::stat_get_int(joaat("sp1_weap_tint_purch_0"), &(uParam0->f_1665[iVar1 /*32*/].f_16[0]), -1);
				stats::stat_get_int(joaat("sp1_weap_tint_purch_1"), &(uParam0->f_1665[iVar1 /*32*/].f_16[1]), -1);
				stats::stat_get_int(joaat("sp1_weap_tint_purch_2"), &(uParam0->f_1665[iVar1 /*32*/].f_16[2]), -1);
				stats::stat_get_int(joaat("sp1_weap_tint_purch_3"), &(uParam0->f_1665[iVar1 /*32*/].f_16[3]), -1);
				stats::stat_get_int(joaat("sp1_weap_tint_purch_4"), &(uParam0->f_1665[iVar1 /*32*/].f_16[4]), -1);
				stats::stat_get_int(joaat("sp1_weap_tint_purch_5"), &(uParam0->f_1665[iVar1 /*32*/].f_16[5]), -1);
				stats::stat_get_int(joaat("sp1_weap_tint_purch_6"), &(uParam0->f_1665[iVar1 /*32*/].f_16[6]), -1);
				stats::stat_get_int(joaat("sp1_weap_tint_purch_7"), &(uParam0->f_1665[iVar1 /*32*/].f_16[7]), -1);
				stats::stat_get_int(joaat("sp1_weap_tint_purch_8"), &(uParam0->f_1665[iVar1 /*32*/].f_16[8]), -1);
				stats::stat_get_int(joaat("sp1_weap_tint_purch_9"), &(uParam0->f_1665[iVar1 /*32*/].f_16[9]), -1);
				stats::stat_get_int(joaat("sp1_weap_tint_purch_10"), &(uParam0->f_1665[iVar1 /*32*/].f_16[10]), -1);
				stats::stat_get_int(joaat("sp1_weap_tint_purch_11"), &(uParam0->f_1665[iVar1 /*32*/].f_16[11]), -1);
				break;
			
			case 2:
				stats::stat_get_int(joaat("sp2_weap_purch_0"), &(uParam0->f_1665[iVar1 /*32*/][0]), -1);
				stats::stat_get_int(joaat("sp2_weap_purch_1"), &(uParam0->f_1665[iVar1 /*32*/][1]), -1);
				stats::stat_get_int(joaat("sp2_weap_addon_purch_0"), &(uParam0->f_1665[iVar1 /*32*/].f_5[0]), -1);
				stats::stat_get_int(joaat("sp2_weap_addon_purch_1"), &(uParam0->f_1665[iVar1 /*32*/].f_5[1]), -1);
				stats::stat_get_int(joaat("sp2_weap_addon_purch_2"), &(uParam0->f_1665[iVar1 /*32*/].f_5[2]), -1);
				stats::stat_get_int(joaat("sp2_weap_addon_purch_3"), &(uParam0->f_1665[iVar1 /*32*/].f_5[3]), -1);
				stats::stat_get_int(joaat("sp2_weap_addon_purch_4"), &(uParam0->f_1665[iVar1 /*32*/].f_5[4]), -1);
				stats::stat_get_int(joaat("sp2_weap_tint_purch_0"), &(uParam0->f_1665[iVar1 /*32*/].f_16[0]), -1);
				stats::stat_get_int(joaat("sp2_weap_tint_purch_1"), &(uParam0->f_1665[iVar1 /*32*/].f_16[1]), -1);
				stats::stat_get_int(joaat("sp2_weap_tint_purch_2"), &(uParam0->f_1665[iVar1 /*32*/].f_16[2]), -1);
				stats::stat_get_int(joaat("sp2_weap_tint_purch_3"), &(uParam0->f_1665[iVar1 /*32*/].f_16[3]), -1);
				stats::stat_get_int(joaat("sp2_weap_tint_purch_4"), &(uParam0->f_1665[iVar1 /*32*/].f_16[4]), -1);
				stats::stat_get_int(joaat("sp2_weap_tint_purch_5"), &(uParam0->f_1665[iVar1 /*32*/].f_16[5]), -1);
				stats::stat_get_int(joaat("sp2_weap_tint_purch_6"), &(uParam0->f_1665[iVar1 /*32*/].f_16[6]), -1);
				stats::stat_get_int(joaat("sp2_weap_tint_purch_7"), &(uParam0->f_1665[iVar1 /*32*/].f_16[7]), -1);
				stats::stat_get_int(joaat("sp2_weap_tint_purch_8"), &(uParam0->f_1665[iVar1 /*32*/].f_16[8]), -1);
				stats::stat_get_int(joaat("sp2_weap_tint_purch_9"), &(uParam0->f_1665[iVar1 /*32*/].f_16[9]), -1);
				stats::stat_get_int(joaat("sp2_weap_tint_purch_10"), &(uParam0->f_1665[iVar1 /*32*/].f_16[10]), -1);
				stats::stat_get_int(joaat("sp2_weap_tint_purch_11"), &(uParam0->f_1665[iVar1 /*32*/].f_16[11]), -1);
				break;
		}
		uParam0->f_9[iVar1] = Global_101553.f_25254.f_233[iVar1 /*69*/].f_1;
		uParam0->f_13[iVar1] = Global_52990[iVar1];
		uParam0->f_25[0 /*295*/][iVar1 /*98*/] = { Global_101553.f_1991.f_539.f_1635[0 /*295*/][iVar1 /*98*/] };
		uParam0->f_25[1 /*295*/][iVar1 /*98*/] = { Global_101553.f_1991.f_539.f_1635[1 /*295*/][iVar1 /*98*/] };
		iVar0 = 0;
		while (iVar0 <= 3)
		{
			uParam0->f_2259[iVar1 /*15*/][iVar0] = Global_101553.f_1991.f_493[iVar1 /*15*/][iVar0];
			uParam0->f_2259[iVar1 /*15*/].f_5[iVar0] = Global_101553.f_1991.f_493[iVar1 /*15*/].f_5[iVar0];
			uParam0->f_2259[iVar1 /*15*/].f_10[iVar0] = Global_101553.f_1991.f_493[iVar1 /*15*/].f_10[iVar0];
			iVar0++;
		}
		iVar0 = 0;
		while (iVar0 <= 2)
		{
			uParam0->f_1766[iVar1 /*164*/][iVar0] = Global_101553.f_1991[iVar1 /*164*/][iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_4[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_4[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_8[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_8[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_12[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_12[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_16[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_16[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_20[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_20[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_24[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_24[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_28[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_28[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_32[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_32[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_36[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_36[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_40[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_40[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_44[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_44[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_48[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_48[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_52[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_52[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_56[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_56[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_60[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_60[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_64[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_64[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_68[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_68[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_72[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_72[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_76[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_76[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_80[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_80[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_84[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_84[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_88[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_88[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_92[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_92[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_96[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_96[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_100[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_100[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_104[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_104[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_108[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_108[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_112[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_112[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_116[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_116[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_120[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_120[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_124[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_124[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_128[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_128[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_132[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_132[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_136[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_136[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_140[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_140[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_144[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_144[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_148[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_148[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_152[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_152[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_156[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_156[iVar0];
			uParam0->f_1766[iVar1 /*164*/].f_160[iVar0] = Global_101553.f_1991[iVar1 /*164*/].f_160[iVar0];
			iVar0++;
		}
		iVar1++;
	}
	stats::stat_get_int(joaat("sp0_special_ability"), &(uParam0->f_1762[0]), -1);
	stats::stat_get_int(joaat("sp1_special_ability"), &(uParam0->f_1762[1]), -1);
	stats::stat_get_int(joaat("sp2_special_ability"), &(uParam0->f_1762[2]), -1);
	uParam0->f_5 = 145;
	if (iParam4 == 1)
	{
		func_4(&(uParam0->f_2311), uParam0, iParam5, 1, 1, 0);
	}
	func_84(&(uParam0->f_2401));
	sParam3 = sParam3;
	iParam2 = iParam2;
}

bool func_84(var uParam0)//Position - 0x4703
{
	*uParam0 = Global_87588;
	uParam0->f_1 = Global_87589;
	uParam0->f_2 = 0;
	uParam0->f_3 = 0;
	return true;
}

void func_85(int iParam0, var uParam1, int iParam2)//Position - 0x4725
{
	int iVar0;
	int iVar1;
	
	if (!ped::is_ped_injured(iParam0))
	{
		iVar0 = func_25(iParam0);
		iVar1 = 0;
		while (iVar1 < 12)
		{
			func_91(iParam0, iVar1, &(uParam1->f_13[iVar1]), uParam1[iVar1], &(uParam1->f_26[iVar1]), iParam2, 145);
			iVar1++;
		}
		iVar1 = 0;
		while (iVar1 < 9)
		{
			func_90(iParam0, iVar1, &(uParam1->f_39[iVar1]), &(uParam1->f_49[iVar1]), iParam2, 145);
			iVar1++;
		}
		if (func_13(iVar0))
		{
			uParam1->f_59 = Global_101553.f_1991.f_539[iVar0 /*65*/].f_59;
			uParam1->f_60 = Global_101553.f_1991.f_539[iVar0 /*65*/].f_60;
			uParam1->f_61 = Global_101553.f_1991.f_539[iVar0 /*65*/].f_61;
			uParam1->f_62 = Global_101553.f_1991.f_539[iVar0 /*65*/].f_62;
			uParam1->f_63 = Global_101553.f_1991.f_539[iVar0 /*65*/].f_63;
			uParam1->f_64 = Global_101553.f_1991.f_539[iVar0 /*65*/].f_64;
		}
		else if (network::network_is_game_in_progress() && entity::get_entity_model(iParam0) == entity::get_entity_model(player::player_ped_id()))
		{
			if (func_89(161, -1))
			{
				uParam1->f_59 = func_86(2043, Global_69436, 0);
			}
			else
			{
				uParam1->f_59 = func_86(745, Global_69436, 0);
			}
			uParam1->f_60 = func_86(746, Global_69436, 0);
			uParam1->f_61 = func_86(747, Global_69436, 0);
		}
		if (network::network_is_game_in_progress() && iParam0 == player::player_ped_id())
		{
			if (func_89(161, -1))
			{
				uParam1->f_59 = func_86(2043, Global_69436, 0);
			}
			else
			{
				uParam1->f_59 = func_86(745, Global_69436, 0);
			}
		}
	}
}

int func_86(int iParam0, int iParam1, int iParam2)//Position - 0x48CF
{
	int iVar0;
	var uVar1;
	
	if (iParam2 == 0)
	{
	}
	iVar0 = Global_2491469[iParam0 /*3*/][func_87(iParam1)];
	if (stats::stat_get_int(iVar0, &uVar1, -1))
	{
		return uVar1;
	}
	return 0;
}

int func_87(var uParam0)//Position - 0x4901
{
	int iVar0;
	int iVar1;
	
	iVar0 = uParam0;
	if (iVar0 == -1)
	{
		iVar1 = func_88();
		if (iVar1 > -1)
		{
			Global_2491182 = 0;
			iVar0 = iVar1;
		}
		else
		{
			iVar0 = 0;
			Global_2491182 = 1;
		}
	}
	return iVar0;
}

var func_88()//Position - 0x4935
{
	return Global_1312731;
}

int func_89(int iParam0, int iParam1)//Position - 0x4941
{
	int iVar0;
	var uVar1;
	
	iVar0 = Global_2506009[iParam0 /*3*/][func_87(iParam1)];
	if (stats::stat_get_bool(iVar0, &uVar1, -1))
	{
		return uVar1;
	}
	return 0;
}

void func_90(int iParam0, int iParam1, var uParam2, var uParam3, int iParam4, int iParam5)//Position - 0x496D
{
	int iVar0;
	
	iVar0 = func_25(iParam0);
	if (iParam0 != 0)
	{
		*uParam2 = ped::get_ped_prop_index(iParam0, iParam1);
		*uParam3 = ped::get_ped_prop_texture_index(iParam0, iParam1);
	}
	else
	{
		iVar0 = iParam5;
	}
	if (iParam4 == 0)
	{
		return;
	}
	if (iParam1 == 0)
	{
		if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 8 != 0)
		{
			if (iParam0 != 0)
			{
				if (ped::is_ped_wearing_helmet(iParam0) && ped::_0x451294E859ECC018(iParam0) != -1)
				{
					*uParam2 = ped::_0x451294E859ECC018(iParam0);
					*uParam3 = ped::_0x9D728C1E12BF5518(iParam0);
				}
			}
		}
	}
	switch (iVar0)
	{
		case 0:
			if (iParam1 == 0)
			{
				if (*uParam2 == 7)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 8 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if (*uParam2 == 11)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 8 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if (*uParam2 == 21)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 16 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if (*uParam2 == 23)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 8 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if (*uParam2 == 27)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 8 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if (*uParam2 == 28)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 8 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if (*uParam2 >= 14 && *uParam2 <= 20)
				{
					if (iParam4 & 2 != 0 || iParam4 & 4 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
			}
			else if (iParam1 == 1)
			{
				if (*uParam2 == 1)
				{
					if (iParam4 & 2 != 0 || iParam4 & 64 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
			}
			break;
		
		case 1:
			if (iParam1 == 0)
			{
				if (*uParam2 == 2)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 8 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if (*uParam2 == 4)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 16 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if (*uParam2 == 6)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 8 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if (*uParam2 == 17)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 8 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if (*uParam2 == 20)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 8 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if (*uParam2 == 21)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 8 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if (*uParam2 >= 8 && *uParam2 <= 14)
				{
					if (iParam4 & 2 != 0 || iParam4 & 4 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
			}
			break;
		
		case 2:
			if (iParam1 == 0)
			{
				if (*uParam2 == 9)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 8 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if (*uParam2 == 11)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 8 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if (*uParam2 == 12)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 8 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if (*uParam2 == 21)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 8 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if (*uParam2 == 23)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 8 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if (*uParam2 == 27)
				{
					if ((iParam4 & 1 != 0 || iParam4 & 2 != 0) || iParam4 & 8 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
				else if ((*uParam2 >= 14 && *uParam2 <= 20) || *uParam2 == 2)
				{
					if (iParam4 & 2 != 0 || iParam4 & 4 != 0)
					{
						*uParam2 = -1;
						*uParam3 = -1;
					}
				}
			}
			break;
	}
}

void func_91(int iParam0, int iParam1, var uParam2, var uParam3, var uParam4, int iParam5, int iParam6)//Position - 0x4EB5
{
	int iVar0;
	
	iVar0 = func_25(iParam0);
	if (iParam0 != 0)
	{
		*uParam2 = ped::get_ped_drawable_variation(iParam0, iParam1);
		*uParam3 = ped::get_ped_texture_variation(iParam0, iParam1);
		*uParam4 = ped::get_ped_palette_variation(iParam0, iParam1);
	}
	else
	{
		iVar0 = iParam6;
	}
	if (iParam5 == 0)
	{
		return;
	}
	switch (iVar0)
	{
		case 0:
			if (iParam1 == 8)
			{
				if ((iParam5 & 1 != 0 || iParam5 & 2 != 0) || iParam5 & 32 != 0)
				{
					if (*uParam2 == 15)
					{
						*uParam2 = 0;
						*uParam3 = 0;
					}
				}
				if (iParam5 & 2 != 0 || iParam5 & 64 != 0)
				{
					if (*uParam2 == 3 || *uParam2 == 22)
					{
						*uParam2 = 0;
						*uParam3 = 0;
					}
				}
			}
			else if (iParam1 == 9)
			{
				if ((iParam5 & 1 != 0 || iParam5 & 2 != 0) || iParam5 & 32 != 0)
				{
					if (*uParam2 == 5)
					{
						*uParam2 = 0;
						*uParam3 = 0;
					}
				}
				if (iParam5 & 2 != 0 || iParam5 & 4 != 0)
				{
					if (*uParam2 == 8)
					{
						*uParam2 = 0;
						*uParam3 = 0;
					}
				}
			}
			break;
		
		case 1:
			if (iParam1 == 8)
			{
				if ((iParam5 & 1 != 0 || iParam5 & 2 != 0) || iParam5 & 32 != 0)
				{
					if (*uParam2 == 1 || *uParam2 == 10)
					{
						*uParam2 = 14;
						*uParam3 = 0;
					}
				}
				if (iParam5 & 2 != 0 || iParam5 & 64 != 0)
				{
					if (*uParam2 == 19)
					{
						*uParam2 = 14;
						*uParam3 = 0;
					}
				}
			}
			else if (iParam1 == 9)
			{
				if (iParam5 & 2 != 0 || iParam5 & 4 != 0)
				{
					if (*uParam2 == 5)
					{
						*uParam2 = 0;
						*uParam3 = 0;
					}
				}
			}
			break;
		
		case 2:
			if (iParam1 == 8)
			{
				if ((iParam5 & 1 != 0 || iParam5 & 2 != 0) || iParam5 & 32 != 0)
				{
					if (*uParam2 == 3)
					{
						*uParam2 = 14;
						*uParam3 = 0;
					}
				}
			}
			else if (iParam1 == 9)
			{
				if (*uParam2 >= 5 && *uParam2 <= 7)
				{
					if (iParam5 & 2 != 0 || iParam5 & 4 != 0)
					{
						*uParam2 = 0;
						*uParam3 = 0;
					}
				}
			}
			break;
	}
}

var func_92()//Position - 0x50F6
{
	func_22();
	return Global_101553.f_1991.f_539.f_3549;
}

void func_93(int iParam0, int iParam1)//Position - 0x510F
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	iVar0 = func_25(iParam0);
	if (func_13(iVar0) && !ped::is_ped_injured(iParam0))
	{
		if (iParam0 == player::player_ped_id())
		{
			func_94(iParam0, &(Global_101553.f_1991.f_539.f_298[iVar0 /*284*/]));
			iVar2 = 0;
			while (iVar2 <= (8 - 1))
			{
				Global_101553.f_1991.f_539.f_1151[iVar2 /*4*/][iVar0] = ui::_0xA13E93403F26C812(iVar2);
				if (iParam1)
				{
					iVar1 = ui::_0xA48931185F0536FE();
					if (Global_101553.f_1991.f_539.f_1151[iVar2 /*4*/][iVar0] == iVar1)
					{
						Global_101553.f_1991.f_539.f_1184 = iVar2;
					}
				}
				iVar2++;
			}
			player::get_player_parachute_pack_tint_index(player::player_id(), &iVar3);
			if (iVar0 == 0)
			{
				stats::stat_set_int(joaat("sp0_parachute_current_tint"), iVar3, 1);
			}
			else if (iVar0 == 1)
			{
				stats::stat_set_int(joaat("sp1_parachute_current_tint"), iVar3, 1);
			}
			else if (iVar0 == 2)
			{
				stats::stat_set_int(joaat("sp2_parachute_current_tint"), iVar3, 1);
			}
		}
	}
}

void func_94(int iParam0, var uParam1)//Position - 0x5202
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	vector3 vVar4;
	int iVar7;
	int iVar8;
	struct<2> Var9;
	struct<4> Var48;
	int iVar70;
	
	if (!ped::is_ped_injured(iParam0))
	{
		iVar0 = 0;
		while (iVar0 <= (44 - 1))
		{
			(uParam1[iVar0 /*3*/])->f_1 = 0;
			iVar0++;
		}
		iVar0 = 0;
		while (iVar0 <= (44 - 1))
		{
			iVar3 = func_98(iVar0);
			if (iVar3 != 0)
			{
				vVar4.x = weapon::get_ped_weapontype_in_slot(iParam0, func_98(iVar0));
				vVar4.y = 0;
				vVar4.z = 0;
				if (vVar4.x != 0 && vVar4.x != joaat("weapon_unarmed"))
				{
					vVar4.y = weapon::get_ammo_in_ped_weapon(iParam0, vVar4.x);
					if (vVar4.x == joaat("gadget_parachute"))
					{
						vVar4.y = 1;
					}
					gameplay::set_bit(&(vVar4.f_2), (20 + weapon::get_ped_weapon_tint_index(iParam0, vVar4.x)));
					if (vVar4.y == -1)
					{
						if (!weapon::get_max_ammo(iParam0, vVar4.x, &(vVar4.f_1)))
						{
							vVar4.y = 0;
						}
					}
					(uParam1[iVar0 /*3*/])->f_1 = vVar4.y;
					iVar1 = 0;
					iVar2 = func_96(vVar4.x, iVar1);
					while (iVar2 != 0)
					{
						if (weapon::has_ped_got_weapon_component(iParam0, vVar4.x, iVar2))
						{
							gameplay::set_bit(&(vVar4.f_2), iVar1);
						}
						iVar1++;
						iVar2 = func_96(vVar4.x, iVar1);
					}
				}
				*(uParam1[iVar0 /*3*/]) = { vVar4 };
			}
			iVar0++;
		}
		iVar0 = 0;
		while (iVar0 <= (50 - 1))
		{
			uParam1->f_133[iVar0 /*3*/].f_1 = 0;
			iVar0++;
		}
		iVar8 = dlc1::get_num_dlc_weapons();
		iVar7 = 0;
		while (iVar7 < iVar8)
		{
			if ((dlc1::get_dlc_weapon_data(iVar7, &Var9) && !func_95(Var9.f_1)) && iVar70 < 50)
			{
				if (!dlc1::_is_dlc_data_empty(Var9))
				{
					vVar4.x = Var9.f_1;
					vVar4.y = 0;
					vVar4.z = 0;
					vVar4.y = weapon::get_ammo_in_ped_weapon(iParam0, vVar4.x);
					if (weapon::has_ped_got_weapon(iParam0, vVar4.x, 0))
					{
						gameplay::set_bit(&(vVar4.f_2), (20 + weapon::get_ped_weapon_tint_index(iParam0, vVar4.x)));
					}
					else
					{
						gameplay::set_bit(&(vVar4.f_2), 20);
					}
					if (vVar4.y == -1)
					{
						if (!weapon::get_max_ammo(iParam0, vVar4.x, &(vVar4.f_1)))
						{
							vVar4.y = 0;
						}
					}
					uParam1->f_133[iVar70 /*3*/].f_1 = vVar4.y;
					iVar1 = 0;
					while (iVar1 < dlc1::get_num_dlc_weapon_components(iVar7))
					{
						if (dlc1::get_dlc_weapon_component_data(iVar7, iVar1, &Var48))
						{
							if (weapon::has_ped_got_weapon_component(iParam0, vVar4.x, Var48.f_3))
							{
								gameplay::set_bit(&(vVar4.f_2), iVar1);
							}
						}
						iVar1++;
					}
				}
				if (vVar4.x != 0)
				{
					if (!weapon::has_ped_got_weapon(iParam0, vVar4.x, 0))
					{
						vVar4.x = 0;
						vVar4.y = 0;
					}
				}
				uParam1->f_133[iVar70 /*3*/] = { vVar4 };
				iVar70++;
			}
			iVar7++;
		}
	}
}

bool func_95(int iParam0)//Position - 0x5466
{
	if (network::network_is_game_in_progress())
	{
	}
	else
	{
		switch (iParam0)
		{
			case joaat("weapon_pistol50"):
			case joaat("weapon_bullpupshotgun"):
			case joaat("weapon_assaultsmg"):
				return false;
				break;
			
			case joaat("weapon_bottle"):
			case joaat("weapon_snspistol"):
			case joaat("weapon_gusenberg"):
				return false;
				break;
			
			case joaat("weapon_heavypistol"):
			case joaat("weapon_specialcarbine"):
				return false;
				break;
			
			case joaat("weapon_bullpuprifle"):
				return false;
				break;
			
			case joaat("weapon_dagger"):
			case joaat("weapon_vintagepistol"):
				return false;
				break;
			
			case joaat("weapon_firework"):
			case joaat("weapon_musket"):
				return false;
				break;
			
			case joaat("weapon_heavyshotgun"):
			case joaat("weapon_marksmanrifle"):
				return false;
				break;
			
			case joaat("weapon_hominglauncher"):
			case joaat("weapon_proxmine"):
				return false;
				break;
			
			case joaat("weapon_combatpdw"):
			case joaat("weapon_knuckle"):
			case joaat("weapon_marksmanpistol"):
				return false;
				break;
			
			case -947031628:
			case -572349828:
			case 392730790:
			case -1523701417:
			case -2112826155:
			case -664359727:
			case -1887867191:
			case -837150131:
			case -344484024:
			case joaat("weapon_flaregun"):
			case joaat("weapon_handcuffs"):
			case joaat("weapon_snowball"):
			case joaat("weapon_garbagebag"):
			case joaat("weapon_flashlight"):
			case joaat("weapon_switchblade"):
			case joaat("weapon_revolver"):
			case joaat("weapon_dbshotgun"):
			case joaat("weapon_compactrifle"):
			case 317205821:
			case -1121678507:
			case 125959754:
			case -853065399:
			case -1169823560:
			case -1810795771:
			case 419712736:
				return true;
				break;
			}
	}
	return false;
}

int func_96(int iParam0, int iParam1)//Position - 0x55D4
{
	int iVar0;
	int iVar1;
	var uVar2;
	struct<4> Var41;
	
	iVar0 = 0;
	switch (iParam0)
	{
		case joaat("weapon_pistol"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_pistol_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_pistol_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_at_pi_flsh");
					break;
				
				case 3:
					iVar0 = joaat("component_at_pi_supp_02");
					break;
				
				case 4:
					iVar0 = joaat("component_pistol_varmod_luxe");
					break;
			}
			break;
		
		case joaat("weapon_combatpistol"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_combatpistol_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_combatpistol_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_at_pi_flsh");
					break;
				
				case 3:
					iVar0 = joaat("component_at_pi_supp");
					break;
				
				case 4:
					iVar0 = joaat("component_combatpistol_varmod_lowrider");
					break;
			}
			break;
		
		case joaat("weapon_appistol"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_appistol_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_appistol_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_at_pi_flsh");
					break;
				
				case 3:
					iVar0 = joaat("component_at_pi_supp");
					break;
				
				case 4:
					iVar0 = joaat("component_appistol_varmod_luxe");
					break;
			}
			break;
		
		case joaat("weapon_microsmg"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_microsmg_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_microsmg_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_at_pi_flsh");
					break;
				
				case 3:
					iVar0 = joaat("component_at_scope_macro");
					break;
				
				case 4:
					iVar0 = joaat("component_at_ar_supp_02");
					break;
				
				case 5:
					iVar0 = joaat("component_microsmg_varmod_luxe");
					break;
			}
			break;
		
		case joaat("weapon_smg"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_smg_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_smg_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_smg_clip_03");
					break;
				
				case 3:
					iVar0 = joaat("component_at_ar_flsh");
					break;
				
				case 4:
					iVar0 = joaat("component_at_pi_supp");
					break;
				
				case 5:
					iVar0 = joaat("component_at_scope_macro_02");
					break;
				
				case 6:
					iVar0 = joaat("component_at_ar_afgrip");
					break;
				
				case 7:
					iVar0 = joaat("component_smg_varmod_luxe");
					break;
			}
			break;
		
		case joaat("weapon_assaultrifle"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_assaultrifle_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_assaultrifle_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_assaultrifle_clip_03");
					break;
				
				case 3:
					iVar0 = joaat("component_at_ar_afgrip");
					break;
				
				case 4:
					iVar0 = joaat("component_at_ar_flsh");
					break;
				
				case 5:
					iVar0 = joaat("component_at_scope_macro");
					break;
				
				case 6:
					iVar0 = joaat("component_at_ar_supp_02");
					break;
				
				case 7:
					iVar0 = joaat("component_assaultrifle_varmod_luxe");
					break;
			}
			break;
		
		case joaat("weapon_carbinerifle"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_carbinerifle_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_carbinerifle_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_carbinerifle_clip_03");
					break;
				
				case 3:
					iVar0 = joaat("component_at_railcover_01");
					break;
				
				case 4:
					iVar0 = joaat("component_at_ar_afgrip");
					break;
				
				case 5:
					iVar0 = joaat("component_at_ar_flsh");
					break;
				
				case 6:
					iVar0 = joaat("component_at_scope_medium");
					break;
				
				case 7:
					iVar0 = joaat("component_at_ar_supp");
					break;
				
				case 8:
					iVar0 = joaat("component_carbinerifle_varmod_luxe");
					break;
			}
			break;
		
		case joaat("weapon_advancedrifle"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_advancedrifle_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_advancedrifle_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_at_ar_flsh");
					break;
				
				case 3:
					iVar0 = joaat("component_at_scope_small");
					break;
				
				case 4:
					iVar0 = joaat("component_at_ar_supp");
					break;
				
				case 5:
					iVar0 = joaat("component_advancedrifle_varmod_luxe");
					break;
			}
			break;
		
		case joaat("weapon_mg"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_mg_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_mg_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_at_scope_small_02");
					break;
				
				case 3:
					iVar0 = joaat("component_at_ar_afgrip");
					break;
				
				case 4:
					iVar0 = joaat("component_mg_varmod_lowrider");
					break;
			}
			break;
		
		case joaat("weapon_combatmg"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_combatmg_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_combatmg_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_at_ar_afgrip");
					break;
				
				case 3:
					iVar0 = joaat("component_at_scope_medium");
					break;
				
				case 4:
					iVar0 = joaat("component_combatmg_varmod_lowrider");
					break;
			}
			break;
		
		case joaat("weapon_pumpshotgun"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_at_sr_supp");
					break;
				
				case 1:
					iVar0 = joaat("component_at_ar_flsh");
					break;
				
				case 2:
					iVar0 = joaat("component_pumpshotgun_varmod_lowrider");
					break;
			}
			break;
		
		case joaat("weapon_assaultshotgun"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_assaultshotgun_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_assaultshotgun_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_at_ar_afgrip");
					break;
				
				case 3:
					iVar0 = joaat("component_at_ar_flsh");
					break;
				
				case 4:
					iVar0 = joaat("component_at_ar_supp");
					break;
			}
			break;
		
		case joaat("weapon_sniperrifle"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_sniperrifle_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_at_scope_large");
					break;
				
				case 2:
					iVar0 = joaat("component_at_scope_max");
					break;
				
				case 3:
					iVar0 = joaat("component_at_ar_supp_02");
					break;
				
				case 4:
					iVar0 = joaat("component_sniperrifle_varmod_luxe");
					break;
			}
			break;
		
		case joaat("weapon_heavysniper"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_heavysniper_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_at_scope_large");
					break;
				
				case 2:
					iVar0 = joaat("component_at_scope_max");
					break;
			}
			break;
		
		case joaat("weapon_grenadelauncher"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_at_ar_afgrip");
					break;
				
				case 1:
					iVar0 = joaat("component_at_ar_flsh");
					break;
				
				case 2:
					iVar0 = joaat("component_at_scope_small");
					break;
			}
			break;
		
		case joaat("weapon_minigun"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_minigun_clip_01");
					break;
			}
			break;
		
		case joaat("weapon_assaultsmg"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_assaultsmg_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_assaultsmg_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_at_ar_flsh");
					break;
				
				case 3:
					iVar0 = joaat("component_at_scope_macro");
					break;
				
				case 4:
					iVar0 = joaat("component_at_ar_supp_02");
					break;
				
				case 5:
					iVar0 = joaat("component_assaultsmg_varmod_lowrider");
					break;
			}
			break;
		
		case joaat("weapon_bullpupshotgun"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_at_ar_afgrip");
					break;
				
				case 1:
					iVar0 = joaat("component_at_ar_flsh");
					break;
				
				case 2:
					iVar0 = joaat("component_at_ar_supp_02");
					break;
			}
			break;
		
		case joaat("weapon_pistol50"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_pistol50_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_pistol50_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_at_pi_flsh");
					break;
				
				case 3:
					iVar0 = joaat("component_at_ar_supp_02");
					break;
				
				case 4:
					iVar0 = joaat("component_pistol50_varmod_luxe");
					break;
			}
			break;
		
		case joaat("weapon_combatpdw"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_combatpdw_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_combatpdw_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_combatpdw_clip_03");
					break;
				
				case 3:
					iVar0 = joaat("component_at_ar_flsh");
					break;
				
				case 4:
					iVar0 = joaat("component_at_scope_small");
					break;
				
				case 5:
					iVar0 = joaat("component_at_ar_afgrip");
					break;
			}
			break;
		
		case joaat("weapon_sawnoffshotgun"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_sawnoffshotgun_varmod_luxe");
					break;
			}
			break;
		
		case joaat("weapon_bullpuprifle"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_bullpuprifle_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_bullpuprifle_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_at_ar_flsh");
					break;
				
				case 3:
					iVar0 = joaat("component_at_scope_small");
					break;
				
				case 4:
					iVar0 = joaat("component_at_ar_supp");
					break;
				
				case 5:
					iVar0 = joaat("component_at_ar_afgrip");
					break;
				
				case 6:
					iVar0 = joaat("component_bullpuprifle_varmod_low");
					break;
			}
			break;
		
		case joaat("weapon_snspistol"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_snspistol_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_snspistol_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_snspistol_varmod_lowrider");
					break;
			}
			break;
		
		case joaat("weapon_specialcarbine"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_specialcarbine_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_specialcarbine_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_specialcarbine_clip_03");
					break;
				
				case 3:
					iVar0 = joaat("component_at_ar_flsh");
					break;
				
				case 4:
					iVar0 = joaat("component_at_scope_medium");
					break;
				
				case 5:
					iVar0 = joaat("component_at_ar_supp_02");
					break;
				
				case 6:
					iVar0 = joaat("component_at_ar_afgrip");
					break;
				
				case 7:
					iVar0 = joaat("component_specialcarbine_varmod_lowrider");
					break;
			}
			break;
		
		case joaat("weapon_knuckle"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_knuckle_varmod_pimp");
					break;
				
				case 1:
					iVar0 = joaat("component_knuckle_varmod_ballas");
					break;
				
				case 2:
					iVar0 = joaat("component_knuckle_varmod_dollar");
					break;
				
				case 3:
					iVar0 = joaat("component_knuckle_varmod_diamond");
					break;
				
				case 4:
					iVar0 = joaat("component_knuckle_varmod_hate");
					break;
				
				case 5:
					iVar0 = joaat("component_knuckle_varmod_love");
					break;
				
				case 6:
					iVar0 = joaat("component_knuckle_varmod_player");
					break;
				
				case 7:
					iVar0 = joaat("component_knuckle_varmod_king");
					break;
				
				case 8:
					iVar0 = joaat("component_knuckle_varmod_vagos");
					break;
			}
			break;
		
		case joaat("weapon_machinepistol"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_machinepistol_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_machinepistol_clip_02");
					break;
				
				case 2:
					iVar0 = joaat("component_machinepistol_clip_03");
					break;
				
				case 3:
					iVar0 = joaat("component_at_pi_supp");
					break;
			}
			break;
		
		case joaat("weapon_switchblade"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_switchblade_varmod_var1");
					break;
				
				case 1:
					iVar0 = joaat("component_switchblade_varmod_var2");
					break;
			}
			break;
		
		case joaat("weapon_revolver"):
			switch (iParam1)
			{
				case 0:
					iVar0 = joaat("component_revolver_clip_01");
					break;
				
				case 1:
					iVar0 = joaat("component_revolver_varmod_boss");
					break;
				
				case 2:
					iVar0 = joaat("component_revolver_varmod_goon");
					break;
			}
			break;
		
		case -1121678507:
			switch (iParam1)
			{
				case 0:
					iVar0 = -2067221805;
					break;
				
				case 1:
					iVar0 = -1820405577;
					break;
			}
			break;
		
		default:
			if (iParam0 != 0)
			{
				iVar1 = func_97(iParam0, &uVar2);
				if (iVar1 != -1)
				{
					if (iParam1 < dlc1::get_num_dlc_weapon_components(iVar1))
					{
						if (dlc1::get_dlc_weapon_component_data(iVar1, iParam1, &Var41))
						{
							return Var41.f_3;
						}
					}
				}
			}
			break;
	}
	return iVar0;
}

int func_97(int iParam0, var uParam1)//Position - 0x60C0
{
	int iVar0;
	int iVar1;
	
	iVar1 = dlc1::get_num_dlc_weapons();
	iVar0 = 0;
	while (iVar0 < iVar1)
	{
		if (dlc1::get_dlc_weapon_data(iVar0, uParam1))
		{
			if (uParam1->f_1 == iParam0)
			{
				return iVar0;
			}
		}
		iVar0++;
	}
	return -1;
}

int func_98(int iParam0)//Position - 0x60FB
{
	int iVar0;
	
	iVar0 = 0;
	switch (iParam0)
	{
		case 0:
			iVar0 = 1993361168;
			break;
		
		case 1:
			iVar0 = 1277010230;
			break;
		
		case 2:
			iVar0 = 932043479;
			break;
		
		case 3:
			iVar0 = -690654591;
			break;
		
		case 4:
			iVar0 = -1459198205;
			break;
		
		case 5:
			iVar0 = 195782970;
			break;
		
		case 6:
			iVar0 = -438797331;
			break;
		
		case 7:
			iVar0 = 896793492;
			break;
		
		case 8:
			iVar0 = 495159329;
			break;
		
		case 9:
			iVar0 = -1155528315;
			break;
		
		case 10:
			iVar0 = -515636489;
			break;
		
		case 11:
			iVar0 = -871913299;
			break;
		
		case 12:
			iVar0 = -1352759032;
			break;
		
		case 13:
			iVar0 = -542958961;
			break;
		
		case 14:
			iVar0 = 1682645887;
			break;
		
		case 15:
			iVar0 = -859470162;
			break;
		
		case 16:
			iVar0 = -2125426402;
			break;
		
		case 17:
			iVar0 = 2067210266;
			break;
		
		case 18:
			iVar0 = -538172856;
			break;
		
		case 19:
			iVar0 = 1783244476;
			break;
		
		case 20:
			iVar0 = 439844898;
			break;
		
		case 21:
			iVar0 = -24829327;
			break;
		
		case 22:
			iVar0 = 1949306232;
			break;
		
		case 23:
			iVar0 = -1941230881;
			break;
		
		case 24:
			iVar0 = -1033554448;
			break;
		
		case 25:
			iVar0 = 320513715;
			break;
		
		case 26:
			iVar0 = -695165975;
			break;
		
		case 27:
			iVar0 = -281028447;
			break;
		
		case 28:
			iVar0 = -686713772;
			break;
		
		case 29:
			iVar0 = 347509793;
			break;
		
		case 30:
			iVar0 = 1769089473;
			break;
		
		case 31:
			iVar0 = 189935548;
			break;
		
		case 33:
			iVar0 = 248801358;
			break;
		
		case 34:
			iVar0 = 386596758;
			break;
		
		case 35:
			iVar0 = -157212362;
			break;
		
		case 36:
			iVar0 = 436985596;
			break;
		
		case 37:
			iVar0 = -47957369;
			break;
		
		case 38:
			iVar0 = 575938238;
			break;
	}
	return iVar0;
}

void func_99(int iParam0)//Position - 0x636F
{
	int iVar0;
	
	iVar0 = func_25(iParam0);
	if (func_13(iVar0) && !ped::is_ped_injured(iParam0))
	{
		Global_101553.f_1991.f_539.f_294[iVar0] = ped::get_ped_armour(iParam0);
	}
}

void func_100(var uParam0, int iParam1)//Position - 0x63AB
{
	int iVar0;
	vector3 vVar1;
	var uVar4;
	int iVar5;
	
	*uParam0 = { entity::get_entity_coords(player::player_ped_id(), 1) };
	uParam0->f_3 = entity::get_entity_heading(player::player_ped_id());
	uParam0->f_5 = ped::get_ped_parachute_state(player::player_ped_id());
	if (player::is_player_playing(player::player_id()))
	{
		uParam0->f_4 = player::get_player_wanted_level(player::player_id());
	}
	if (system::vdist(*uParam0, 320.9934f, 265.2515f, 82.1221f) < 10f)
	{
		*uParam0 = { 301.2162f, 202.1357f, 103.3797f };
		uParam0->f_3 = 156.5144f;
	}
	else if (system::vdist(*uParam0, 377.153f, -717.567f, 10.0536f) < 10f)
	{
		*uParam0 = { 394.2567f, -713.5439f, 28.2853f };
		uParam0->f_3 = 276.6273f;
	}
	else if (system::vdist(*uParam0, -1425.564f, -244.3f, 15.8053f) < 10f)
	{
		*uParam0 = { -1423.472f, -214.2539f, 45.5004f };
		uParam0->f_3 = 353.8757f;
	}
	else if (script::_get_number_of_instances_of_streamed_script(joaat("finale_choice")) > 0)
	{
		*uParam0 = { 4.2587f, 525.0214f, 173.6281f };
		uParam0->f_3 = 203.6746f;
	}
	else if (gameplay::is_bit_set(Global_69865, 4))
	{
		*uParam0 = { 452.0255f, 5571.85f, 780.1859f };
		uParam0->f_3 = 78.9858f;
	}
	else if (gameplay::is_bit_set(Global_69865, 5))
	{
		*uParam0 = { -745.4462f, 5595.146f, 40.6594f };
		uParam0->f_3 = 261.747f;
	}
	else if (gameplay::is_bit_set(Global_69865, 6))
	{
		*uParam0 = { -1675.521f, -1125.59f, 12.091f };
		uParam0->f_3 = 271.8208f;
	}
	else if (gameplay::is_bit_set(Global_69865, 7))
	{
		*uParam0 = { -1631.219f, -1112.805f, 12.0212f };
		uParam0->f_3 = 316.8879f;
	}
	else if (interior::get_interior_from_entity(player::player_ped_id()) == interior::get_interior_at_coords_with_type(1272.659f, -1715.467f, 53.7715f, "v_lesters"))
	{
		*uParam0 = { 1276.956f, -1725.189f, 53.6551f };
		uParam0->f_3 = 204.1703f;
	}
	else if (entity::is_entity_in_angled_area(player::player_ped_id(), -415.4365f, 2068.289f, 113.3002f, -564.9516f, 1884.703f, 134.0403f, 258.75f, 0, true, 0) || entity::is_entity_in_angled_area(player::player_ped_id(), -596.4706f, 2089.921f, 125.4128f, -581.2134f, 2036.256f, 136.2836f, 9.5f, 0, true, 0))
	{
		*uParam0 = { -601.59f, 2099.197f, 128.8928f };
		uParam0->f_3 = 204.7498f;
	}
	else if (system::vdist(*uParam0, -1007.393f, -477.9584f, 52.5357f) < 8f)
	{
		*uParam0 = { -1018.376f, -483.9436f, 36.0964f };
		uParam0->f_3 = 114.7664f;
	}
	else if (system::vdist(*uParam0, 480.6662f, -1317.808f, 28.20303f) < 15f)
	{
		*uParam0 = { 497.7238f, -1310.932f, 28.2372f };
		uParam0->f_3 = 289.3663f;
	}
	else if (system::vdist(*uParam0, 2329.527f, 2571.311f, 45.6779f) < 5f)
	{
		*uParam0 = { 2316.93f, 2594.153f, 45.7199f };
		uParam0->f_3 = 348.1325f;
	}
	if (iParam1 == 1)
	{
		if (func_104(&iVar0))
		{
			if (func_102(iVar0, &vVar1, &uVar4))
			{
				vVar1.z = (vVar1.y + 1f);
				*uParam0 = { vVar1 };
				uParam0->f_3 = uVar4;
			}
		}
		else if (entity::is_entity_in_angled_area(player::player_ped_id(), 207.4336f, -1019.795f, -100.4728f, 189.9338f, -1019.623f, -95.56883f, 17.1875f, 0, true, 0))
		{
			iVar5 = func_21();
			if (iVar5 == 0)
			{
				*uParam0 = { -65.1234f, 81.2517f, 70.5644f };
				uParam0->f_3 = 71.6237f;
			}
			else if (iVar5 == 1)
			{
				*uParam0 = { -68.5531f, -1824.377f, 25.9424f };
				uParam0->f_3 = 215.8295f;
			}
			else if (iVar5 == 2)
			{
				*uParam0 = { -220.8189f, -1162.302f, 22.0242f };
				uParam0->f_3 = 70.2711f;
			}
		}
		else if (entity::is_entity_in_angled_area(player::player_ped_id(), 483.7175f, -1326.63f, 28.2135f, 474.9644f, -1307.998f, 34.49498f, 12f, 0, true, 0))
		{
			*uParam0 = { 495.4108f, -1306.08f, 29.2883f };
			uParam0->f_3 = 213.6273f;
		}
		else if (entity::is_entity_in_angled_area(player::player_ped_id(), -1146.77f, -1534.22f, 3.37f, -1158.453f, -1517.75f, 6.374244f, 13f, 0, true, 0))
		{
			*uParam0 = { -1160.095f, -1515.407f, 3.1496f };
			uParam0->f_3 = 305.6424f;
		}
		else if (entity::is_entity_in_angled_area(player::player_ped_id(), 439.5432f, -996.9769f, 24.88307f, 428.2935f, -997.0192f, 28.57458f, 8.5f, 0, true, 0))
		{
			*uParam0 = { 431.8853f, -1013.133f, 28.7907f };
			uParam0->f_3 = 186.6814f;
		}
		else if (func_101(*uParam0, "v_hospital", 307.3065f, -589.9595f, 43.302f))
		{
			*uParam0 = { 279.4137f, -585.8815f, 43.2502f };
			uParam0->f_3 = 48.8028f;
		}
	}
}

bool func_101(vector3 vParam0, char* sParam3, vector3 vParam4)//Position - 0x6904
{
	int iVar0;
	int iVar1;
	
	if (!interior::_are_coords_colliding_with_exterior(vParam0))
	{
		iVar0 = interior::get_interior_at_coords_with_type(vParam4, sParam3);
		if (!interior::is_valid_interior(iVar0))
		{
			return false;
		}
		iVar1 = interior::get_interior_from_collision(vParam0);
		if (iVar1 == iVar0)
		{
			return true;
		}
	}
	return false;
}

int func_102(int iParam0, var uParam1, var uParam2)//Position - 0x6948
{
	*uParam1 = { 0f, 0f, 0f };
	*uParam2 = 0f;
	switch (iParam0)
	{
		case 0:
			*uParam1 = { -829.842f, -191.7454f, 36.4386f };
			*uParam2 = 29.5061f;
			break;
		
		case 1:
			*uParam1 = { 129.8484f, -1716.528f, 28.0702f };
			*uParam2 = 50.3483f;
			break;
		
		case 2:
			*uParam1 = { -1296.913f, -1120.999f, 5.3951f };
			*uParam2 = 0.9933f;
			break;
		
		case 3:
			*uParam1 = { 1938.028f, 3718.736f, 31.3154f };
			*uParam2 = 118.2305f;
			break;
		
		case 4:
			*uParam1 = { 1197.866f, -469.3809f, 65.0885f };
			*uParam2 = 346.4477f;
			break;
		
		case 5:
			*uParam1 = { -32.2161f, -135.8212f, 56.0532f };
			*uParam2 = 186.0052f;
			break;
		
		case 6:
			*uParam1 = { -287.7696f, 6238.081f, 30.2902f };
			*uParam2 = 316.1349f;
			break;
		
		case 7:
			*uParam1 = { 99.2876f, -1395.16f, 28.2759f };
			*uParam2 = 320.2739f;
			break;
		
		case 8:
			*uParam1 = { 1679.445f, 4819.056f, 41.0035f };
			*uParam2 = 4.6192f;
			break;
		
		case 9:
			*uParam1 = { 411.3063f, -809.1863f, 28.1554f };
			*uParam2 = 1.8972f;
			break;
		
		case 10:
			*uParam1 = { -1088.054f, 2699.167f, 19.2748f };
			*uParam2 = 129.7382f;
			break;
		
		case 11:
			*uParam1 = { 1194.163f, 2695.644f, 36.9225f };
			*uParam2 = 1.1454f;
			break;
		
		case 12:
			*uParam1 = { -821.2829f, -1088.027f, 10.0499f };
			*uParam2 = 120.5883f;
			break;
		
		case 13:
			*uParam1 = { -3.3416f, 6521.303f, 30.2961f };
			*uParam2 = 316.4451f;
			break;
		
		case 14:
			*uParam1 = { -1208.417f, -785.9635f, 16.0139f };
			*uParam2 = 36.3181f;
			break;
		
		case 15:
			*uParam1 = { 623.1845f, 2739.191f, 40.9588f };
			*uParam2 = 3.5411f;
			break;
		
		case 16:
			*uParam1 = { 130.9555f, -198.2084f, 53.41f };
			*uParam2 = 251.3506f;
			break;
		
		case 17:
			*uParam1 = { -3164.065f, 1067.317f, 19.6778f };
			*uParam2 = 101.2229f;
			break;
		
		case 18:
			*uParam1 = { -713.2797f, -174.2767f, 35.8962f };
			*uParam2 = 29.8138f;
			break;
		
		case 19:
			*uParam1 = { -147.0616f, -306.4322f, 37.7912f };
			*uParam2 = 160.4526f;
			break;
		
		case 20:
			*uParam1 = { -1461.355f, -230.6092f, 48.3064f };
			*uParam2 = 318.7851f;
			break;
		
		case 21:
			*uParam1 = { -1347.739f, -1278.573f, 3.8952f };
			*uParam2 = 17.9365f;
			break;
		
		case 22:
			*uParam1 = { 325.6833f, 164.3263f, 102.4425f };
			*uParam2 = 68.6407f;
			break;
		
		case 23:
			*uParam1 = { 1858.774f, 3742.393f, 32.0779f };
			*uParam2 = 301.2329f;
			break;
		
		case 24:
			*uParam1 = { -286.3272f, 6202.802f, 30.3323f };
			*uParam2 = 225.1334f;
			break;
		
		case 25:
			*uParam1 = { -1161.596f, -1417.7f, 3.712f };
			*uParam2 = 246.9161f;
			break;
		
		case 26:
			*uParam1 = { 1308.952f, -1660.611f, 50.2362f };
			*uParam2 = 163.5456f;
			break;
		
		case 27:
			*uParam1 = { -3161.585f, 1074.214f, 19.6847f };
			*uParam2 = 98.6092f;
			break;
		
		case 28:
			*uParam1 = { 28.423f, -1110.814f, 28.2848f };
			*uParam2 = 85.2495f;
			break;
		
		case 29:
			*uParam1 = { 1704.966f, 3749.709f, 33.0188f };
			*uParam2 = 45.6778f;
			break;
		
		case 30:
			*uParam1 = { 223.949f, -38.7894f, 68.6483f };
			*uParam2 = 159.4265f;
			break;
		
		case 31:
			*uParam1 = { 837.7854f, -1017.963f, 26.3045f };
			*uParam2 = 181.0445f;
			break;
		
		case 32:
			*uParam1 = { -313.1914f, 6093.351f, 30.4625f };
			*uParam2 = 315.8405f;
			break;
		
		case 33:
			*uParam1 = { -663.4631f, -952.8069f, 20.3143f };
			*uParam2 = 92.6796f;
			break;
		
		case 34:
			*uParam1 = { -1323.06f, -392.8577f, 35.4596f };
			*uParam2 = 210.7398f;
			break;
		
		case 35:
			*uParam1 = { -1106.102f, 2684.35f, 18.0953f };
			*uParam2 = 127.0383f;
			break;
		
		case 36:
			*uParam1 = { -3157.932f, 1081.309f, 19.6953f };
			*uParam2 = 100.2942f;
			break;
		
		case 37:
			*uParam1 = { 2562.882f, 312.8641f, 107.4612f };
			*uParam2 = 179.205f;
			break;
		
		case 38:
			*uParam1 = { 822.48f, -2142.875f, 27.8496f };
			*uParam2 = 355.0598f;
			break;
		
		case 39:
			*uParam1 = { -1137.053f, -1993.916f, 12.1677f };
			*uParam2 = 43.1213f;
			break;
		
		case 40:
			*uParam1 = { 717.8107f, -1084.081f, 21.3094f };
			*uParam2 = 93.2649f;
			break;
		
		case 41:
			*uParam1 = { -387.6789f, -128.2568f, 37.6796f };
			*uParam2 = 119.1085f;
			break;
		
		case 42:
			*uParam1 = { 117.8835f, 6599.415f, 31.0134f };
			*uParam2 = 90.7225f;
			break;
		
		case 43:
			*uParam1 = { 1201.709f, 2664.813f, 36.8102f };
			*uParam2 = 133.9002f;
			break;
		
		case 44:
			*uParam1 = { -200.1521f, -1297.502f, 30.296f };
			*uParam2 = 269.0687f;
			break;
		
		case 45:
			*uParam1 = { 0f, 0f, 0f };
			*uParam2 = 0f;
			break;
	}
	return !func_103(*uParam1, 0f, 0f, 0f, 0);
}

int func_103(vector3 vParam0, vector3 vParam3, int iParam6)//Position - 0x6FD7
{
	if (iParam6)
	{
		return (vParam0.x == vParam3.x && vParam0.y == vParam3.y);
	}
	return ((vParam0.x == vParam3.x && vParam0.y == vParam3.y) && vParam0.y == vParam3.y);
}

bool func_104(var uParam0)//Position - 0x701E
{
	if (!entity::is_entity_dead(player::player_ped_id(), 0) && !ped::is_ped_injured(player::player_ped_id()))
	{
		if (func_115())
		{
			*uParam0 = func_110(entity::get_entity_coords(player::player_ped_id(), 0), 6, -1, 0, 1, -1);
			if (func_109(*uParam0) && !func_105(*uParam0))
			{
				return true;
			}
		}
	}
	return false;
}

int func_105(int iParam0)//Position - 0x7079
{
	return func_106(iParam0, 0, 1);
}

int func_106(int iParam0, int iParam1, int iParam2)//Position - 0x7089
{
	if (iParam2)
	{
		return gameplay::is_bit_set(Global_91458.f_1308[iParam0], iParam1);
	}
	else if (network::network_is_game_in_progress())
	{
		if (func_108() == 0)
		{
			return gameplay::is_bit_set(func_86(func_107(iParam0), -1, 0), iParam1);
		}
	}
	else
	{
		return gameplay::is_bit_set(Global_101553.f_668[iParam0], iParam1);
	}
	return false;
}

int func_107(int iParam0)//Position - 0x70E9
{
	switch (iParam0)
	{
		case 0:
			return 820;
			break;
		
		case 1:
			return 821;
			break;
		
		case 2:
			return 822;
			break;
		
		case 3:
			return 823;
			break;
		
		case 4:
			return 824;
			break;
		
		case 5:
			return 825;
			break;
		
		case 6:
			return 826;
			break;
		
		case 7:
			return 827;
			break;
		
		case 8:
			return 828;
			break;
		
		case 9:
			return 829;
			break;
		
		case 10:
			return 830;
			break;
		
		case 11:
			return 831;
			break;
		
		case 12:
			return 832;
			break;
		
		case 13:
			return 833;
			break;
		
		case 14:
			return 834;
			break;
		
		case 15:
			return 836;
			break;
		
		case 16:
			return 837;
			break;
		
		case 17:
			return 838;
			break;
		
		case 18:
			return 839;
			break;
		
		case 19:
			return 840;
			break;
		
		case 20:
			return 841;
			break;
		
		case 21:
			return 842;
			break;
		
		case 22:
			return 843;
			break;
		
		case 23:
			return 844;
			break;
		
		case 24:
			return 845;
			break;
		
		case 25:
			return 846;
			break;
		
		case 26:
			return 847;
			break;
		
		case 27:
			return 848;
			break;
		
		case 28:
			return 849;
			break;
		
		case 29:
			return 850;
			break;
		
		case 30:
			return 851;
			break;
		
		case 31:
			return 852;
			break;
		
		case 32:
			return 853;
			break;
		
		case 33:
			return 854;
			break;
		
		case 34:
			return 855;
			break;
		
		case 35:
			return 856;
			break;
		
		case 36:
			return 857;
			break;
		
		case 37:
			return 858;
			break;
		
		case 38:
			return 859;
			break;
		
		case 39:
			return 860;
			break;
		
		case 40:
			return 864;
			break;
		
		case 41:
			return 865;
			break;
		
		case 42:
			return 866;
			break;
		
		case 43:
			return 867;
			break;
		
		case 44:
			return 4442;
			break;
		
		case 45:
			return 3776;
			break;
		
		default:
			break;
	}
	return 4617;
}

var func_108()//Position - 0x73B0
{
	return Global_25185;
}

int func_109(int iParam0)//Position - 0x73BB
{
	return func_106(iParam0, 5, 1);
}

int func_110(vector3 vParam0, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7)//Position - 0x73CB
{
	int iVar0;
	float fVar1;
	float fVar2;
	int iVar3;
	
	fVar2 = 1000000f;
	iVar3 = -1;
	iVar0 = 0;
	while (iVar0 <= 45)
	{
		if (iParam3 == 6 || iParam3 == func_114(iVar0))
		{
			if (!iParam5 || func_113(iVar0))
			{
				fVar1 = gameplay::get_distance_between_coords(vParam0, func_111(iVar0, 0), 1);
				if (((fVar1 < fVar2 && (fVar1 <= IntToFloat(iParam4) || iParam4 == -1)) && (iParam6 || iVar0 != 21)) && iVar0 != iParam7)
				{
					fVar2 = fVar1;
					iVar3 = iVar0;
				}
			}
		}
		iVar0++;
	}
	return iVar3;
}

Vector3 func_111(int iParam0, int iParam1)//Position - 0x746D
{
	switch (iParam0)
	{
		case -1:
			return 0f, 0f, 0f;
			break;
		
		case 0:
			return -821.9946f, -187.1776f, 36.5689f;
			break;
		
		case 1:
			return 133.5702f, -1710.918f, 28.2916f;
			break;
		
		case 2:
			return -1287.082f, -1116.558f, 5.9901f;
			break;
		
		case 3:
			return 1933.119f, 3726.079f, 31.8444f;
			break;
		
		case 4:
			return 1208.333f, -470.917f, 65.208f;
			break;
		
		case 5:
			return -30.7448f, -148.4921f, 56.0765f;
			break;
		
		case 6:
			return -280.8165f, 6231.771f, 30.6955f;
			break;
		
		case 7:
			return 80.665f, -1391.669f, 28.3761f;
			break;
		
		case 8:
			return 1687.881f, 4820.55f, 41.0096f;
			break;
		
		case 9:
			return 419.531f, -807.5787f, 28.4896f;
			break;
		
		case 10:
			return -1094.049f, 2704.171f, 18.0873f;
			break;
		
		case 11:
			return 1197.972f, 2704.22f, 37.1572f;
			break;
		
		case 12:
			return -818.6218f, -1077.533f, 10.3282f;
			break;
		
		case 13:
			return -0.2361f, 6516.045f, 30.8684f;
			break;
		
		case 14:
			return -1199.809f, -776.6886f, 16.3237f;
			break;
		
		case 15:
			return 618.1857f, 2752.567f, 41.0881f;
			break;
		
		case 16:
			return 126.6853f, -212.5027f, 53.5578f;
			break;
		
		case 17:
			return -3168.966f, 1055.287f, 19.8632f;
			break;
		
		case 18:
			return -715.3598f, -155.7742f, 36.4105f;
			break;
		
		case 19:
			return -158.2199f, -304.9663f, 38.735f;
			break;
		
		case 20:
			return -1455.005f, -233.1862f, 48.7936f;
			break;
		
		case 21:
			return -1335.973f, -1278.555f, 3.8598f;
			break;
		
		case 22:
			return 321.6098f, 179.4165f, 102.5865f;
			break;
		
		case 23:
			return 1861.685f, 3750.08f, 32.0318f;
			break;
		
		case 24:
			return -290.1603f, 6199.095f, 30.4871f;
			break;
		
		case 25:
			return -1153.948f, -1425.019f, 3.9544f;
			break;
		
		case 26:
			return 1322.455f, -1651.125f, 51.1885f;
			break;
		
		case 27:
			return -3169.42f, 1074.727f, 19.8343f;
			break;
		
		case 28:
			return 17.6804f, -1114.288f, 28.797f;
			break;
		
		case 29:
			return 1697.979f, 3753.2f, 33.7053f;
			break;
		
		case 30:
			return 245.2711f, -45.8126f, 68.941f;
			break;
		
		case 31:
			return 844.1248f, -1025.571f, 27.1948f;
			break;
		
		case 32:
			return -325.8904f, 6077.026f, 30.4548f;
			break;
		
		case 33:
			return -664.2178f, -943.3646f, 20.8292f;
			break;
		
		case 34:
			return -1313.948f, -390.9637f, 35.592f;
			break;
		
		case 35:
			return -1111.238f, 2688.463f, 17.6131f;
			break;
		
		case 36:
			return -3165.231f, 1082.855f, 19.8438f;
			break;
		
		case 37:
			return 2569.612f, 302.576f, 107.7349f;
			break;
		
		case 38:
			return 811.8699f, -2149.102f, 28.6363f;
			break;
		
		case 39:
			return -1147.314f, -1992.434f, 12.1803f;
			break;
		
		case 40:
			return 724.524f, -1089.081f, 21.1692f;
			break;
		
		case 41:
			return -354.5272f, -135.4011f, 38.185f;
			break;
		
		case 42:
			return 113.2615f, 6624.28f, 30.7871f;
			break;
		
		case 43:
			return 1174.707f, 2644.45f, 36.7552f;
			break;
		
		case 44:
			if (iParam1)
			{
				return -211.5f, -1324.2f, 30.296f;
			}
			else
			{
				return -205.6654f, -1311.113f, 30.296f;
			}
			break;
		
		case 45:
			return func_112(Global_92918);
			break;
	}
	return 1000000f, 1000000f, 1000000f;
}

Vector3 func_112(int iParam0)//Position - 0x7987
{
	switch (iParam0)
	{
		case 1:
			return 1060f, -2990f, -35f;
			break;
		
		case 2:
			return 1060f, -2990f, -35f;
			break;
		
		case 3:
			return 1060f, -2990f, -35f;
			break;
		
		case 4:
			return 1102.515f, -3158.888f, -38.5186f;
			break;
		
		case 5:
			return 1005.861f, -3156.162f, -39.907f;
			break;
		
		default:
			return 0f, 0f, -200f;
			break;
	}
	return 0f, 0f, -200f;
}

int func_113(int iParam0)//Position - 0x7A31
{
	return func_106(iParam0, 0, 0);
}

int func_114(int iParam0)//Position - 0x7A41
{
	switch (iParam0)
	{
		case -1:
			return 6;
			break;
		
		case 0:
			return 0;
			break;
		
		case 1:
			return 0;
			break;
		
		case 2:
			return 0;
			break;
		
		case 3:
			return 0;
			break;
		
		case 4:
			return 0;
			break;
		
		case 5:
			return 0;
			break;
		
		case 6:
			return 0;
			break;
		
		case 7:
			return 1;
			break;
		
		case 8:
			return 1;
			break;
		
		case 9:
			return 1;
			break;
		
		case 10:
			return 1;
			break;
		
		case 11:
			return 1;
			break;
		
		case 12:
			return 1;
			break;
		
		case 13:
			return 1;
			break;
		
		case 14:
			return 1;
			break;
		
		case 15:
			return 1;
			break;
		
		case 16:
			return 1;
			break;
		
		case 17:
			return 1;
			break;
		
		case 18:
			return 1;
			break;
		
		case 19:
			return 1;
			break;
		
		case 20:
			return 1;
			break;
		
		case 21:
			return 1;
			break;
		
		case 22:
			return 2;
			break;
		
		case 23:
			return 2;
			break;
		
		case 24:
			return 2;
			break;
		
		case 25:
			return 2;
			break;
		
		case 26:
			return 2;
			break;
		
		case 27:
			return 2;
			break;
		
		case 28:
			return 3;
			break;
		
		case 29:
			return 3;
			break;
		
		case 30:
			return 3;
			break;
		
		case 31:
			return 3;
			break;
		
		case 32:
			return 3;
			break;
		
		case 33:
			return 3;
			break;
		
		case 34:
			return 3;
			break;
		
		case 35:
			return 3;
			break;
		
		case 36:
			return 3;
			break;
		
		case 37:
			return 3;
			break;
		
		case 38:
			return 3;
			break;
		
		case 39:
			return 4;
			break;
		
		case 40:
			return 4;
			break;
		
		case 41:
			return 4;
			break;
		
		case 42:
			return 4;
			break;
		
		case 43:
			return 4;
			break;
		
		case 44:
			return 4;
			break;
		
		case 45:
			return 5;
			break;
	}
	return 6;
}

int func_115()//Position - 0x7CB4
{
	return Global_91458.f_303 > 0;
}

int func_116(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4)//Position - 0x7CC5
{
	int iVar0;
	
	if (iParam1 == 7)
	{
		return 0;
	}
	if (!iParam3)
	{
		if (Global_89217.f_44 == 1)
		{
			return 2;
		}
	}
	if (iParam1 == 0)
	{
		if (func_26(0))
		{
			return 0;
		}
		Global_35739++;
		*iParam0 = Global_35739;
		player::set_player_invincible(player::get_player_index(), 0);
		Global_17151.f_5 = 0;
		if (iParam2 != 5)
		{
			player::force_cleanup(8);
		}
		Global_35775 = iParam2;
		Global_35737 = *iParam0;
		Global_35738 = iParam4;
		Global_35736 = 0;
		return 1;
	}
	if (*iParam0 != -1)
	{
		if (Global_35736 > 0)
		{
			iVar0 = 0;
			iVar0 = 0;
			while (iVar0 < Global_35736)
			{
				if (Global_35742[iVar0 /*4*/] == *iParam0)
				{
					return 2;
				}
				iVar0++;
			}
		}
		else if (Global_35737 == *iParam0)
		{
			return 1;
		}
		*iParam0 = -1;
	}
	if (*iParam0 == -1)
	{
		if (!func_27(iParam2))
		{
			return 0;
		}
		if (Global_35736 == 8)
		{
			return 0;
		}
		Global_35739++;
		*iParam0 = Global_35739;
		Global_35742[Global_35736 /*4*/] = Global_35739;
		Global_35742[Global_35736 /*4*/].f_1 = iParam1;
		Global_35742[Global_35736 /*4*/].f_2 = iParam2;
		Global_35742[Global_35736 /*4*/].f_3 = 0;
		Global_35736++;
		if (iParam4 != 0)
		{
			func_117(iParam0, iParam4);
		}
	}
	return 2;
}

void func_117(var uParam0, int iParam1)//Position - 0x7DFC
{
	int iVar0;
	
	if (Global_35736 == 0)
	{
		return;
	}
	if (*uParam0 == -1)
	{
		return;
	}
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < Global_35736)
	{
		if (Global_35742[iVar0 /*4*/] == *uParam0)
		{
			Global_35742[iVar0 /*4*/].f_3 = iParam1;
		}
		iVar0++;
	}
	*uParam0 = -1;
}

void func_118(int iParam0, vector3 vParam1, float fParam4, int iParam5, int iParam6)//Position - 0x7E4B
{
	struct<60> Var0;
	
	if (entity::does_entity_exist(iParam0) && vehicle::is_vehicle_driveable(iParam0, 0))
	{
		if (iParam5 != 24 && iParam5 != 25)
		{
			return;
		}
		if (iParam5 == 24)
		{
			if (entity::does_entity_exist(Global_68446.f_484[25]) && vehicle::is_vehicle_driveable(Global_68446.f_484[25], 0))
			{
				if (Global_68446.f_484[25] == iParam0)
				{
					return;
				}
			}
		}
		if (!iParam6)
		{
			if ((vehicle::is_big_vehicle(iParam0) || entity::get_entity_model(iParam0) == joaat("bus")) || entity::get_entity_model(iParam0) == joaat("tourbus"))
			{
				return;
			}
		}
		func_142(iParam5);
		Var0.f_9 = 49;
		Var0.f_59 = 2;
		func_14(iParam0, &Var0);
		if (func_103(vParam1, 0f, 0f, 0f, 0))
		{
			vParam1 = { entity::get_entity_coords(iParam0, 1) };
			fParam4 = entity::get_entity_heading(iParam0);
		}
		if (iParam5 == 24)
		{
			if (gameplay::get_hash_key(script::get_this_script_name()) != joaat("vehicle_gen_controller"))
			{
				Global_69434 = gameplay::get_hash_key(script::get_this_script_name());
			}
		}
		func_136(iParam5, &Var0, vParam1, fParam4, func_9(iParam0));
		func_119(iParam5, iParam0, 0);
	}
}

void func_119(int iParam0, int iParam1, int iParam2)//Position - 0x7F74
{
	int iVar0;
	
	if (iParam0 == -1)
	{
		return;
	}
	if (!func_135(&(Global_68446.f_555[0 /*21*/]), iParam0))
	{
		return;
	}
	if (!gameplay::is_bit_set(Global_68446.f_555[0 /*21*/].f_9, 12) && !gameplay::is_bit_set(Global_68446.f_555[0 /*21*/].f_9, 10))
	{
		if (Global_68446.f_555[0 /*21*/].f_4 != entity::get_entity_model(iParam1))
		{
			return;
		}
	}
	if (Global_69353 != -1 && Global_69353 != iParam0)
	{
		return;
	}
	if (entity::does_entity_exist(iParam1))
	{
		if (vehicle::is_vehicle_driveable(iParam1, 0))
		{
			if (!entity::is_entity_a_mission_entity(iParam1))
			{
				entity::set_entity_as_mission_entity(iParam1, true, 1);
			}
			if (iParam0 == 24)
			{
				Global_101553.f_18972.f_4801 = func_51();
			}
			if (iParam1 != Global_68446.f_139[iParam0])
			{
				if (iParam0 == 24)
				{
					iVar0 = func_134(iParam0);
					if ((entity::does_entity_exist(iVar0) && vehicle::is_vehicle_driveable(iVar0, 0)) && iParam1 != iVar0)
					{
						func_120(iVar0, 145);
					}
				}
				Global_69352 = iParam1;
				Global_69353 = iParam0;
				Global_69354 = iParam2;
			}
		}
	}
}

void func_120(int iParam0, int iParam1)//Position - 0x8091
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	if (!func_121(iParam0))
	{
		return;
	}
	if ((iParam1 != 0 && iParam1 != 1) && iParam1 != 2)
	{
		iVar0 = vehicle::get_ped_in_vehicle_seat(iParam0, -1, 0);
		if (!entity::does_entity_exist(iVar0))
		{
			iVar0 = vehicle::get_last_ped_in_vehicle_seat(iParam0, -1);
		}
		if (entity::does_entity_exist(iVar0) && !ped::is_ped_injured(iVar0))
		{
			if (entity::get_entity_model(iVar0) == joaat("player_zero"))
			{
				iParam1 = 0;
			}
			else if (entity::get_entity_model(iVar0) == joaat("player_one"))
			{
				iParam1 = 1;
			}
			else if (entity::get_entity_model(iVar0) == joaat("player_two"))
			{
				iParam1 = 2;
			}
		}
		if ((iParam1 != 0 && iParam1 != 1) && iParam1 != 2)
		{
			iParam1 = Global_101553.f_1991.f_539.f_3549;
		}
	}
	iVar1 = 0;
	while (iVar1 < 3)
	{
		iVar2 = 0;
		while (iVar2 < 2)
		{
			if (entity::get_entity_model(iParam0) == Global_101553.f_18972.f_5038[iVar1 /*157*/][iVar2 /*78*/].f_66)
			{
				if (!gameplay::is_string_null_or_empty(&(Global_101553.f_18972.f_5038[iVar1 /*157*/][iVar2 /*78*/].f_1)))
				{
					if (gameplay::are_strings_equal(vehicle::get_vehicle_number_plate_text(iParam0), &(Global_101553.f_18972.f_5038[iVar1 /*157*/][iVar2 /*78*/].f_1)))
					{
						Global_101553.f_18972.f_5038[iVar1 /*157*/][iVar2 /*78*/].f_66 = 0;
						Global_101553.f_18972.f_5592[iVar1] = iVar2;
					}
				}
			}
			iVar2++;
		}
		iVar1++;
	}
	iVar1 = 0;
	while (iVar1 < 3)
	{
		if (entity::get_entity_model(iParam0) == Global_101553.f_18972.f_5600[iVar1 /*78*/].f_66)
		{
			if (!gameplay::is_string_null_or_empty(&(Global_101553.f_18972.f_5600[iVar1 /*78*/].f_1)))
			{
				if (gameplay::are_strings_equal(vehicle::get_vehicle_number_plate_text(iParam0), &(Global_101553.f_18972.f_5600[iVar1 /*78*/].f_1)))
				{
					Global_101553.f_18972.f_5600[iVar1 /*78*/].f_66 = 0;
				}
			}
		}
		iVar1++;
	}
	Global_101553.f_18972.f_5590 = iParam1;
	Global_69351 = iParam0;
	Global_101553.f_18972.f_5588 = 1;
	func_14(iParam0, &(Global_101553.f_18972.f_5510));
}

bool func_121(int iParam0)//Position - 0x8293
{
	if ((((((((((!entity::does_entity_exist(iParam0) || !vehicle::is_vehicle_driveable(iParam0, 0)) || func_19(iParam0, 0, 0)) || func_19(iParam0, 1, 0)) || func_19(iParam0, 2, 0)) || func_9(iParam0) != 145) || func_133(iParam0)) || func_132(iParam0)) || func_131(iParam0)) || func_130(iParam0)) || !func_122(entity::get_entity_model(iParam0)))
	{
		if (func_132(iParam0))
		{
		}
		if (func_132(iParam0))
		{
		}
		if (func_19(iParam0, 0, 0))
		{
		}
		if (func_19(iParam0, 1, 0))
		{
		}
		if (func_19(iParam0, 2, 0))
		{
		}
		if (func_9(iParam0) != 145)
		{
		}
		return false;
	}
	return true;
}

bool func_122(int iParam0)//Position - 0x8370
{
	if (iParam0 == 0)
	{
		return false;
	}
	if (!func_123(iParam0, 0))
	{
		return false;
	}
	if (((vehicle::is_this_model_a_boat(iParam0) || vehicle::is_this_model_a_plane(iParam0)) || vehicle::is_this_model_a_heli(iParam0)) || vehicle::is_this_model_a_train(iParam0))
	{
		return false;
	}
	switch (iParam0)
	{
		case joaat("bus"):
		case joaat("stretch"):
		case joaat("barracks"):
		case joaat("armytanker"):
		case joaat("rhino"):
		case joaat("armytrailer"):
		case joaat("barracks2"):
		case joaat("flatbed"):
		case joaat("ripley"):
		case joaat("towtruck"):
		case joaat("towtruck2"):
		case joaat("airbus"):
		case joaat("coach"):
		case joaat("rentalbus"):
		case joaat("tourbus"):
		case 1938952078:
		case joaat("pbus"):
		case joaat("trash"):
		case joaat("benson"):
		case joaat("boattrailer"):
		case joaat("biff"):
		case joaat("hauler"):
		case joaat("docktrailer"):
		case joaat("phantom"):
		case joaat("pounder"):
		case joaat("tractor2"):
		case joaat("bulldozer"):
		case joaat("handler"):
		case joaat("tiptruck"):
		case joaat("cutter"):
		case joaat("dump"):
		case joaat("mixer"):
		case joaat("mixer2"):
		case joaat("rubble"):
		case joaat("scrap"):
		case joaat("tiptruck2"):
		case joaat("camper"):
		case joaat("taco"):
		case joaat("boxville"):
		case joaat("boxville2"):
		case joaat("boxville3"):
		case joaat("journey"):
		case joaat("mule"):
		case joaat("mule2"):
		case joaat("police"):
		case joaat("police2"):
		case joaat("police3"):
		case joaat("police4"):
		case joaat("policeb"):
		case joaat("policeold1"):
		case joaat("policeold2"):
		case joaat("policet"):
		case joaat("taxi"):
		case joaat("submersible"):
		case joaat("submersible2"):
		case joaat("monster"):
			return false;
			break;
	}
	return true;
}

bool func_123(int iParam0, int iParam1)//Position - 0x8521
{
	int iVar0;
	struct<2> Var1;
	
	if (iParam0 == 0)
	{
		return false;
	}
	if (!streaming::is_model_a_vehicle(iParam0))
	{
		return false;
	}
	if ((((((((((((iParam0 == joaat("dodo") || iParam0 == joaat("dukes")) || iParam0 == joaat("dukes2")) || (iParam0 == joaat("dominator2") && !network::network_is_game_in_progress())) || (iParam0 == joaat("buffalo3") && !network::network_is_game_in_progress())) || (iParam0 == joaat("gauntlet2") && !network::network_is_game_in_progress())) || iParam0 == joaat("blimp2")) || iParam0 == joaat("stalion")) || (iParam0 == joaat("stalion2") && !network::network_is_game_in_progress())) || iParam0 == joaat("submersible2")) || iParam0 == joaat("marshall")) || iParam0 == joaat("blista2")) || iParam0 == joaat("blista3"))
	{
		if (!func_129())
		{
			return false;
		}
	}
	else
	{
		iVar0 = 0;
		while (iVar0 < dlc1::get_num_dlc_vehicles())
		{
			if (dlc1::get_dlc_vehicle_data(iVar0, &Var1))
			{
				if (iParam0 == Var1.f_1)
				{
					if (dlc1::_is_dlc_data_empty(Var1))
					{
						return false;
					}
				}
			}
			iVar0++;
		}
	}
	if (iParam0 == joaat("blimp"))
	{
		if ((((!func_128() && !func_127()) && !func_126()) && !func_125()) && !func_129())
		{
			return false;
		}
	}
	if ((iParam0 == joaat("hotknife") || iParam0 == joaat("carbonrs")) || iParam0 == joaat("khamelion"))
	{
		if ((gameplay::is_durango_version() || gameplay::is_pc_version()) || gameplay::is_orbis_version())
		{
		}
		else if (!func_126())
		{
			return false;
		}
	}
	if (iParam1)
	{
		if (!func_124(iParam0))
		{
			return false;
		}
	}
	return true;
}

int func_124(int iParam0)//Position - 0x8703
{
	int iVar0;
	int iVar1;
	
	if (Global_2471234)
	{
		return 1;
	}
	iVar0 = 1;
	iVar1 = network::_get_posix_time();
	if (iParam0 == joaat("btype3"))
	{
		if ((!Global_262145.f_5415 && !Global_262145.f_11342) && iVar1 < Global_262145.f_11343)
		{
			iVar0 = 0;
		}
	}
	if (iParam0 == joaat("faction3"))
	{
		if (!Global_262145.f_12154 && iVar1 < Global_262145.f_12166)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("virgo3") || iParam0 == joaat("virgo2"))
	{
		if (!Global_262145.f_12150 && iVar1 < Global_262145.f_12162)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("sabregt2"))
	{
		if (!Global_262145.f_12151 && iVar1 < Global_262145.f_12163)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("tornado5"))
	{
		if (!Global_262145.f_12152 && iVar1 < Global_262145.f_12164)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("minivan2"))
	{
		if (!Global_262145.f_12153 && iVar1 < Global_262145.f_12165)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("slamvan3"))
	{
		if (!Global_262145.f_12155 && iVar1 < Global_262145.f_12167)
		{
			iVar0 = 0;
		}
	}
	if (iParam0 == joaat("prototipo"))
	{
		if (!Global_262145.f_12156 && iVar1 < Global_262145.f_12159)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("seven70"))
	{
		if (!Global_262145.f_12157 && iVar1 < Global_262145.f_12160)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("pfister811"))
	{
		if (!Global_262145.f_12158 && iVar1 < Global_262145.f_12161)
		{
			iVar0 = 0;
		}
	}
	if (iParam0 == joaat("bf400"))
	{
		if (!Global_262145.f_14731 && iVar1 < Global_262145.f_14696)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("brioso"))
	{
		if (!Global_262145.f_14726 && iVar1 < Global_262145.f_14691)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("cliffhanger"))
	{
		if (!Global_262145.f_14730 && iVar1 < Global_262145.f_14695)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("contender"))
	{
		if (!Global_262145.f_14729 && iVar1 < Global_262145.f_14694)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("le7b"))
	{
		if (!Global_262145.f_14723 && iVar1 < Global_262145.f_14688)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("omnis"))
	{
		if (!Global_262145.f_14724 && iVar1 < Global_262145.f_14689)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("trophytruck"))
	{
		if (!Global_262145.f_14727 && iVar1 < Global_262145.f_14692)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("trophytruck2"))
	{
		if (!Global_262145.f_14728 && iVar1 < Global_262145.f_14693)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("tropos"))
	{
		if (!Global_262145.f_14725 && iVar1 < Global_262145.f_14690)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("gargoyle"))
	{
		if (!Global_262145.f_14733 && iVar1 < Global_262145.f_14698)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("rallytruck"))
	{
		if (!Global_262145.f_14734 && iVar1 < Global_262145.f_14699)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("tampa2"))
	{
		if (!Global_262145.f_14722 && iVar1 < Global_262145.f_14687)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("tyrus"))
	{
		if (!Global_262145.f_14721 && iVar1 < Global_262145.f_14686)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("sheava"))
	{
		if (!Global_262145.f_14720 && iVar1 < Global_262145.f_14685)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("lynx"))
	{
		if (!Global_262145.f_14732 && iVar1 < Global_262145.f_14697)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("stalion2"))
	{
		if (!Global_262145.f_14735 && iVar1 < Global_262145.f_14700)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("gauntlet2"))
	{
		if (!Global_262145.f_14736 && iVar1 < Global_262145.f_14701)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("dominator2"))
	{
		if (!Global_262145.f_14737 && iVar1 < Global_262145.f_14702)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("buffalo3"))
	{
		if (!Global_262145.f_14738 && iVar1 < Global_262145.f_14703)
		{
			iVar0 = 0;
		}
	}
	if (iParam0 == joaat("defiler"))
	{
		if (!Global_262145.f_14884 && iVar1 < Global_262145.f_14906)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("nightblade"))
	{
		if (!Global_262145.f_14885 && iVar1 < Global_262145.f_14907)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("zombiea"))
	{
		if (!Global_262145.f_14886 && iVar1 < Global_262145.f_14908)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("esskey"))
	{
		if (!Global_262145.f_14888 && iVar1 < Global_262145.f_14909)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("avarus"))
	{
		if (!Global_262145.f_14889 && iVar1 < Global_262145.f_14910)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("zombieb"))
	{
		if (!Global_262145.f_14890 && iVar1 < Global_262145.f_14911)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("hakuchou2"))
	{
		if (!Global_262145.f_14891 && iVar1 < Global_262145.f_14912)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("vortex"))
	{
		if (!Global_262145.f_14892 && iVar1 < Global_262145.f_14913)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("shotaro"))
	{
		if (!Global_262145.f_14893 && iVar1 < Global_262145.f_14914)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("chimera"))
	{
		if (!Global_262145.f_14894 && iVar1 < Global_262145.f_14915)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("raptor"))
	{
		if (!Global_262145.f_14895 && iVar1 < Global_262145.f_14916)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("daemon2"))
	{
		if (!Global_262145.f_14896 && iVar1 < Global_262145.f_14917)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("blazer4"))
	{
		if (!Global_262145.f_14897 && iVar1 < Global_262145.f_14918)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("tornado6"))
	{
		if (!Global_262145.f_14903 && iVar1 < Global_262145.f_14925)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("youga2"))
	{
		if (!Global_262145.f_14900 && iVar1 < Global_262145.f_14921)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("wolfsbane"))
	{
		if (!Global_262145.f_14901 && iVar1 < Global_262145.f_14922)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("faggio3"))
	{
		if (!Global_262145.f_14902 && iVar1 < Global_262145.f_14923)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("faggio"))
	{
		if (!Global_262145.f_14887 && iVar1 < Global_262145.f_14924)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("bagger"))
	{
		if (!Global_262145.f_14904 && iVar1 < Global_262145.f_14926)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("sanctus"))
	{
		if (!Global_262145.f_14898 && iVar1 < Global_262145.f_14919)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("manchez"))
	{
		if (!Global_262145.f_14899 && iVar1 < Global_262145.f_14920)
		{
			iVar0 = 0;
		}
	}
	else if (iParam0 == joaat("ratbike"))
	{
		if (!Global_262145.f_14905 && iVar1 < Global_262145.f_14927)
		{
			iVar0 = 0;
		}
	}
	return iVar0;
}

bool func_125()//Position - 0x8F8A
{
	return false;
}

bool func_126()//Position - 0x8F93
{
	return true;
}

bool func_127()//Position - 0x8F9C
{
	return true;
}

bool func_128()//Position - 0x8FA5
{
	if (dlc2::is_dlc_present(-1226939934))
	{
		return true;
	}
	return false;
}

bool func_129()//Position - 0x8FBE
{
	int iVar0;
	
	if (network::network_is_signed_in())
	{
		if (network::_network_are_ros_available())
		{
			if (network::_0x593570C289A77688())
			{
				stats::stat_get_int(joaat("sp_unlock_exclus_content"), &iVar0, -1);
				gameplay::set_bit(&iVar0, 2);
				gameplay::set_bit(&iVar0, 4);
				gameplay::set_bit(&iVar0, 6);
				gameplay::set_bit(&Global_25, 2);
				gameplay::set_bit(&Global_25, 4);
				gameplay::set_bit(&Global_25, 6);
				stats::stat_set_int(joaat("sp_unlock_exclus_content"), iVar0, 1);
				if (gameplay::_0x5AA3BEFA29F03AD4())
				{
					iVar0 = gameplay::get_profile_setting(866);
					gameplay::set_bit(&iVar0, 0);
					stats::_0xDAC073C7901F9E15(iVar0);
				}
				return true;
			}
		}
	}
	if (Global_138925 == 2)
	{
		return true;
	}
	else if (Global_138925 == 3)
	{
		return false;
	}
	if (gameplay::_0x5AA3BEFA29F03AD4())
	{
		if (gameplay::is_bit_set(gameplay::get_profile_setting(866), 0))
		{
			return true;
		}
	}
	return false;
}

bool func_130(int iParam0)//Position - 0x9079
{
	int iVar0;
	char* sVar1;
	
	iVar0 = entity::get_entity_model(iParam0);
	sVar1 = vehicle::get_vehicle_number_plate_text(iParam0);
	if (iVar0 == joaat("speedo") && gameplay::are_strings_equal(sVar1, "LAMAR G "))
	{
		return true;
	}
	if (!func_123(iVar0, 0))
	{
		return true;
	}
	return false;
}

bool func_131(int iParam0)//Position - 0x90BF
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < 3)
	{
		if (entity::does_entity_exist(Global_89100[iVar0]))
		{
			if (Global_89100[iVar0] == iParam0)
			{
				return true;
			}
		}
		iVar0++;
	}
	return false;
}

bool func_132(int iParam0)//Position - 0x90FA
{
	int iVar0;
	
	if (entity::does_entity_exist(iParam0) && vehicle::is_vehicle_driveable(iParam0, 0))
	{
		iVar0 = 0;
		while (iVar0 < 9)
		{
			if (entity::does_entity_exist(Global_89070[iVar0]) && vehicle::is_vehicle_driveable(Global_89070[iVar0], 0))
			{
				if (Global_89070[iVar0] == iParam0 && entity::get_entity_model(Global_89070[iVar0]) == entity::get_entity_model(iParam0))
				{
					return true;
				}
			}
			iVar0++;
		}
	}
	return false;
}

bool func_133(int iParam0)//Position - 0x9176
{
	int iVar0;
	
	if (entity::does_entity_exist(Global_68446.f_484[24]))
	{
		if (iParam0 == Global_68446.f_484[24])
		{
			return false;
		}
	}
	iVar0 = 0;
	while (iVar0 < 68)
	{
		if (entity::does_entity_exist(Global_68446.f_484[iVar0]))
		{
			if ((((((((((((iVar0 != 24 && iVar0 != 21) && iVar0 != 22) && iVar0 != 23) && iVar0 != 27) && iVar0 != 30) && iVar0 != 33) && iVar0 != 28) && iVar0 != 31) && iVar0 != 34) && iVar0 != 26) && iVar0 != 29) && iVar0 != 32)
			{
				if (iParam0 == Global_68446.f_484[iVar0])
				{
					return true;
				}
			}
		}
		iVar0++;
	}
	return false;
}

int func_134(int iParam0)//Position - 0x925E
{
	if (iParam0 == -1)
	{
		return 0;
	}
	return Global_68446.f_139[iParam0];
}

int func_135(var uParam0, int iParam1)//Position - 0x927A
{
	int iVar0;
	int iVar1;
	
	*uParam0 = { 0f, 0f, 0f };
	uParam0->f_3 = 0f;
	uParam0->f_4 = 0;
	StringCopy(&(uParam0->f_5), "", 16);
	uParam0->f_9 = 0;
	uParam0->f_10 = 0;
	uParam0->f_11 = 0;
	uParam0->f_12 = 145;
	uParam0->f_13 = -1;
	uParam0->f_14 = 0;
	uParam0->f_15 = { 0f, 0f, 0f };
	uParam0->f_18 = { 0f, 0f, 0f };
	switch (iParam1)
	{
		case 0:
			*uParam0 = { -831.8538f, 172.1154f, 69.9058f };
			uParam0->f_3 = 157.5705f;
			uParam0->f_4 = func_11(0, 1);
			uParam0->f_12 = 0;
			gameplay::set_bit(&(uParam0->f_9), 20);
			gameplay::set_bit(&(uParam0->f_9), 7);
			iVar0 = 1;
			break;
		
		case 1:
			*uParam0 = { 1970.943f, 3801.684f, 31.1396f };
			uParam0->f_3 = 301.3964f;
			uParam0->f_4 = func_11(0, 1);
			uParam0->f_12 = 0;
			gameplay::set_bit(&(uParam0->f_9), 20);
			gameplay::set_bit(&(uParam0->f_9), 7);
			iVar0 = 1;
			break;
		
		case 2:
			*uParam0 = { -22.6297f, -1439.137f, 29.6549f };
			uParam0->f_3 = 180.0808f;
			uParam0->f_4 = func_11(1, 1);
			uParam0->f_12 = 1;
			gameplay::set_bit(&(uParam0->f_9), 20);
			gameplay::set_bit(&(uParam0->f_9), 7);
			iVar0 = 1;
			break;
		
		case 3:
			*uParam0 = { -22.5229f, -1434.699f, 29.6552f };
			uParam0->f_3 = 141.6114f;
			uParam0->f_4 = func_11(1, 2);
			uParam0->f_12 = 1;
			gameplay::set_bit(&(uParam0->f_9), 19);
			gameplay::set_bit(&(uParam0->f_9), 7);
			iVar0 = 1;
			break;
		
		case 4:
			*uParam0 = { 10.9281f, 545.669f, 174.7951f };
			uParam0->f_3 = 61.392f;
			uParam0->f_4 = func_11(1, 1);
			uParam0->f_12 = 1;
			gameplay::set_bit(&(uParam0->f_9), 20);
			gameplay::set_bit(&(uParam0->f_9), 7);
			iVar0 = 1;
			break;
		
		case 5:
			*uParam0 = { 6.1093f, 544.9742f, 174.2835f };
			uParam0->f_3 = 92.1548f;
			uParam0->f_4 = func_11(1, 2);
			uParam0->f_12 = 1;
			gameplay::set_bit(&(uParam0->f_9), 19);
			gameplay::set_bit(&(uParam0->f_9), 7);
			iVar0 = 1;
			break;
		
		case 6:
			*uParam0 = { 1981.416f, 3808.131f, 31.1384f };
			uParam0->f_3 = 117.2557f;
			uParam0->f_4 = func_11(2, 1);
			uParam0->f_12 = 2;
			gameplay::set_bit(&(uParam0->f_9), 20);
			gameplay::set_bit(&(uParam0->f_9), 7);
			iVar0 = 1;
			break;
		
		case 7:
			*uParam0 = { -1158.488f, -1529.367f, 3.8995f };
			uParam0->f_3 = 35.7505f;
			uParam0->f_4 = func_11(2, 1);
			uParam0->f_12 = 2;
			gameplay::set_bit(&(uParam0->f_9), 20);
			gameplay::set_bit(&(uParam0->f_9), 7);
			iVar0 = 1;
			break;
		
		case 8:
			*uParam0 = { 148.2868f, -1270.569f, 28.2252f };
			uParam0->f_3 = 208.4685f;
			uParam0->f_4 = func_11(2, 1);
			uParam0->f_12 = 2;
			gameplay::set_bit(&(uParam0->f_9), 20);
			gameplay::set_bit(&(uParam0->f_9), 7);
			iVar0 = 1;
			break;
		
		case 9:
			*uParam0 = { 1459.509f, -1380.45f, 78.3259f };
			uParam0->f_3 = 99.6211f;
			uParam0->f_4 = joaat("scorcher");
			gameplay::set_bit(&(uParam0->f_9), 6);
			iVar0 = 1;
			break;
		
		case 10:
			*uParam0 = { -1518.947f, -1387.865f, -0.5134f };
			uParam0->f_3 = 98.3867f;
			uParam0->f_4 = joaat("seashark");
			iVar0 = 1;
			gameplay::set_bit(&(uParam0->f_9), 6);
			break;
		
		case 11:
			*uParam0 = { 353.0926f, 3577.593f, 32.351f };
			uParam0->f_3 = 16.6205f;
			uParam0->f_4 = joaat("duster");
			iVar0 = 1;
			gameplay::set_bit(&(uParam0->f_9), 6);
			break;
		
		case 12:
			uParam0->f_14 = 0;
			*uParam0 = { -1652.004f, -3142.348f, 12.9921f };
			uParam0->f_3 = 329.1082f;
			uParam0->f_12 = 0;
			uParam0->f_13 = 359;
			gameplay::set_bit(&(uParam0->f_9), 0);
			gameplay::set_bit(&(uParam0->f_9), 21);
			gameplay::set_bit(&(uParam0->f_9), 14);
			gameplay::set_bit(&(uParam0->f_9), 7);
			gameplay::set_bit(&(uParam0->f_9), 10);
			gameplay::set_bit(&(uParam0->f_9), 12);
			gameplay::set_bit(&(uParam0->f_9), 28);
			iVar0 = 1;
			break;
		
		case 13:
			uParam0->f_14 = 1;
			*uParam0 = { -1271.649f, -3380.685f, 12.9451f };
			uParam0->f_3 = 329.5137f;
			uParam0->f_12 = 1;
			uParam0->f_13 = 359;
			gameplay::set_bit(&(uParam0->f_9), 0);
			gameplay::set_bit(&(uParam0->f_9), 21);
			gameplay::set_bit(&(uParam0->f_9), 14);
			gameplay::set_bit(&(uParam0->f_9), 7);
			gameplay::set_bit(&(uParam0->f_9), 10);
			gameplay::set_bit(&(uParam0->f_9), 12);
			gameplay::set_bit(&(uParam0->f_9), 28);
			iVar0 = 1;
			break;
		
		case 14:
			uParam0->f_14 = 2;
			*uParam0 = { 1735.586f, 3294.531f, 40.1651f };
			uParam0->f_3 = 194.9525f;
			uParam0->f_12 = 2;
			uParam0->f_13 = 359;
			gameplay::set_bit(&(uParam0->f_9), 0);
			gameplay::set_bit(&(uParam0->f_9), 21);
			gameplay::set_bit(&(uParam0->f_9), 14);
			gameplay::set_bit(&(uParam0->f_9), 7);
			gameplay::set_bit(&(uParam0->f_9), 10);
			gameplay::set_bit(&(uParam0->f_9), 12);
			gameplay::set_bit(&(uParam0->f_9), 28);
			iVar0 = 1;
			break;
		
		case 15:
			uParam0->f_14 = 3;
			*uParam0 = { -846.27f, -1363.19f, 0.22f };
			uParam0->f_3 = 108.78f;
			uParam0->f_12 = 0;
			uParam0->f_13 = 356;
			gameplay::set_bit(&(uParam0->f_9), 0);
			gameplay::set_bit(&(uParam0->f_9), 21);
			gameplay::set_bit(&(uParam0->f_9), 14);
			gameplay::set_bit(&(uParam0->f_9), 7);
			gameplay::set_bit(&(uParam0->f_9), 10);
			gameplay::set_bit(&(uParam0->f_9), 12);
			gameplay::set_bit(&(uParam0->f_9), 22);
			gameplay::set_bit(&(uParam0->f_9), 28);
			iVar0 = 1;
			break;
		
		case 16:
			uParam0->f_14 = 4;
			*uParam0 = { -849.47f, -1354.99f, 0.24f };
			uParam0->f_3 = 109.84f;
			uParam0->f_12 = 1;
			uParam0->f_13 = 356;
			gameplay::set_bit(&(uParam0->f_9), 0);
			gameplay::set_bit(&(uParam0->f_9), 21);
			gameplay::set_bit(&(uParam0->f_9), 14);
			gameplay::set_bit(&(uParam0->f_9), 7);
			gameplay::set_bit(&(uParam0->f_9), 10);
			gameplay::set_bit(&(uParam0->f_9), 12);
			gameplay::set_bit(&(uParam0->f_9), 22);
			gameplay::set_bit(&(uParam0->f_9), 28);
			iVar0 = 1;
			break;
		
		case 17:
			uParam0->f_14 = 5;
			*uParam0 = { -852.47f, -1346.2f, 0.21f };
			uParam0->f_3 = 108.76f;
			uParam0->f_12 = 2;
			uParam0->f_13 = 356;
			gameplay::set_bit(&(uParam0->f_9), 0);
			gameplay::set_bit(&(uParam0->f_9), 21);
			gameplay::set_bit(&(uParam0->f_9), 14);
			gameplay::set_bit(&(uParam0->f_9), 7);
			gameplay::set_bit(&(uParam0->f_9), 10);
			gameplay::set_bit(&(uParam0->f_9), 12);
			gameplay::set_bit(&(uParam0->f_9), 22);
			gameplay::set_bit(&(uParam0->f_9), 28);
			iVar0 = 1;
			break;
		
		case 18:
			uParam0->f_14 = 6;
			*uParam0 = { -745.857f, -1433.904f, 4.0005f };
			uParam0->f_12 = 0;
			uParam0->f_13 = 360;
			uParam0->f_15 = { -756.2952f, -1441.609f, 2.9184f };
			uParam0->f_18 = { -738.0606f, -1423.068f, 8.2835f };
			gameplay::set_bit(&(uParam0->f_9), 0);
			gameplay::set_bit(&(uParam0->f_9), 21);
			gameplay::set_bit(&(uParam0->f_9), 14);
			gameplay::set_bit(&(uParam0->f_9), 7);
			gameplay::set_bit(&(uParam0->f_9), 10);
			gameplay::set_bit(&(uParam0->f_9), 12);
			gameplay::set_bit(&(uParam0->f_9), 28);
			iVar0 = 1;
			break;
		
		case 19:
			uParam0->f_14 = 7;
			*uParam0 = { -761.8486f, -1453.829f, 4.0005f };
			uParam0->f_12 = 1;
			uParam0->f_13 = 360;
			uParam0->f_15 = { -772.8158f, -1459.957f, 3.2894f };
			uParam0->f_18 = { -754.3353f, -1440.836f, 8.3334f };
			gameplay::set_bit(&(uParam0->f_9), 0);
			gameplay::set_bit(&(uParam0->f_9), 21);
			gameplay::set_bit(&(uParam0->f_9), 14);
			gameplay::set_bit(&(uParam0->f_9), 7);
			gameplay::set_bit(&(uParam0->f_9), 10);
			gameplay::set_bit(&(uParam0->f_9), 12);
			gameplay::set_bit(&(uParam0->f_9), 28);
			iVar0 = 1;
			break;
		
		case 20:
			uParam0->f_14 = 8;
			*uParam0 = { 1769.3f, 3244f, 41.1f };
			uParam0->f_12 = 2;
			uParam0->f_13 = 360;
			gameplay::set_bit(&(uParam0->f_9), 0);
			gameplay::set_bit(&(uParam0->f_9), 21);
			gameplay::set_bit(&(uParam0->f_9), 14);
			gameplay::set_bit(&(uParam0->f_9), 7);
			gameplay::set_bit(&(uParam0->f_9), 10);
			gameplay::set_bit(&(uParam0->f_9), 12);
			gameplay::set_bit(&(uParam0->f_9), 23);
			gameplay::set_bit(&(uParam0->f_9), 28);
			iVar0 = 1;
			break;
		
		case 21:
			uParam0->f_14 = 9;
			*uParam0 = { 192.7897f, -1020.539f, -99.98f };
			uParam0->f_3 = 180f;
			uParam0->f_4 = 0;
			uParam0->f_12 = 0;
			uParam0->f_13 = 357;
			gameplay::set_bit(&(uParam0->f_9), 0);
			gameplay::set_bit(&(uParam0->f_9), 21);
			gameplay::set_bit(&(uParam0->f_9), 14);
			gameplay::set_bit(&(uParam0->f_9), 7);
			gameplay::set_bit(&(uParam0->f_9), 10);
			gameplay::set_bit(&(uParam0->f_9), 12);
			gameplay::set_bit(&(uParam0->f_9), 24);
			gameplay::set_bit(&(uParam0->f_9), 28);
			gameplay::set_bit(&(uParam0->f_9), 29);
			iVar0 = 1;
			break;
		
		case 22:
			uParam0->f_14 = 10;
			*uParam0 = { 192.7897f, -1020.539f, -99.98f };
			uParam0->f_3 = 180f;
			uParam0->f_4 = 0;
			uParam0->f_12 = 1;
			uParam0->f_13 = 357;
			gameplay::set_bit(&(uParam0->f_9), 0);
			gameplay::set_bit(&(uParam0->f_9), 21);
			gameplay::set_bit(&(uParam0->f_9), 14);
			gameplay::set_bit(&(uParam0->f_9), 7);
			gameplay::set_bit(&(uParam0->f_9), 10);
			gameplay::set_bit(&(uParam0->f_9), 12);
			gameplay::set_bit(&(uParam0->f_9), 24);
			gameplay::set_bit(&(uParam0->f_9), 28);
			gameplay::set_bit(&(uParam0->f_9), 29);
			iVar0 = 1;
			break;
		
		case 23:
			uParam0->f_14 = 11;
			*uParam0 = { 192.7897f, -1020.539f, -99.98f };
			uParam0->f_3 = 180f;
			uParam0->f_4 = 0;
			uParam0->f_12 = 2;
			uParam0->f_13 = 357;
			gameplay::set_bit(&(uParam0->f_9), 0);
			gameplay::set_bit(&(uParam0->f_9), 21);
			gameplay::set_bit(&(uParam0->f_9), 14);
			gameplay::set_bit(&(uParam0->f_9), 7);
			gameplay::set_bit(&(uParam0->f_9), 10);
			gameplay::set_bit(&(uParam0->f_9), 12);
			gameplay::set_bit(&(uParam0->f_9), 24);
			gameplay::set_bit(&(uParam0->f_9), 28);
			gameplay::set_bit(&(uParam0->f_9), 29);
			iVar0 = 1;
			break;
		
		case 26:
		case 27:
		case 28:
			iVar1 = (iParam1 - 26);
			uParam0->f_14 = (12 + iVar1);
			*uParam0 = { 196.2794f, -1020.479f, -99.98f };
			uParam0->f_3 = 180f;
			uParam0->f_4 = 0;
			uParam0->f_12 = (0 + iVar1);
			gameplay::set_bit(&(uParam0->f_9), 10);
			gameplay::set_bit(&(uParam0->f_9), 12);
			gameplay::set_bit(&(uParam0->f_9), 7);
			gameplay::set_bit(&(uParam0->f_9), 27);
			gameplay::set_bit(&(uParam0->f_9), 24);
			gameplay::set_bit(&(uParam0->f_9), 29);
			iVar0 = 1;
			break;
		
		case 29:
		case 30:
		case 31:
			iVar1 = (iParam1 - 29);
			uParam0->f_14 = (15 + iVar1);
			*uParam0 = { 199.8872f, -1020.048f, -99.98f };
			uParam0->f_3 = 180f;
			uParam0->f_4 = 0;
			uParam0->f_12 = (0 + iVar1);
			gameplay::set_bit(&(uParam0->f_9), 10);
			gameplay::set_bit(&(uParam0->f_9), 12);
			gameplay::set_bit(&(uParam0->f_9), 7);
			gameplay::set_bit(&(uParam0->f_9), 27);
			gameplay::set_bit(&(uParam0->f_9), 24);
			gameplay::set_bit(&(uParam0->f_9), 29);
			iVar0 = 1;
			break;
		
		case 32:
		case 33:
		case 34:
			iVar1 = (iParam1 - 32);
			uParam0->f_14 = (18 + iVar1);
			*uParam0 = { 203.6006f, -1019.776f, -99.98f };
			uParam0->f_3 = 180f;
			uParam0->f_4 = 0;
			uParam0->f_12 = (0 + iVar1);
			gameplay::set_bit(&(uParam0->f_9), 10);
			gameplay::set_bit(&(uParam0->f_9), 12);
			gameplay::set_bit(&(uParam0->f_9), 7);
			gameplay::set_bit(&(uParam0->f_9), 27);
			gameplay::set_bit(&(uParam0->f_9), 24);
			gameplay::set_bit(&(uParam0->f_9), 29);
			iVar0 = 1;
			break;
		
		case 24:
			uParam0->f_14 = 21;
			*uParam0 = { 0f, 0f, 0f };
			uParam0->f_3 = 0f;
			uParam0->f_4 = 0;
			gameplay::set_bit(&(uParam0->f_9), 10);
			gameplay::set_bit(&(uParam0->f_9), 11);
			gameplay::set_bit(&(uParam0->f_9), 13);
			gameplay::set_bit(&(uParam0->f_9), 12);
			iVar0 = 1;
			break;
		
		case 25:
			uParam0->f_14 = 22;
			*uParam0 = { 723.2515f, -632.0496f, 27.1484f };
			uParam0->f_3 = 12.9316f;
			uParam0->f_4 = joaat("tailgater");
			gameplay::set_bit(&(uParam0->f_9), 10);
			gameplay::set_bit(&(uParam0->f_9), 11);
			gameplay::set_bit(&(uParam0->f_9), 13);
			gameplay::set_bit(&(uParam0->f_9), 12);
			iVar0 = 1;
			break;
		
		case 35:
			*uParam0 = { -51.23f, 3111.9f, 24.95f };
			uParam0->f_3 = 46.78f;
			uParam0->f_4 = joaat("proptrailer");
			gameplay::set_bit(&(uParam0->f_9), 8);
			iVar0 = 1;
			break;
		
		case 36:
			*uParam0 = { -55.7984f, -1096.586f, 25.4223f };
			uParam0->f_3 = 308.0596f;
			uParam0->f_4 = joaat("bjxl");
			uParam0->f_10 = 126;
			uParam0->f_11 = 126;
			gameplay::set_bit(&(uParam0->f_9), 9);
			gameplay::set_bit(&(uParam0->f_9), 13);
			iVar0 = 1;
			break;
		
		case 37:
			*uParam0 = { -2892.93f, 3192.37f, 11.66f };
			uParam0->f_3 = -132.35f;
			uParam0->f_4 = joaat("velum");
			uParam0->f_10 = 157;
			uParam0->f_11 = 157;
			gameplay::set_bit(&(uParam0->f_9), 9);
			gameplay::set_bit(&(uParam0->f_9), 23);
			gameplay::set_bit(&(uParam0->f_9), 13);
			iVar0 = 1;
			break;
		
		case 38:
			*uParam0 = { 1744.308f, 3270.673f, 40.2076f };
			uParam0->f_3 = 125f;
			uParam0->f_4 = joaat("cargobob3");
			gameplay::set_bit(&(uParam0->f_9), 23);
			gameplay::set_bit(&(uParam0->f_9), 8);
			iVar0 = 1;
			break;
		
		case 39:
			*uParam0 = { 1751.44f, 3322.643f, 42.1855f };
			uParam0->f_3 = 268.134f;
			uParam0->f_4 = joaat("submersible");
			gameplay::set_bit(&(uParam0->f_9), 23);
			iVar0 = 1;
			break;
		
		case 41:
			*uParam0 = { 1377.104f, -2076.2f, 52f };
			uParam0->f_3 = 37.5f;
			uParam0->f_4 = joaat("towtruck");
			gameplay::set_bit(&(uParam0->f_9), 8);
			iVar0 = 1;
			break;
		
		case 40:
			*uParam0 = { 1380.42f, -2072.77f, 51.7607f };
			uParam0->f_3 = 37.5f;
			uParam0->f_4 = joaat("trash");
			gameplay::set_bit(&(uParam0->f_9), 8);
			iVar0 = 1;
			break;
		
		case 42:
			*uParam0 = { 1359.389f, 3618.441f, 33.8907f };
			uParam0->f_3 = 108.2337f;
			uParam0->f_4 = joaat("barracks");
			gameplay::set_bit(&(uParam0->f_9), 8);
			iVar0 = 1;
			break;
		
		case 43:
			*uParam0 = { 693.1154f, -1018.155f, 21.6387f };
			uParam0->f_3 = 177.6454f;
			uParam0->f_4 = 1938952078;
			gameplay::set_bit(&(uParam0->f_9), 23);
			gameplay::set_bit(&(uParam0->f_9), 8);
			iVar0 = 1;
			break;
		
		case 44:
			*uParam0 = { -73.6963f, 495.124f, 143.5226f };
			uParam0->f_3 = 155.5994f;
			uParam0->f_4 = joaat("vacca");
			iVar0 = 1;
			break;
		
		case 45:
			*uParam0 = { -67.6314f, 891.8266f, 234.5348f };
			uParam0->f_3 = 294.993f;
			uParam0->f_4 = joaat("surano");
			iVar0 = 1;
			break;
		
		case 46:
			*uParam0 = { 533.9048f, -169.2469f, 53.7005f };
			uParam0->f_3 = 1.2998f;
			uParam0->f_4 = joaat("tornado2");
			iVar0 = 1;
			break;
		
		case 47:
			*uParam0 = { -726.8914f, -408.6952f, 34.0416f };
			uParam0->f_3 = 267.7392f;
			uParam0->f_4 = joaat("superd");
			iVar0 = 1;
			break;
		
		case 48:
			*uParam0 = { -1321.519f, 261.3993f, 61.5709f };
			uParam0->f_3 = 350.7697f;
			uParam0->f_4 = joaat("double");
			iVar0 = 1;
			break;
		
		case 49:
			*uParam0 = { -1267.999f, 451.6463f, 93.7071f };
			uParam0->f_3 = 48.9311f;
			uParam0->f_4 = joaat("double");
			iVar0 = 1;
			break;
		
		case 50:
			*uParam0 = { -1062.076f, -226.7637f, 37.157f };
			uParam0->f_3 = 234.2767f;
			uParam0->f_4 = joaat("double");
			iVar0 = 1;
			break;
		
		case 51:
			*uParam0 = { 68.16914f, -1558.958f, 29.46904f };
			uParam0->f_3 = 49.90575f;
			uParam0->f_4 = joaat("rumpo2");
			uParam0->f_12 = 2;
			gameplay::set_bit(&(uParam0->f_9), 26);
			iVar0 = 1;
			break;
		
		case 52:
			*uParam0 = { 589.4399f, 2736.708f, 42.03316f };
			uParam0->f_3 = -175.7105f;
			uParam0->f_4 = joaat("rumpo2");
			uParam0->f_12 = 2;
			gameplay::set_bit(&(uParam0->f_9), 26);
			iVar0 = 1;
			break;
		
		case 53:
			*uParam0 = { -488.774f, -344.5721f, 34.36356f };
			uParam0->f_3 = 82.4042f;
			uParam0->f_4 = joaat("rumpo2");
			uParam0->f_12 = 2;
			gameplay::set_bit(&(uParam0->f_9), 26);
			iVar0 = 1;
			break;
		
		case 54:
			*uParam0 = { 288.8808f, -585.4728f, 43.15428f };
			uParam0->f_3 = -20.80707f;
			uParam0->f_4 = joaat("rumpo2");
			uParam0->f_12 = 2;
			gameplay::set_bit(&(uParam0->f_9), 26);
			iVar0 = 1;
			break;
		
		case 55:
			*uParam0 = { 304.8294f, -1383.674f, 31.67744f };
			uParam0->f_3 = -41.11603f;
			uParam0->f_4 = joaat("rumpo2");
			uParam0->f_12 = 2;
			gameplay::set_bit(&(uParam0->f_9), 26);
			iVar0 = 1;
			break;
		
		case 56:
			*uParam0 = { 1126.194f, -1481.486f, 34.7016f };
			uParam0->f_3 = -91.43369f;
			uParam0->f_4 = joaat("rumpo2");
			uParam0->f_12 = 2;
			gameplay::set_bit(&(uParam0->f_9), 26);
			iVar0 = 1;
			break;
		
		case 57:
			*uParam0 = { -1598.36f, 5252.84f, 0f };
			uParam0->f_3 = 28.14f;
			uParam0->f_4 = joaat("submersible");
			uParam0->f_13 = 308;
			gameplay::set_bit(&(uParam0->f_9), 2);
			gameplay::set_bit(&(uParam0->f_9), 30);
			gameplay::set_bit(&(uParam0->f_9), 6);
			iVar0 = 1;
			break;
		
		case 58:
			*uParam0 = { -1602.62f, 5260.37f, 0.86f };
			uParam0->f_3 = 25.32f;
			uParam0->f_4 = joaat("dinghy");
			uParam0->f_13 = 404;
			gameplay::set_bit(&(uParam0->f_9), 2);
			gameplay::set_bit(&(uParam0->f_9), 22);
			gameplay::set_bit(&(uParam0->f_9), 6);
			iVar0 = 1;
			break;
		
		case 59:
			*uParam0 = { 2116.571f, 4763.279f, 40.1596f };
			uParam0->f_3 = 198.723f;
			uParam0->f_4 = joaat("bfinjection");
			iVar0 = 1;
			break;
		
		case 60:
			*uParam0 = { 1133.21f, 120.2f, 80.9f };
			uParam0->f_3 = 134.4f;
			if (func_129())
			{
				uParam0->f_4 = joaat("blimp2");
			}
			else
			{
				uParam0->f_4 = joaat("blimp");
			}
			uParam0->f_13 = 401;
			gameplay::set_bit(&(uParam0->f_9), 13);
			gameplay::set_bit(&(uParam0->f_9), 2);
			gameplay::set_bit(&(uParam0->f_9), 1);
			gameplay::set_bit(&(uParam0->f_9), 23);
			gameplay::set_bit(&(uParam0->f_9), 21);
			iVar0 = 1;
			break;
		
		case 61:
			*uParam0 = { -806.31f, -2679.65f, 13.9f };
			uParam0->f_3 = 150.54f;
			if (func_129())
			{
				uParam0->f_4 = joaat("blimp2");
			}
			else
			{
				uParam0->f_4 = joaat("blimp");
			}
			uParam0->f_13 = 401;
			gameplay::set_bit(&(uParam0->f_9), 13);
			gameplay::set_bit(&(uParam0->f_9), 2);
			gameplay::set_bit(&(uParam0->f_9), 1);
			gameplay::set_bit(&(uParam0->f_9), 23);
			gameplay::set_bit(&(uParam0->f_9), 21);
			iVar0 = 1;
			break;
		
		case 62:
			*uParam0 = { 1985.85f, 3828.96f, 31.98f };
			uParam0->f_3 = -16.58f;
			uParam0->f_4 = joaat("blazer3");
			gameplay::set_bit(&(uParam0->f_9), 6);
			iVar0 = 1;
			break;
		
		case 63:
			*uParam0 = { 3870.75f, 4464.67f, 0f };
			uParam0->f_3 = 0f;
			uParam0->f_4 = joaat("submersible2");
			uParam0->f_13 = 308;
			gameplay::set_bit(&(uParam0->f_9), 0);
			gameplay::set_bit(&(uParam0->f_9), 21);
			gameplay::set_bit(&(uParam0->f_9), 23);
			gameplay::set_bit(&(uParam0->f_9), 6);
			gameplay::set_bit(&(uParam0->f_9), 30);
			iVar0 = 1;
			break;
		
		case 64:
			*uParam0 = { 1257.729f, -2564.474f, 41.717f };
			uParam0->f_3 = 284.5561f;
			uParam0->f_4 = joaat("dukes2");
			gameplay::set_bit(&(uParam0->f_9), 6);
			iVar0 = 1;
			break;
		
		case 65:
			*uParam0 = { 643.2823f, 3014.152f, 42.2733f };
			uParam0->f_3 = 128.0554f;
			uParam0->f_4 = joaat("dukes2");
			gameplay::set_bit(&(uParam0->f_9), 6);
			iVar0 = 1;
			break;
		
		case 66:
			*uParam0 = { 38.9368f, 850.8677f, 196.3f };
			uParam0->f_3 = 311.6813f;
			uParam0->f_4 = joaat("dodo");
			gameplay::set_bit(&(uParam0->f_9), 30);
			gameplay::set_bit(&(uParam0->f_9), 23);
			gameplay::set_bit(&(uParam0->f_9), 6);
			iVar0 = 1;
			break;
		
		case 67:
			*uParam0 = { 1333.875f, 4262.226f, 30.78f };
			uParam0->f_3 = 262.5293f;
			uParam0->f_4 = joaat("dodo");
			gameplay::set_bit(&(uParam0->f_9), 30);
			gameplay::set_bit(&(uParam0->f_9), 23);
			gameplay::set_bit(&(uParam0->f_9), 6);
			iVar0 = 1;
			break;
	}
	if (gameplay::is_bit_set(uParam0->f_9, 10))
	{
		uParam0->f_4 = Global_101553.f_18972.f_69[uParam0->f_14 /*78*/].f_66;
		if (iParam1 == 14)
		{
			if (((((uParam0->f_4 == joaat("miljet") || uParam0->f_4 == joaat("besra")) || uParam0->f_4 == joaat("luxor")) || uParam0->f_4 == joaat("shamal")) || uParam0->f_4 == joaat("titan")) || uParam0->f_4 == joaat("luxor2"))
			{
				*uParam0 = { 1678.8f, 3229.6f, 41.8f };
				uParam0->f_3 = 106.0906f;
			}
		}
		if (!func_103(Global_101553.f_18972.f_1864[uParam0->f_14 /*3*/], 0f, 0f, 0f, 0))
		{
			*uParam0 = { Global_101553.f_18972.f_1864[uParam0->f_14 /*3*/] };
		}
		if (Global_101553.f_18972.f_1934[uParam0->f_14] != -1f)
		{
			uParam0->f_3 = Global_101553.f_18972.f_1934[uParam0->f_14];
		}
	}
	if (gameplay::is_bit_set(uParam0->f_9, 19))
	{
		if (!func_103(Global_101553.f_1991.f_539.f_2816[1 /*10*/][uParam0->f_12 /*3*/], 0f, 0f, 0f, 0))
		{
			*uParam0 = { Global_101553.f_1991.f_539.f_2816[1 /*10*/][uParam0->f_12 /*3*/] };
			uParam0->f_3 = Global_101553.f_1991.f_539.f_2837[1 /*4*/][uParam0->f_12];
		}
	}
	else if (gameplay::is_bit_set(uParam0->f_9, 20))
	{
		if (!func_103(Global_101553.f_1991.f_539.f_2816[0 /*10*/][uParam0->f_12 /*3*/], 0f, 0f, 0f, 0))
		{
			*uParam0 = { Global_101553.f_1991.f_539.f_2816[0 /*10*/][uParam0->f_12 /*3*/] };
			uParam0->f_3 = Global_101553.f_1991.f_539.f_2837[0 /*4*/][uParam0->f_12];
		}
	}
	return iVar0;
}

void func_136(int iParam0, var uParam1, vector3 vParam2, float fParam5, int iParam6)//Position - 0xA971
{
	if (func_135(&(Global_68446.f_555[0 /*21*/]), iParam0))
	{
		if (gameplay::is_bit_set(Global_68446.f_555[0 /*21*/].f_9, 10))
		{
			func_141(iParam0);
			func_140(uParam1, &(Global_101553.f_18972.f_69[Global_68446.f_555[0 /*21*/].f_14 /*78*/]));
			if (gameplay::is_bit_set(Global_68446.f_555[0 /*21*/].f_9, 11))
			{
				Global_101553.f_18972.f_1864[Global_68446.f_555[0 /*21*/].f_14 /*3*/] = { vParam2 };
				Global_101553.f_18972.f_1934[Global_68446.f_555[0 /*21*/].f_14] = fParam5;
			}
			else
			{
				Global_101553.f_18972.f_1864[Global_68446.f_555[0 /*21*/].f_14 /*3*/] = { 0f, 0f, 0f };
				Global_101553.f_18972.f_1934[Global_68446.f_555[0 /*21*/].f_14] = -1f;
			}
			Global_101553.f_18972.f_1958[Global_68446.f_555[0 /*21*/].f_14] = iParam6 + 1;
			func_137(iParam0, 1);
		}
	}
}

void func_137(int iParam0, int iParam1)//Position - 0xAA70
{
	if (iParam0 == -1)
	{
		return;
	}
	if (iParam1)
	{
		if (!func_139(iParam0, 0))
		{
			func_138(iParam0, 1, 0);
			func_138(iParam0, 2, 0);
			func_138(iParam0, 3, 0);
			func_138(iParam0, 4, 0);
			func_138(iParam0, 0, 1);
			Global_68446[iParam0] = 1;
		}
	}
	else
	{
		func_138(iParam0, 0, 0);
	}
}

void func_138(int iParam0, int iParam1, int iParam2)//Position - 0xAACD
{
	if (iParam0 == -1)
	{
		return;
	}
	if (iParam2)
	{
		gameplay::set_bit(&(Global_101553.f_18972[iParam0]), iParam1);
	}
	else
	{
		gameplay::clear_bit(&(Global_101553.f_18972[iParam0]), iParam1);
	}
}

int func_139(int iParam0, int iParam1)//Position - 0xAB08
{
	if (iParam0 == -1)
	{
		return false;
	}
	return gameplay::is_bit_set(Global_101553.f_18972[iParam0], iParam1);
}

void func_140(var uParam0, var uParam1)//Position - 0xAB2B
{
	uParam1->f_66 = uParam0->f_66;
	*uParam1 = *uParam0;
	uParam1->f_1 = { uParam0->f_1 };
	uParam1->f_5 = uParam0->f_5;
	uParam1->f_6 = uParam0->f_6;
	uParam1->f_7 = uParam0->f_7;
	uParam1->f_8 = uParam0->f_8;
	uParam1->f_9 = { uParam0->f_9 };
	uParam1->f_59 = { uParam0->f_59 };
	uParam1->f_62 = uParam0->f_62;
	uParam1->f_63 = uParam0->f_63;
	uParam1->f_64 = uParam0->f_64;
	uParam1->f_65 = uParam0->f_65;
	uParam1->f_77 = uParam0->f_77;
	uParam1->f_67 = uParam0->f_67;
	uParam1->f_69 = uParam0->f_69;
	uParam1->f_68 = uParam0->f_68;
	uParam1->f_71 = uParam0->f_71;
	uParam1->f_72 = uParam0->f_72;
	uParam1->f_73 = uParam0->f_73;
	uParam1->f_74 = uParam0->f_74;
	uParam1->f_75 = uParam0->f_75;
	uParam1->f_76 = uParam0->f_76;
}

void func_141(int iParam0)//Position - 0xABF7
{
	if (iParam0 == -1)
	{
		return;
	}
	if (func_135(&(Global_68446.f_555[0 /*21*/]), iParam0))
	{
		if (entity::does_entity_exist(Global_68446.f_139[iParam0]))
		{
			entity::set_entity_as_mission_entity(Global_68446.f_139[iParam0], true, 1);
			entity::set_vehicle_as_no_longer_needed(&(Global_68446.f_139[iParam0]));
			Global_68446.f_139[iParam0] = 0;
		}
		if (gameplay::is_bit_set(Global_68446.f_555[0 /*21*/].f_9, 13))
		{
			func_137(iParam0, 0);
		}
	}
}

void func_142(int iParam0)//Position - 0xAC71
{
	if (iParam0 != 24 && iParam0 != 25)
	{
	}
	func_141(iParam0);
	func_137(iParam0, 0);
}

void func_143()//Position - 0xAC98
{
	Global_17151.f_6 = 1;
}

void func_144()//Position - 0xACA6
{
	int iVar0;
	
	if (!entity::does_entity_exist(iLocal_29))
	{
		if (!entity::is_entity_dead(player::player_ped_id(), 0))
		{
			if (system::vdist2(entity::get_entity_coords(player::player_ped_id(), 1), vLocal_32) < 2500f)
			{
				iLocal_29 = player::get_players_last_vehicle();
				if (entity::does_entity_exist(iLocal_29))
				{
					iVar0 = entity::get_entity_model(iLocal_29);
					if (iVar0 == joaat("dune"))
					{
					}
				}
			}
		}
	}
}

int func_145()//Position - 0xAD00
{
	return joaat("dune");
}

void func_146(int iParam0)//Position - 0xAD0D
{
	streaming::set_model_as_no_longer_needed(joaat("dune"));
	if (entity::does_entity_exist(iLocal_54))
	{
		if (iParam0)
		{
			vehicle::delete_vehicle(&iLocal_54);
		}
		else
		{
			entity::set_vehicle_as_no_longer_needed(&iLocal_54);
		}
	}
}

bool func_147()//Position - 0xAD3B
{
	if (func_26(9))
	{
		if (script::_get_number_of_instances_of_streamed_script(joaat("trevor2")) == 1)
		{
			if (!iLocal_38[0])
			{
				iLocal_38[0] = 1;
			}
			return false;
		}
		if (script::_get_number_of_instances_of_streamed_script(joaat("finale_heist2b")) == 1)
		{
			if (!iLocal_38[1])
			{
				iLocal_38[1] = 1;
			}
			return false;
		}
		if (script::_get_number_of_instances_of_streamed_script(joaat("traffick_air")) == 1)
		{
			if (!iLocal_38[2])
			{
				iLocal_38[2] = 1;
			}
			return false;
		}
		if (script::_get_number_of_instances_of_streamed_script(joaat("traffick_ground")) == 1)
		{
			if (!iLocal_38[3])
			{
				iLocal_38[3] = 1;
			}
			return false;
		}
		if (Global_91440)
		{
			return false;
		}
		if (iLocal_35 != -1)
		{
			return false;
		}
		if (func_169() == 309)
		{
			return false;
		}
		return true;
	}
	return false;
}

void func_148(var uParam0, int iParam1)//Position - 0xADF4
{
	func_149(uParam0, iParam1);
}

void func_149(var uParam0, var uParam1)//Position - 0xAE04
{
	*uParam0 = (*uParam0 || uParam1);
}

void func_150(char* sParam0, int iParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8)//Position - 0xAE15
{
	func_151(sParam0, "", iParam1, iParam2, iParam3, iParam4, iParam5, iParam6, iParam7, iParam8);
}

void func_151(char* sParam0, char* sParam1, var uParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8, var uParam9)//Position - 0xAE36
{
	int iVar0;
	
	if (gameplay::are_strings_equal(sParam0, ""))
	{
		return;
	}
	if (iParam3 < 0)
	{
		return;
	}
	if (iParam5 < 500 && iParam5 != -1)
	{
		return;
	}
	if (iParam4 < 0 && iParam4 != -1)
	{
		return;
	}
	if (iParam6 < 1 || iParam6 > 7)
	{
		return;
	}
	if (iParam7 == 235)
	{
		return;
	}
	if (iParam8 == 235)
	{
		return;
	}
	iVar0 = 0;
	while (iVar0 < Global_101553.f_25100.f_145)
	{
		if (gameplay::are_strings_equal(&(Global_101553.f_25100[iVar0 /*16*/]), sParam0))
		{
			return;
		}
		iVar0++;
	}
	if (Global_101553.f_25100.f_145 < 9)
	{
		StringCopy(&(Global_101553.f_25100[Global_101553.f_25100.f_145 /*16*/]), sParam0, 16);
		StringCopy(&(Global_101553.f_25100[Global_101553.f_25100.f_145 /*16*/].f_4), sParam1, 16);
		Global_101553.f_25100[Global_101553.f_25100.f_145 /*16*/].f_8 = (gameplay::get_game_timer() + iParam3);
		Global_101553.f_25100[Global_101553.f_25100.f_145 /*16*/].f_9 = iParam5;
		Global_101553.f_25100[Global_101553.f_25100.f_145 /*16*/].f_11 = iParam6;
		Global_101553.f_25100[Global_101553.f_25100.f_145 /*16*/].f_12 = uParam2;
		Global_101553.f_25100[Global_101553.f_25100.f_145 /*16*/].f_13 = iParam7;
		Global_101553.f_25100[Global_101553.f_25100.f_145 /*16*/].f_14 = iParam8;
		Global_101553.f_25100[Global_101553.f_25100.f_145 /*16*/].f_15 = uParam9;
		if (iParam4 != -1)
		{
			Global_101553.f_25100[Global_101553.f_25100.f_145 /*16*/].f_10 = ((gameplay::get_game_timer() + iParam3) + iParam4);
		}
		else
		{
			Global_101553.f_25100[Global_101553.f_25100.f_145 /*16*/].f_10 = -1;
		}
		Global_101553.f_25100.f_145++;
		func_152();
	}
}

void func_152()//Position - 0xB009
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < 3)
	{
		Global_101553.f_25100.f_146[iVar0] = 0;
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 < Global_101553.f_25100.f_145)
	{
		if (gameplay::is_bit_set(Global_101553.f_25100[iVar0 /*16*/].f_11, 0))
		{
			if (Global_101553.f_25100[iVar0 /*16*/].f_12 > Global_101553.f_25100.f_146[0])
			{
				Global_101553.f_25100.f_146[0] = Global_101553.f_25100[iVar0 /*16*/].f_12;
			}
		}
		if (gameplay::is_bit_set(Global_101553.f_25100[iVar0 /*16*/].f_11, 1))
		{
			if (Global_101553.f_25100[iVar0 /*16*/].f_12 > Global_101553.f_25100.f_146[1])
			{
				Global_101553.f_25100.f_146[1] = Global_101553.f_25100[iVar0 /*16*/].f_12;
			}
		}
		if (gameplay::is_bit_set(Global_101553.f_25100[iVar0 /*16*/].f_11, 2))
		{
			if (Global_101553.f_25100[iVar0 /*16*/].f_12 > Global_101553.f_25100.f_146[2])
			{
				Global_101553.f_25100.f_146[2] = Global_101553.f_25100[iVar0 /*16*/].f_12;
			}
		}
		iVar0++;
	}
}

int func_153(var uParam0, int iParam1)//Position - 0xB129
{
	return (uParam0 && iParam1) != 0;
}

void func_154(int iParam0)//Position - 0xB138
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	var uVar4;
	
	iVar0 = false;
	if (iLocal_47 != 9)
	{
		if (!Global_101553.f_18838.f_14)
		{
			func_1(105, 1, 0);
			Global_101553.f_18838.f_14 = 1;
			iVar0 = true;
		}
		else
		{
			iVar0 = true;
		}
	}
	else
	{
		func_1(105, 0, 0);
		Global_101553.f_18838.f_14 = 0;
	}
	if (iLocal_47 != 1 && iLocal_47 != 8)
	{
		if (func_147() && !*iParam0)
		{
			func_155(0);
			iLocal_47 = 1;
		}
	}
	switch (iLocal_47)
	{
		case 0:
			iLocal_47 = 1;
			break;
		
		case 1:
			if (!func_147())
			{
				if (fLocal_31 < 50625f)
				{
					iLocal_47 = 2;
				}
				else if (iLocal_37)
				{
					iLocal_47 = 2;
				}
			}
			break;
		
		case 2:
			streaming::request_model(joaat("cuban800"));
			iLocal_47 = 3;
			break;
		
		case 3:
			streaming::request_model(joaat("cuban800"));
			if (streaming::has_model_loaded(joaat("cuban800")))
			{
				if (!entity::does_entity_exist(iLocal_48))
				{
					gameplay::clear_area_of_vehicles(vLocal_50, 8f, 0, 0, 0, 0, false);
					iLocal_48 = vehicle::create_vehicle(joaat("cuban800"), vLocal_50, 25.29f, 1, true);
					streaming::set_model_as_no_longer_needed(joaat("cuban800"));
					vehicle::set_vehicle_colour_combination(iLocal_48, 2);
					func_148(&(Global_101553.f_18838), 128);
					iLocal_47 = 4;
				}
				else
				{
					iLocal_47 = 4;
				}
			}
			break;
		
		case 4:
			if (entity::does_entity_exist(iLocal_48))
			{
				if (entity::is_entity_dead(iLocal_48, 0) || entity::is_entity_dead(player::player_ped_id(), 0))
				{
					iLocal_47 = 9;
					return;
				}
			}
			if (func_26(9))
			{
				if (script::_get_number_of_instances_of_streamed_script(joaat("traffick_ground")) == 1)
				{
					if (!entity::is_entity_dead(iLocal_48, 0))
					{
						vehicle::set_vehicle_doors_locked(iLocal_48, 2);
						return;
					}
				}
			}
			else if (script::_get_number_of_instances_of_streamed_script(joaat("traffick_ground")) == 0)
			{
				if (!entity::is_entity_dead(iLocal_48, 0))
				{
					vehicle::set_vehicle_doors_locked(iLocal_48, 1);
				}
			}
			if (!iLocal_37)
			{
				if (fLocal_31 >= 50625f && !*iParam0)
				{
					func_155(0);
					iLocal_47 = 1;
					return;
				}
			}
			if (!iVar0 && !*iParam0)
			{
				if (!iLocal_49)
				{
					if (ped::is_ped_in_any_vehicle(iLocal_28, 0))
					{
						iVar1 = ped::get_vehicle_ped_is_using(iLocal_28);
						if (iVar1 == iLocal_48)
						{
							iLocal_49 = 1;
							entity::set_vehicle_as_no_longer_needed(&iLocal_48);
							iLocal_47 = 9;
						}
					}
				}
			}
			if (*iParam0)
			{
				ped::set_ped_into_vehicle(iLocal_28, iLocal_48, -1);
			}
			if (!entity::is_entity_dead(player::player_ped_id(), 0) && !entity::is_entity_dead(iLocal_48, 0))
			{
				if (ped::is_ped_in_vehicle(player::player_ped_id(), iLocal_48, 1))
				{
					func_143();
				}
			}
			if (!entity::is_entity_dead(player::player_ped_id(), 0))
			{
				if (ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
				{
					iVar2 = ped::get_vehicle_ped_is_using(player::player_ped_id());
					if (iVar2 == iLocal_48)
					{
						script::request_script("Traffick_Air");
						if (entity::does_entity_exist(iLocal_29) && !entity::is_entity_dead(iLocal_29, 0))
						{
							if (entity::get_entity_model(iLocal_29) != joaat("dune") && entity::get_entity_model(iLocal_29) != joaat("cuban800"))
							{
								if (!entity::is_entity_in_angled_area(iLocal_29, 2137.12f, 4799.97f, 39.67854f, 2116.64f, 4790.417f, 45.45295f, 25f, 0, true, 0))
								{
									func_118(iLocal_29, 2142.245f, 4823.463f, 40.2769f, 118.4428f, 24, 0);
								}
							}
							else if (!entity::is_entity_dead(player::player_ped_id(), 0))
							{
								vehicle::set_players_last_vehicle(iLocal_29);
							}
						}
						iLocal_47 = 6;
					}
				}
			}
			break;
		
		case 6:
			if (script::has_script_loaded("Traffick_Air"))
			{
				iVar3 = 0;
				if (*iParam0)
				{
					iVar3 = 1;
				}
				else
				{
					iVar3 = func_116(&iLocal_35, 6, 9, 0, 0);
					iLocal_45 = 1;
				}
				if (iVar3 == 1)
				{
					if (player::is_player_playing(player::player_id()))
					{
						player::clear_player_wanted_level(player::player_id());
					}
					if (!*iParam0)
					{
						func_80(script::get_this_script_name(), 0);
					}
					iLocal_30 = system::start_new_script("Traffick_Air", 19000);
					func_79(15);
					script::set_script_as_no_longer_needed("Traffick_Air");
					entity::set_vehicle_as_no_longer_needed(&iLocal_48);
					if (!ped::is_ped_injured(player::player_ped_id()))
					{
						if (Global_36906 == 1)
						{
							func_70(player::player_ped_id());
						}
					}
					iLocal_49 = 0;
					iLocal_47 = 7;
				}
				else if (iVar3 == 0)
				{
					iLocal_45 = 0;
					func_155(0);
					iLocal_47 = 9;
				}
			}
			break;
		
		case 7:
			if (!script::is_thread_active(iLocal_30))
			{
				if (func_153(Global_100206, 1))
				{
					iLocal_47 = 8;
				}
				else
				{
					func_69(&iLocal_35);
					func_52();
					uVar4 = func_51();
					func_43(&uVar4, 0, 0, 3, 0, 0, 0);
					Global_101553.f_18838.f_11 = uVar4;
					func_1(105, 0, 0);
					Global_101553.f_18838.f_14 = 0;
					iLocal_47 = 9;
				}
				*iParam0 = 0;
				func_41(&Global_100206, 1);
			}
			break;
		
		case 8:
			if (Global_91406 == 10)
			{
				if (Global_91440)
				{
					*iParam0 = 1;
					if (entity::does_entity_exist(player::player_ped_id()))
					{
						if (!ped::is_ped_injured(player::player_ped_id()))
						{
							entity::set_entity_coords(player::player_ped_id(), 2136.446f, 4791.483f, 39.9702f, 1, false, 0, 1);
						}
					}
					streaming::request_model(joaat("cuban800"));
					script::request_script("Traffick_Air");
					if (streaming::has_model_loaded(joaat("cuban800")))
					{
						gameplay::clear_area_of_vehicles(vLocal_50, 8f, 0, 0, 0, 0, false);
						iLocal_48 = vehicle::create_vehicle(joaat("cuban800"), vLocal_50, 25.29f, 1, true);
						streaming::set_model_as_no_longer_needed(joaat("cuban800"));
						iLocal_47 = 3;
					}
				}
				else
				{
					*iParam0 = 0;
					iLocal_47 = 1;
				}
			}
			else if (Global_91406 == 13)
			{
				func_69(&iLocal_35);
				func_52();
				*iParam0 = 0;
				iLocal_47 = 1;
			}
			break;
		
		case 9:
			if (fLocal_31 >= 50625f && func_30(Global_101553.f_18838.f_11))
			{
				func_155(0);
				iLocal_47 = 1;
			}
			break;
		
		default:
			break;
	}
}

void func_155(int iParam0)//Position - 0xB67E
{
	streaming::set_model_as_no_longer_needed(joaat("cuban800"));
	if (entity::does_entity_exist(iLocal_48))
	{
		if (iParam0)
		{
			vehicle::delete_vehicle(&iLocal_48);
		}
		else
		{
			entity::set_vehicle_as_no_longer_needed(&iLocal_48);
		}
	}
	if (func_153(Global_101553.f_18838, 128))
	{
		func_41(&(Global_101553.f_18838), 128);
	}
	iLocal_49 = 0;
}

bool func_156()//Position - 0xB6CC
{
	if (!func_167())
	{
		return false;
	}
	if (!iLocal_45)
	{
		if (func_169() == 309)
		{
			return true;
		}
		if (!func_27(9))
		{
			return false;
		}
	}
	if (script::_get_number_of_instances_of_streamed_script(joaat("traffick_ground")) == 1 || script::_get_number_of_instances_of_streamed_script(joaat("traffick_air")) == 1)
	{
		return true;
	}
	iLocal_28 = player::player_ped_id();
	if (entity::is_entity_dead(iLocal_28, 0))
	{
	}
	if (func_166())
	{
		return true;
	}
	if (func_21() != 2)
	{
		return false;
	}
	if (!func_160(6))
	{
		if (ped::is_ped_getting_into_a_vehicle(player::player_ped_id()))
		{
			iLocal_46 = true;
		}
		if (!player::is_player_ready_for_cutscene(player::player_id()))
		{
			iLocal_46 = true;
		}
		if (ped::is_ped_in_combat(player::player_ped_id(), 0))
		{
		}
		if (!player::is_player_ready_for_cutscene(player::player_id()))
		{
		}
		if (player::get_player_wanted_level(player::player_id()) > 0)
		{
		}
		if (player::is_player_wanted_level_greater(player::player_id(), 0))
		{
		}
		if (entity::is_entity_in_air(player::player_ped_id()))
		{
		}
		if (ped::is_ped_getting_into_a_vehicle(player::player_ped_id()))
		{
		}
		if (ped::is_ped_ragdoll(player::player_ped_id()))
		{
		}
		if (player::is_player_being_arrested(player::player_id(), 1))
		{
		}
		if (player::is_player_climbing(player::player_id()))
		{
		}
		if (Global_100600)
		{
		}
		if (Global_25187)
		{
		}
		if (func_159())
		{
		}
		if (func_158(8, -1))
		{
		}
		if (func_157())
		{
			return true;
		}
		return false;
	}
	else
	{
		iLocal_46 = false;
	}
	return true;
}

bool func_157()//Position - 0xB80E
{
	if (Global_69877)
	{
		return true;
	}
	else if (Global_55810 && !Global_55816)
	{
		return true;
	}
	return false;
}

int func_158(int iParam0, int iParam1)//Position - 0xB838
{
	switch (iParam0)
	{
		case 5:
			if (iParam1 > -1)
			{
				return Global_1342783.f_203[iParam1];
			}
			break;
	}
	return gameplay::is_bit_set(Global_1342783.f_982, iParam0);
}

var func_159()//Position - 0xB873
{
	return Global_1315229;
}

bool func_160(int iParam0)//Position - 0xB87F
{
	int iVar0;
	
	if (player::is_player_playing(player::player_id()))
	{
		if (entity::does_entity_exist(player::player_ped_id()))
		{
			if (!ped::is_ped_injured(player::player_ped_id()))
			{
				iVar0 = func_21();
				if (!func_13(iVar0))
				{
					return false;
				}
				switch (iParam0)
				{
					case 9:
					case 0:
						if (((((((((((((((((!player::is_player_ready_for_cutscene(player::player_id()) || entity::is_entity_in_air(player::player_ped_id())) || ped::is_ped_getting_into_a_vehicle(player::player_ped_id())) || ped::is_ped_ragdoll(player::player_ped_id())) || ped::is_ped_falling(player::player_ped_id())) || player::is_player_being_arrested(player::player_id(), 1)) || player::is_player_climbing(player::player_id())) || ped::is_ped_in_combat(player::player_ped_id(), 0)) || func_165()) || Global_100600) || Global_25187) || func_159()) || func_158(8, -1)) || func_115()) || func_164()) || func_157()) || func_163()) || Global_101553.f_6543.f_919[iVar0] == 5)
						{
							return false;
						}
						break;
					
					case 1:
						if (((((((((player::is_player_being_arrested(player::player_id(), 1) || func_165()) || Global_25187) || func_159()) || func_158(8, -1)) || func_157()) || func_115()) || func_164()) || func_163()) || Global_101553.f_6543.f_919[iVar0] == 5)
						{
							return false;
						}
						break;
					
					case 2:
						if ((((((((((((((((((!player::is_player_ready_for_cutscene(player::player_id()) || entity::is_entity_in_air(player::player_ped_id())) || ped::is_ped_getting_into_a_vehicle(player::player_ped_id())) || ped::is_ped_ragdoll(player::player_ped_id())) || ped::is_ped_falling(player::player_ped_id())) || player::is_player_being_arrested(player::player_id(), 1)) || player::is_player_climbing(player::player_id())) || ped::is_ped_in_combat(player::player_ped_id(), 0)) || func_165()) || Global_100600) || Global_25187) || func_159()) || func_158(8, -1)) || func_157()) || func_115()) || func_164()) || func_163()) || Global_101553.f_6543.f_919[iVar0] == 5) || Global_36322 != -1)
						{
							return false;
						}
						break;
					
					case 3:
						if ((((((((((((ped::is_ped_ragdoll(player::player_ped_id()) || ped::is_ped_falling(player::player_ped_id())) || player::is_player_being_arrested(player::player_id(), 1)) || ped::is_ped_in_combat(player::player_ped_id(), 0)) || func_165()) || Global_100600) || Global_25187) || func_159()) || func_158(8, -1)) || func_115()) || func_164()) || func_163()) || Global_101553.f_6543.f_919[iVar0] == 5)
						{
							return false;
						}
						break;
					
					case 4:
						if (((((func_165() || player::get_player_wanted_level(player::player_id()) > 0) || func_158(8, -1)) || func_163()) || func_162()) || Global_101553.f_6543.f_919[iVar0] == 5)
						{
							return false;
						}
						break;
					
					case 5:
						if ((((func_158(8, -1) || func_115()) || func_164()) || func_162()) || func_161())
						{
							return false;
						}
						if ((streaming::is_player_switch_in_progress() && streaming::get_player_switch_type() != 3) && streaming::get_player_switch_state() < 8)
						{
							return false;
						}
						break;
					
					case 6:
						if (entity::does_entity_exist(player::player_ped_id()))
						{
							if ((((((((((((((ped::is_ped_in_combat(player::player_ped_id(), 0) || player::get_player_wanted_level(player::player_id()) > 0) || entity::is_entity_in_air(player::player_ped_id())) || ped::is_ped_ragdoll(player::player_ped_id())) || ped::is_ped_falling(player::player_ped_id())) || player::is_player_being_arrested(player::player_id(), 1)) || player::is_player_climbing(player::player_id())) || func_165()) || Global_25187) || func_159()) || func_158(8, -1)) || func_164()) || func_157()) || func_163()) || Global_101553.f_6543.f_919[iVar0] == 5)
							{
								return false;
							}
						}
						break;
					
					case 7:
						if ((((((((((((((((((ped::is_ped_in_combat(player::player_ped_id(), 0) || !player::is_player_control_on(player::player_id())) || !player::is_player_ready_for_cutscene(player::player_id())) || !cam::is_screen_faded_in()) || entity::is_entity_in_air(player::player_ped_id())) || ped::is_ped_ragdoll(player::player_ped_id())) || ped::is_ped_falling(player::player_ped_id())) || player::is_player_being_arrested(player::player_id(), 1)) || func_165()) || func_164()) || Global_100600) || Global_25187) || func_159()) || Global_36906) || func_158(8, -1)) || func_157()) || func_162()) || func_163()) || Global_101553.f_6543.f_919[iVar0] == 5)
						{
							return false;
						}
						break;
					
					case 8:
						if (((((((((((((((((((((ped::is_ped_in_combat(player::player_ped_id(), 0) || !player::is_player_control_on(player::player_id())) || !player::is_player_ready_for_cutscene(player::player_id())) || !cam::is_screen_faded_in()) || player::is_player_wanted_level_greater(player::player_id(), 0)) || entity::is_entity_in_air(player::player_ped_id())) || ped::is_ped_in_any_vehicle(player::player_ped_id(), 1)) || ped::is_ped_ragdoll(player::player_ped_id())) || ped::is_ped_falling(player::player_ped_id())) || ped::is_ped_swimming(player::player_ped_id())) || player::is_player_being_arrested(player::player_id(), 1)) || player::is_player_climbing(player::player_id())) || func_165()) || Global_100600) || Global_25187) || func_159()) || func_158(8, -1)) || func_157()) || func_162()) || func_115()) || func_164()) || func_163())
						{
							return false;
						}
						break;
				}
			}
			else
			{
				return false;
			}
		}
		else
		{
			return false;
		}
	}
	else
	{
		return false;
	}
	return true;
}

var func_161()//Position - 0xBF9C
{
	return Global_91445.f_1;
}

int func_162()//Position - 0xBFAA
{
	if (Global_88661 != -1)
	{
		return gameplay::is_bit_set(Global_82527[Global_88661 /*34*/].f_15, 13);
	}
	return false;
}

bool func_163()//Position - 0xBFD0
{
	if (script::_get_number_of_instances_of_streamed_script(joaat("player_timetable_scene")) > 0)
	{
		return true;
	}
	return false;
}

int func_164()//Position - 0xBFEA
{
	return Global_91458.f_304 > 0;
}

int func_165()//Position - 0xBFFB
{
	if (!network::network_is_game_in_progress())
	{
		return Global_89217.f_44 == 1;
	}
	return false;
}

bool func_166()//Position - 0xC01C
{
	if (((Global_91406 == 13 || Global_91406 == 10) || Global_91406 == 11) || Global_91406 == 12)
	{
		return false;
	}
	return true;
}

int func_167()//Position - 0xC05A
{
	if (Global_101553.f_7940)
	{
		return (func_168(0, 15) && func_168(0, 16));
	}
	else
	{
		return 1;
	}
	return 0;
}

int func_168(int iParam0, int iParam1)//Position - 0xC08A
{
	int iVar0;
	
	if (iParam0 == 11 || iParam0 == -1)
	{
		return false;
	}
	if (iParam1 < 0 || iParam1 >= 32)
	{
		return false;
	}
	iVar0 = gameplay::is_bit_set(Global_101553.f_7940.f_99.f_219[iParam0], iParam1);
	return iVar0;
}

int func_169()//Position - 0xC0D7
{
	if (streaming::is_player_switch_in_progress())
	{
		return Global_89581;
	}
	if (func_163())
	{
		return Global_89581;
	}
	return 318;
}

void func_170()//Position - 0xC0FE
{
	if (!iLocal_80)
	{
		iLocal_79 = ped::add_scenario_blocking_area(Vector(40.073f, 4788.559f, 2157.109f) - Vector(25f, 25f, 25f), Vector(40.073f, 4788.559f, 2157.109f) + Vector(25f, 25f, 25f), 0, 1, 1, 1);
		iLocal_80 = 1;
	}
}

bool func_171(int iParam0)//Position - 0xC157
{
	int iVar0;
	int iVar1;
	
	if (iParam0 <= 31)
	{
		iVar0 = 9;
		iVar1 = iParam0;
	}
	else
	{
		iVar0 = 10;
		iVar1 = (iParam0 - 32);
	}
	if (gameplay::is_bit_set(Global_101553.f_7940.f_99.f_219[iVar0], iVar1))
	{
		return false;
	}
	gameplay::set_bit(&(Global_101553.f_7940.f_99.f_219[iVar0]), iVar1);
	return true;
}

void func_172()//Position - 0xC1B1
{
	if (iLocal_79 != 0)
	{
		ped::remove_scenario_blocking_area(iLocal_79, 0);
	}
	func_155(1);
	func_146(1);
	func_175();
	func_173();
	script::terminate_this_thread();
}

void func_173()//Position - 0xC1DC
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < 8)
	{
		if (Global_88672[iVar0 /*17*/] && !Global_88672[iVar0 /*17*/].f_1)
		{
			if (Global_88672[iVar0 /*17*/].f_3 == 0)
			{
				if ((Global_88672[iVar0 /*17*/].f_5 != 88 && Global_88672[iVar0 /*17*/].f_5 != 89) && Global_88672[iVar0 /*17*/].f_5 != 92)
				{
					func_174(Global_88672[iVar0 /*17*/].f_5, 1);
				}
			}
		}
		iVar0++;
	}
}

void func_174(int iParam0, int iParam1)//Position - 0xC263
{
	if (iParam1)
	{
		if ((iParam0 != 88 && iParam0 != 89) && iParam0 != 92)
		{
			Global_85724[iParam0 /*2*/] = 1;
		}
	}
	else
	{
		Global_85724[iParam0 /*2*/] = 0;
	}
}

void func_175()//Position - 0xC2A1
{
	int iVar0;
	
	iLocal_36 = 0;
	weapon::remove_weapon_asset(joaat("weapon_combatpistol"));
	weapon::remove_weapon_asset(joaat("weapon_smg"));
	weapon::remove_weapon_asset(joaat("weapon_stickybomb"));
	weapon::remove_weapon_asset(joaat("weapon_assaultshotgun"));
	weapon::remove_weapon_asset(joaat("weapon_rpg"));
	iVar0 = 0;
	while (iVar0 < 5)
	{
		if (object::does_pickup_exist(uLocal_67[iVar0]))
		{
			object::remove_pickup(uLocal_67[iVar0]);
		}
		if (entity::does_entity_exist(uLocal_61[iVar0]))
		{
			object::delete_object(&(uLocal_61[iVar0]));
		}
		iVar0++;
	}
}

