#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;
	char* sLocal_18 = NULL;
	var uLocal_19 = 0;
	var uLocal_20 = 0;
	var uLocal_21 = 0;
	var uLocal_22 = 0;
	float fLocal_23 = 0f;
	float fLocal_24 = 0f;
	float fLocal_25 = 0f;
	var uLocal_26 = 0;
	var uLocal_27 = 0;
	float fLocal_28 = 0f;
	var uLocal_29 = 0;
	var uLocal_30 = 0;
	var uLocal_31 = 0;
	float fLocal_32 = 0f;
	float fLocal_33 = 0f;
	var uLocal_34 = 0;
	var uLocal_35 = 0;
	int iLocal_36 = 0;
	var uLocal_37 = 0;
	var uLocal_38 = 0;
	var uLocal_39 = 0;
	int iLocal_40 = 0;
	int iLocal_41 = 0;
	int iLocal_42 = 0;
	int iLocal_43 = 0;
	var uLocal_44 = 0;
	var uLocal_45 = 0;
	var uLocal_46 = 0;
	var uLocal_47 = 0;
	var uLocal_48 = 0;
	var uLocal_49 = 0;
	var uLocal_50 = 0;
	var uLocal_51 = 0;
	var uLocal_52 = 0;
	var uLocal_53 = 0;
	var uLocal_54 = 0;
	var uLocal_55 = 0;
	var uLocal_56 = 8;
	var uLocal_57 = 0;
	var uLocal_58 = 0;
	var uLocal_59 = 0;
	var uLocal_60 = 0;
	var uLocal_61 = 0;
	var uLocal_62 = 0;
	var uLocal_63 = 0;
	var uLocal_64 = 0;
	var uLocal_65 = 2;
	var uLocal_66 = 0;
	var uLocal_67 = 0;
	var uLocal_68 = 8;
	var uLocal_69 = 0;
	var uLocal_70 = 0;
	var uLocal_71 = 0;
	var uLocal_72 = 0;
	var uLocal_73 = 0;
	var uLocal_74 = 0;
	var uLocal_75 = 0;
	var uLocal_76 = 0;
	var uLocal_77 = 8;
	var uLocal_78 = 0;
	var uLocal_79 = 0;
	var uLocal_80 = 0;
	var uLocal_81 = 0;
	var uLocal_82 = 0;
	var uLocal_83 = 0;
	var uLocal_84 = 0;
	var uLocal_85 = 0;
	var uLocal_86 = 0;
	float fLocal_87 = 0f;
	var uLocal_88 = 0;
	var uLocal_89 = 0;
	float fLocal_90 = 0f;
	float fLocal_91 = 0f;
	float fLocal_92 = 0f;
	float fLocal_93 = 0f;
	float fLocal_94 = 0f;
	var uLocal_95 = 0;
	struct<73> Local_96 = { 0, 0, 3, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1101004800, 0 } ;
	struct<10> Local_169[32];
	struct<54> Local_490 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0 } ;
	var uLocal_544 = 0;
	var uLocal_545 = 0;
	int iLocal_546 = 0;
	char* sLocal_547 = NULL;
	int iLocal_548 = 0;
	vector3 vLocal_549 = { 0f, 0f, 0f };
	vector3 vLocal_552 = { 0f, 0f, 0f };
	float fLocal_555 = 0f;
	int iLocal_556 = 0;
	vector3 vLocal_557 = { 0f, 0f, 0f };
	vector3 vLocal_560 = { 0f, 0f, 0f };
	int iLocal_563 = 0;
	var uLocal_564 = 0;
	int iLocal_565 = 0;
	int iLocal_566 = 0;
	int iLocal_567 = 0;
	int iLocal_568 = 0;
	int iLocal_569 = 0;
	int iLocal_570 = 0;
	int iLocal_571 = 0;
	int iLocal_572 = 0;
	vector3 vLocal_573 = { 0f, 0f, 0f };
	float fLocal_576 = 0f;
	vector3 vLocal_577 = { 0f, 0f, 0f };
	float fLocal_580 = 0f;
	int iLocal_581 = 0;
	int iLocal_582 = 0;
	int iLocal_583 = 0;
	int iLocal_584 = 0;
	var uLocal_585 = 0;
	var uLocal_586 = 0;
	var uLocal_587 = 0;
	var uLocal_588 = 0;
	int iLocal_589 = 0;
	int iLocal_590 = 0;
	int iLocal_591 = 0;
	int iLocal_592 = 0;
	vector3 vLocal_593 = { 0f, 0f, 0f };
	vector3 vLocal_596 = { 0f, 0f, 0f };
	vector3 vLocal_599 = { 0f, 0f, 0f };
	vector3 vLocal_602 = { 0f, 0f, 0f };
	float fLocal_605 = 0f;
	vector3 vLocal_606 = { 0f, 0f, 0f };
	vector3 vLocal_609 = { 0f, 0f, 0f };
	float fLocal_612 = 0f;
	var uLocal_613 = 16;
	var uLocal_614 = 0;
	var uLocal_615 = 0;
	var uLocal_616 = 0;
	var uLocal_617 = 0;
	var uLocal_618 = 0;
	var uLocal_619 = 0;
	var uLocal_620 = 0;
	var uLocal_621 = 0;
	var uLocal_622 = 0;
	var uLocal_623 = 0;
	var uLocal_624 = 0;
	var uLocal_625 = 0;
	var uLocal_626 = 0;
	var uLocal_627 = 0;
	var uLocal_628 = 0;
	var uLocal_629 = 0;
	var uLocal_630 = 0;
	var uLocal_631 = 0;
	var uLocal_632 = 0;
	var uLocal_633 = 0;
	var uLocal_634 = 0;
	var uLocal_635 = 0;
	var uLocal_636 = 0;
	var uLocal_637 = 0;
	var uLocal_638 = 0;
	var uLocal_639 = 0;
	var uLocal_640 = 0;
	var uLocal_641 = 0;
	var uLocal_642 = 0;
	var uLocal_643 = 0;
	var uLocal_644 = 0;
	var uLocal_645 = 0;
	var uLocal_646 = 0;
	var uLocal_647 = 0;
	var uLocal_648 = 0;
	var uLocal_649 = 0;
	var uLocal_650 = 0;
	var uLocal_651 = 0;
	var uLocal_652 = 0;
	var uLocal_653 = 0;
	var uLocal_654 = 0;
	var uLocal_655 = 0;
	var uLocal_656 = 0;
	var uLocal_657 = 0;
	var uLocal_658 = 0;
	var uLocal_659 = 0;
	var uLocal_660 = 0;
	var uLocal_661 = 0;
	var uLocal_662 = 0;
	var uLocal_663 = 0;
	var uLocal_664 = 0;
	var uLocal_665 = 0;
	var uLocal_666 = 0;
	var uLocal_667 = 0;
	var uLocal_668 = 0;
	var uLocal_669 = 0;
	var uLocal_670 = 0;
	var uLocal_671 = 0;
	var uLocal_672 = 0;
	var uLocal_673 = 0;
	var uLocal_674 = 0;
	var uLocal_675 = 0;
	var uLocal_676 = 0;
	var uLocal_677 = 0;
	var uLocal_678 = 0;
	var uLocal_679 = 0;
	var uLocal_680 = 0;
	var uLocal_681 = 0;
	var uLocal_682 = 0;
	var uLocal_683 = 0;
	var uLocal_684 = 0;
	var uLocal_685 = 0;
	var uLocal_686 = 0;
	var uLocal_687 = 0;
	var uLocal_688 = 0;
	var uLocal_689 = 0;
	var uLocal_690 = 0;
	var uLocal_691 = 0;
	var uLocal_692 = 0;
	var uLocal_693 = 0;
	var uLocal_694 = 0;
	var uLocal_695 = 0;
	var uLocal_696 = 0;
	var uLocal_697 = 0;
	var uLocal_698 = 0;
	var uLocal_699 = 0;
	var uLocal_700 = 0;
	var uLocal_701 = 0;
	var uLocal_702 = 0;
	var uLocal_703 = 0;
	var uLocal_704 = 0;
	var uLocal_705 = 0;
	var uLocal_706 = 0;
	var uLocal_707 = 0;
	var uLocal_708 = 0;
	var uLocal_709 = 0;
	var uLocal_710 = 0;
	var uLocal_711 = 0;
	var uLocal_712 = 0;
	var uLocal_713 = 0;
	var uLocal_714 = 0;
	var uLocal_715 = 0;
	var uLocal_716 = 0;
	var uLocal_717 = 0;
	var uLocal_718 = 0;
	var uLocal_719 = 0;
	var uLocal_720 = 0;
	var uLocal_721 = 0;
	var uLocal_722 = 0;
	var uLocal_723 = 0;
	var uLocal_724 = 0;
	var uLocal_725 = 0;
	var uLocal_726 = 0;
	var uLocal_727 = 0;
	var uLocal_728 = 0;
	var uLocal_729 = 0;
	var uLocal_730 = 0;
	var uLocal_731 = 0;
	var uLocal_732 = 0;
	var uLocal_733 = 0;
	var uLocal_734 = 0;
	var uLocal_735 = 0;
	var uLocal_736 = 0;
	var uLocal_737 = 0;
	var uLocal_738 = 0;
	var uLocal_739 = 0;
	var uLocal_740 = 0;
	var uLocal_741 = 0;
	var uLocal_742 = 0;
	var uLocal_743 = 0;
	var uLocal_744 = 0;
	var uLocal_745 = 0;
	var uLocal_746 = 0;
	var uLocal_747 = 0;
	var uLocal_748 = 0;
	var uLocal_749 = 0;
	var uLocal_750 = 0;
	var uLocal_751 = 0;
	var uLocal_752 = 0;
	var uLocal_753 = 0;
	var uLocal_754 = 0;
	var uLocal_755 = 0;
	var uLocal_756 = 0;
	var uLocal_757 = 0;
	var uLocal_758 = 0;
	var uLocal_759 = 0;
	var uLocal_760 = 0;
	var uLocal_761 = 0;
	var uLocal_762 = 0;
	var uLocal_763 = 0;
	var uLocal_764 = 0;
	var uLocal_765 = 0;
	var uLocal_766 = 0;
	var uLocal_767 = 0;
	var uLocal_768 = 0;
	var uLocal_769 = 0;
	var uLocal_770 = 0;
	var uLocal_771 = 0;
	var uLocal_772 = 0;
	var uLocal_773 = 0;
	var uLocal_774 = 0;
	var uLocal_775 = 0;
	var uLocal_776 = 0;
	var uLocal_777 = 0;
	int iLocal_778[5] = { 0, 0, 0, 0, 0 };
	int iLocal_784[5] = { 0, 0, 0, 0, 0 };
	float fLocal_790 = 0f;
	var uLocal_791 = 0;
	var uLocal_792 = 0;
	var uLocal_793 = 0;
	var uLocal_794 = 0;
	var uLocal_795 = 0;
	var uLocal_796 = 0;
	var uLocal_797 = 0;
	var uLocal_798 = 0;
	var uLocal_799 = 0;
	var uLocal_800 = 0;
	var uLocal_801 = 0;
	var uLocal_802 = 0;
	var uLocal_803 = 0;
	var uLocal_804 = 0;
	int iLocal_805 = 0;
	int iLocal_806 = 0;
	int iLocal_807 = 0;
	int iLocal_808 = 0;
	int iLocal_809 = 0;
	int iLocal_810 = 0;
	int iLocal_811 = 0;
	int iLocal_812 = 0;
	int iLocal_813 = 0;
	vector3 vLocal_814 = { 0f, 0f, 0f };
	struct<20> Local_817 = { 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1 } ;
#endregion

void __EntryFunction__()//Position - 0x0
{
	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_18 = "NULL";
	fLocal_23 = 80f;
	fLocal_24 = 140f;
	fLocal_25 = 180f;
	fLocal_28 = 0f;
	fLocal_32 = -0.0375f;
	fLocal_33 = 0.17f;
	iLocal_36 = 3;
	iLocal_40 = 1;
	iLocal_41 = 65;
	iLocal_42 = 49;
	iLocal_43 = 64;
	fLocal_87 = ((0.05f + 0.275f) - 0.01f);
	fLocal_90 = -0.05f;
	fLocal_91 = 0.92f;
	fLocal_92 = 1.94f;
	fLocal_93 = 2.99f;
	fLocal_94 = 3.7f;
	iLocal_548 = joaat("mp_m_shopkeep_01");
	iLocal_556 = -1;
	iLocal_563 = -1;
	iLocal_581 = 303280717;
	iLocal_582 = system::round(Global_262145.f_2417);
	iLocal_583 = system::round(Global_262145.f_2413) + 1;
	iLocal_584 = 1;
	if (network::network_is_game_in_progress())
	{
		if (!func_450(Local_817))
		{
			func_445();
		}
		if (func_444(1))
		{
			func_438(player::player_id(), 0, 98816);
		}
	}
	while (true)
	{
		func_437();
		if (func_427())
		{
			func_445();
		}
		func_425();
		if (gameplay::is_bit_set(Local_96.f_23, 6))
		{
			if (func_444(1))
			{
				func_438(player::player_id(), 1, 0);
				func_422();
				gameplay::clear_bit(&(Local_490.f_53), 7);
				func_421();
			}
		}
		switch (func_420(network::participant_id_to_int()))
		{
			case 0:
				streaming::request_anim_dict("mp_am_hold_up");
				if (streaming::has_anim_dict_loaded("mp_am_hold_up"))
				{
					if (func_410())
					{
						graphics::request_streamed_texture_dict(func_409(Local_490), false);
						if (network::network_does_network_id_exist(Local_96))
						{
							if (func_408() > 0)
							{
								if (!func_407(Local_96))
								{
									func_406(&uLocal_613, 3, network::net_to_ped(Local_96), &(Local_96.f_46), 1, 0);
									func_405();
								}
								gameplay::set_bit(&(Local_490.f_52), 22);
								Local_169[network::participant_id_to_int() /*10*/].f_4 = 2;
							}
						}
					}
				}
				if (func_408() == 6)
				{
					Local_169[network::participant_id_to_int() /*10*/].f_4 = 5;
				}
				break;
			
			case 2:
				func_286(&Local_490, vLocal_557, vLocal_560, &Local_96, &(Local_169[network::participant_id_to_int() /*10*/]), entity::is_entity_in_angled_area(network::net_to_ped(Local_96), vLocal_606, vLocal_609, fLocal_612, 0, true, 0), 0);
				func_279();
				if (func_408() == 2)
				{
					func_126();
				}
				else if (func_408() == 6)
				{
					Local_169[network::participant_id_to_int() /*10*/].f_4 = 5;
				}
				if (!entity::is_entity_at_coord(player::player_ped_id(), vLocal_596, 30f, 30f, 30f, false, true, 0))
				{
					Local_169[network::participant_id_to_int() /*10*/].f_4 = 6;
				}
				break;
			
			case 5:
				func_125(&(Local_96.f_69));
				if (func_124(&(Local_96.f_69)))
				{
					Local_169[network::participant_id_to_int() /*10*/].f_4 = 6;
				}
				break;
			
			case 4:
				Local_169[network::participant_id_to_int() /*10*/].f_4 = 6;
			
			case 6:
				func_51();
				func_445();
				break;
		}
		if (network::network_is_host_of_this_script())
		{
			switch (func_408())
			{
				case 0:
					if (!gameplay::is_bit_set(Local_490.f_52, 16))
					{
						func_49(func_50(0));
						func_49(func_50(1));
						func_49(func_50(2));
						streaming::request_anim_dict("mp_am_hold_up");
						if (streaming::has_anim_dict_loaded("mp_am_hold_up"))
						{
							if (func_410())
							{
								gameplay::clear_area(vLocal_557, 1.5f, 0, 1, 0, true);
								gameplay::clear_area(vLocal_552, 1.5f, 0, 1, 0, true);
								gameplay::set_bit(&(Local_490.f_52), 16);
							}
						}
					}
					else if (func_47())
					{
						Local_96.f_12 = 2;
					}
					break;
				
				case 2:
					func_46();
					func_43();
					func_28();
					func_27();
					func_20();
					func_19();
					func_11();
					func_10();
					if (func_4())
					{
						func_1();
						Local_96.f_12 = 6;
					}
					break;
				
				case 6:
					func_1();
					break;
				}
		}
	}
}

void func_1()//Position - 0x3B7
{
	if (network::network_does_network_id_exist(Local_96.f_13))
	{
		if (func_3(Local_96.f_13))
		{
			if (entity::is_entity_attached(network::net_to_obj(Local_96.f_13)))
			{
				entity::detach_entity(network::net_to_obj(Local_96.f_13), 1, true);
				func_2(&(Local_96.f_13));
			}
		}
	}
}

void func_2(var uParam0)//Position - 0x3FA
{
	int iVar0;
	
	if (network::network_does_entity_exist_with_network_id(*uParam0))
	{
		iVar0 = network::net_to_ent(*uParam0);
		entity::set_entity_as_no_longer_needed(&iVar0);
	}
}

int func_3(int iParam0)//Position - 0x41E
{
	if (network::network_does_network_id_exist(iParam0))
	{
		network::network_request_control_of_network_id(iParam0);
		return network::network_has_control_of_network_id(iParam0);
	}
	return false;
}

bool func_4()//Position - 0x440
{
	if (func_5())
	{
		return true;
	}
	return false;
}

bool func_5()//Position - 0x454
{
	if (gameplay::is_bit_set(Local_96.f_23, 2))
	{
		return true;
	}
	if (gameplay::is_bit_set(Local_96.f_23, 3))
	{
		return true;
	}
	if (!func_9())
	{
		if ((gameplay::is_bit_set(Local_96.f_23, 11) || gameplay::is_bit_set(Local_96.f_23, 19)) || (gameplay::is_bit_set(Local_96.f_23, 9) && !gameplay::is_bit_set(Local_96.f_23, 20)))
		{
			func_6(Local_490.f_50, 1, func_7());
			return true;
		}
		if (gameplay::is_bit_set(Local_96.f_23, 18))
		{
			func_6(Local_490.f_50, 1, func_7());
			return true;
		}
	}
	if (gameplay::is_bit_set(Local_96.f_23, 18))
	{
		if (!gameplay::is_bit_set(Local_96.f_24, 7))
		{
			func_6(Local_490.f_50, 1, func_7());
			gameplay::set_bit(&(Local_96.f_24), 7);
		}
	}
	return false;
}

void func_6(var uParam0, int iParam1, int iParam2)//Position - 0x524
{
	struct<4> Var0;
	
	Var0 = 23;
	Var0.f_1 = player::player_id();
	Var0.f_2 = uParam0;
	Var0.f_3 = iParam1;
	if (!iParam2 == 0)
	{
		script::trigger_script_event(1, &Var0, 4, iParam2);
	}
}

var func_7()//Position - 0x559
{
	return func_8(network::network_get_host_of_script("freemode", -1, 0));
}

var func_8(int iParam0)//Position - 0x56E
{
	var uVar0;
	
	gameplay::set_bit(&uVar0, iParam0);
	return uVar0;
}

bool func_9()//Position - 0x580
{
	if ((gameplay::is_bit_set(Local_96.f_23, 13) || gameplay::is_bit_set(Local_96.f_23, 27)) || gameplay::is_bit_set(Local_96.f_23, 28))
	{
		return true;
	}
	return false;
}

void func_10()//Position - 0x5BA
{
	var uVar0;
	
	if (!gameplay::is_bit_set(Local_96.f_23, 21))
	{
		if (func_407(Local_96))
		{
			Local_96.f_72 = network::network_get_destroyer_of_network_id(Local_96, &uVar0);
			gameplay::set_bit(&(Local_96.f_23), 21);
		}
	}
	if (!gameplay::is_bit_set(Local_96.f_23, 19))
	{
		if (gameplay::is_bit_set(Local_96.f_23, 10) && Local_96.f_37 <= 0f)
		{
			gameplay::set_bit(&(Local_96.f_23), 19);
		}
	}
	if (!gameplay::is_bit_set(Local_96.f_24, 17))
	{
		if (gameplay::is_bit_set(Local_96.f_23, 20))
		{
			if (func_3(Local_96.f_13))
			{
				object::_0x92AEFB5F6E294023(network::net_to_obj(Local_96.f_13), 0, 0);
				gameplay::set_bit(&(Local_96.f_24), 17);
			}
		}
	}
	if (!gameplay::is_bit_set(Local_96.f_23, 6))
	{
		if (Global_2464975.f_8 == 1)
		{
			gameplay::set_bit(&(Local_96.f_23), 6);
			gameplay::set_bit(&(Local_96.f_23), 16);
		}
	}
}

bool func_11()//Position - 0x687
{
	int iVar0;
	int iVar1;
	
	if (!network::network_is_host_of_this_script() || !gameplay::is_bit_set(Local_96.f_25, 0))
	{
		return false;
	}
	if (Local_96.f_66 != 6)
	{
		if (Local_96.f_66 > 0 && func_407(Local_96.f_15))
		{
			Local_96.f_66 = 6;
			return false;
		}
		switch (Local_96.f_66)
		{
			case 0:
				if (!func_17(&uLocal_803, 10000, 0))
				{
					iVar0 = ped::get_random_ped_at_coord(vLocal_606, 20f, 20f, 20f, -1);
					if (!ped::is_ped_injured(iVar0))
					{
						if (!entity::is_entity_a_mission_entity(iVar0))
						{
							iVar1 = entity::get_entity_model(iVar0);
							if (((((((iVar1 != joaat("mp_m_freemode_01") && iVar1 != joaat("mp_f_freemode_01")) && !ped::is_cop_ped_in_area_3d(vLocal_606, 25f, 25f, 25f)) && !entity::is_entity_at_coord(iVar0, vLocal_593, 1f, 1f, 2f, false, true, 0)) && !weapon::is_ped_armed(iVar0, 7)) && !ped::is_ped_in_any_vehicle(iVar0, 1)) && ped::is_ped_human(iVar0)) && func_16(iVar1))
							{
								network::network_request_control_of_entity(iVar0);
								if (network::network_has_control_of_entity(iVar0))
								{
									if (func_15(&(Local_96.f_15), iVar0, 1, 0))
									{
										weapon::give_delayed_weapon_to_ped(network::net_to_ped(Local_96.f_15), joaat("weapon_pistol"), 25000, 0);
										ped::set_ped_keep_task(network::net_to_ped(Local_96.f_15), true);
										Local_96.f_66 = 1;
										gameplay::set_bit(&(Local_96.f_25), 1);
										ped::set_ped_relationship_group_hash(network::net_to_ped(Local_96.f_15), Global_1574255);
										ped::set_ped_combat_movement(network::net_to_ped(Local_96.f_15), 2);
										entity::set_entity_health(network::net_to_ped(Local_96.f_15), system::round((200f * Global_262145.f_151)));
										func_406(&uLocal_613, 4, network::net_to_ped(Local_96.f_15), "StoreHero", 1, 0);
										ai::task_start_scenario_in_place(network::net_to_ped(Local_96.f_15), func_14(), 0, 1);
									}
								}
							}
						}
					}
				}
				break;
			
			case 1:
				if ((gameplay::is_bit_set(Local_96.f_23, 9) || gameplay::is_bit_set(Local_96.f_23, 5)) || gameplay::is_bit_set(Local_96.f_23, 4))
				{
					Local_96.f_66 = 2;
				}
				break;
			
			case 2:
				if (func_17(&(Local_96.f_67), 3000, 0) || (ai::get_script_task_status(network::net_to_ped(Local_96.f_15), 1227113341) != 0 && ai::get_script_task_status(network::net_to_ped(Local_96.f_15), 1227113341) != 1))
				{
					func_13(&(Local_96.f_67));
					Local_96.f_66 = 3;
				}
				break;
			
			case 3:
				if (((gameplay::is_bit_set(Local_96.f_23, 5) || gameplay::is_bit_set(Local_96.f_25, 8)) || gameplay::is_bit_set(Local_96.f_25, 9)) || func_17(&(Local_96.f_67), 5000, 0))
				{
					if (func_12() || func_17(&(Local_96.f_67), 5000, 0))
					{
						Local_96.f_66 = 4;
					}
					else
					{
						Local_96.f_66 = 5;
					}
				}
				break;
			
			case 4:
				break;
			
			case 5:
				break;
			}
	}
	return true;
}

bool func_12()//Position - 0x965
{
	if (gameplay::is_bit_set(gameplay::get_random_int_in_range(0, 65535), 0))
	{
		return true;
	}
	return false;
}

void func_13(var uParam0)//Position - 0x986
{
	uParam0->f_1 = 0;
}

char* func_14()//Position - 0x993
{
	int iVar0;
	
	iVar0 = gameplay::get_random_int_in_range(0, 100);
	if (iVar0 < 30)
	{
		return "WORLD_HUMAN_SMOKING";
	}
	if (iVar0 >= 30 && iVar0 < 70)
	{
		return "WORLD_HUMAN_HANG_OUT_STREET";
	}
	return "WORLD_HUMAN_STAND_MOBILE";
}

bool func_15(var uParam0, int iParam1, int iParam2, int iParam3)//Position - 0x9D2
{
	entity::set_entity_as_mission_entity(iParam1, iParam2, iParam3);
	*uParam0 = network::network_get_network_id_from_entity(iParam1);
	if (network::network_does_network_id_exist(*uParam0))
	{
		if (iParam2)
		{
			network::set_network_id_exists_on_all_machines(*uParam0, 1);
		}
		return true;
	}
	return false;
}

bool func_16(int iParam0)//Position - 0xA09
{
	if (((((((((((((((((((((((((((((((((((((((((((((((((((((iParam0 == joaat("mp_m_freemode_01") || iParam0 == joaat("mp_m_fibsec_01")) || iParam0 == joaat("mp_s_m_armoured_01")) || iParam0 == joaat("s_f_y_airhostess_01")) || iParam0 == joaat("s_f_y_baywatch_01")) || iParam0 == joaat("s_f_y_cop_01")) || iParam0 == joaat("s_f_y_ranger_01")) || iParam0 == joaat("s_f_y_scrubs_01")) || iParam0 == joaat("s_f_y_sheriff_01")) || iParam0 == joaat("s_m_m_armoured_01")) || iParam0 == joaat("s_m_m_armoured_02")) || iParam0 == joaat("s_m_m_bouncer_01")) || iParam0 == joaat("s_m_m_ciasec_01")) || iParam0 == joaat("s_m_m_chemsec_01")) || iParam0 == joaat("s_m_m_doctor_01")) || iParam0 == joaat("s_m_m_fiboffice_01")) || iParam0 == joaat("s_m_m_fiboffice_02")) || iParam0 == joaat("s_m_m_highsec_01")) || iParam0 == joaat("s_m_m_highsec_02")) || iParam0 == joaat("s_m_m_janitor")) || iParam0 == joaat("s_m_m_lsmetro_01")) || iParam0 == joaat("s_m_m_marine_01")) || iParam0 == joaat("s_m_m_marine_02")) || iParam0 == joaat("s_m_m_paramedic_01")) || iParam0 == joaat("s_m_m_pilot_01")) || iParam0 == joaat("s_m_m_pilot_02")) || iParam0 == joaat("s_m_m_postal_01")) || iParam0 == joaat("s_m_m_postal_02")) || iParam0 == joaat("s_m_m_prisguard_01")) || iParam0 == joaat("s_m_m_scientist_01")) || iParam0 == joaat("s_m_m_security_01")) || iParam0 == joaat("s_m_m_ups_01")) || iParam0 == joaat("s_m_m_ups_02")) || iParam0 == joaat("s_m_y_airworker")) || iParam0 == joaat("s_m_y_armymech_01")) || iParam0 == joaat("s_m_y_baywatch_01")) || iParam0 == joaat("s_m_y_blackops_01")) || iParam0 == joaat("s_m_y_blackops_02")) || iParam0 == joaat("s_m_y_cop_01")) || iParam0 == joaat("s_m_y_doorman_01")) || iParam0 == joaat("s_m_y_fireman_01")) || iParam0 == joaat("s_m_y_garbage")) || iParam0 == joaat("s_m_y_hwaycop_01")) || iParam0 == joaat("s_m_y_marine_01")) || iParam0 == joaat("s_m_y_marine_02")) || iParam0 == joaat("s_m_y_marine_03")) || iParam0 == joaat("s_m_y_pilot_01")) || iParam0 == joaat("s_m_y_ranger_01")) || iParam0 == joaat("s_m_y_sheriff_01")) || iParam0 == joaat("s_m_y_swat_01")) || iParam0 == joaat("s_m_y_uscg_01")) || iParam0 == joaat("s_m_y_valet_01")) || iParam0 == joaat("s_m_y_waiter_01")) || iParam0 == joaat("u_m_m_jewelsec_01"))
	{
		return false;
	}
	return true;
}

bool func_17(var uParam0, int iParam1, int iParam2)//Position - 0xD07
{
	if (iParam1 == -1)
	{
		return true;
	}
	func_18(uParam0, iParam2, 0);
	if (network::network_is_game_in_progress() && !iParam2)
	{
		if (gameplay::absi(network::get_time_difference(network::get_network_time(), *uParam0)) >= iParam1)
		{
			return true;
		}
	}
	else if (gameplay::absi(network::get_time_difference(gameplay::get_game_timer(), *uParam0)) >= iParam1)
	{
		return true;
	}
	return false;
}

void func_18(var uParam0, int iParam1, int iParam2)//Position - 0xD65
{
	if (uParam0->f_1 == 0)
	{
		if (network::network_is_game_in_progress() && !iParam1)
		{
			if (!iParam2)
			{
				*uParam0 = network::get_network_time();
			}
			else
			{
				*uParam0 = network::_0x89023FBBF9200E9F();
			}
		}
		else
		{
			*uParam0 = gameplay::get_game_timer();
		}
		uParam0->f_1 = 1;
	}
}

void func_19()//Position - 0xDAA
{
	if (Local_96.f_30 == 0)
	{
		if (Local_96.f_3 >= 2 && Local_96.f_3 != 9)
		{
			Local_96.f_30 = decisionevent::add_shocking_event_for_entity(99, player::player_ped_id(), 60000f);
		}
	}
}

void func_20()//Position - 0xDE2
{
	float fVar0;
	float fVar1;
	float fVar2;
	
	if (!gameplay::is_bit_set(Local_96.f_1, 5))
	{
		if (Local_96.f_41 > 0)
		{
			func_24();
			if (!gameplay::is_bit_set(Local_96.f_1, 5))
			{
				return;
			}
		}
	}
	if (gameplay::is_bit_set(Local_96.f_1, 1))
	{
		if (Local_96.f_2 == 3 && !gameplay::is_bit_set(Local_96.f_23, 9))
		{
			Local_96.f_2 = 0;
		}
		gameplay::clear_bit(&(Local_96.f_1), 1);
	}
	switch (Local_96.f_2)
	{
		case 0:
			if ((((func_3(Local_96) && !func_407(Local_96)) && func_3(Local_96.f_16[Local_96.f_26])) && Local_96.f_3 != 8) && Local_96.f_3 != 7)
			{
				if (!ped::is_ped_ragdoll(network::net_to_ped(Local_96)))
				{
					if (gameplay::is_bit_set(Local_96.f_23, 9) || gameplay::is_bit_set(Local_96.f_1, 4))
					{
						Local_96.f_2 = 2;
						return;
					}
					if (!iLocal_546)
					{
						ai::task_achieve_heading(network::net_to_ped(Local_96), Local_96.f_42, 1600);
						iLocal_546 = 1;
					}
					if (func_17(&uLocal_793, 100, 0))
					{
						fVar0 = entity::get_entity_heading(network::net_to_ped(Local_96));
						fVar1 = (Local_96.f_42 - 10f);
						fVar2 = (Local_96.f_42 + 10f);
						if (fVar1 < 0f)
						{
							fVar2 = ((Local_96.f_42 - 10f) + 360f);
							fVar1 = ((Local_96.f_42 + 10f) + 360f);
						}
						else if (fVar2 >= 360f)
						{
							fVar2 = ((Local_96.f_42 - 10f) - 360f);
							fVar1 = ((Local_96.f_42 + 10f) - 360f);
						}
						if (((fVar0 < fVar2 && fVar0 > fVar1) && func_17(&uLocal_799, 1000, 0)) || func_17(&uLocal_799, 3125, 0))
						{
							ai::clear_ped_secondary_task(network::net_to_ped(Local_96));
							Local_96.f_27 = network::network_create_synchronised_scene(entity::get_offset_from_entity_in_world_coords(network::net_to_ped(Local_96), -0.65f, 0.87f, -0.02f), vLocal_560, 2, true, false, 1065353216, 0, 1065353216);
							network::network_add_ped_to_synchronised_scene(network::net_to_ped(Local_96), Local_96.f_27, "mp_am_hold_up", func_23(Local_96.f_26), 1.5f, -1.5f, 157, 16, 1148846080, 0);
							if (network::network_does_network_id_exist(Local_96.f_16[Local_96.f_26]))
							{
								entity::set_entity_visible(network::net_to_obj(Local_96.f_16[Local_96.f_26]), true, 0);
								network::network_add_entity_to_synchronised_scene(network::net_to_obj(Local_96.f_16[Local_96.f_26]), Local_96.f_27, "mp_am_hold_up", func_22(Local_96.f_26), 4f, -4f, 8);
							}
							network::network_start_synchronised_scene(Local_96.f_27);
							Local_96.f_2 = 1;
							iLocal_563 = network::_0x02C40BF885C567B6(Local_96.f_27);
						}
					}
				}
			}
			break;
		
		case 1:
			if (gameplay::is_bit_set(Local_96.f_23, 9) || gameplay::is_bit_set(Local_96.f_1, 4))
			{
				iLocal_563 = network::_0x02C40BF885C567B6(Local_96.f_27);
				if (ped::is_synchronized_scene_running(iLocal_563))
				{
					network::network_stop_synchronised_scene(Local_96.f_27);
				}
				Local_96.f_2 = 2;
				return;
			}
			if (iLocal_563 >= 0)
			{
				if (ped::is_synchronized_scene_running(iLocal_563) || func_17(&uLocal_795, 2000, 0))
				{
					if ((ped::is_synchronized_scene_running(iLocal_563) && ped::get_synchronized_scene_phase(iLocal_563) == 1f) || func_17(&uLocal_795, 2000, 0))
					{
						if ((func_3(Local_96) && !func_407(Local_96)) && !gameplay::is_bit_set(Local_96.f_23, 9))
						{
							ai::clear_ped_tasks(network::net_to_ped(Local_96));
						}
						network::network_stop_synchronised_scene(Local_96.f_27);
						Local_96.f_2 = 2;
					}
				}
			}
			else
			{
				iLocal_563 = network::_0x02C40BF885C567B6(Local_96.f_27);
			}
			break;
		
		case 2:
			func_3(Local_96.f_16[Local_96.f_26]);
			if (func_17(&uLocal_801, 1000, 0) && func_3(Local_96.f_16[Local_96.f_26]))
			{
				if (entity::does_entity_exist(network::net_to_obj(Local_96.f_16[Local_96.f_26])))
				{
					entity::set_entity_visible(network::net_to_obj(Local_96.f_16[Local_96.f_26]), false, 0);
					entity::freeze_entity_position(network::net_to_obj(Local_96.f_16[Local_96.f_26]), true);
					entity::set_entity_coords(network::net_to_obj(Local_96.f_16[Local_96.f_26]), func_21(Local_96.f_26), 1, false, 0, 1);
				}
				iLocal_563 = -1;
				iLocal_546 = 0;
				if (gameplay::is_bit_set(Local_96.f_1, 4))
				{
					gameplay::clear_bit(&(Local_96.f_1), 4);
				}
				func_13(&uLocal_801);
				func_13(&uLocal_795);
				func_13(&uLocal_793);
				func_13(&uLocal_799);
				Local_96.f_2 = 3;
			}
			break;
		
		case 3:
			break;
	}
}

Vector3 func_21(int iParam0)//Position - 0x1237
{
	switch (iParam0)
	{
		case 3:
			return vLocal_577 - Vector(1f, 0.2f, 0.1f);
		
		case 1:
			return vLocal_577 - Vector(1f, 0.2f, 0f);
		
		case 2:
			return vLocal_577 - Vector(1f, 0.2f, -0.1f);
		
		case 4:
			return vLocal_577 - Vector(1f, -0.2f, 0.1f);
		
		case 0:
			return vLocal_577 - Vector(1f, -0.2f, 0f);
		
		case 5:
			return vLocal_577 - Vector(1f, -0.2f, -0.1f);
		
		default:
	}
	return vLocal_577 - Vector(1f, 0f, -0.1f);
}

char* func_22(int iParam0)//Position - 0x12E7
{
	switch (iParam0)
	{
		case 3:
			return "purchase_chocbar";
		
		case 1:
			return "purchase_chocbar";
		
		case 2:
			return "purchase_chocbar";
		
		case 4:
			return "purchase_cigarette";
		
		case 0:
			return "purchase_beer";
		
		case 5:
			return "purchase_energydrink";
		
		default:
	}
	return "purchase_energydrink";
}

char* func_23(int iParam0)//Position - 0x1341
{
	switch (iParam0)
	{
		case 3:
			return "purchase_chocbar_shopkeeper";
		
		case 1:
			return "purchase_chocbar_shopkeeper";
		
		case 2:
			return "purchase_chocbar_shopkeeper";
		
		case 4:
			return "purchase_cigarette_shopkeeper";
		
		case 0:
			return "purchase_beer_shopkeeper";
		
		case 5:
			return "purchase_energydrink_shopkeeper";
		
		default:
	}
	return "purchase_energydrink_shopkeeper";
}

bool func_24()//Position - 0x139D
{
	if (((((!network::network_does_network_id_exist(Local_96.f_16[3]) || !network::network_does_network_id_exist(Local_96.f_16[1])) || !network::network_does_network_id_exist(Local_96.f_16[2])) || !network::network_does_network_id_exist(Local_96.f_16[4])) || !network::network_does_network_id_exist(Local_96.f_16[0])) || !network::network_does_network_id_exist(Local_96.f_16[5]))
	{
		if (((((func_49(func_26(3)) && func_49(func_26(1))) && func_49(func_26(2))) && func_49(func_26(4))) && func_49(func_26(0))) && func_49(func_26(5)))
		{
			if (network::can_register_mission_entities(0, 0, 6, 0))
			{
				if (!network::network_does_network_id_exist(Local_96.f_16[3]))
				{
					if (func_25(&(Local_96.f_16[3]), func_26(3), func_21(3), 1, 1, 0, 1))
					{
						interior::_0x82EBB79E258FA2B7(network::net_to_obj(Local_96.f_16[3]), interior::get_interior_at_coords(vLocal_549));
						entity::freeze_entity_position(network::net_to_obj(Local_96.f_16[3]), true);
						entity::set_entity_visible(network::net_to_obj(Local_96.f_16[3]), false, 0);
					}
				}
				if (!network::network_does_network_id_exist(Local_96.f_16[1]))
				{
					if (func_25(&(Local_96.f_16[1]), func_26(1), func_21(1), 1, 1, 0, 1))
					{
						interior::_0x82EBB79E258FA2B7(network::net_to_obj(Local_96.f_16[1]), interior::get_interior_at_coords(vLocal_549));
						entity::freeze_entity_position(network::net_to_obj(Local_96.f_16[1]), true);
						entity::set_entity_visible(network::net_to_obj(Local_96.f_16[1]), false, 0);
					}
				}
				if (!network::network_does_network_id_exist(Local_96.f_16[2]))
				{
					if (func_25(&(Local_96.f_16[2]), func_26(2), func_21(2), 1, 1, 0, 1))
					{
						interior::_0x82EBB79E258FA2B7(network::net_to_obj(Local_96.f_16[2]), interior::get_interior_at_coords(vLocal_549));
						entity::freeze_entity_position(network::net_to_obj(Local_96.f_16[2]), true);
						entity::set_entity_visible(network::net_to_obj(Local_96.f_16[2]), false, 0);
					}
				}
				if (!network::network_does_network_id_exist(Local_96.f_16[4]))
				{
					if (func_25(&(Local_96.f_16[4]), func_26(4), func_21(4), 1, 1, 0, 1))
					{
						interior::_0x82EBB79E258FA2B7(network::net_to_obj(Local_96.f_16[4]), interior::get_interior_at_coords(vLocal_549));
						entity::freeze_entity_position(network::net_to_obj(Local_96.f_16[4]), true);
						entity::set_entity_visible(network::net_to_obj(Local_96.f_16[4]), false, 0);
					}
				}
				if (!network::network_does_network_id_exist(Local_96.f_16[0]))
				{
					if (func_25(&(Local_96.f_16[0]), func_26(0), func_21(0), 1, 1, 0, 1))
					{
						interior::_0x82EBB79E258FA2B7(network::net_to_obj(Local_96.f_16[0]), interior::get_interior_at_coords(vLocal_549));
						entity::freeze_entity_position(network::net_to_obj(Local_96.f_16[0]), true);
						entity::set_entity_visible(network::net_to_obj(Local_96.f_16[0]), false, 0);
					}
				}
				if (!network::network_does_network_id_exist(Local_96.f_16[5]))
				{
					if (func_25(&(Local_96.f_16[5]), func_26(5), func_21(5), 1, 1, 0, 1))
					{
						interior::_0x82EBB79E258FA2B7(network::net_to_obj(Local_96.f_16[5]), interior::get_interior_at_coords(vLocal_549));
						entity::freeze_entity_position(network::net_to_obj(Local_96.f_16[5]), true);
						entity::set_entity_visible(network::net_to_obj(Local_96.f_16[5]), false, 0);
					}
				}
			}
		}
	}
	else
	{
		gameplay::set_bit(&(Local_96.f_1), 5);
		return true;
	}
	return false;
}

bool func_25(var uParam0, int iParam1, vector3 vParam2, int iParam5, int iParam6, int iParam7, int iParam8)//Position - 0x16DA
{
	if (!network::can_register_mission_objects(1))
	{
		return false;
	}
	*uParam0 = network::obj_to_net(object::create_object(iParam1, vParam2, iParam6, iParam5, iParam7));
	if (network::network_does_network_id_exist(*uParam0))
	{
		entity::_0x3910051CCECDB00C(network::net_to_obj(*uParam0), iParam8);
		if (network::_0xC7827959479DCC78(network::net_to_obj(*uParam0)))
		{
			if (iParam5)
			{
				network::set_network_id_exists_on_all_machines(*uParam0, 1);
			}
		}
		return true;
	}
	return false;
}

int func_26(int iParam0)//Position - 0x173D
{
	switch (iParam0)
	{
		case 3:
			return joaat("prop_choc_pq");
		
		case 1:
			return joaat("prop_choc_ego");
		
		case 2:
			return joaat("prop_choc_meto");
		
		case 4:
			return joaat("prop_ld_fags_01");
		
		case 0:
			return joaat("prop_ecola_can");
		
		case 5:
			return joaat("prop_amb_beer_bottle");
		
		default:
	}
	return joaat("prop_choc_pq");
}

void func_27()//Position - 0x17A5
{
	float fVar0;
	
	if (!gameplay::is_bit_set(Local_96.f_23, 9))
	{
		if (Global_2464975.f_8 == 1 || gameplay::is_bit_set(Local_96.f_23, 6))
		{
			if ((((func_3(Local_96.f_13) && func_3(Local_96)) && !func_407(Local_96)) && Local_96.f_3 != 8) && Local_96.f_3 != 7)
			{
				if (!ped::is_ped_ragdoll(network::net_to_ped(Local_96)))
				{
					if (!gameplay::is_bit_set(Local_490.f_52, 30))
					{
						ai::task_achieve_heading(network::net_to_ped(Local_96), Local_96.f_42, 1600);
						gameplay::set_bit(&(Local_490.f_52), 30);
					}
					if (func_17(&uLocal_791, 100, 0))
					{
						fVar0 = entity::get_entity_heading(network::net_to_ped(Local_96));
						if ((fVar0 > (Local_96.f_42 - 20f) && fVar0 < (Local_96.f_42 + 20f)) || func_17(&uLocal_797, 1500, 0))
						{
							ai::clear_ped_secondary_task(network::net_to_ped(Local_96));
							Local_96.f_29 = network::network_create_synchronised_scene(vLocal_557, vLocal_560, 2, true, false, 1065353216, 0, 1065353216);
							network::network_add_ped_to_synchronised_scene(network::net_to_ped(Local_96), Local_96.f_29, "mp_am_hold_up", "holdup_victim_20s", 4f, -1.5f, 157, 16, 1148846080, 0);
							if (network::network_does_network_id_exist(Local_96.f_13))
							{
								entity::freeze_entity_position(network::net_to_obj(Local_96.f_13), false);
								entity::set_entity_dynamic(network::net_to_obj(Local_96.f_13), 1);
								network::network_add_entity_to_synchronised_scene(network::net_to_obj(Local_96.f_13), Local_96.f_29, "mp_am_hold_up", "holdup_victim_20s_bag", 4f, -4f, 137);
							}
							if (network::network_does_network_id_exist(Local_96.f_14))
							{
								network::network_add_entity_to_synchronised_scene(network::net_to_obj(Local_96.f_14), Local_96.f_29, "mp_am_hold_up", "holdup_victim_20s_till", 4f, -4f, 137);
							}
							network::network_start_synchronised_scene(Local_96.f_29);
							gameplay::set_bit(&(Local_96.f_23), 9);
						}
					}
				}
				else
				{
					Local_96.f_3 = 8;
				}
			}
		}
	}
	else if (!gameplay::is_bit_set(Local_96.f_23, 17))
	{
		iLocal_556 = network::_0x02C40BF885C567B6(Local_96.f_29);
		if (iLocal_556 >= 0)
		{
			func_3(Local_96);
			if (ped::is_synchronized_scene_running(iLocal_556))
			{
				ped::set_ped_using_action_mode(player::player_ped_id(), false, -1, 0);
				gameplay::set_bit(&(Local_96.f_23), 17);
			}
		}
	}
	else if (!gameplay::is_bit_set(Local_96.f_24, 15))
	{
		iLocal_556 = network::_0x02C40BF885C567B6(Local_96.f_29);
		if (iLocal_556 >= 0)
		{
			if (ped::is_synchronized_scene_running(iLocal_556))
			{
				func_3(Local_96);
				if ((network::network_does_network_id_exist(Local_96.f_13) && func_3(Local_96.f_13)) && func_3(Local_96))
				{
					if (ped::get_synchronized_scene_phase(iLocal_556) > 0.44f)
					{
						entity::set_entity_visible(network::net_to_obj(Local_96.f_13), true, 0);
						entity::set_entity_collision(network::net_to_obj(Local_96.f_13), true, 0);
						gameplay::set_bit(&(Local_96.f_24), 15);
					}
				}
			}
		}
	}
}

bool func_28()//Position - 0x1A3D
{
	int iVar0;
	float fVar1;
	
	if (!network::network_is_host_of_this_script())
	{
		return false;
	}
	func_41();
	if (Local_96.f_3 != 9)
	{
		if (func_407(Local_96))
		{
			Local_96.f_3 = 9;
			return false;
		}
		if ((gameplay::is_bit_set(Local_96.f_23, 6) && !gameplay::is_bit_set(Local_96.f_23, 9)) && Local_96.f_3 < 8)
		{
			if (!network::network_does_network_id_exist(Local_96.f_13) || !network::network_does_network_id_exist(Local_96.f_14))
			{
				Local_96.f_3 = 8;
			}
		}
		switch (Local_96.f_3)
		{
			case 0:
				if (!func_407(Local_96))
				{
					Local_96.f_3 = 1;
				}
				break;
			
			case 1:
				if (gameplay::is_bit_set(Local_96.f_23, 4))
				{
					Local_96.f_3 = 2;
				}
				else if (gameplay::is_bit_set(Local_96.f_23, 6) || gameplay::is_bit_set(Local_96.f_23, 9))
				{
					Local_96.f_3 = 4;
				}
				else if (func_39() || func_33(0))
				{
					Local_96.f_3 = 8;
				}
				else if (func_31())
				{
					Local_96.f_3 = 7;
				}
				break;
			
			case 2:
				if (gameplay::is_bit_set(Local_96.f_23, 6) || gameplay::is_bit_set(Local_96.f_23, 9))
				{
					Local_96.f_3 = 4;
				}
				else if (func_39() || func_33(1))
				{
					Local_96.f_3 = 8;
				}
				else if (func_31())
				{
					Local_96.f_3 = 7;
				}
				break;
			
			case 3:
				if (ai::get_script_task_status(network::net_to_ped(Local_96), 1920390111) != 0 && ai::get_script_task_status(network::net_to_ped(Local_96), 1920390111) != 1)
				{
					Local_96.f_3 = 4;
				}
				else if (func_33(1))
				{
					Local_96.f_3 = 8;
				}
				else if (func_31())
				{
					Local_96.f_3 = 7;
				}
				break;
			
			case 4:
				if (gameplay::is_bit_set(Local_96.f_23, 17))
				{
					iVar0 = 0;
					iLocal_556 = network::_0x02C40BF885C567B6(Local_96.f_29);
					if (iLocal_556 >= 0)
					{
						if (ped::is_synchronized_scene_running(iLocal_556))
						{
							if (gameplay::is_bullet_in_area(vLocal_549, 3f, 0))
							{
								if (!gameplay::is_bit_set(Local_96.f_23, 25))
								{
									gameplay::set_bit(&(Local_96.f_23), 25);
								}
								Local_96.f_33 = (Local_96.f_33 + 0.35f);
							}
							fVar1 = ped::get_synchronized_scene_phase(iLocal_556);
							if (fVar1 >= 0.8f)
							{
								Local_96.f_37 = 1f;
							}
							else if (fVar1 <= 0.5f)
							{
								Local_96.f_37 = 0f;
							}
							else if (fVar1 > Local_96.f_37)
							{
								Local_96.f_37 = ((fVar1 - 0.5f) * 3.33f);
							}
							if (fVar1 >= 0.92f)
							{
								Local_96.f_37 = 1f;
								iVar0 = 1;
							}
						}
						else
						{
							iVar0 = 1;
						}
					}
					else
					{
						iVar0 = 1;
					}
					if (iVar0 == 1)
					{
						Local_96.f_3 = 6;
					}
					else if (func_33(1))
					{
						Local_96.f_3 = 8;
					}
					else if (func_31())
					{
						Local_96.f_3 = 7;
					}
				}
				break;
			
			case 5:
				if (func_39() || func_33(1))
				{
					Local_96.f_3 = 8;
				}
				break;
			
			case 6:
				func_29();
				if (func_39() || func_33(1))
				{
					Local_96.f_3 = 8;
				}
				else if (func_31())
				{
					Local_96.f_3 = 7;
				}
				else if (gameplay::is_bit_set(Local_96.f_24, 3))
				{
					if (!gameplay::is_bit_set(Local_96.f_24, 4))
					{
						Local_96.f_3 = 7;
					}
				}
				break;
			
			case 8:
				func_29();
				break;
			
			case 7:
				break;
		}
	}
	else if (!gameplay::is_bit_set(Local_96.f_24, 10))
	{
		if (!network::network_does_network_id_exist(Local_96))
		{
			Local_96.f_43 = (Local_96.f_43 - 1);
			gameplay::set_bit(&(Local_96.f_24), 10);
		}
	}
	return true;
}

void func_29()//Position - 0x1DA9
{
	int iVar0;
	int iVar1;
	
	if (!gameplay::is_bit_set(Local_96.f_24, 2))
	{
		iVar0 = gameplay::get_random_int_in_range(0, 10);
		iVar1 = (iLocal_584 + func_30());
		if (iVar0 < iVar1)
		{
			gameplay::set_bit(&(Local_96.f_24), 3);
		}
		gameplay::set_bit(&(Local_96.f_24), 2);
	}
}

int func_30()//Position - 0x1DEA
{
	int iVar0;
	
	iVar0 = (Global_2418529[player::player_id() /*313*/].f_46 - 1);
	if (iVar0 >= 4)
	{
		return 4;
	}
	return iVar0;
}

bool func_31()//Position - 0x1E0F
{
	int iVar0;
	int iVar1;
	
	if (controls::is_control_just_pressed(0, 24) || controls::is_control_just_pressed(0, 257))
	{
		iVar0 = func_32(player::player_ped_id());
		if ((((((iVar0 != joaat("weapon_unarmed") && iVar0 != 0) && iVar0 != joaat("vehicle_weapon_player_bullet")) && iVar0 != joaat("vehicle_weapon_player_buzzard")) && iVar0 != joaat("vehicle_weapon_player_laser")) && iVar0 != joaat("vehicle_weapon_tank")) && iVar0 != joaat("weapon_flare"))
		{
			iVar1 = weapon::get_weapontype_group(iVar0);
			if (((((((weapon::get_ammo_in_ped_weapon(player::player_ped_id(), iVar0) == 0 && iVar1 != -728555052) && iVar1 != 507375312) && iVar1 != 0) && iVar1 != -37788308) && iVar1 != -801780072) && iVar1 != 431593103) && iVar1 != -755518101)
			{
				if (interior::get_interior_from_entity(player::player_ped_id()) == iLocal_589)
				{
					return true;
				}
			}
		}
	}
	return false;
}

var func_32(int iParam0)//Position - 0x1F0F
{
	var uVar0;
	
	weapon::get_current_ped_weapon(iParam0, &uVar0, 1);
	return uVar0;
}

bool func_33(int iParam0)//Position - 0x1F23
{
	int iVar0;
	struct<2> Var1;
	int iVar11;
	int iVar12;
	
	if (func_37(player::player_id(), 146))
	{
		return true;
	}
	if (gameplay::is_bit_set(Local_96.f_23, 5))
	{
		return true;
	}
	if (ped::is_ped_ragdoll(network::net_to_ped(Local_96)))
	{
		return true;
	}
	if (func_36() || func_35())
	{
		return true;
	}
	if (func_34())
	{
		return true;
	}
	iVar0 = 0;
	while (iVar0 < script::get_number_of_events(1))
	{
		if (script::get_event_at_index(1, iVar0) == 179)
		{
			if (script::get_event_data(1, iVar0, &Var1, 10))
			{
				if (entity::does_entity_exist(Var1) && entity::is_entity_a_ped(Var1))
				{
					iVar11 = entity::get_ped_index_from_entity_index(Var1);
					if (ped::is_ped_injured(iVar11) && interior::get_interior_from_entity(iVar11) == iLocal_589)
					{
						if (entity::does_entity_exist(Var1.f_1) && entity::is_entity_a_ped(Var1.f_1))
						{
							iVar12 = entity::get_ped_index_from_entity_index(Var1.f_1);
							if (iVar12 != network::net_to_ped(Local_96))
							{
								return true;
							}
						}
					}
				}
			}
		}
		iVar0++;
	}
	if (iParam0 == 1)
	{
		if (!gameplay::is_bit_set(Local_96.f_24, 5))
		{
			if (ped::is_cop_ped_in_area_3d(vLocal_599 - Vector(25f, 25f, 25f), vLocal_599 + Vector(25f, 25f, 25f)))
			{
				gameplay::set_bit(&(Local_96.f_24), 5);
			}
		}
	}
	return false;
}

bool func_34()//Position - 0x2060
{
	if (Local_490.f_50 >= 15 && Local_490.f_50 <= 19)
	{
		if (fire::is_explosion_in_sphere(9, vLocal_599, 40f))
		{
			return true;
		}
	}
	if (fire::is_explosion_in_angled_area(-1, vLocal_599, vLocal_602, fLocal_605))
	{
		return true;
	}
	if (fire::is_explosion_in_angled_area(-1, vLocal_606, vLocal_609, fLocal_612))
	{
		return true;
	}
	return false;
}

bool func_35()//Position - 0x20CA
{
	if ((gameplay::is_projectile_type_in_angled_area(vLocal_606, vLocal_609, fLocal_612, joaat("weapon_grenade"), 0) || gameplay::is_projectile_type_in_angled_area(vLocal_606, vLocal_609, fLocal_612, joaat("weapon_molotov"), 0)) || gameplay::is_projectile_type_in_angled_area(vLocal_606, vLocal_609, fLocal_612, joaat("weapon_stickybomb"), 0))
	{
		return true;
	}
	return false;
}

bool func_36()//Position - 0x212B
{
	if ((gameplay::is_projectile_type_in_angled_area(vLocal_599, vLocal_602, fLocal_605, joaat("weapon_grenade"), 0) || gameplay::is_projectile_type_in_angled_area(vLocal_599, vLocal_602, fLocal_605, joaat("weapon_molotov"), 0)) || gameplay::is_projectile_type_in_angled_area(vLocal_599, vLocal_602, fLocal_605, joaat("weapon_stickybomb"), 0))
	{
		return true;
	}
	return false;
}

int func_37(int iParam0, int iParam1)//Position - 0x218C
{
	if (Global_1610705[iParam0 /*178*/] == iParam1)
	{
		return func_38(iParam0);
	}
	return false;
}

int func_38(int iParam0)//Position - 0x21AB
{
	int iVar0;
	
	iVar0 = iParam0;
	if (iVar0 != -1)
	{
		return gameplay::is_bit_set(Global_1610705[iVar0 /*178*/].f_1, 0);
	}
	return false;
}

bool func_39()//Position - 0x21D0
{
	if (func_40() || func_34())
	{
		return true;
	}
	return false;
}

bool func_40()//Position - 0x21EE
{
	if (gameplay::is_bullet_in_angled_area(vLocal_599, vLocal_602, fLocal_605, 0))
	{
		return true;
	}
	if (gameplay::is_bullet_in_angled_area(vLocal_606, vLocal_609, fLocal_612, 0))
	{
		return true;
	}
	return false;
}

void func_41()//Position - 0x2229
{
	if (Local_96.f_33 > 0f)
	{
		if (func_42(&(Local_96.f_34), 50, 0))
		{
			Local_96.f_33 = (Local_96.f_33 - 0.02f);
			if (Local_96.f_33 < 0f)
			{
				Local_96.f_33 = 0f;
			}
			func_13(&(Local_96.f_34));
		}
	}
}

bool func_42(var uParam0, int iParam1, int iParam2)//Position - 0x226C
{
	if (iParam1 == -1)
	{
		return true;
	}
	func_18(uParam0, iParam2, 0);
	if (network::network_is_game_in_progress() && !iParam2)
	{
		if (gameplay::absi(network::get_time_difference(network::get_network_time(), *uParam0)) >= iParam1)
		{
			func_13(uParam0);
			return true;
		}
	}
	else if (gameplay::absi(network::get_time_difference(gameplay::get_game_timer(), *uParam0)) >= iParam1)
	{
		func_13(uParam0);
		return true;
	}
	return false;
}

void func_43()//Position - 0x22D6
{
	int iVar0;
	int iVar1;
	
	if (network::network_is_participant_active(player::int_to_participantindex(iLocal_570)))
	{
		iVar0 = network::network_get_player_index(player::int_to_participantindex(iLocal_570));
		iVar1 = player::get_player_ped(iVar0);
		if (!gameplay::is_bit_set(Local_96.f_23, 11))
		{
			if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 5))
			{
				if (network::network_does_entity_exist_with_network_id(Local_96.f_13))
				{
					if (func_3(Local_96.f_13))
					{
						entity::detach_entity(network::net_to_obj(Local_96.f_13), 1, true);
						func_45(&(Local_96.f_13));
					}
				}
				else
				{
					Local_96.f_38 = { Local_169[iLocal_570 /*10*/].f_7 };
					Local_96.f_44 = 7;
					gameplay::set_bit(&(Local_96.f_23), 11);
				}
			}
		}
		if (!gameplay::is_bit_set(Local_96.f_23, 14))
		{
			if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 6))
			{
				gameplay::set_bit(&(Local_96.f_23), 14);
			}
		}
		if (!gameplay::is_bit_set(Local_96.f_23, 15))
		{
			if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 7))
			{
				gameplay::set_bit(&(Local_96.f_23), 15);
			}
		}
		if (!gameplay::is_bit_set(Local_96.f_23, 26))
		{
			if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 24))
			{
				gameplay::set_bit(&(Local_96.f_23), 26);
			}
		}
		if (!gameplay::is_bit_set(Local_96.f_23, 22))
		{
			if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 22))
			{
				gameplay::set_bit(&(Local_96.f_23), 22);
			}
		}
		if (!gameplay::is_bit_set(Local_96.f_23, 23))
		{
			if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 23))
			{
				gameplay::set_bit(&(Local_96.f_23), 23);
			}
		}
		if (!gameplay::is_bit_set(Local_96.f_23, 30))
		{
			if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 25))
			{
				gameplay::set_bit(&(Local_96.f_23), 30);
			}
		}
		if (!gameplay::is_bit_set(Local_96.f_23, 31))
		{
			if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 26))
			{
				gameplay::set_bit(&(Local_96.f_23), 31);
			}
		}
		if (!gameplay::is_bit_set(Local_96.f_24, 6))
		{
			if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 29))
			{
				gameplay::set_bit(&(Local_96.f_24), 6);
			}
		}
		if (!gameplay::is_bit_set(Local_96.f_24, 9))
		{
			if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 31))
			{
				gameplay::set_bit(&(Local_96.f_24), 9);
			}
		}
		if (!gameplay::is_bit_set(Local_96.f_1, 3))
		{
			if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/].f_1, 3))
			{
				gameplay::set_bit(&(Local_96.f_1), 3);
			}
		}
		if (gameplay::is_bit_set(Local_96.f_25, 1))
		{
			if (!gameplay::is_bit_set(Local_96.f_25, 6))
			{
				if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/].f_5, 1))
				{
					gameplay::set_bit(&(Local_96.f_25), 6);
				}
			}
			if (!gameplay::is_bit_set(Local_96.f_25, 7))
			{
				if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/].f_5, 2))
				{
					gameplay::set_bit(&(Local_96.f_25), 7);
				}
			}
			if (!gameplay::is_bit_set(Local_96.f_25, 5))
			{
				if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/].f_5, 0))
				{
					gameplay::set_bit(&(Local_96.f_25), 5);
				}
			}
		}
		if (!gameplay::is_bit_set(Local_96.f_23, 20))
		{
			if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 11))
			{
				gameplay::set_bit(&(Local_96.f_23), 20);
			}
		}
		if (!gameplay::is_bit_set(Local_96.f_24, 17))
		{
			if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 13))
			{
				gameplay::set_bit(&(Local_96.f_24), 17);
			}
		}
		if (func_44(iVar0, 1, 1))
		{
			if (!gameplay::is_bit_set(Local_96.f_23, 5))
			{
				if (!func_407(Local_96))
				{
					if (entity::has_entity_been_damaged_by_entity(network::net_to_ped(Local_96), iVar1, 1))
					{
						gameplay::set_bit(&(Local_96.f_23), 5);
					}
				}
			}
			if (gameplay::is_bit_set(Local_96.f_25, 1))
			{
				if (!gameplay::is_bit_set(Local_96.f_25, 8))
				{
					if (!func_407(Local_96.f_15))
					{
						if (entity::has_entity_been_damaged_by_entity(network::net_to_ped(Local_96.f_15), iVar1, 1))
						{
							gameplay::set_bit(&(Local_96.f_25), 8);
						}
					}
				}
				if (!gameplay::is_bit_set(Local_96.f_25, 9))
				{
					if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/].f_5, 3))
					{
						gameplay::set_bit(&(Local_96.f_25), 9);
					}
				}
			}
			if (!gameplay::is_bit_set(Local_96.f_23, 6))
			{
				if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 1))
				{
					gameplay::set_bit(&(Local_96.f_23), 6);
				}
			}
			if (!gameplay::is_bit_set(Local_96.f_23, 16))
			{
				if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 8))
				{
					gameplay::set_bit(&(Local_96.f_23), 16);
				}
			}
			if (!gameplay::is_bit_set(Local_96.f_24, 1))
			{
				if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 27))
				{
					gameplay::set_bit(&(Local_96.f_24), 1);
				}
			}
			if (!gameplay::is_bit_set(Local_96.f_23, 7))
			{
				if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 0))
				{
					gameplay::set_bit(&(Local_96.f_23), 7);
				}
			}
			if (!gameplay::is_bit_set(Local_96.f_23, 10))
			{
				if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 4))
				{
					if (Local_96.f_3 != 5 && Local_96.f_3 != 6)
					{
						Local_96.f_3 = 5;
					}
					gameplay::set_bit(&(Local_96.f_23), 10);
				}
			}
			if (!gameplay::is_bit_set(Local_96.f_1, 2))
			{
				if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/].f_1, 2))
				{
					gameplay::set_bit(&(Local_96.f_1), 2);
					gameplay::set_bit(&(Local_96.f_1), 4);
					iLocal_572 = iLocal_570;
				}
			}
			else if (!gameplay::is_bit_set(Local_169[iLocal_572 /*10*/].f_1, 2))
			{
				gameplay::clear_bit(&(Local_96.f_1), 2);
				if (gameplay::is_bit_set(Local_96.f_1, 3))
				{
					gameplay::clear_bit(&(Local_96.f_1), 3);
				}
			}
			if (!gameplay::is_bit_set(Local_96.f_24, 8))
			{
				if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 30))
				{
					gameplay::set_bit(&(Local_96.f_24), 8);
				}
			}
			if (!gameplay::is_bit_set(Local_96.f_1, 0))
			{
				if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/].f_1, 0))
				{
					gameplay::set_bit(&(Local_96.f_1), 0);
					gameplay::set_bit(&(Local_96.f_1), 1);
					Local_96.f_26 = Local_169[iLocal_570 /*10*/].f_2;
					iLocal_571 = iLocal_570;
				}
			}
			else if (!gameplay::is_bit_set(Local_169[iLocal_571 /*10*/].f_1, 0))
			{
				gameplay::clear_bit(&(Local_96.f_1), 0);
			}
			if (!gameplay::is_bit_set(Local_96.f_24, 13))
			{
				if (gameplay::is_bit_set(Local_169[iLocal_570 /*10*/], 21))
				{
					gameplay::set_bit(&(Local_96.f_24), 13);
				}
			}
		}
	}
	iLocal_570++;
	if (iLocal_570 == network::_network_get_num_participants_host())
	{
		iLocal_570 = 0;
	}
}

bool func_44(int iParam0, int iParam1, int iParam2)//Position - 0x2877
{
	var uVar0;
	
	uVar0 = iParam0;
	if (network::network_is_player_active(iParam0))
	{
		if (iParam1)
		{
			if (!player::is_player_playing(iParam0))
			{
				return false;
			}
		}
		if (iParam2)
		{
			if (!Global_2428549.f_3[uVar0])
			{
				return false;
			}
		}
		return true;
	}
	return false;
}

void func_45(var uParam0)//Position - 0x28BB
{
	int iVar0;
	
	if (network::network_does_network_id_exist(*uParam0))
	{
		if (!network::network_has_control_of_network_id(*uParam0))
		{
		}
	}
	if (network::network_does_entity_exist_with_network_id(*uParam0))
	{
		iVar0 = network::net_to_ent(*uParam0);
		entity::delete_entity(&iVar0);
	}
}

void func_46()//Position - 0x28F4
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	int iVar6;
	
	gameplay::set_bit(&(Local_96.f_23), 2);
	gameplay::set_bit(&(Local_96.f_23), 3);
	gameplay::clear_bit(&(Local_96.f_23), 13);
	gameplay::clear_bit(&(Local_96.f_23), 27);
	gameplay::clear_bit(&(Local_96.f_23), 28);
	gameplay::clear_bit(&(Local_96.f_24), 4);
	if (!gameplay::is_bit_set(Local_96.f_23, 18))
	{
		if (func_407(Local_96))
		{
			if (Local_96.f_37 <= 0f)
			{
				gameplay::set_bit(&(Local_96.f_23), 18);
			}
		}
	}
	iVar0 = 0;
	while (iVar0 < network::_network_get_num_participants_host())
	{
		if (network::network_is_participant_active(player::int_to_participantindex(iVar0)))
		{
			iVar5 = network::network_get_player_index(player::int_to_participantindex(iVar0));
			iVar6 = player::get_player_ped(iVar5);
			if (Local_169[iVar0 /*10*/].f_3 > 0)
			{
				Local_96.f_4 = (Local_96.f_4 + Local_169[iVar0 /*10*/].f_3);
				Local_169[iVar0 /*10*/].f_3 = 0;
			}
			if (gameplay::is_bit_set(Local_96.f_23, 3))
			{
				if (entity::is_entity_at_coord(iVar6, vLocal_596, 30f, 30f, 30f, false, true, 0))
				{
					gameplay::clear_bit(&(Local_96.f_23), 3);
				}
			}
			if (!gameplay::is_bit_set(Local_96.f_24, 16))
			{
				if (gameplay::is_bit_set(Local_169[iVar0 /*10*/], 12))
				{
					gameplay::set_bit(&(Local_96.f_24), 16);
				}
			}
			if (func_44(iVar5, 1, 1))
			{
				if (gameplay::is_bit_set(Local_96.f_23, 2))
				{
					gameplay::clear_bit(&(Local_96.f_23), 2);
				}
				if (interior::get_interior_from_entity(iVar6) == iLocal_589)
				{
					if (interior::get_room_key_from_entity(iVar6) == iLocal_590 || interior::get_room_key_from_entity(iVar6) == iLocal_591)
					{
						iVar2 = 1;
					}
					else if (interior::get_room_key_from_entity(iVar6) == iLocal_592)
					{
						gameplay::set_bit(&(Local_96.f_23), 27);
						iVar3 = 1;
					}
				}
				if (iVar2 == 1 || iVar3 == 1)
				{
					gameplay::set_bit(&(Local_96.f_23), 13);
					iVar4++;
					if (!gameplay::is_bit_set(Local_96.f_23, 9) && !gameplay::is_bit_set(Local_96.f_23, 21))
					{
						if (!gameplay::is_bit_set(Local_96.f_23, 4))
						{
							if (weapon::get_current_ped_weapon(iVar6, &iVar1, 1))
							{
								if ((((iVar1 != joaat("weapon_unarmed") && iVar1 != 0) && iVar1 != joaat("object")) && iVar1 != joaat("weapon_flare")) && iVar1 != joaat("weapon_snowball"))
								{
									if (Local_96.f_32 == -1)
									{
										Local_96.f_32 = iVar0;
									}
									else if (!network::network_is_participant_active(player::int_to_participantindex(Local_96.f_32)))
									{
										Local_96.f_32 = -1;
									}
									gameplay::set_bit(&(Local_96.f_23), 4);
									if (!gameplay::is_bit_set(Local_96.f_23, 12))
									{
										if (entity::is_entity_at_coord(iVar6, vLocal_549, 2.5f, 2.5f, 3f, false, true, 0))
										{
											gameplay::set_bit(&(Local_96.f_23), 12);
										}
									}
								}
							}
						}
						if (!gameplay::is_bit_set(Local_96.f_24, 0))
						{
							if (player::get_player_wanted_level(iVar5) > 0)
							{
								gameplay::set_bit(&(Local_96.f_24), 0);
							}
						}
					}
				}
				else if (entity::is_entity_at_coord(iVar6, vLocal_596, 5f, 5f, 2.5f, false, true, 0))
				{
					gameplay::set_bit(&(Local_96.f_23), 28);
					iVar4++;
				}
				if (!gameplay::is_bit_set(Local_96.f_24, 4))
				{
					if (gameplay::is_bit_set(Local_169[iVar0 /*10*/], 28))
					{
						gameplay::set_bit(&(Local_96.f_24), 4);
					}
				}
				if ((gameplay::is_bit_set(Local_96.f_23, 9) && !gameplay::is_bit_set(Local_96.f_23, 20)) && !gameplay::is_bit_set(Local_96.f_23, 19))
				{
					if (Local_169[iLocal_570 /*10*/].f_6 > Local_96.f_33)
					{
						Local_96.f_33 = Local_169[iVar0 /*10*/].f_6;
						func_13(&(Local_96.f_34));
						if (!gameplay::is_bit_set(Local_96.f_23, 24))
						{
							if (Local_96.f_33 > (0.55f + 0.2f))
							{
								gameplay::set_bit(&(Local_96.f_23), 24);
							}
						}
					}
				}
			}
		}
		iVar0++;
	}
	if (Local_96.f_41 != iVar4)
	{
		Local_96.f_41 = iVar4;
	}
}

bool func_47()//Position - 0x2C71
{
	int iVar0;
	
	if ((!network::network_does_network_id_exist(Local_96) || !network::network_does_network_id_exist(Local_96.f_13)) || !network::network_does_network_id_exist(Local_96.f_14))
	{
		if ((func_49(iLocal_548) && func_49(func_50(1))) && func_49(func_50(2)))
		{
			if (network::can_register_mission_entities(1, 0, 2, 0))
			{
				if (!network::network_does_network_id_exist(Local_96))
				{
					if (func_48(&Local_96, 4, iLocal_548, vLocal_549 - Vector(1f, 0f, 0f), Local_96.f_42, 1, 1, 1))
					{
						ped::set_ped_component_variation(network::net_to_ped(Local_96), 0, iLocal_778[0], iLocal_784[0], 0);
						ped::set_ped_component_variation(network::net_to_ped(Local_96), 2, iLocal_778[1], iLocal_784[1], 0);
						ped::set_ped_component_variation(network::net_to_ped(Local_96), 3, iLocal_778[2], iLocal_784[2], 0);
						ped::set_ped_component_variation(network::net_to_ped(Local_96), 4, iLocal_778[3], iLocal_784[3], 0);
						ped::set_ped_component_variation(network::net_to_ped(Local_96), 8, iLocal_778[4], iLocal_784[4], 0);
						interior::_0x82EBB79E258FA2B7(network::net_to_ped(Local_96), interior::get_interior_at_coords(vLocal_549));
						ped::set_ped_keep_task(network::net_to_ped(Local_96), true);
						ped::set_blocking_of_non_temporary_events(network::net_to_ped(Local_96), true);
						entity::set_entity_is_target_priority(network::net_to_ped(Local_96), 1, 0);
						ped::_set_ped_ragdoll_flag(network::net_to_ped(Local_96), 16);
						ped::set_ped_can_evasive_dive(network::net_to_ped(Local_96), 0);
						ped::set_ped_flee_attributes(network::net_to_ped(Local_96), 1024, true);
						weapon::remove_all_ped_weapons(network::net_to_ped(Local_96), 1);
						entity::set_entity_health(network::net_to_ped(Local_96), system::round((200f * Global_262145.f_151)));
						if (!decorator::decor_exist_on(network::net_to_ped(Local_96), "XP_Blocker"))
						{
							decorator::decor_set_bool(network::net_to_ped(Local_96), "XP_Blocker", 1);
						}
						func_406(&uLocal_613, 3, network::net_to_ped(Local_96), &(Local_96.f_46), 1, 0);
					}
				}
				if (!network::network_does_network_id_exist(Local_96.f_13))
				{
					iVar0 = object::create_portable_pickup(-1795552418, vLocal_573, false, func_50(1));
					if (entity::does_entity_exist(iVar0))
					{
						Local_96.f_13 = network::obj_to_net(iVar0);
						entity::freeze_entity_position(network::net_to_obj(Local_96.f_13), true);
						entity::set_entity_collision(network::net_to_obj(Local_96.f_13), false, 0);
						entity::set_entity_heading(network::net_to_obj(Local_96.f_13), fLocal_576);
						interior::_0x82EBB79E258FA2B7(network::net_to_obj(Local_96.f_13), interior::get_interior_at_coords(vLocal_549));
						entity::set_entity_invincible(network::net_to_obj(Local_96.f_13), true);
						object::_0xA08FE5E49BDC39DD(network::net_to_obj(Local_96.f_13), -0.2f, 1);
						object::_0x92AEFB5F6E294023(network::net_to_obj(Local_96.f_13), 1, 0);
						entity::set_entity_visible(network::net_to_obj(Local_96.f_13), false, 0);
					}
				}
				if (!network::network_does_network_id_exist(Local_96.f_14))
				{
					if (func_25(&(Local_96.f_14), func_50(2), vLocal_577 - Vector(0.12f, 0f, 0f), 1, 1, 0, 1))
					{
						entity::set_entity_heading(network::net_to_obj(Local_96.f_14), fLocal_580);
						interior::_0x82EBB79E258FA2B7(network::net_to_obj(Local_96.f_14), interior::get_interior_at_coords(vLocal_549));
						entity::freeze_entity_position(network::net_to_obj(Local_96.f_14), true);
					}
				}
			}
		}
	}
	else
	{
		return true;
	}
	return false;
}

bool func_48(int iParam0, int iParam1, int iParam2, vector3 vParam3, float fParam6, int iParam7, int iParam8, int iParam9)//Position - 0x2F42
{
	int iVar0;
	
	if (!network::can_register_mission_peds(1))
	{
		return false;
	}
	iVar0 = ped::create_ped(iParam1, iParam2, vParam3, fParam6, iParam8, iParam7);
	*iParam0 = network::ped_to_net(iVar0);
	if (network::network_does_network_id_exist(*iParam0))
	{
		entity::_0x3910051CCECDB00C(iVar0, iParam9);
		if (network::_0xC7827959479DCC78(iVar0))
		{
			if (iParam7)
			{
				network::set_network_id_exists_on_all_machines(*iParam0, 1);
			}
		}
		return true;
	}
	return false;
}

int func_49(int iParam0)//Position - 0x2FA1
{
	if (iParam0 == 0)
	{
		return true;
	}
	streaming::request_model(iParam0);
	return streaming::has_model_loaded(iParam0);
}

int func_50(int iParam0)//Position - 0x2FBF
{
	switch (iParam0)
	{
		case 0:
			return joaat("mp_m_shopkeep_01");
		
		case 1:
			return joaat("p_poly_bag_01_s");
		
		case 2:
			return joaat("p_till_01_s");
		
		default:
	}
	return joaat("mp_m_shopkeep_01");
}

void func_51()//Position - 0x2FFD
{
	if (!gameplay::is_bit_set(Local_490.f_52, 20))
	{
		if (gameplay::is_bit_set(Local_96.f_23, 11) || gameplay::is_bit_set(Local_96.f_24, 16))
		{
			if (interior::get_interior_from_entity(player::player_ped_id()) == iLocal_589 || entity::is_entity_at_coord(player::player_ped_id(), vLocal_596, 5f, 5f, 2.5f, false, true, 0))
			{
				func_54();
				func_52();
				func_6(Local_490.f_50, 1, func_7());
				gameplay::set_bit(&(Local_490.f_52), 20);
			}
			else
			{
				if ((gameplay::is_bit_set(Local_490.f_52, 31) && (player::get_player_wanted_level(player::player_id()) > 0 || gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 1))) && entity::is_entity_at_coord(player::player_ped_id(), vLocal_596, 20f, 20f, 20f, false, true, 0))
				{
					func_54();
				}
				gameplay::set_bit(&(Local_490.f_52), 20);
			}
		}
	}
}

void func_52()//Position - 0x30E7
{
	var uVar0;
	
	uVar0 = func_53(47);
	Global_2411275[uVar0 /*83*/] = 47;
	StringCopy(&(Global_2411275[uVar0 /*83*/].f_18[0 /*16*/]), "-StraightIntoFreemode", 64);
}

int func_53(int iParam0)//Position - 0x3114
{
	int iVar0;
	int iVar1;
	
	iVar0 = 19;
	iVar1 = 0;
	while (iVar1 <= 19)
	{
		if (Global_2411275[iVar1 /*83*/] == iParam0)
		{
			iVar0 = iVar1;
			iVar1 = 20;
		}
		else if (Global_2411275[iVar1 /*83*/] == 0)
		{
			iVar0 = iVar1;
			iVar1 = 20;
		}
		iVar1++;
	}
	return iVar0;
}

void func_54()//Position - 0x3161
{
	int iVar0;
	
	if (player::get_player_wanted_level(player::player_id()) > 0 || gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 1))
	{
		iVar0 = func_123(1174, -1, 0);
		if (!gameplay::is_bit_set(iVar0, Local_490.f_50))
		{
			func_122(14, 1, -1);
			gameplay::set_bit(&iVar0, Local_490.f_50);
			func_121(1174, iVar0, -1, 1);
			if (func_120(14, -1) >= 20)
			{
				func_106(44, 1);
			}
			else
			{
				func_105(44, func_120(14, -1));
			}
		}
		func_104(1160, 1, -1);
		func_103(12, 1, -1, 1);
		func_93(19);
		iLocal_806 = 100;
		iLocal_806 = system::round((IntToFloat(iLocal_806) * Global_262145.f_4221));
		func_58(2, "XPT_HOLDUP", -1636175450, -235721452, iLocal_806, 1, -1, 0);
		func_55(12, 0);
	}
}

void func_55(int iParam0, int iParam1)//Position - 0x3237
{
	var uVar0;
	
	if (func_57(iParam0, iParam1))
	{
		uVar0 = func_56();
		Global_2444000[uVar0] = iParam0;
	}
}

int func_56()//Position - 0x325A
{
	int iVar0;
	int iVar1;
	
	iVar0 = 9;
	iVar1 = 0;
	while (iVar1 <= 9)
	{
		if (Global_2444000[iVar1] == 0)
		{
			iVar0 = iVar1;
			iVar1 = 10;
		}
		iVar1++;
	}
	return iVar0;
}

bool func_57(int iParam0, var uParam1)//Position - 0x328F
{
	if (Global_1315901)
	{
		return false;
	}
	if (iParam0 == 22)
	{
		return true;
	}
	if ((((((((uParam1 || !Global_1315913) || iParam0 == 3) || iParam0 == 10) || iParam0 == 11) || iParam0 == 27) || iParam0 == 28) || iParam0 == 29) || iParam0 == 30)
	{
		return true;
	}
	else
	{
		return false;
	}
	return true;
}

var func_58(int iParam0, char* sParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7)//Position - 0x3315
{
	return func_59(iParam0, sParam1, iParam2, iParam3, iParam4, iParam5, iParam6, iParam7);
}

var func_59(int iParam0, char* sParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7)//Position - 0x3331
{
	var uVar0;
	
	uVar0 = func_60(iParam0, 0, sParam1, iParam4, iParam5, 0, iParam6, 1, iParam2, iParam3, iParam7);
	return uVar0;
}

int func_60(int iParam0, int iParam1, char* sParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8, int iParam9, int iParam10)//Position - 0x3354
{
	float fVar0;
	int iVar1;
	int iVar2;
	float fVar3;
	
	if (func_92(player::player_id()) || func_91(player::player_id()))
	{
		if (Global_262145.f_7844 > 8000)
		{
			iVar2 = 8000;
		}
		else
		{
			iVar2 = Global_262145.f_7844;
		}
	}
	else if (Global_262145.f_5249 > 5000)
	{
		iVar2 = 5000;
	}
	else
	{
		iVar2 = Global_262145.f_5249;
	}
	if (func_90(sParam2))
	{
	}
	if (func_89())
	{
		if (iParam4 < 1)
		{
			iParam4 = 1;
		}
		iVar1 = system::round((IntToFloat(iParam3) * (IntToFloat(iParam4) + fVar0)));
		iVar1 = func_87(iVar1);
		fVar3 = (system::to_float(iVar1) * Global_262145.f_1);
		iVar1 = system::round(fVar3);
		if (iParam10)
		{
			iVar1 = func_86(&iVar1);
		}
		if (iParam1 == 0)
		{
			switch (iParam0)
			{
				case 2:
					func_83(0, &iVar1);
					break;
				
				case 3:
					func_83(1, &iVar1);
					break;
				
				case 1:
					func_79(&iVar1);
					break;
				}
		}
		if (iParam1 == 0)
		{
			if (iVar1 > iVar2)
			{
				if (iParam0 == 1)
				{
					iVar1 = iVar2;
				}
				if (iParam0 == 2 || iParam0 == 3)
				{
					iVar1 = iVar2;
				}
			}
		}
		if (iParam7)
		{
			func_104(1157, iVar1, -1);
			if (iParam1 == 0)
			{
				func_71((func_78(player::player_id()) + iVar1), iParam9, 0);
				if (iParam8 == 0)
				{
				}
				if (iParam9 == 0)
				{
				}
				stats::playstats_award_xp(iVar1, iParam8, iParam9);
				if (Global_1587816[player::player_id() /*444*/].f_39.f_2 != -1)
				{
					func_104(1158, iVar1, -1);
				}
				if (iParam1 == 0)
				{
					func_65(iVar1);
				}
			}
		}
		if (iParam5)
		{
		}
		if (iParam7)
		{
			if (iParam6 == -1)
			{
				func_61((func_63(player::player_id()) + iVar1));
			}
			else
			{
				func_61((func_63(player::player_id()) + iParam6));
			}
		}
		if (iParam7)
		{
		}
	}
	return iVar1;
}

void func_61(int iParam0)//Position - 0x350F
{
	if (func_89())
	{
		Global_1587816[player::player_id() /*444*/].f_195.f_5 = iParam0;
		func_62(joaat("mpply_globalxp"), iParam0);
	}
}

void func_62(int iParam0, int iParam1)//Position - 0x353A
{
	int iVar0;
	
	iVar0 = iParam0;
	if (iVar0 != 0)
	{
		stats::stat_set_int(iVar0, iParam1, 1);
	}
}

int func_63(int iParam0)//Position - 0x3556
{
	if (iParam0 > -1)
	{
		if (func_44(iParam0, 0, 1))
		{
			if (iParam0 == player::player_id())
			{
				return func_64(joaat("mpply_globalxp"));
			}
			else
			{
				return Global_1587816[iParam0 /*444*/].f_195.f_5;
			}
		}
		else
		{
			return func_64(joaat("mpply_globalxp"));
		}
	}
	return 0;
}

int func_64(int iParam0)//Position - 0x35A7
{
	int iVar0;
	var uVar1;
	
	iVar0 = iParam0;
	if (stats::stat_get_int(iVar0, &uVar1, -1))
	{
		return uVar1;
	}
	return 0;
}

void func_65(int iParam0)//Position - 0x35C5
{
	struct<13> Var0;
	int iVar13;
	
	Var0 = { func_70(player::player_id()) };
	if (network::_network_player_is_in_clan())
	{
		if (network::network_clan_player_is_active(&Var0))
		{
			iVar13 = func_68(func_69(&Var0));
			if (iVar13 == 0)
			{
				func_67(&Global_1347700, iParam0);
				func_66(joaat("mpply_crew_local_xp_0"), Global_1347700);
			}
			else if (iVar13 == 1)
			{
				func_67(&Global_1347701, iParam0);
				func_66(joaat("mpply_crew_local_xp_1"), Global_1347701);
			}
			else if (iVar13 == 2)
			{
				func_67(&Global_1347702, iParam0);
				func_66(joaat("mpply_crew_local_xp_2"), Global_1347702);
			}
			else if (iVar13 == 3)
			{
				func_67(&Global_1347703, iParam0);
				func_66(joaat("mpply_crew_local_xp_3"), Global_1347703);
			}
			else if (iVar13 == 4)
			{
				func_67(&Global_1347704, iParam0);
				func_66(joaat("mpply_crew_local_xp_4"), Global_1347704);
			}
		}
	}
}

void func_66(int iParam0, int iParam1)//Position - 0x3699
{
	int iVar0;
	
	iVar0 = iParam0;
	if (iVar0 != 0)
	{
		stats::stat_set_int(iVar0, iParam1, 1);
	}
	switch (iParam0)
	{
		case joaat("mpply_crew_0_id"):
			Global_1347695 = iParam1;
			break;
		
		case joaat("mpply_crew_1_id"):
			Global_1347697 = iParam1;
			break;
		
		case joaat("mpply_crew_2_id"):
			Global_1347697 = iParam1;
			break;
		
		case joaat("mpply_crew_3_id"):
			Global_1347698 = iParam1;
			break;
		
		case joaat("mpply_crew_4_id"):
			Global_1347699 = iParam1;
			break;
		
		case joaat("mpply_crew_local_xp_0"):
			Global_1347700 = iParam1;
			break;
		
		case joaat("mpply_crew_local_xp_1"):
			Global_1347701 = iParam1;
			break;
		
		case joaat("mpply_crew_local_xp_2"):
			Global_1347702 = iParam1;
			break;
		
		case joaat("mpply_crew_local_xp_3"):
			Global_1347703 = iParam1;
			break;
		
		case joaat("mpply_crew_local_xp_4"):
			Global_1347704 = iParam1;
			break;
		
		case joaat("mpply_became_cheater_num"):
			Global_1347705 = iParam1;
			break;
		
		case joaat("mpply_friendly"):
			Global_1347706 = iParam1;
			break;
		
		case joaat("mpply_offensive_language"):
			Global_1347707 = iParam1;
			break;
		
		case joaat("mpply_griefing"):
			Global_1347708 = iParam1;
			break;
		
		case joaat("mpply_helpful"):
			Global_1347709 = iParam1;
			break;
		
		case joaat("mpply_offensive_tagplate"):
			Global_1347710 = iParam1;
			break;
		
		case joaat("mpply_offensive_ugc"):
			Global_1347711 = iParam1;
			break;
		
		default:
			break;
	}
}

void func_67(var uParam0, int iParam1)//Position - 0x37BE
{
	*uParam0 = (*uParam0 + iParam1);
}

int func_68(int iParam0)//Position - 0x37CF
{
	if (iParam0 == Global_1347695)
	{
		return 0;
	}
	else if (iParam0 == Global_1347696)
	{
		return 1;
	}
	else if (iParam0 == Global_1347697)
	{
		return 2;
	}
	else if (iParam0 == Global_1347698)
	{
		return 3;
	}
	else if (iParam0 == Global_1347699)
	{
		return 4;
	}
	else
	{
		return -1;
	}
	return -1;
}

var func_69(var uParam0)//Position - 0x382C
{
	if (network::_network_player_is_in_clan())
	{
		if (network::network_clan_player_is_active(uParam0))
		{
			return Global_2444023;
		}
	}
	return Global_2444023;
}

struct<13> func_70(int iParam0)//Position - 0x384F
{
	struct<13> Var0;
	
	network::network_handle_from_player(iParam0, &Var0, 13);
	return Var0;
}

void func_71(int iParam0, int iParam1, int iParam2)//Position - 0x3866
{
	if (func_89())
	{
		if (iParam0 >= 1787576850)
		{
			iParam0 = 1787576850;
		}
		if (Global_262145.f_7814 == 0 && iParam1 != -1076930708)
		{
			if (iParam2 == 0)
			{
				if (iParam0 < Global_1347815[func_76(-1)])
				{
					stats::playstats_award_xp(iParam0, -523908350, iParam1);
					return;
				}
				else if (iParam0 == Global_1347815[func_76(-1)])
				{
					return;
				}
			}
		}
		if (Global_262145.f_7813 == 0)
		{
			if (iParam0 == 0)
			{
				stats::playstats_award_xp(iParam0, -1158693853, -1345423847);
				if (iParam2 == 0)
				{
					return;
				}
			}
		}
		if (Global_262145.f_7813 == 0)
		{
			if (iParam0 < 0)
			{
				stats::playstats_award_xp(iParam0, -1586921397, iParam1);
				return;
			}
		}
		if (func_75(player::player_id()))
		{
			Global_1587816[player::player_id() /*444*/].f_195.f_1 = iParam0;
			Global_1587816[player::player_id() /*444*/].f_195.f_6 = func_73(iParam0, 1);
		}
		func_72(632, iParam0, -1, 1);
		func_121(633, func_73(iParam0, 1), -1, 1);
		Global_1347815[func_76(-1)] = iParam0;
		func_55(7, 0);
	}
}

void func_72(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x3986
{
	int iVar0;
	
	iVar0 = Global_2473854[iParam0 /*5*/][func_76(iParam2)];
	if (iVar0 != 0)
	{
		stats::stat_set_int(iVar0, iParam1, iParam3);
	}
	switch (iParam0)
	{
		case 780:
			Global_1347761[func_76(iParam2)] = iParam1;
			break;
		
		case 781:
			Global_1347767[func_76(iParam2)] = iParam1;
			break;
		
		case 782:
			Global_1347773[func_76(iParam2)] = iParam1;
			break;
		
		case 783:
			Global_1347779[func_76(iParam2)] = iParam1;
			break;
		
		case 770:
			Global_1347737[func_76(iParam2)] = iParam1;
			break;
		
		case 771:
			Global_1347743[func_76(iParam2)] = iParam1;
			break;
		
		case 772:
			Global_1347749[func_76(iParam2)] = iParam1;
			break;
		
		case 773:
			Global_1347755[func_76(iParam2)] = iParam1;
			break;
		
		case 760:
			Global_1347713[func_76(iParam2)] = iParam1;
			break;
		
		case 761:
			Global_1347719[func_76(iParam2)] = iParam1;
			break;
		
		case 762:
			Global_1347725[func_76(iParam2)] = iParam1;
			break;
		
		case 763:
			Global_1347731[func_76(iParam2)] = iParam1;
			break;
		
		case 750:
			Global_1347785[func_76(iParam2)] = iParam1;
			break;
		
		case 751:
			Global_1347791[func_76(iParam2)] = iParam1;
			break;
		
		case 752:
			Global_1347797[func_76(iParam2)] = iParam1;
			break;
		
		case 753:
			Global_1347803[func_76(iParam2)] = iParam1;
			break;
		
		case 1296:
			Global_1347809[func_76(iParam2)] = iParam1;
			break;
		
		case 632:
			Global_1347815[func_76(iParam2)] = iParam1;
			break;
		
		case 1271:
			Global_1347821[func_76(iParam2)] = iParam1;
			break;
		
		case 1868:
			Global_2497579[0 /*6*/][func_76(iParam2)] = iParam1;
			break;
		
		case 2259:
			Global_2497579[1 /*6*/][func_76(iParam2)] = iParam1;
			break;
		
		case 2907:
			Global_2497579[2 /*6*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3036:
			Global_2497579[3 /*6*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3918:
			Global_2497641[func_76(iParam2)] = iParam1;
			break;
		
		case 757:
			Global_1347827[func_76(iParam2)] = iParam1;
			break;
		
		case 758:
			Global_1347833[func_76(iParam2)] = iParam1;
			break;
		
		case 759:
			Global_1347839[func_76(iParam2)] = iParam1;
			break;
		
		case 1229:
			Global_1347845[func_76(iParam2)] = iParam1;
			break;
		
		case 3031:
			Global_2497610[0 /*5*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3032:
			Global_2497610[1 /*5*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3033:
			Global_2497610[2 /*5*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3034:
			Global_2497610[3 /*5*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3035:
			Global_2497610[4 /*5*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3216:
			Global_2497646[0 /*5*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3217:
			Global_2497646[1 /*5*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3218:
			Global_2497646[2 /*5*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3219:
			Global_2497646[3 /*5*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3220:
			Global_2497646[4 /*5*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3221:
			Global_2497672[0 /*5*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3222:
			Global_2497672[1 /*5*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3223:
			Global_2497672[2 /*5*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3224:
			Global_2497672[3 /*5*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3225:
			Global_2497672[4 /*5*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3199:
			Global_2497610[5 /*5*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3205:
			Global_2497579[4 /*6*/][func_76(iParam2)] = iParam1;
			break;
		
		case 3243:
			Global_2497698[func_76(iParam2)] = iParam1;
			break;
		
		case 3244:
			Global_2497713[func_76(iParam2)] = iParam1;
			break;
		
		case 3245:
			Global_2497703[func_76(iParam2)] = iParam1;
			break;
		
		case 3246:
			Global_2497718[func_76(iParam2)] = iParam1;
			break;
		
		case 3247:
			Global_2497708[func_76(iParam2)] = iParam1;
			break;
		
		case 3248:
			Global_2497723[func_76(iParam2)] = iParam1;
			break;
		
		case 3269:
			Global_2497728[func_76(iParam2)] = iParam1;
			break;
		
		default:
			break;
	}
}

int func_73(int iParam0, int iParam1)//Position - 0x3EA6
{
	if (iParam1)
	{
	}
	return func_74(iParam0, 0);
}

int func_74(int iParam0, int iParam1)//Position - 0x3EBA
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	float fVar4;
	
	if (iParam1 == 0)
	{
	}
	iVar1 = 8000;
	iVar2 = 0;
	iVar3 = ((iVar1 - iVar2) / 2);
	iVar0 = 0;
	while (iVar0 <= 100)
	{
		if (iVar1 == iVar2)
		{
			iVar0 = 8000;
			if (iVar3 == 0)
			{
				iVar3 = 1;
			}
			return iVar3;
		}
		if (Global_276766[iVar3] == iParam0)
		{
			iVar1 = iVar3;
			iVar2 = iVar3;
		}
		else if (Global_276766[iVar3] < iParam0)
		{
			if (iVar2 == iVar3)
			{
				iVar2++;
			}
			else
			{
				iVar2 = iVar3;
			}
		}
		else if (iVar1 == iVar3)
		{
			iVar1 = (iVar1 - 1);
		}
		else
		{
			iVar1 = iVar3;
		}
		fVar4 = (((system::to_float(iVar1) - system::to_float(iVar2)) / 2f) + system::to_float(iVar2));
		iVar3 = system::round(fVar4);
		iVar0++;
	}
	return 8000;
}

int func_75(int iParam0)//Position - 0x3F79
{
	if (iParam0 == -1)
	{
		return false;
	}
	else
	{
		return gameplay::is_bit_set(Global_2428549.f_1, iParam0);
	}
	return true;
}

int func_76(int iParam0)//Position - 0x3F9E
{
	int iVar0;
	int iVar1;
	
	iVar0 = iParam0;
	if (iVar0 == -1)
	{
		iVar1 = func_77();
		if (iVar1 > -1)
		{
			Global_2473567 = 0;
			iVar0 = iVar1;
		}
		else
		{
			iVar0 = 0;
			Global_2473567 = 1;
		}
	}
	return iVar0;
}

var func_77()//Position - 0x3FD2
{
	return Global_1312747;
}

int func_78(int iParam0)//Position - 0x3FDE
{
	if (Global_1312466.f_9 == 0)
	{
		if (iParam0 > -1)
		{
			if (iParam0 == player::player_id())
			{
				return Global_1347815[func_76(-1)];
			}
			else if (func_75(iParam0))
			{
				return Global_1587816[iParam0 /*444*/].f_195.f_1;
			}
		}
	}
	else
	{
		return Global_1347815[func_76(-1)];
	}
	return 0;
}

void func_79(int iParam0)//Position - 0x403E
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	int iVar6;
	int iVar7;
	
	iVar1 = player::get_player_team(player::player_id());
	iVar0 = 0;
	while (iVar0 < network::_network_get_num_participants_host())
	{
		iVar4 = player::int_to_participantindex(iVar0);
		if (network::network_is_participant_active(iVar4))
		{
			iVar5 = network::network_get_player_index(iVar4);
			if (player::get_player_team(iVar5) != -1)
			{
				if (player::get_player_team(iVar5) == iVar1 || func_82(player::get_player_team(iVar5), iVar1, 0))
				{
					iVar2++;
					if (iVar5 != player::player_id())
					{
						if (func_81(player::player_id(), iVar5))
						{
							iVar3 = true;
						}
					}
				}
			}
		}
		iVar0++;
	}
	if (iVar3)
	{
		iVar6 = system::round((func_80(*iParam0, 100) * (10f * Global_262145.f_4213)));
	}
	if (iVar2 > 4)
	{
		iVar2 = 4;
	}
	if (iVar2 >= 2)
	{
		iVar7 = system::round((func_80(*iParam0, 100) * (20f * Global_262145.f_4206)));
	}
	*iParam0 = (*iParam0 + iVar6);
	*iParam0 = (*iParam0 + iVar7);
}

float func_80(int iParam0, int iParam1)//Position - 0x4129
{
	float fVar0;
	float fVar1;
	float fVar2;
	
	fVar0 = system::to_float(iParam0);
	fVar1 = system::to_float(iParam1);
	fVar2 = (fVar0 / fVar1);
	return fVar2;
}

bool func_81(int iParam0, int iParam1)//Position - 0x414A
{
	if (network::_network_player_is_in_clan())
	{
		Global_2460474 = { func_70(iParam0) };
		Global_2460487 = { func_70(iParam1) };
		if (network::network_clan_player_is_active(&Global_2460474))
		{
			if (network::network_clan_player_is_active(&Global_2460487))
			{
				network::network_clan_player_get_desc(&Global_2460404, 35, &Global_2460474);
				network::network_clan_player_get_desc(&Global_2460439, 35, &Global_2460487);
				if (Global_2460404 == Global_2460439)
				{
					return true;
				}
			}
		}
	}
	return false;
}

int func_82(int iParam0, int iParam1, int iParam2)//Position - 0x41B7
{
	if (iParam2 == 1)
	{
		if (iParam0 == iParam1)
		{
			return true;
		}
		return false;
	}
	if ((iParam0 > -1 && iParam1 > -1) && iParam0 == iParam1)
	{
		return true;
	}
	switch (iParam0)
	{
		case 0:
			switch (iParam1)
			{
				case 0:
					return gameplay::is_bit_set(Global_1617902.f_39, 0);
				
				case 1:
					return gameplay::is_bit_set(Global_1617902.f_39, 1);
				
				case 2:
					return gameplay::is_bit_set(Global_1617902.f_39, 2);
				
				case 3:
					return gameplay::is_bit_set(Global_1617902.f_39, 3);
				
				default:
			}
			break;
		
		case 1:
			switch (iParam1)
			{
				case 0:
					return gameplay::is_bit_set(Global_1617902.f_39, 4);
				
				case 1:
					return gameplay::is_bit_set(Global_1617902.f_39, 5);
				
				case 2:
					return gameplay::is_bit_set(Global_1617902.f_39, 6);
				
				case 3:
					return gameplay::is_bit_set(Global_1617902.f_39, 7);
				
				default:
			}
			break;
		
		case 2:
			switch (iParam1)
			{
				case 0:
					return gameplay::is_bit_set(Global_1617902.f_39, 8);
				
				case 1:
					return gameplay::is_bit_set(Global_1617902.f_39, 9);
				
				case 2:
					return gameplay::is_bit_set(Global_1617902.f_39, 10);
				
				case 3:
					return gameplay::is_bit_set(Global_1617902.f_39, 11);
				
				default:
			}
			break;
		
		case 3:
			switch (iParam1)
			{
				case 0:
					return gameplay::is_bit_set(Global_1617902.f_39, 12);
				
				case 1:
					return gameplay::is_bit_set(Global_1617902.f_39, 13);
				
				case 2:
					return gameplay::is_bit_set(Global_1617902.f_39, 14);
				
				case 3:
					return gameplay::is_bit_set(Global_1617902.f_39, 15);
				
				default:
			}
			break;
	}
	return false;
}

void func_83(int iParam0, int iParam1)//Position - 0x4382
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	int iVar6;
	
	if (iParam0)
	{
		iVar0 = 0;
		while (iVar0 < network::_network_get_num_participants_host())
		{
			iVar3 = iVar0;
			if (network::network_is_participant_active(iVar3))
			{
				iVar4 = network::network_get_player_index(iVar3);
				if (func_44(iVar4, 0, 1))
				{
					if (iVar4 != player::player_id())
					{
						iVar1++;
						if (func_81(player::player_id(), iVar4))
						{
							iVar2 = true;
						}
					}
				}
			}
			iVar0++;
		}
	}
	else
	{
		iVar0 = 0;
		while (iVar0 < 32)
		{
			iVar4 = iVar0;
			if (func_44(iVar4, 1, 1))
			{
				if (iVar4 != player::player_id())
				{
					if (func_84(player::player_id(), iVar4) <= 20f)
					{
						iVar1++;
						if (func_81(player::player_id(), iVar4))
						{
							iVar2 = true;
						}
					}
				}
			}
			iVar0++;
		}
	}
	if (iVar2)
	{
		iVar5 = system::round((func_80(*iParam1, 100) * (10f * Global_262145.f_4213)));
	}
	if (iVar1 > 4)
	{
		iVar1 = 4;
	}
	if (iVar1 >= 1)
	{
		iVar6 = system::round((func_80(*iParam1, 100) * (20f * Global_262145.f_4206)));
	}
	*iParam1 = (*iParam1 + iVar5);
	*iParam1 = (*iParam1 + iVar6);
}

float func_84(int iParam0, int iParam1)//Position - 0x449A
{
	return system::vdist(func_85(iParam0), func_85(iParam1));
	return 0f;
}

Vector3 func_85(int iParam0)//Position - 0x44B6
{
	return entity::get_entity_coords(player::get_player_ped(iParam0), 0);
}

var func_86(int iParam0)//Position - 0x44C9
{
	int iVar0;
	
	if (controls::get_local_player_aim_state() != 3)
	{
		return *iParam0;
	}
	iVar0 = system::round((func_80(*iParam0, 100) * 25f));
	*iParam0 = (*iParam0 + iVar0);
	return *iParam0;
}

int func_87(int iParam0)//Position - 0x4500
{
	if (iParam0 < 0)
	{
		if (gameplay::absi(iParam0) > func_78(player::player_id()))
		{
			iParam0 = -func_78(player::player_id());
		}
	}
	if (func_88(8000, 0, 0) > 0)
	{
		if (func_88(8000, 0, 0) < (iParam0 + func_78(player::player_id())))
		{
			iParam0 = (func_88(8000, 0, 0) - func_78(player::player_id()));
		}
	}
	return iParam0;
}

var func_88(int iParam0, int iParam1, int iParam2)//Position - 0x4564
{
	if (iParam2 == 0)
	{
	}
	if (iParam1)
	{
	}
	if (iParam0 >= 8000)
	{
		iParam0 = 8000;
	}
	return Global_276766[iParam0];
}

bool func_89()//Position - 0x458C
{
	return true;
}

bool func_90(char* sParam0)//Position - 0x4595
{
	if (gameplay::is_string_null(sParam0))
	{
		return true;
	}
	else if (gameplay::are_strings_equal(sParam0, "") || gameplay::are_strings_equal(sParam0, "0"))
	{
		return true;
	}
	return false;
}

int func_91(int iParam0)//Position - 0x45CF
{
	return Global_2418529[iParam0 /*313*/].f_114 == 2;
}

int func_92(int iParam0)//Position - 0x45E4
{
	return Global_2418529[iParam0 /*313*/].f_114 == 7;
}

void func_93(int iParam0)//Position - 0x45F9
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	if (!Global_262145.f_7114)
	{
		iVar1 = iParam0;
		iVar2 = -1;
		iVar3 = 0;
		iVar0 = 0;
		while (iVar0 < 3)
		{
			if (Global_2097152[func_102() /*10510*/].f_7704.f_2291[iVar0 /*3*/] == iVar1)
			{
				iVar2 = iVar0;
			}
			if (Global_2097152[func_102() /*10510*/].f_7704.f_2291[iVar0 /*3*/].f_1)
			{
				iVar3++;
			}
			iVar0++;
		}
		if (iVar2 > -1 && iVar2 < 3)
		{
			if (!Global_2097152[func_102() /*10510*/].f_7704.f_2291[iVar2 /*3*/].f_1)
			{
				func_98(iVar2, 1);
				gameplay::set_bit(&Global_2460586, (8 + iVar2));
				func_96(2102, -1);
				func_94(67, -1);
				func_96(2559, -1);
				func_94(69, -1);
				stats::_0xA071E0ED98F91286(1000, iVar1);
				if (iVar3 < 2)
				{
					if (!gameplay::is_bit_set(Global_2460586, 12))
					{
						func_55(7, 0);
					}
					else
					{
						func_55(15, 0);
					}
				}
			}
		}
	}
}

void func_94(int iParam0, int iParam1)//Position - 0x46F0
{
	int iVar0;
	
	iVar0 = func_120(iParam0, func_76(iParam1));
	iVar0++;
	func_95(iParam0, iVar0, iParam1);
}

void func_95(int iParam0, int iParam1, var uParam2)//Position - 0x4716
{
	int iVar0;
	
	iVar0 = Global_2496915[iParam0 /*5*/][func_76(uParam2)];
	stats::stat_set_int(iVar0, iParam1, 1);
}

void func_96(int iParam0, int iParam1)//Position - 0x473A
{
	int iVar0;
	
	iVar0 = func_123(iParam0, func_76(iParam1), 0);
	iVar0++;
	if (!func_97(iParam0))
	{
		func_121(iParam0, iVar0, iParam1, 1);
	}
	else
	{
		func_72(iParam0, iVar0, iParam1, 1);
	}
}

bool func_97(int iParam0)//Position - 0x477A
{
	if (Global_1347694)
	{
		switch (iParam0)
		{
			case 780:
			case 781:
			case 782:
			case 783:
			case 770:
			case 771:
			case 772:
			case 773:
			case 760:
			case 761:
			case 762:
			case 763:
			case 750:
			case 751:
			case 752:
			case 753:
			case 1296:
			case 632:
			case 1271:
			case 757:
			case 758:
			case 759:
			case 1229:
			case 1868:
			case 2259:
			case 2907:
			case 3036:
			case 3918:
			case 3031:
			case 3032:
			case 3033:
			case 3034:
			case 3035:
			case 3216:
			case 3217:
			case 3218:
			case 3219:
			case 3220:
			case 3221:
			case 3222:
			case 3223:
			case 3224:
			case 3225:
			case 3205:
			case 3199:
			case 3243:
			case 3244:
			case 3245:
			case 3246:
			case 3247:
			case 3248:
			case 3269:
				return true;
				break;
			}
	}
	return false;
}

void func_98(int iParam0, int iParam1)//Position - 0x48D0
{
	if (Global_2097152[func_102() /*10510*/].f_7704.f_2291[iParam0 /*3*/].f_1 != iParam1)
	{
		Global_2097152[func_102() /*10510*/].f_7704.f_2291[iParam0 /*3*/].f_1 = iParam1;
		func_99(func_101(iParam0), iParam1, -1, 1);
	}
}

void func_99(var uParam0, int iParam1, int iParam2, int iParam3)//Position - 0x491B
{
	int iVar0;
	
	if (func_100())
	{
		iVar0 = Global_2494881[uParam0 /*5*/][func_76(iParam2)];
		if (iVar0 != 0)
		{
			stats::stat_set_bool(iVar0, iParam1, iParam3);
		}
	}
}

bool func_100()//Position - 0x494D
{
	return true;
	return false;
}

int func_101(int iParam0)//Position - 0x495A
{
	switch (iParam0)
	{
		case 0:
			return 169;
		
		case 1:
			return 170;
		
		case 2:
			return 171;
		
		default:
	}
	return 169;
}

int func_102()//Position - 0x498C
{
	int iVar0;
	
	iVar0 = 0;
	return iVar0;
}

int func_103(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x4999
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	int iVar6;
	int iVar7;
	int iVar8;
	int iVar9;
	int iVar10;
	int iVar11;
	int iVar12;
	
	if (iParam2 == -1)
	{
		iParam2 = func_77();
	}
	iVar0 = 0;
	if (iParam0 >= 0 && iParam0 < 192)
	{
		iVar2 = stats::_0x80C75307B1C42837((iParam0 - 0), 0, 1, iParam2);
		iVar1 = ((iParam0 - 0) - stats::_0xF4D8E7AC2A27758C((iParam0 - 0)) * 64);
		iVar0 = stats::stat_set_bool_masked(iVar2, iParam1, iVar1, iParam3);
	}
	else if (iParam0 >= 192 && iParam0 < 384)
	{
		iVar3 = stats::_0x80C75307B1C42837((iParam0 - 192), 1, 1, iParam2);
		iVar1 = ((iParam0 - 192) - stats::_0xF4D8E7AC2A27758C((iParam0 - 192)) * 64);
		iVar0 = stats::stat_set_bool_masked(iVar3, iParam1, iVar1, iParam3);
	}
	else if (iParam0 >= 513 && iParam0 < 705)
	{
		iVar4 = stats::_0x80C75307B1C42837((iParam0 - 513), 0, 0, 0);
		iVar1 = ((iParam0 - 513) - stats::_0xF4D8E7AC2A27758C((iParam0 - 513)) * 64);
		iVar0 = stats::stat_set_bool_masked(iVar4, iParam1, iVar1, iParam3);
	}
	else if (iParam0 >= 705 && iParam0 < 1281)
	{
		iVar5 = stats::_0x80C75307B1C42837((iParam0 - 705), 1, 0, 0);
		iVar1 = ((iParam0 - 705) - stats::_0xF4D8E7AC2A27758C((iParam0 - 705)) * 64);
		iVar0 = stats::stat_set_bool_masked(iVar5, iParam1, iVar1, iParam3);
	}
	else if (iParam0 >= 3111 && iParam0 < 3879)
	{
		iVar6 = stats::_0xC4BB08EE7907471E((iParam0 - 3111), 0, 1, iParam2);
		iVar1 = ((iParam0 - 3111) - stats::_0xF4D8E7AC2A27758C((iParam0 - 3111)) * 64);
		iVar0 = stats::stat_set_bool_masked(iVar6, iParam1, iVar1, iParam3);
	}
	else if (iParam0 >= 2919 && iParam0 < 3111)
	{
		iVar7 = stats::_0xC4BB08EE7907471E((iParam0 - 2919), 0, 0, 0);
		iVar1 = ((iParam0 - 2919) - stats::_0xF4D8E7AC2A27758C((iParam0 - 2919)) * 64);
		iVar0 = stats::stat_set_bool_masked(iVar7, iParam1, iVar1, iParam3);
	}
	else if (iParam0 >= 4207 && iParam0 < 4335)
	{
		iVar8 = stats::_0xBA52FF538ED2BC71((iParam0 - 4207), 0, 1, iParam2, "_NGPSTAT_BOOL");
		iVar1 = ((iParam0 - 4207) - stats::_0xF4D8E7AC2A27758C((iParam0 - 4207)) * 64);
		iVar0 = stats::stat_set_bool_masked(iVar8, iParam1, iVar1, iParam3);
	}
	else if (iParam0 >= 4335 && iParam0 < 4399)
	{
		iVar9 = stats::_0xBA52FF538ED2BC71((iParam0 - 4335), 0, 0, 0, "_NGPSTAT_BOOL");
		iVar1 = ((iParam0 - 4335) - stats::_0xF4D8E7AC2A27758C((iParam0 - 4335)) * 64);
		iVar0 = stats::stat_set_bool_masked(iVar9, iParam1, iVar1, iParam3);
	}
	else if (iParam0 >= 6029 && iParam0 < 6413)
	{
		iVar10 = stats::_0xBA52FF538ED2BC71((iParam0 - 6029), 0, 1, iParam2, "_NGTATPSTAT_BOOL");
		iVar1 = ((iParam0 - 6029) - stats::_0xF4D8E7AC2A27758C((iParam0 - 6029)) * 64);
		iVar0 = stats::stat_set_bool_masked(iVar10, iParam1, iVar1, iParam3);
	}
	else if (iParam0 >= 7385 && iParam0 < 7641)
	{
		iVar11 = stats::_0xBA52FF538ED2BC71((iParam0 - 7385), 0, 1, iParam2, "_NGDLCPSTAT_BOOL");
		iVar1 = ((iParam0 - 7385) - stats::_0xF4D8E7AC2A27758C((iParam0 - 7385)) * 64);
		iVar0 = stats::stat_set_bool_masked(iVar11, iParam1, iVar1, iParam3);
	}
	else if (iParam0 >= 7321 && iParam0 < 7385)
	{
		iVar12 = stats::_0xBA52FF538ED2BC71((iParam0 - 7321), 0, 0, 0, "_NGDLCPSTAT_BOOL");
		iVar1 = ((iParam0 - 7321) - stats::_0xF4D8E7AC2A27758C((iParam0 - 7321)) * 64);
		iVar0 = stats::stat_set_bool_masked(iVar12, iParam1, iVar1, iParam3);
	}
	return iVar0;
}

void func_104(int iParam0, int iParam1, int iParam2)//Position - 0x4CDF
{
	int iVar0;
	
	iVar0 = func_123(iParam0, func_76(iParam2), 0);
	iVar0 = (iVar0 + iParam1);
	if (!func_97(iParam0))
	{
		func_121(iParam0, iVar0, iParam2, 1);
	}
	else
	{
		func_72(iParam0, iVar0, iParam2, 1);
	}
}

int func_105(int iParam0, int iParam1)//Position - 0x4D20
{
	int iVar0;
	
	if (iParam0 < 0)
	{
		return 0;
	}
	if (iParam0 > 70)
	{
		return 0;
	}
	if (iParam1 <= 0 || iParam1 > 100)
	{
		return 0;
	}
	iVar0 = player::_0x1C186837D0619335(iParam0);
	if (iParam1 > iVar0)
	{
		return player::_0xC2AFFFDABBDC2C5C(iParam0, iParam1);
	}
	return 0;
}

int func_106(int iParam0, int iParam1)//Position - 0x4D71
{
	if (iParam0 >= 70)
	{
		return 0;
	}
	return func_107(iParam0, iParam1);
}

bool func_107(int iParam0, int iParam1)//Position - 0x4D8C
{
	if (func_119(14) && !func_118(iParam0))
	{
		return false;
	}
	if (player::has_achievement_been_passed(iParam0) && iParam1 == 1)
	{
		return false;
	}
	if (Global_25398 != 0 && !Global_69521)
	{
		return false;
	}
	if (func_117(&Global_2568285))
	{
		if (func_115(&Global_2568285, iParam0))
		{
			return false;
		}
		if (func_108(&Global_2568285, iParam0))
		{
			return true;
		}
	}
	else
	{
		if (!player::give_achievement_to_player(iParam0))
		{
			return false;
		}
		if (player::has_achievement_been_passed(iParam0))
		{
			return true;
		}
		return false;
	}
	return false;
}

bool func_108(var uParam0, int iParam1)//Position - 0x4E29
{
	int iVar0;
	var uVar1[70];
	
	if (player::has_achievement_been_passed(iParam1))
	{
		return false;
	}
	if (func_119(14) && !func_118(iParam1))
	{
		return false;
	}
	if (func_115(uParam0, iParam1))
	{
		return false;
	}
	if (func_114(uParam0) < 0f)
	{
		func_113(uParam0, 0);
	}
	func_111(&uVar1);
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < (*uParam0 - 1))
	{
		uVar1[iVar0 + 1] = (*uParam0)[iVar0];
		iVar0++;
	}
	func_109(&uVar1, iParam1);
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < *uParam0)
	{
		(*uParam0)[iVar0] = uVar1[iVar0];
		iVar0++;
	}
	return true;
}

bool func_109(var uParam0, int iParam1)//Position - 0x4EDA
{
	int iVar0;
	
	if (player::has_achievement_been_passed(iParam1))
	{
		return false;
	}
	if (func_119(14) && !func_118(iParam1))
	{
		return false;
	}
	if (func_115(uParam0, iParam1))
	{
		return false;
	}
	if (func_114(uParam0) < 0f)
	{
		func_113(uParam0, 0);
	}
	iVar0 = 0;
	while (iVar0 < *uParam0)
	{
		if (func_110(uParam0, iVar0))
		{
			(*uParam0)[iVar0] = iParam1;
			return true;
		}
		iVar0++;
	}
	return false;
}

int func_110(var uParam0, int iParam1)//Position - 0x4F55
{
	return (*uParam0)[iParam1] == 70;
}

void func_111(var uParam0)//Position - 0x4F66
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < *uParam0)
	{
		func_112(uParam0, iVar0);
		iVar0++;
	}
	func_113(uParam0, (Global_2568284 - 0.5f));
}

void func_112(var uParam0, int iParam1)//Position - 0x4F9A
{
	(*uParam0)[iParam1] = 70;
}

void func_113(var uParam0, float fParam1)//Position - 0x4FAA
{
	if (fParam1 == 0f)
	{
		uParam0->f_72 = 0f;
	}
	else
	{
		uParam0->f_72 = fParam1;
	}
}

var func_114(var uParam0)//Position - 0x4FC7
{
	return uParam0->f_72;
}

int func_115(var uParam0, int iParam1)//Position - 0x4FD3
{
	return func_116(uParam0, iParam1) != -1;
}

int func_116(var uParam0, int iParam1)//Position - 0x4FE5
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < *uParam0)
	{
		if ((*uParam0)[iVar0] == iParam1)
		{
			return iVar0;
		}
		iVar0++;
	}
	return -1;
}

int func_117(var uParam0)//Position - 0x5012
{
	return uParam0->f_71 == 1;
}

bool func_118(int iParam0)//Position - 0x5020
{
	switch (iParam0)
	{
		case 60:
		case 61:
		case 62:
		case 63:
		case 64:
		case 65:
		case 66:
		case 67:
		case 68:
		case 69:
			return true;
		
		default:
	}
	return false;
}

int func_119(int iParam0)//Position - 0x5070
{
	return Global_35742 == iParam0;
}

int func_120(int iParam0, int iParam1)//Position - 0x507E
{
	int iVar0;
	var uVar1;
	
	iVar0 = Global_2496915[iParam0 /*5*/][func_76(iParam1)];
	if (stats::stat_get_int(iVar0, &uVar1, -1))
	{
		return uVar1;
	}
	return 0;
}

void func_121(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x50AA
{
	int iVar0;
	
	iVar0 = Global_2473854[iParam0 /*5*/][func_76(iParam2)];
	if (iVar0 != 0)
	{
		stats::stat_set_int(iVar0, iParam1, iParam3);
	}
}

void func_122(int iParam0, int iParam1, int iParam2)//Position - 0x50D5
{
	int iVar0;
	
	iVar0 = func_120(iParam0, func_76(iParam2));
	iVar0 = (iVar0 + iParam1);
	func_95(iParam0, iVar0, iParam2);
}

int func_123(int iParam0, int iParam1, int iParam2)//Position - 0x50FC
{
	int iVar0;
	var uVar1;
	
	if (iParam2 == 0)
	{
	}
	iVar0 = Global_2473854[iParam0 /*5*/][func_76(iParam1)];
	if (stats::stat_get_int(iVar0, &uVar1, -1))
	{
		return uVar1;
	}
	return 0;
}

bool func_124(var uParam0)//Position - 0x512E
{
	if (uParam0->f_1)
	{
		if (gameplay::absi(network::get_time_difference(network::get_network_time(), *uParam0)) >= 1000)
		{
			return true;
		}
	}
	return false;
}

void func_125(var uParam0)//Position - 0x5157
{
	if (!uParam0->f_1)
	{
		if (network::network_is_host_of_this_script())
		{
			func_18(uParam0, 0, 0);
		}
	}
}

void func_126()//Position - 0x5176
{
	int iVar0;
	int iVar1;
	
	func_271();
	func_245();
	func_170();
	func_51();
	func_168();
	func_167();
	if (!ped::is_ped_injured(player::player_ped_id()))
	{
		if (interior::get_interior_from_entity(player::player_ped_id()) == iLocal_589)
		{
			if (Global_2464975.f_4981.f_1 == 0)
			{
				Global_2464975.f_4981.f_1 = 1;
			}
			if (interior::get_room_key_from_entity(player::player_ped_id()) == iLocal_590 || interior::get_room_key_from_entity(player::player_ped_id()) == iLocal_591)
			{
				iVar0 = true;
			}
			else if (interior::get_room_key_from_entity(player::player_ped_id()) == iLocal_592)
			{
				iVar1 = 1;
			}
		}
		else if (Global_2464975.f_4981.f_1 == 1)
		{
			Global_2464975.f_4981.f_1 = 0;
		}
	}
	if (!gameplay::is_bit_set(Local_490.f_52, 31))
	{
		if (func_165(player::player_id()) != 154)
		{
			if ((iVar0 || iVar1) || entity::is_entity_at_coord(player::player_ped_id(), vLocal_596, (5f / 2f), (5f / 2f), (5f / 2f), false, true, 0))
			{
				weapon::set_current_ped_weapon(player::player_ped_id(), joaat("weapon_unarmed"), true);
				gameplay::set_bit(&(Local_490.f_52), 31);
			}
		}
	}
	if ((!gameplay::is_bit_set(Local_490.f_52, 26) && iVar0) && !(func_164(0) || func_163()))
	{
		if (func_161("SNK_MNU", Local_490, 0))
		{
			gameplay::set_bit(&(Local_490.f_52), 26);
		}
	}
	if (!iVar0 && gameplay::is_bit_set(Local_490.f_52, 26))
	{
		if (!player::is_player_control_on(player::player_id()) || (cam::does_cam_exist(Local_490.f_1) && cam::is_cam_active(Local_490.f_1)))
		{
			ai::clear_ped_tasks(player::player_ped_id());
			player::set_player_control(player::player_id(), true, 0);
			cam::set_gameplay_cam_relative_heading(0f);
			cam::set_gameplay_cam_relative_pitch(0f, 1065353216);
			if (Local_490.f_51 > 0)
			{
				Local_169[network::participant_id_to_int() /*10*/].f_3 = Local_490.f_51;
				Local_490.f_51 = 0;
			}
			func_422();
			gameplay::clear_bit(&(Local_490.f_53), 7);
			if (cam::does_cam_exist(Local_490.f_1))
			{
				cam::destroy_cam(Local_490.f_1, 0);
			}
			cam::render_script_cams(false, false, 3000, 1, 0, 0);
		}
		func_158(1, Local_490);
		gameplay::clear_bit(&(Local_490.f_52), 26);
	}
	if (!gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 21))
	{
		if (iVar1 || func_156(player::player_ped_id(), Local_490.f_50))
		{
			gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 21);
		}
	}
	if (iVar0 || iVar1)
	{
		func_153();
		func_147();
		func_142();
		func_138(1);
		func_131();
		player::_0x4669B3ED80F24B4E(player::player_id());
		player::_0xDC64D2C53493ED12(player::player_id());
		if (gameplay::is_bit_set(Global_2464975.f_7, 0))
		{
			player::_0xB45EFF719D8427A6(Local_96.f_71);
			func_129(vLocal_596, func_130(30), 0);
			gameplay::clear_bit(&(Global_2464975.f_7), 0);
		}
	}
	else
	{
		if (entity::is_entity_at_coord(player::player_ped_id(), vLocal_596, 5f, 5f, 2.5f, false, true, 0))
		{
			func_138(0);
		}
		if (!gameplay::is_bit_set(Global_2464975.f_7, 0))
		{
			player::_0x0032A6DBA562C518();
			func_127(vLocal_596, func_130(30), "");
			gameplay::set_bit(&(Global_2464975.f_7), 0);
		}
	}
	if ((gameplay::is_bit_set(Local_96.f_23, 22) || gameplay::is_bit_set(Local_96.f_23, 23)) || gameplay::is_bit_set(Local_96.f_23, 7))
	{
		player::set_all_random_peds_flee_this_frame(player::player_id());
	}
}

bool func_127(vector3 vParam0, char* sParam3, char* sParam4)//Position - 0x54A7
{
	int iVar0;
	
	if (!gameplay::is_string_null_or_empty(sParam3))
	{
		iVar0 = 0;
		while (iVar0 < 16)
		{
			if (!gameplay::are_strings_equal(&(Global_2464975.f_3827[iVar0 /*26*/].f_4), sParam3))
			{
				if (gameplay::is_string_null_or_empty(&(Global_2464975.f_3827[iVar0 /*26*/].f_4)))
				{
					Global_2464975.f_3827[iVar0 /*26*/] = 1;
					Global_2464975.f_3827[iVar0 /*26*/].f_1 = { vParam0 };
					StringCopy(&(Global_2464975.f_3827[iVar0 /*26*/].f_4), sParam3, 24);
					StringCopy(&(Global_2464975.f_3827[iVar0 /*26*/].f_10), sParam4, 64);
					return true;
				}
			}
			else if (!func_128(Global_2464975.f_3827[iVar0 /*26*/].f_1, vParam0, 0))
			{
				Global_2464975.f_3827[iVar0 /*26*/] = 1;
				Global_2464975.f_3827[iVar0 /*26*/].f_1 = { vParam0 };
				StringCopy(&(Global_2464975.f_3827[iVar0 /*26*/].f_4), sParam3, 24);
				StringCopy(&(Global_2464975.f_3827[iVar0 /*26*/].f_10), sParam4, 64);
				return true;
			}
			else
			{
				return true;
			}
			iVar0++;
		}
	}
	return false;
}

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

void func_129(vector3 vParam0, char* sParam3, int iParam4)//Position - 0x55EF
{
	int iVar0;
	
	if (!gameplay::is_string_null_or_empty(sParam3))
	{
		iVar0 = 0;
		while (iVar0 < 16)
		{
			if (gameplay::are_strings_equal(&(Global_2464975.f_3827[iVar0 /*26*/].f_4), sParam3))
			{
				if (iParam4 || func_128(Global_2464975.f_3827[iVar0 /*26*/].f_1, vParam0, 0))
				{
					Global_2464975.f_3827[iVar0 /*26*/] = 0;
					Global_2464975.f_3827[iVar0 /*26*/].f_1 = { 0f, 0f, 0f };
					StringCopy(&(Global_2464975.f_3827[iVar0 /*26*/].f_4), "", 24);
					StringCopy(&(Global_2464975.f_3827[iVar0 /*26*/].f_10), "", 64);
				}
			}
			iVar0++;
		}
	}
}

char* func_130(int iParam0)//Position - 0x5691
{
	if (iParam0 == iParam0)
	{
	}
	return "";
}

void func_131()//Position - 0x56A4
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	gameplay::clear_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 28);
	if (!func_407(Local_96) && func_44(player::player_id(), 1, 1))
	{
		if (weapon::get_current_ped_weapon(player::player_ped_id(), &iVar0, 1))
		{
			if ((((iVar0 != joaat("weapon_unarmed") && iVar0 != joaat("object")) && iVar0 != joaat("weapon_flare")) && iVar0 != joaat("weapon_snowball")) && iVar0 != joaat("weapon_flashlight"))
			{
				if ((((player::is_player_free_aiming(player::player_id()) && ped::is_ped_facing_ped(player::player_ped_id(), network::net_to_ped(Local_96), 45f)) && entity::is_entity_at_entity(player::player_ped_id(), network::net_to_ped(Local_96), 5f, 5f, 2f, 0, 1, 0)) || player::is_player_free_aiming_at_entity(player::player_id(), network::net_to_ped(Local_96))) || player::is_player_targetting_entity(player::player_id(), network::net_to_ped(Local_96)))
				{
					if (!(func_164(0) || func_163()) && ((!func_135(player::player_id()) || func_165(player::player_id()) == 154) || func_165(player::player_id()) == 171))
					{
						if (func_133(player::player_id(), network::net_to_ped(Local_96)) || network::network_is_player_talking(player::player_id()))
						{
							if (!gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 1))
							{
								func_132(func_8(network::network_get_player_index(network::network_get_host_of_this_script())));
								gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 1);
							}
							if (!gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 8))
							{
								gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 8);
							}
						}
						gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 28);
					}
				}
			}
		}
	}
	if (!gameplay::is_bit_set(Local_490.f_52, 28))
	{
		if (gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 28))
		{
			if (weapon::get_current_ped_weapon(player::player_ped_id(), &iVar1, 1))
			{
				if (iVar1 != 0 && iVar1 != joaat("weapon_snowball"))
				{
					iVar2 = weapon::get_weapontype_group(iVar1);
					if (iVar2 == 416676503)
					{
						sLocal_547 = "hold_up_head_additive_pistol";
						ai::task_play_anim(player::player_ped_id(), "mp_am_hold_up", sLocal_547, 8f, -8f, -1, 305, 0f, 0, 0, 0);
					}
					else if ((((iVar2 == 1159398588 || iVar2 == 970310034) || iVar2 == 860033945) || iVar2 == -1212426201) || iVar2 == -957766203)
					{
						sLocal_547 = "hold_up_head_additive_rifle";
						ai::task_play_anim(player::player_ped_id(), "mp_am_hold_up", sLocal_547, 8f, -8f, -1, 305, 0f, 0, 0, 0);
					}
					else
					{
						sLocal_547 = "";
					}
					gameplay::set_bit(&(Local_490.f_52), 28);
				}
			}
		}
	}
	else if (!gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 28) || ped::is_ped_shooting(player::player_ped_id()))
	{
		if (!gameplay::is_string_null_or_empty(sLocal_547))
		{
			if (entity::is_entity_playing_anim(player::player_ped_id(), "mp_am_hold_up", sLocal_547, 3))
			{
				ai::stop_anim_task(player::player_ped_id(), "mp_am_hold_up", sLocal_547, -8f);
			}
		}
		gameplay::clear_bit(&(Local_490.f_52), 28);
	}
	if (gameplay::is_bit_set(Local_96.f_25, 1))
	{
		if (!gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/].f_5, 3))
		{
			if (!func_407(Local_96.f_15) && func_44(player::player_id(), 1, 1))
			{
				if (weapon::get_current_ped_weapon(player::player_ped_id(), &iVar3, 1))
				{
					if ((((iVar3 != joaat("weapon_unarmed") && iVar3 != joaat("object")) && iVar3 != joaat("weapon_flare")) && iVar3 != joaat("weapon_snowball")) && !(func_164(0) || func_163()))
					{
						if (player::is_player_free_aiming_at_entity(player::player_id(), network::net_to_ped(Local_96.f_15)) || player::is_player_targetting_entity(player::player_id(), network::net_to_ped(Local_96.f_15)))
						{
							if (func_133(player::player_id(), network::net_to_ped(Local_96.f_15)) || network::network_is_player_talking(player::player_id()))
							{
								gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/].f_5), 3);
							}
						}
					}
				}
			}
		}
	}
}

void func_132(int iParam0)//Position - 0x5A81
{
	struct<2> Var0;
	
	Var0 = 26;
	Var0.f_1 = player::player_id();
	if (!iParam0 == 0)
	{
		script::trigger_script_event(1, &Var0, 2, iParam0);
	}
}

bool func_133(int iParam0, int iParam1)//Position - 0x5AAA
{
	vector3 vVar0;
	vector3 vVar3;
	vector3 vVar6;
	vector3 vVar9;
	vector3 vVar12;
	float fVar15;
	
	if (func_44(iParam0, 1, 1))
	{
		vVar0 = { func_85(iParam0) };
	}
	if (!ped::is_ped_injured(iParam1))
	{
		vVar3 = { entity::get_entity_coords(iParam1, 1) };
	}
	vVar9 = { vVar3 - vVar0 };
	if (!ped::is_ped_injured(iParam1))
	{
		vVar6 = { entity::get_offset_from_entity_in_world_coords(iParam1, 0f, 7f, 0f) };
		vVar12 = { vVar6 - vVar3 };
	}
	vVar9.z = 0f;
	vVar12.z = 0f;
	fVar15 = func_134(vVar9, vVar12);
	if (fVar15 < -0.1f)
	{
		return true;
	}
	return false;
}

float func_134(vector3 vParam0, vector3 vParam3)//Position - 0x5B35
{
	return (((vParam0.x * vParam3.x) + (vParam0.y * vParam3.y)) + (vParam0.y * vParam3.y));
}

bool func_135(int iParam0)//Position - 0x5B56
{
	if (func_38(iParam0))
	{
		return true;
	}
	if (func_136(iParam0))
	{
		return true;
	}
	return false;
}

int func_136(int iParam0)//Position - 0x5B79
{
	int iVar0;
	
	iVar0 = iParam0;
	if (iVar0 != -1)
	{
		return func_137(iParam0, 9);
	}
	return false;
}

int func_137(var uParam0, int iParam1)//Position - 0x5B97
{
	return gameplay::is_bit_set(Global_1610705[uParam0 /*178*/].f_10.f_4, iParam1);
}

void func_138(int iParam0)//Position - 0x5BB1
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	if (player::player_id() != Global_2464975.f_4676)
	{
		if (!gameplay::is_bit_set(Local_490.f_52, 6))
		{
			if (iParam0 == 1)
			{
				if (weapon::get_current_ped_weapon(player::player_ped_id(), &iVar2, 1))
				{
					if ((((iVar2 != joaat("weapon_unarmed") && iVar2 != 0) && iVar2 != joaat("object")) && iVar2 != joaat("weapon_flare")) && iVar2 != joaat("weapon_snowball"))
					{
						if (!entity::is_entity_at_coord(player::player_ped_id(), vLocal_549, 2.5f, 2.5f, 3f, false, true, 0))
						{
							iVar1 = 1;
						}
						iVar0 = 1;
					}
				}
				if ((((iVar1 == 1 || gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 5)) || (iVar0 == 1 && Local_96.f_3 >= 3)) || (iVar0 == 1 && gameplay::is_bit_set(Local_96.f_24, 16))) || gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 12))
				{
					if (((!gameplay::is_bit_set(Local_96.f_23, 12) || Local_96.f_3 >= 3) || gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 12)) || (iVar0 == 1 && gameplay::is_bit_set(Local_96.f_24, 16)))
					{
						Global_2418529[player::player_id() /*313*/].f_46++;
						func_13(&(Global_2428549.f_3190));
						func_18(&(Global_2428549.f_3190), 0, 0);
						if (Global_2418529[player::player_id() /*313*/].f_46 <= 2)
						{
							if (func_141())
							{
								if (func_140() < 2)
								{
									player::report_crime(player::player_id(), 37, player::get_wanted_level_threshold(func_140()));
								}
								else
								{
									player::report_crime(player::player_id(), 37, player::get_wanted_level_threshold(2));
								}
							}
							else
							{
								player::report_crime(player::player_id(), 37, player::get_wanted_level_threshold(2));
							}
						}
						else if (Global_2418529[player::player_id() /*313*/].f_46 >= 5)
						{
							if (func_141())
							{
								if (func_140() < 3)
								{
									player::report_crime(player::player_id(), 37, player::get_wanted_level_threshold(func_140()));
								}
								else
								{
									player::report_crime(player::player_id(), 37, player::get_wanted_level_threshold(3));
								}
							}
							else
							{
								player::report_crime(player::player_id(), 37, player::get_wanted_level_threshold(4));
							}
						}
						else if (func_141())
						{
							if (func_140() < 3)
							{
								player::report_crime(player::player_id(), 37, player::get_wanted_level_threshold(func_140()));
							}
							else
							{
								player::report_crime(player::player_id(), 37, player::get_wanted_level_threshold(3));
							}
						}
						else
						{
							player::report_crime(player::player_id(), 37, player::get_wanted_level_threshold(3));
						}
						if (!gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 1))
						{
							gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 2);
						}
						gameplay::set_bit(&(Local_490.f_52), 6);
						gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 25);
					}
				}
			}
			if (!gameplay::is_bit_set(Local_490.f_52, 27) && !gameplay::is_bit_set(Local_490.f_52, 6))
			{
				if (ped::is_ped_in_melee_combat(player::player_ped_id()))
				{
					if (func_17(&uLocal_587, 2000, 0) || ped::_0xDCCA191DF9980FD7(player::player_ped_id()))
					{
						player::report_crime(player::player_id(), 37, player::get_wanted_level_threshold(1));
						gameplay::set_bit(&(Local_490.f_52), 27);
						gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 27);
						gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 25);
						if (!gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 1))
						{
							gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 2);
						}
					}
				}
				else if (func_139(&uLocal_587))
				{
					func_13(&uLocal_587);
				}
			}
		}
		if (!gameplay::is_bit_set(Local_490.f_52, 24))
		{
			if (gameplay::is_bit_set(Local_490.f_52, 31))
			{
				if (func_407(Local_96))
				{
					if (func_141())
					{
						if (func_140() < 3)
						{
							player::report_crime(player::player_id(), 37, player::get_wanted_level_threshold(func_140()));
						}
						else
						{
							player::report_crime(player::player_id(), 37, player::get_wanted_level_threshold(3));
						}
					}
					else
					{
						player::report_crime(player::player_id(), 13, player::get_wanted_level_threshold(3));
					}
					gameplay::set_bit(&(Local_490.f_52), 24);
					if (!gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 1))
					{
						gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 2);
					}
				}
			}
		}
	}
}

var func_139(var uParam0)//Position - 0x5F8F
{
	return uParam0->f_1;
}

var func_140()//Position - 0x5F9B
{
	return Global_262145.f_10784;
}

bool func_141()//Position - 0x5FAA
{
	if (func_136(player::player_id()) && func_165(player::player_id()) == 154)
	{
		return true;
	}
	return false;
}

void func_142()//Position - 0x5FD2
{
	int iVar0;
	int iVar1;
	
	if (func_44(player::player_id(), 1, 1))
	{
		if (!gameplay::is_bit_set(Local_490.f_52, 23) && gameplay::is_bit_set(Local_96.f_23, 17))
		{
			if (!func_407(Local_96))
			{
				iLocal_556 = network::_0x02C40BF885C567B6(Local_96.f_29);
				if (iLocal_556 >= 0)
				{
					if (ped::is_synchronized_scene_running(iLocal_556))
					{
						if ((!gameplay::is_bit_set(Global_1714045, 15) && func_146()) && func_145())
						{
							gameplay::set_bit(&Global_1714045, 15);
						}
						if (!ui::is_help_message_being_displayed())
						{
							iVar0 = func_123(1183, -1, 0);
							if (!gameplay::is_bit_set(iVar0, 3))
							{
								if (ped::get_synchronized_scene_phase(iLocal_556) < 0.4f && interior::get_interior_from_entity(player::player_ped_id()) == iLocal_589)
								{
									func_144("FHU_HELP3", -1);
									gameplay::set_bit(&iVar0, 3);
									func_121(1183, iVar0, -1, 1);
								}
							}
							else if (!gameplay::is_bit_set(iVar0, 5) || !gameplay::is_bit_set(iVar0, 6))
							{
								if (ped::get_synchronized_scene_phase(iLocal_556) < 0.7f && interior::get_interior_from_entity(player::player_ped_id()) == iLocal_589)
								{
									func_144("FHU_HELP4", -1);
									gameplay::set_bit(&iVar0, 5);
									func_121(1183, iVar0, -1, 1);
									gameplay::set_bit(&(Local_490.f_52), 23);
								}
							}
							else
							{
								gameplay::set_bit(&(Local_490.f_52), 23);
							}
						}
					}
				}
			}
		}
		if ((!func_37(player::player_id(), 146) && Global_1572925 == 0) && func_165(player::player_id()) != 167)
		{
			if (!gameplay::is_bit_set(Local_490.f_53, 1))
			{
				if (!ui::is_help_message_being_displayed())
				{
					if (((((func_407(Local_96) || Local_96.f_3 > 7) && !gameplay::is_bit_set(Local_96.f_23, 20)) && !gameplay::is_bit_set(Local_96.f_23, 11)) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 5)) && fire::get_number_of_fires_in_range(vLocal_557, 1.5f) == 0)
					{
						iVar1 = func_123(1183, -1, 0);
						if (!gameplay::is_bit_set(iVar1, 20) || !gameplay::is_bit_set(iVar1, 21))
						{
							func_144("FHU_HELPM", -1);
							if (!gameplay::is_bit_set(iVar1, 20))
							{
								gameplay::set_bit(&iVar1, 20);
							}
							else
							{
								gameplay::set_bit(&iVar1, 21);
							}
							func_121(1183, iVar1, -1, 1);
							gameplay::set_bit(&(Local_490.f_53), 1);
						}
						else
						{
							gameplay::set_bit(&(Local_490.f_53), 1);
						}
					}
				}
			}
			else if (func_143("FHU_HELPM"))
			{
				if ((gameplay::is_bit_set(Local_96.f_23, 20) || gameplay::is_bit_set(Local_96.f_23, 11)) || gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 5))
				{
					ui::clear_help(1);
				}
			}
		}
	}
}

int func_143(char* sParam0)//Position - 0x626F
{
	ui::_0x0A24DA3A41B718F5(sParam0);
	return ui::_0x10BDDBFC529428DD(0);
}

void func_144(char* sParam0, int iParam1)//Position - 0x6282
{
	ui::_set_text_component_format(sParam0);
	ui::_display_help_text_from_string_label(0, 0, true, iParam1);
}

int func_145()//Position - 0x6299
{
	return gameplay::is_bit_set(Global_2464975.f_1639, 21);
}

int func_146()//Position - 0x62AE
{
	return gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_135, 3);
}

void func_147()//Position - 0x62C8
{
	float fVar0;
	float fVar1;
	
	if (Local_96.f_3 == 4)
	{
		if (func_44(player::player_id(), 1, 1))
		{
			if (!func_407(Local_96))
			{
				iLocal_556 = network::_0x02C40BF885C567B6(Local_96.f_29);
				if (iLocal_556 >= 0)
				{
					if (ped::is_synchronized_scene_running(iLocal_556))
					{
						fVar0 = ped::get_synchronized_scene_phase(iLocal_556);
						fVar0 = (fVar0 * 1000f);
						if (fVar0 <= 890f)
						{
							func_148(system::round(fVar0), 890, "HUP_PROG", func_152(player::get_player_team(player::player_id())), 0, 1, 13);
						}
						fVar1 = network::network_get_player_loudness(player::player_id());
						fVar1 = (fVar1 - 0.3f);
						if (fVar1 < 0f)
						{
							fVar1 = 0f;
						}
						fVar1 = (fVar1 * 4f);
						Local_169[network::participant_id_to_int() /*10*/].f_6 = fVar1;
					}
				}
			}
		}
	}
}

void func_148(int iParam0, int iParam1, char* sParam2, var uParam3, int iParam4, int iParam5, int iParam6)//Position - 0x637A
{
	func_149(iParam0, iParam1, sParam2, uParam3, iParam4, iParam6, -1f, -1f, 0, iParam5, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1);
}

void func_149(var uParam0, var uParam1, char* sParam2, var uParam3, var uParam4, var uParam5, float fParam6, float fParam7, int iParam8, var uParam9, int iParam10, int iParam11, int iParam12, int iParam13, int iParam14, int iParam15, int iParam16, int iParam17, int iParam18, int iParam19)//Position - 0x63A1
{
	int iVar0;
	int iVar1;
	
	iVar0 = -1;
	iVar1 = 0;
	while (iVar1 <= 9)
	{
		if (iVar0 == -1)
		{
			if (func_151(0, iVar1) == 0)
			{
				iVar0 = iVar1;
			}
		}
		iVar1++;
	}
	if (iVar0 > -1)
	{
		Global_1339962.f_1 = 1;
		func_150(0, iVar0);
		Global_1339962.f_946[iVar0] = uParam0;
		Global_1339962.f_946.f_11[iVar0] = uParam1;
		StringCopy(&(Global_1339962.f_946.f_22[iVar0 /*16*/]), sParam2, 64);
		Global_1339962.f_946.f_194[iVar0] = uParam3;
		Global_1339962.f_946.f_183[iVar0] = uParam4;
		Global_1339962.f_946.f_216[iVar0] = uParam5;
		Global_1339962.f_946.f_227[iVar0 /*3*/] = fParam6;
		Global_1339962.f_946.f_227[iVar0 /*3*/].f_1 = fParam7;
		Global_1339962.f_946.f_258[iVar0] = iParam8;
		Global_1339962.f_946.f_269[iVar0] = uParam9;
		Global_1339962.f_946.f_312[iVar0] = iParam10;
		Global_1339962.f_946.f_323[iVar0] = iParam11;
		Global_1339962.f_946.f_334[iVar0] = iParam12;
		Global_1339962.f_946.f_345[iVar0] = iParam13;
		Global_1339962.f_941 = 1;
		Global_1339962.f_946.f_356[iVar0] = iParam14;
		Global_1339962.f_946.f_367[iVar0] = iParam15;
		Global_1339962.f_946.f_378[iVar0] = iParam16;
		Global_1339962.f_946.f_389[iVar0] = iParam17;
		Global_1339962.f_946.f_400[iVar0] = iParam18;
		Global_1339962.f_946.f_411[iVar0] = iParam19;
	}
}

void func_150(int iParam0, int iParam1)//Position - 0x652A
{
	gameplay::set_bit(&(Global_1339962.f_4759[iParam0]), iParam1);
}

int func_151(int iParam0, int iParam1)//Position - 0x6543
{
	return gameplay::is_bit_set(Global_1339962.f_4759[iParam0], iParam1);
}

int func_152(int iParam0)//Position - 0x655C
{
	if (iParam0 == 0)
	{
	}
	return 116;
}

void func_153()//Position - 0x656C
{
	if (!gameplay::is_bit_set(Local_490.f_53, 2))
	{
		streaming::request_anim_dict("oddjobs@shop_robbery@rob_till");
		streaming::request_anim_dict(func_154());
		if (streaming::has_anim_dict_loaded("oddjobs@shop_robbery@rob_till") && streaming::has_anim_dict_loaded(func_154()))
		{
			gameplay::set_bit(&(Local_490.f_53), 2);
		}
	}
}

char* func_154()//Position - 0x65B4
{
	if (func_155(player::player_id()))
	{
		return "anim@am_hold_up@male";
	}
	return "anim@am_hold_up@female";
}

int func_155(int iParam0)//Position - 0x65D2
{
	if (!network::network_is_game_in_progress())
	{
		return 1;
	}
	return Global_2418529[iParam0 /*313*/].f_227;
}

bool func_156(int iParam0, int iParam1)//Position - 0x65F4
{
	vector3 vVar0;
	vector3 vVar3;
	float fVar6;
	
	vVar0 = { 0f, 0f, 0f };
	vVar3 = { 0f, 0f, 0f };
	fVar6 = 0f;
	func_157(iParam1, &vVar0, &vVar3, &fVar6);
	if (entity::is_entity_in_angled_area(iParam0, vVar0, vVar3, fVar6, 0, true, 0))
	{
		return true;
	}
	return false;
}

void func_157(int iParam0, var uParam1, var uParam2, float fParam3)//Position - 0x6634
{
	if (iParam0 == 0)
	{
		*uParam1 = { 1390.033f, 3605.529f, 33.98091f };
		*uParam2 = { 1394.412f, 3607.156f, 36.38288f };
		*fParam3 = 1.25f;
	}
	else if (iParam0 == 1)
	{
		*uParam1 = { -3041.675f, 583.5931f, 6.908931f };
		*uParam2 = { -3037.284f, 585.0375f, 9.521532f };
		*fParam3 = 1.25f;
	}
	else if (iParam0 == 2)
	{
		*uParam1 = { -3245.184f, 1000.124f, 11.83071f };
		*uParam2 = { -3240.504f, 999.7783f, 14.46645f };
		*fParam3 = 1.25f;
	}
	else if (iParam0 == 3)
	{
		*uParam1 = { 549.5332f, 2668.464f, 41.15651f };
		*uParam2 = { 548.9114f, 2673.108f, 43.7766f };
		*fParam3 = 1.25f;
	}
	else if (iParam0 == 4)
	{
		*uParam1 = { 2554.316f, 380.8569f, 107.623f };
		*uParam2 = { 2558.98f, 380.6908f, 110.2684f };
		*fParam3 = 1.25f;
	}
	else if (iParam0 == 5)
	{
		*uParam1 = { 2675.476f, 3280.807f, 54.24115f };
		*uParam2 = { 2679.577f, 3278.526f, 56.8955f };
		*fParam3 = 1.25f;
	}
	else if (iParam0 == 6)
	{
		*uParam1 = { 1729.145f, 6417.834f, 34.03724f };
		*uParam2 = { 1727.07f, 6413.635f, 36.66442f };
		*fParam3 = 1.25f;
	}
	else if (iParam0 == 7)
	{
		*uParam1 = { 1958.61f, 3742.512f, 31.34376f };
		*uParam2 = { 1960.958f, 3738.465f, 33.98634f };
		*fParam3 = 1.25f;
	}
	else if (iParam0 == 8)
	{
		*uParam1 = { 24.51093f, -1344.449f, 28.49703f };
		*uParam2 = { 24.52224f, -1349.084f, 31.14272f };
		*fParam3 = 1.25f;
	}
	else if (iParam0 == 9)
	{
		*uParam1 = { 373.296f, 329.2379f, 102.5664f };
		*uParam2 = { 372.1347f, 324.6985f, 105.214f };
		*fParam3 = 1.25f;
	}
	else if (iParam0 == 10)
	{
		*uParam1 = { 1168.183f, 2711.203f, 37.06316f };
		*uParam2 = { 1163.144f, 2711.246f, 40.16688f };
		*fParam3 = 2.5f;
	}
	else if (iParam0 == 11)
	{
		*uParam1 = { -2966.142f, 388.6418f, 14.04331f };
		*uParam2 = { -2965.812f, 393.6473f, 17.17248f };
		*fParam3 = 2.5f;
	}
	else if (iParam0 == 12)
	{
		*uParam1 = { -1223.599f, -909.8984f, 11.32635f };
		*uParam2 = { -1219.443f, -907.0756f, 14.45929f };
		*fParam3 = 2.5f;
	}
	else if (iParam0 == 13)
	{
		*uParam1 = { 1133.524f, -980.3087f, 45.41582f };
		*uParam2 = { 1134.22f, -985.284f, 48.53235f };
		*fParam3 = 2.5f;
	}
	else if (iParam0 == 14)
	{
		*uParam1 = { -1484.413f, -379.3236f, 39.16341f };
		*uParam2 = { -1487.954f, -375.7666f, 42.28885f };
		*fParam3 = 2.5f;
	}
	else if (iParam0 == 15)
	{
		*uParam1 = { 1699.447f, 4921.57f, 41.06366f };
		*uParam2 = { 1695.64f, 4924.245f, 44.22165f };
		*fParam3 = 2.25f;
	}
	else if (iParam0 == 16)
	{
		*uParam1 = { -705.7869f, -911.6997f, 18.2156f };
		*uParam2 = { -705.7026f, -916.374f, 21.33545f };
		*fParam3 = 2.25f;
	}
	else if (iParam0 == 17)
	{
		*uParam1 = { -45.26995f, -1756.669f, 28.42101f };
		*uParam2 = { -48.26036f, -1760.285f, 31.56342f };
		*fParam3 = 2.25f;
	}
	else if (iParam0 == 18)
	{
		*uParam1 = { 1164.697f, -320.7587f, 68.2051f };
		*uParam2 = { 1165.463f, -325.0899f, 71.37893f };
		*fParam3 = 2.25f;
	}
	else if (iParam0 == 19)
	{
		*uParam1 = { -1821.205f, 795.8699f, 137.0893f };
		*uParam2 = { -1818.041f, 792.3982f, 140.1836f };
		*fParam3 = 2.25f;
	}
}

void func_158(int iParam0, int iParam1)//Position - 0x6A91
{
	var uVar0;
	
	if (!func_160(&uVar0, 0, iParam1))
	{
		return;
	}
	if (Global_17257.f_7894)
	{
		ui::reset_hud_component_values(15);
		Global_17257.f_7894 = 0;
	}
	ui::_0x55598D21339CB998(0f);
	if (Global_17257.f_5498[uVar0])
	{
		ui::clear_additional_text(9, false);
		Global_17257.f_5498[uVar0] = 0;
	}
	if (Global_17257.f_5484[uVar0])
	{
		graphics::set_streamed_texture_dict_as_no_longer_needed("CommonMenu");
		Global_17257.f_5484[uVar0] = 0;
	}
	if (Global_17257.f_5491[uVar0])
	{
		graphics::set_streamed_texture_dict_as_no_longer_needed("MPShopSale");
		Global_17257.f_5491[uVar0] = 0;
	}
	if (iParam0)
	{
		func_159(&(Global_17257.f_5530[uVar0 /*10*/]));
		Global_17257.f_5591[uVar0] = 0;
	}
	else
	{
		Global_17257.f_5591[uVar0] = 0;
	}
}

void func_159(int iParam0)//Position - 0x6B4F
{
	if (iParam0->f_9 != 0)
	{
		if (graphics::has_scaleform_movie_loaded(*iParam0))
		{
			graphics::set_scaleform_movie_as_no_longer_needed(iParam0);
		}
		*iParam0 = 0;
		iParam0->f_9 = 0;
	}
}

bool func_160(var uParam0, int iParam1, int iParam2)//Position - 0x6B78
{
	char cVar0[64];
	int iVar16;
	int iVar17;
	int iVar18;
	
	if (iParam2 == -1)
	{
		if (network::network_is_game_in_progress() && network::network_get_this_script_is_network_script())
		{
			iParam2 = network::_0x638A3A81733086DB();
		}
	}
	StringCopy(&cVar0, script::get_this_script_name(), 64);
	StringIntConCat(&cVar0, iParam2, 64);
	iVar16 = gameplay::get_hash_key(&cVar0);
	iVar18 = -1;
	iVar17 = 0;
	while (iVar17 < 6)
	{
		if (Global_17257.f_5591[iVar17] == iVar16)
		{
			*uParam0 = iVar17;
			return true;
		}
		else if (Global_17257.f_5591[iVar17] == 0)
		{
			iVar18 = iVar17;
		}
		iVar17++;
	}
	if (iParam1)
	{
		if (iVar18 != -1)
		{
			Global_17257.f_5591[iVar18] = iVar16;
			*uParam0 = iVar18;
			return true;
		}
	}
	return false;
}

int func_161(char* sParam0, int iParam1, int iParam2)//Position - 0x6C15
{
	var uVar0;
	int iVar1;
	int iVar2;
	
	if (!func_160(&uVar0, 1, iParam1))
	{
		return false;
	}
	iVar1 = true;
	StringCopy(&(Global_17257.f_5505[uVar0 /*4*/]), sParam0, 16);
	if (!gameplay::is_string_null_or_empty(&(Global_17257.f_5505[uVar0 /*4*/])))
	{
		ui::request_additional_text(&(Global_17257.f_5505[uVar0 /*4*/]), 9);
		Global_17257.f_5498[uVar0] = 1;
		if (!ui::has_this_additional_text_loaded(&(Global_17257.f_5505[uVar0 /*4*/]), 9))
		{
			iVar1 = false;
		}
	}
	graphics::request_streamed_texture_dict("CommonMenu", false);
	Global_17257.f_5484[uVar0] = 1;
	if (!graphics::has_streamed_texture_dict_loaded("CommonMenu"))
	{
		iVar1 = false;
	}
	if (iParam2)
	{
		graphics::request_streamed_texture_dict("MPShopSale", false);
		Global_17257.f_5491[uVar0] = 1;
		if (!graphics::has_streamed_texture_dict_loaded("MPShopSale"))
		{
			iVar1 = false;
		}
	}
	iVar2 = false;
	StringCopy(&(Global_17257.f_5530[uVar0 /*10*/].f_1), "instructional_buttons", 24);
	iVar2 = func_162(&(Global_17257.f_5530[uVar0 /*10*/]));
	if (!iVar1 || !iVar2)
	{
	}
	return (iVar1 && iVar2);
}

int func_162(var uParam0)//Position - 0x6D0B
{
	switch (uParam0->f_9)
	{
		case 0:
			if (!graphics::has_scaleform_movie_loaded(*uParam0))
			{
				*uParam0 = unk_0x67D02A194A2FC2BD(&(uParam0->f_1));
				uParam0->f_9 = 1;
				if (uParam0->f_7)
				{
					if (graphics::has_scaleform_movie_loaded(*uParam0))
					{
						uParam0->f_8 = gameplay::get_game_timer();
						uParam0->f_9 = 2;
					}
				}
			}
			else
			{
				uParam0->f_8 = gameplay::get_game_timer();
				uParam0->f_9 = 2;
			}
			break;
		
		case 1:
			if (graphics::has_scaleform_movie_loaded(*uParam0))
			{
				uParam0->f_8 = gameplay::get_game_timer();
				uParam0->f_9 = 2;
			}
			break;
		
		case 2:
			if (!graphics::has_scaleform_movie_loaded(*uParam0))
			{
				uParam0->f_9 = 0;
			}
			break;
	}
	return uParam0->f_9 == 2;
}

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

bool func_164(int iParam0)//Position - 0x6DCA
{
	if (iParam0 == 1)
	{
		if (Global_14413.f_1 > 3)
		{
			if (gameplay::is_bit_set(Global_2283, 14))
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		else
		{
			return false;
		}
	}
	if (script::_get_number_of_instances_of_streamed_script(joaat("cellphone_flashhand")) > 0)
	{
		return true;
	}
	if (Global_14413.f_1 > 3)
	{
		return true;
	}
	return false;
}

int func_165(int iParam0)//Position - 0x6E24
{
	if (func_166(iParam0, 0))
	{
		return Global_1610705[iParam0 /*178*/].f_10.f_28;
	}
	return -1;
}

bool func_166(var uParam0, int iParam1)//Position - 0x6E46
{
	if (Global_1610705[uParam0 /*178*/].f_10.f_28 != -1 || (iParam1 && Global_1610705[uParam0 /*178*/].f_10.f_27 != -1))
	{
		return true;
	}
	return false;
}

void func_167()//Position - 0x6E7F
{
	if (player::player_id() != Global_2464975.f_4676)
	{
		if (!gameplay::is_bit_set(Local_490.f_52, 24))
		{
			if (Local_96.f_72 == player::player_id() || (gameplay::is_bit_set(Local_490.f_52, 31) && entity::is_entity_at_coord(player::player_ped_id(), vLocal_599, 20f, 20f, 20f, false, true, 0)))
			{
				if (func_407(Local_96))
				{
					if (func_141())
					{
						if (func_140() < 3)
						{
							player::report_crime(player::player_id(), 37, player::get_wanted_level_threshold(func_140()));
						}
						else
						{
							player::report_crime(player::player_id(), 37, player::get_wanted_level_threshold(3));
						}
					}
					else
					{
						player::report_crime(player::player_id(), 13, player::get_wanted_level_threshold(3));
					}
					gameplay::set_bit(&(Local_490.f_52), 24);
					if (!gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 1))
					{
						gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 2);
					}
				}
			}
		}
	}
}

bool func_168()//Position - 0x6F5C
{
	if (!gameplay::is_bit_set(Local_96.f_25, 0))
	{
		return false;
	}
	if (func_407(Local_96.f_15))
	{
		if (ui::does_blip_exist(iLocal_805))
		{
			ui::remove_blip(&iLocal_805);
		}
		return false;
	}
	if (Local_96.f_66 == 4)
	{
		if (!ui::does_blip_exist(iLocal_805))
		{
			iLocal_805 = ui::add_blip_for_entity(network::net_to_ped(Local_96.f_15));
			ui::set_blip_colour(iLocal_805, 1);
			ui::set_blip_scale(iLocal_805, 0.7f);
		}
	}
	if (!network::network_has_control_of_network_id(Local_96.f_15))
	{
		return false;
	}
	switch (Local_96.f_66)
	{
		case 0:
			break;
		
		case 1:
			break;
		
		case 2:
			if (ai::get_script_task_status(network::net_to_ped(Local_96.f_15), 713668775) != 0)
			{
				if (ai::get_script_task_status(network::net_to_ped(Local_96.f_15), 713668775) != 1)
				{
					if (func_44(player::player_id(), 1, 1))
					{
						ai::task_go_to_entity(network::net_to_ped(Local_96.f_15), player::player_ped_id(), -1, 4f, 2f, 1073741824, 0);
					}
				}
			}
			break;
		
		case 3:
			if (!gameplay::is_bit_set(Local_96.f_25, 5) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/].f_5, 0))
			{
				if (ai::get_script_task_status(network::net_to_ped(Local_96.f_15), 1227113341) != 0 && ai::get_script_task_status(network::net_to_ped(Local_96.f_15), 1227113341) != 1)
				{
					ai::task_turn_ped_to_face_entity(network::net_to_ped(Local_96.f_15), player::player_ped_id(), 10000);
					gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/].f_5), 0);
				}
			}
			if ((!gameplay::is_bit_set(Local_96.f_25, 6) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/].f_5, 1)) && !func_169())
			{
				func_406(&uLocal_613, 4, network::net_to_ped(Local_96.f_15), "StoreHero", 1, 0);
				audio::_play_ambient_speech1(network::net_to_ped(Local_96.f_15), "GENERIC_INSULT_HIGH", "SPEECH_PARAMS_FORCE", 1);
				gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/].f_5), 1);
			}
			break;
		
		case 4:
			if ((!gameplay::is_bit_set(Local_96.f_25, 7) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/].f_5, 2)) && !func_169())
			{
				func_406(&uLocal_613, 4, network::net_to_ped(Local_96.f_15), "StoreHero", 1, 0);
				audio::_play_ambient_speech1(network::net_to_ped(Local_96.f_15), "GENERIC_FUCK_YOU", "SPEECH_PARAMS_FORCE", 1);
				gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/].f_5), 2);
			}
			if (gameplay::is_bit_set(Local_96.f_25, 7) || gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/].f_5, 2))
			{
				if (ai::get_script_task_status(network::net_to_ped(Local_96.f_15), -1442466670) != 0 && ai::get_script_task_status(network::net_to_ped(Local_96.f_15), -1442466670) != 1)
				{
					ai::clear_ped_tasks(network::net_to_ped(Local_96.f_15));
					ped::set_ped_relationship_group_hash(network::net_to_ped(Local_96.f_15), Global_1574256);
					ai::task_combat_hated_targets_around_ped(network::net_to_ped(Local_96.f_15), 20f, 0);
					ped::set_ped_keep_task(network::net_to_ped(Local_96.f_15), true);
				}
			}
			break;
		
		case 5:
			if (ai::get_script_task_status(network::net_to_ped(Local_96.f_15), 242628503) != 0 && ai::get_script_task_status(network::net_to_ped(Local_96.f_15), 242628503) != 1)
			{
				ai::clear_ped_tasks(network::net_to_ped(Local_96.f_15));
				ai::task_perform_sequence(network::net_to_ped(Local_96.f_15), iLocal_565);
				ped::set_ped_keep_task(network::net_to_ped(Local_96.f_15), true);
			}
			else if (ai::get_script_task_status(network::net_to_ped(Local_96.f_15), -875674219) != 1 && ai::get_script_task_status(network::net_to_ped(Local_96.f_15), -875674219) != 0)
			{
				if (func_17(&uLocal_585, 5000, 0))
				{
					func_13(&uLocal_585);
					ai::task_turn_ped_to_face_entity(network::net_to_ped(Local_96.f_15), player::player_ped_id(), 10000);
				}
			}
			break;
	}
	return true;
}

bool func_169()//Position - 0x72E0
{
	if (Global_15712 != 0 || audio::is_scripted_conversation_ongoing())
	{
		return true;
	}
	return false;
}

void func_170()//Position - 0x7302
{
	if (Local_96.f_3 == 4)
	{
		if ((!gameplay::is_bit_set(Local_96.f_23, 10) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 4)) && gameplay::is_bit_set(Local_96.f_23, 17))
		{
			if (network::network_does_network_id_exist(Local_96.f_13))
			{
				if (network::network_has_control_of_network_id(Local_96.f_13) || (!network::_0xA1607996431332DF(Local_96.f_13) && network::network_is_host_of_this_script()))
				{
					if (!func_407(Local_96))
					{
						if (ped::is_ped_ragdoll(network::net_to_ped(Local_96)))
						{
							entity::set_entity_collision(network::net_to_obj(Local_96.f_13), true, 0);
							entity::set_entity_dynamic(network::net_to_obj(Local_96.f_13), 1);
							entity::set_entity_velocity(network::net_to_obj(Local_96.f_13), 0f, 0f, -1f);
							ped::_set_ped_ragdoll_flag(network::net_to_ped(Local_96), 16);
							gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 4);
						}
					}
					else
					{
						entity::set_entity_collision(network::net_to_obj(Local_96.f_13), true, 0);
						entity::set_entity_dynamic(network::net_to_obj(Local_96.f_13), 1);
						entity::set_entity_velocity(network::net_to_obj(Local_96.f_13), 0f, 0f, -1f);
						gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 4);
					}
				}
			}
		}
	}
	func_171();
}

void func_171()//Position - 0x7408
{
	int iVar0;
	var uVar1;
	
	if (network::network_does_network_id_exist(Local_96.f_13))
	{
		if (!entity::is_entity_dead(network::net_to_obj(Local_96.f_13), 0))
		{
			if ((!gameplay::is_bit_set(Local_96.f_23, 11) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 5)) && Local_96.f_37 > 0f)
			{
				if (((func_244() || func_243(0.87f)) || Local_96.f_3 >= 5) || gameplay::is_bit_set(Local_96.f_23, 10))
				{
					if (!gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 11))
					{
						if (network::network_has_control_of_network_id(Local_96.f_13))
						{
							object::_0x92AEFB5F6E294023(network::net_to_obj(Local_96.f_13), 0, 0);
							gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 13);
						}
						if (func_165(player::player_id()) != 155)
						{
							object::_0x0BF3B3BD47D79C08(func_50(1), 1);
						}
						gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 11);
					}
					if (entity::is_entity_attached_to_entity(network::net_to_obj(Local_96.f_13), player::player_ped_id()))
					{
						Local_169[network::participant_id_to_int() /*10*/].f_7 = { entity::get_entity_coords(player::player_ped_id(), 1) };
						gameplay::get_ground_z_for_3d_coord(Local_169[network::participant_id_to_int() /*10*/].f_7, &(Local_169[network::participant_id_to_int() /*10*/].f_7.f_2), 0);
						if (network::network_has_control_of_network_id(Local_96.f_13))
						{
							entity::detach_entity(network::net_to_obj(Local_96.f_13), 1, true);
							func_45(&(Local_96.f_13));
						}
						iVar0 = gameplay::get_random_int_in_range(iLocal_582, iLocal_583);
						if (gameplay::is_bit_set(Local_96.f_23, 10))
						{
							iVar0 = system::floor((system::to_float(iVar0) * Local_96.f_37));
						}
						if (Local_96.f_4 > 1000)
						{
							Local_96.f_4 = 1000;
						}
						iVar0 = (iVar0 + Local_96.f_4);
						iVar0 = func_242(iVar0, 1);
						if (iVar0 > Global_262145.f_164)
						{
							iVar0 = Global_262145.f_164;
						}
						if (func_241(player::player_id()) && func_239(func_240(player::player_id())) < 1f)
						{
							if (Global_262145.f_4222 > 1f)
							{
								Global_262145.f_4222 = 1f;
							}
							iVar0 = system::round((system::to_float(iVar0) * Global_262145.f_4222));
						}
						if (!func_136(player::player_id()) && func_165(player::player_id()) != 154)
						{
							func_198(&iVar0, 1);
						}
						if (iVar0 > 0)
						{
							if (func_197())
							{
								func_188(1734805203, iVar0, &uVar1, 0, 0, 0);
							}
							else
							{
								func_184(iVar0, 1, 1, 1092616192);
								networkcash::network_earn_from_holdups(iVar0);
							}
						}
						Global_2464975.f_4981 = (Global_2464975.f_4981 + iVar0);
						Global_2464975.f_4981.f_2 = 1;
						Global_2464975.f_4981.f_5 = 1;
						iLocal_807 = (iLocal_807 + iVar0);
						func_183(3);
						if (!gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 5))
						{
							func_182(Local_96.f_38, iVar0);
						}
						else
						{
							func_173(player::player_ped_id(), iVar0);
						}
						func_172(1, iVar0);
						gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 5);
						gameplay::set_bit(&(Local_490.f_53), 6);
					}
				}
			}
		}
	}
}

void func_172(int iParam0, int iParam1)//Position - 0x76C6
{
	if (iParam1 > 0)
	{
		Global_2464975.f_269 = iParam0;
		if (iParam1 > Global_262145.f_5198)
		{
			iParam1 = Global_262145.f_5198;
		}
		Global_2464975.f_270 = iParam1;
		Global_2464975.f_271 = 0;
	}
}

void func_173(int iParam0, int iParam1)//Position - 0x7703
{
	vector3 vVar0;
	
	vVar0 = { func_180(player::player_ped_id(), 1) };
	if (iParam0 == func_179(player::player_ped_id()))
	{
		func_178(1);
	}
	func_174(vVar0, iParam1, 7, 0, 0);
}

void func_174(vector3 vParam0, int iParam3, int iParam4, char* sParam5, int iParam6)//Position - 0x7737
{
	int iVar0;
	int iVar1;
	
	if (iParam3 != 0)
	{
		iVar1 = -1;
		iVar0 = 0;
		while (iVar0 < 20)
		{
			if (Global_2428549.f_774[iVar0 /*30*/].f_6 == 0 || Global_2428549.f_774[iVar0 /*30*/].f_6 == 7)
			{
				iVar1 = iVar0;
				iVar0 = 20;
			}
			iVar0++;
		}
		if (iVar1 != -1)
		{
			Global_2428549.f_774[iVar1 /*30*/] = { vParam0 };
			Global_2428549.f_774[iVar1 /*30*/].f_6 = 1;
			Global_2428549.f_774[iVar1 /*30*/].f_4 = func_177(Global_2428549.f_774[iVar1 /*30*/], &Global_1312317, &Global_1312318);
			Global_2428549.f_774[iVar1 /*30*/].f_7 = network::get_network_time();
			Global_2428549.f_774[iVar1 /*30*/].f_3 = iParam3;
			Global_2428549.f_774[iVar1 /*30*/].f_8 = iParam4;
			Global_2428549.f_774[iVar1 /*30*/].f_9 = func_176();
			Global_2428549.f_774[iVar1 /*30*/].f_10 = func_175();
			StringCopy(&(Global_2428549.f_774[iVar1 /*30*/].f_22), sParam5, 16);
			Global_2428549.f_774[iVar1 /*30*/].f_26 = network::get_time_offset(network::get_network_time(), iParam6);
		}
	}
}

bool func_175()//Position - 0x784E
{
	if (Global_2428549.f_1375)
	{
		Global_2428549.f_1375 = 0;
		return true;
	}
	Global_2428549.f_1375 = 0;
	return false;
}

var func_176()//Position - 0x7878
{
	var uVar0;
	
	uVar0 = Global_2428549.f_1377;
	Global_2428549.f_1377 = 1;
	return uVar0;
}

float func_177(vector3 vParam0, var uParam3, var uParam4)//Position - 0x7893
{
	float fVar0;
	float fVar1;
	float fVar2;
	float fVar3;
	
	fVar0 = gameplay::get_distance_between_coords(cam::get_gameplay_cam_coord(), vParam0, 1);
	if (fVar0 < 5f)
	{
		*uParam3 = 0.402f;
		*uParam4 = 0.476f;
		return 0f;
	}
	if (fVar0 > 20f)
	{
		*uParam3 = 0.212f;
		*uParam4 = 0.286f;
		return 1f;
	}
	fVar1 = (1f - ((fVar0 - 5f) / (20f - 5f)));
	fVar2 = (fVar1 * (0.402f - 0.212f));
	fVar3 = (fVar1 * (0.476f - 0.286f));
	*uParam3 = (fVar2 + 0.212f);
	*uParam4 = (fVar3 + 0.286f);
	return fVar1;
}

void func_178(int iParam0)//Position - 0x792C
{
	Global_2428549.f_1375 = iParam0;
}

int func_179(int iParam0)//Position - 0x793D
{
	return iParam0;
}

Vector3 func_180(int iParam0, int iParam1)//Position - 0x7947
{
	vector3 vVar0;
	vector3 vVar3;
	float fVar6;
	vector3 vVar7;
	vector3 vVar10;
	float fVar13;
	
	if (cam::is_gameplay_cam_rendering())
	{
		vVar3 = { cam::get_gameplay_cam_rot(2) };
	}
	if (iParam0 == func_181(player::player_ped_id()) && cam::_0xEE778F8C7E1142E2(cam::_0x19CAFA3C87F7C2FF()) == 4)
	{
		vVar0 = { entity::get_offset_from_entity_in_world_coords(iParam0, 0f, 8f, -0.2f) };
	}
	else
	{
		vVar0 = { entity::get_entity_coords(iParam0, 0) };
	}
	fVar6 = 0f;
	if (!entity::is_entity_dead(iParam0, 0))
	{
		fVar6 = entity::get_entity_heading(iParam0);
		if (cam::_0xEE778F8C7E1142E2(cam::_0x19CAFA3C87F7C2FF()) == 4)
		{
			fVar6 = vVar3.y;
		}
	}
	gameplay::get_model_dimensions(entity::get_entity_model(iParam0), &vVar7, &vVar10);
	if (iParam1)
	{
		fVar13 = (vVar10.y + 0.18f);
	}
	else
	{
		fVar13 = (vVar7.y + 0.18f);
	}
	vVar0 = { object::_get_object_offset_from_coords(vVar0, fVar6, 0f, 0f, fVar13) };
	return vVar0;
}

int func_181(int iParam0)//Position - 0x7A0B
{
	return iParam0;
}

void func_182(vector3 vParam0, int iParam3)//Position - 0x7A15
{
	func_174(vParam0, iParam3, 6, 0, 0);
}

void func_183(int iParam0)//Position - 0x7A2A
{
	Global_2428549.f_1377 = iParam0;
}

void func_184(int iParam0, int iParam1, int iParam2, float fParam3)//Position - 0x7A3B
{
	func_185(iParam0, iParam1, iParam2, fParam3);
}

void func_185(int iParam0, int iParam1, int iParam2, float fParam3)//Position - 0x7A4F
{
	func_186(iParam0, iParam1, iParam2, fParam3);
}

void func_186(int iParam0, int iParam1, int iParam2, float fParam3)//Position - 0x7A63
{
	int iVar0;
	int iVar1;
	float fVar2;
	
	if (iParam1 < 1)
	{
		iParam1 = 1;
	}
	iVar0 = (iParam0 * iParam1);
	fParam3 = 0f;
	if (iVar0 > 0)
	{
		fVar2 = (100f - fParam3);
		iVar1 = system::floor((IntToFloat(iVar0) * (fVar2 / 100f)));
	}
	else
	{
		iVar1 = iVar0;
	}
	Global_1587816[player::player_id() /*444*/].f_195.f_4 = iVar1;
	Global_1587816[player::player_id() /*444*/].f_195.f_3 = (Global_1587816[player::player_id() /*444*/].f_195.f_3 + iVar1);
	if (iParam2 == 1)
	{
		func_187(iVar1, 0);
	}
}

void func_187(int iParam0, int iParam1)//Position - 0x7AE6
{
	if (iParam1)
	{
	}
	iParam0 = iParam0;
}

void func_188(int iParam0, int iParam1, var uParam2, int iParam3, int iParam4, int iParam5)//Position - 0x7AF7
{
	int iVar0;
	
	if (!func_197())
	{
		return;
	}
	iVar0 = 1;
	if (iParam4)
	{
		iVar0 = 4;
	}
	else if (iParam3)
	{
		iVar0 = 2;
	}
	else if (iParam5)
	{
		iVar0 = 8;
	}
	switch (iParam0)
	{
		case -1645229221:
		case -585718395:
		case -1359375127:
		case 454359403:
		case -982394051:
		case 1643659499:
		case -2072289654:
		case 650665123:
		case 1654961868:
		case -876847842:
		case 68030260:
		case -2122299283:
		case 366672791:
		case 283351220:
		case 291576838:
		case 1182673174:
		case -516219046:
		case 1036455748:
		case 277665518:
		case 2043854386:
		case 1839532116:
		case 1022400740:
		case 1940862352:
		case -1389227906:
		case 711665950:
		case 1704445500:
		case 1515774909:
		case 1173654533:
		case -899802304:
		case -663944335:
		case 1208553146:
		case -613221010:
		case -671062876:
		case -407201236:
		case -754024203:
		case -1885444887:
		case 1931729587:
		case 1064954035:
		case -180141073:
		case 2131324797:
		case 1612072658:
		case -517447402:
		case 1948102096:
		case 1108628223:
		case -1834046564:
		case -1239008812:
		case -222363842:
		case -1276678868:
		case 1564537328:
		case -96593501:
		case 742499889:
		case 2050093329:
		case -1752488069:
		case 634375935:
		case 1850983186:
		case 763367758:
		case 1941570214:
		case 665109499:
		case -1330755006:
			if (iParam1 > 0)
			{
				func_189(uParam2, -1135378931, 537254313, 1474183246, iParam0, iParam1, iVar0, 7);
			}
			break;
		
		case -31156877:
		case -1027218631:
		case -1398318418:
		case 1652884147:
		case -57868256:
		case -1216489292:
		case -46622315:
		case -352356931:
		case -990286235:
		case 563463121:
		case 1734805203:
		case 941287179:
		case -1186079845:
		case -1985150258:
		case -1127021384:
		case -109201286:
		case 312105838:
		case 1982688246:
		case -661030418:
		case 1301046174:
		case -1586170317:
		case 393059668:
		case 23796958:
		case -1077156170:
		case 1780666425:
		case -2043695058:
		case -1922554349:
		case 1287308202:
		case 691372038:
		case 1480707108:
		case 1512499951:
		case 562283735:
		case -154732333:
		case -1362660491:
		case 645708827:
		case 767907967:
		case -1970151306:
		case 718859568:
		case -1955564771:
		case 892388724:
		case 1349151477:
		case 1620609399:
		case 1961641934:
		case 210955503:
		case -59668082:
		case 1736933716:
		case -1468524125:
		case 111573502:
		case 1525644423:
		case 968073639:
		case 1577781788:
		case -934465332:
		case -1194253122:
		case -212607085:
		case -815546555:
		case 1048226110:
		case 569170531:
		case -856006867:
		case 848090538:
		case -47546905:
			func_189(uParam2, -1135378931, 1445302971, 1474183246, iParam0, iParam1, iVar0, 7);
			break;
	}
}

bool func_189(var uParam0, int iParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7)//Position - 0x7E43
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	
	iVar0 = false;
	if (!func_197())
	{
		iVar0 = true;
	}
	if (!iVar0)
	{
		if (!unk3::_0xB24F0944DA203D9E(func_77()) || unk3::_0x810E8431C0614BF9())
		{
			Global_2563294 = 1;
			return false;
		}
		if (Global_2445217)
		{
			if (iParam3 == 1067618600 || iParam3 == -1303831698)
			{
				Global_2563295 = 1;
				return false;
			}
		}
	}
	iVar2 = false;
	iVar1 = 0;
	while (iVar1 < 5)
	{
		if (Global_2562803[iVar1 /*73*/].f_2 == 0)
		{
			iVar2 = true;
		}
		iVar1++;
	}
	if (!iVar2)
	{
		return false;
	}
	*uParam0 = 5;
	iVar3 = 2147483647;
	if (iVar0 || unk3::_network_shop_begin_service(&iVar3, iParam3, iParam4, iParam2, iParam5, iParam6))
	{
		if (iVar0 || unk3::_network_shop_checkout_start(iVar3))
		{
			*uParam0 = func_196(iVar3, iParam1, iParam4, iParam2, iParam3, iParam5, 0, iParam6, iParam7);
			if (iVar0)
			{
				if (*uParam0 != -1)
				{
					Global_2562803[*uParam0 /*73*/].f_66 = 1;
				}
			}
			Global_2563285 = 1;
			return true;
		}
	}
	else
	{
		if (iParam7 & 2 != 0)
		{
			Global_2563293 = 1;
			Global_2563296 = iParam4;
			Global_2563298 = iParam3;
			Global_2563299 = 1;
			Global_2563297 = iParam5;
		}
		if (iParam7 & 8 != 0)
		{
			Global_2563296 = iParam4;
			Global_2563298 = iParam3;
			Global_2563299 = 1;
			Global_2563297 = iParam5;
		}
		iVar4 = false;
		if (iVar4)
		{
			func_195(1, iParam4);
			Global_2563293 = 0;
		}
		if (iParam7 & 4 != 0)
		{
			func_190(-1, iParam4, iParam6, iParam5, -1);
		}
	}
	return false;
}

void func_190(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4)//Position - 0x7FB7
{
	switch (iParam1)
	{
		case 1704445500:
			gameplay::set_bit(&(Global_2418529[player::player_id() /*313*/].f_121.f_71), 0);
			break;
	}
	if (iParam0 != -1)
	{
		func_191(iParam0);
	}
}

void func_191(int iParam0)//Position - 0x7FEF
{
	int iVar0;
	
	iVar0 = false;
	if (!func_197())
	{
		iVar0 = true;
	}
	if (iParam0 != -1)
	{
		if (func_194(iParam0))
		{
			if (!iVar0)
			{
				unk_0xFA336E7F40C0A0D0();
			}
		}
		else if (!iVar0)
		{
			unk3::_network_shop_end_service(Global_2562803[iParam0 /*73*/]);
		}
		func_192(&(Global_2562803[iParam0 /*73*/]));
	}
}

void func_192(var uParam0)//Position - 0x8042
{
	*uParam0 = 0;
	*uParam0 = 2147483647;
	uParam0->f_1 = 0;
	uParam0->f_2 = 0;
	uParam0->f_3 = -1593119440;
	uParam0->f_4 = -2085313189;
	uParam0->f_5 = 0;
	uParam0->f_6 = 1227573907;
	uParam0->f_7 = -1161833819;
	uParam0->f_8 = 0;
	uParam0->f_8.f_1 = 0;
	uParam0->f_8.f_2 = 0;
	func_193(&(uParam0->f_8.f_3));
	func_193(&(uParam0->f_8.f_16));
	StringCopy(&(uParam0->f_8.f_29), "", 32);
	StringCopy(&(uParam0->f_8.f_37), "", 24);
	StringCopy(&(uParam0->f_8.f_43), "", 16);
	StringCopy(&(uParam0->f_8.f_47), "", 16);
	uParam0->f_8.f_51 = 0;
	uParam0->f_8.f_52 = 0;
	uParam0->f_8.f_53 = 0;
	uParam0->f_8.f_54 = 0;
	uParam0->f_8.f_55 = 0;
	uParam0->f_8.f_56 = 0;
	uParam0->f_66 = 0;
	uParam0->f_67 = 0;
	uParam0->f_68 = 0;
	uParam0->f_69 = 0;
	uParam0->f_70 = 0;
	uParam0->f_71 = 0;
	uParam0->f_72 = 0;
}

void func_193(var uParam0)//Position - 0x812D
{
	*uParam0 = 0;
	uParam0->f_1 = 0;
	uParam0->f_2 = 0;
	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;
	uParam0->f_11 = 0;
	uParam0->f_12 = 0;
}

int func_194(int iParam0)//Position - 0x8175
{
	if (iParam0 >= 0 && iParam0 < 5)
	{
		return Global_2562803[iParam0 /*73*/].f_5 == 1;
	}
	return false;
}

void func_195(int iParam0, int iParam1)//Position - 0x819D
{
	Global_2446544 = iParam1;
	Global_2446543 = iParam0;
}

int func_196(int iParam0, var uParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, var uParam8)//Position - 0x81B1
{
	int iVar0;
	
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < 5)
	{
		if (Global_2562803[iVar0 /*73*/].f_2 == 0)
		{
			if (!func_197())
			{
				iParam0 = iVar0 + 900;
			}
			Global_2562803[iVar0 /*73*/].f_2 = 1;
			Global_2562803[iVar0 /*73*/].f_1 = iParam5;
			Global_2562803[iVar0 /*73*/].f_3 = uParam1;
			Global_2562803[iVar0 /*73*/].f_4 = iParam2;
			Global_2562803[iVar0 /*73*/].f_7 = iParam3;
			Global_2562803[iVar0 /*73*/].f_5 = 0;
			Global_2562803[iVar0 /*73*/] = iParam0;
			Global_2562803[iVar0 /*73*/].f_6 = iParam4;
			Global_2562803[iVar0 /*73*/].f_69 = uParam8;
			Global_2562803[iVar0 /*73*/].f_68 = iParam7;
			Global_2562803[iVar0 /*73*/].f_72 = 0;
			Global_2563285 = 0;
			if (iParam6)
			{
				Global_2562803[iVar0 /*73*/].f_5 = 1;
			}
			return iVar0;
		}
		iVar0++;
	}
	return -1;
}

bool func_197()//Position - 0x8285
{
	if (gameplay::is_pc_version())
	{
		return true;
	}
	return false;
}

void func_198(int iParam0, int iParam1)//Position - 0x8299
{
	int iVar0;
	
	if (*iParam0 > 0)
	{
		if (!func_238())
		{
			if (func_237(0))
			{
				if (network::network_is_player_active(func_236()))
				{
					if (func_235() == 100)
					{
						iVar0 = *iParam0;
						*iParam0 = 0;
					}
					else
					{
						iVar0 = ((*iParam0 / 100) * func_235());
						*iParam0 = (*iParam0 - iVar0);
					}
					func_233(&iVar0, 0);
					if (iParam1 == 1)
					{
						func_201("GB_BCUT_TICK1", func_236(), iVar0, 0, 0, 1, 1);
					}
					func_200(20);
					func_199(func_236(), iVar0, 1);
				}
			}
		}
	}
}

void func_199(int iParam0, int iParam1, int iParam2)//Position - 0x832E
{
	struct<4> Var0;
	
	if (func_44(iParam0, 0, 1))
	{
		Var0 = 456;
		Var0.f_1 = player::player_id();
		Var0.f_2 = iParam1;
		Var0.f_3 = iParam2;
		script::trigger_script_event(1, &Var0, 5, func_8(iParam0));
	}
}

void func_200(int iParam0)//Position - 0x836B
{
	int iVar0;
	int iVar1;
	
	iVar0 = (iParam0 / 32);
	iVar1 = (iParam0 % 32);
	gameplay::set_bit(&(Global_2464975.f_4685.f_7[iVar0]), iVar1);
}

int func_201(char* sParam0, int iParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6)//Position - 0x8394
{
	int iVar0;
	struct<8> Var1;
	
	iVar0 = -1;
	if (network::_0x9DE986FC9A87C474(player::player_id(), iParam1) || iParam5)
	{
		if (!iParam4)
		{
			StringCopy(&Var1, player::get_player_name(iParam1), 64);
		}
		else
		{
			StringCopy(&Var1, player::get_player_name(iParam1), 64);
		}
		ui::_set_notification_text_entry(sParam0);
		ui::_0x39BBF623FC803EAC(func_210(iParam1, -2, 1, 0));
		ui::add_text_component_substring_player_name(func_208(&Var1));
		if (!iParam3 == 0)
		{
			ui::_0x39BBF623FC803EAC(iParam3);
		}
		ui::add_text_component_integer(iParam2);
		iVar0 = ui::_draw_notification(0, 1);
		func_202(27, sParam0, 1, &Var1, iParam2, 0, 0, 0, 1, 0, 0, 0);
	}
	return iVar0;
}

void func_202(int iParam0, char* sParam1, int iParam2, char* sParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8, char* sParam9, char* sParam10, char* sParam11)//Position - 0x8422
{
	int iVar0;
	
	if ((!func_207() || !network::network_is_activity_session()) || !func_205(player::player_id(), 0))
	{
		return;
	}
	iVar0 = func_203(iParam2);
	if (iVar0 >= 0 && iVar0 < 5)
	{
		Global_1731647.f_5[iVar0 /*53*/] = iParam0;
		Global_1731647.f_5[iVar0 /*53*/].f_1 = iParam2;
		StringCopy(&(Global_1731647.f_5[iVar0 /*53*/].f_8), sParam1, 16);
		Global_1731647.f_5[iVar0 /*53*/].f_2[0] = iParam4;
		Global_1731647.f_5[iVar0 /*53*/].f_2[1] = iParam5;
		Global_1731647.f_5[iVar0 /*53*/].f_2[2] = iParam6;
		Global_1731647.f_5[iVar0 /*53*/].f_7 = iParam7;
		Global_1731647.f_5[iVar0 /*53*/].f_6 = iParam8;
		StringCopy(&(Global_1731647.f_5[iVar0 /*53*/].f_12), sParam3, 64);
		StringCopy(&(Global_1731647.f_5[iVar0 /*53*/].f_28[0 /*6*/]), sParam9, 24);
		StringCopy(&(Global_1731647.f_5[iVar0 /*53*/].f_28[1 /*6*/]), sParam10, 24);
		StringCopy(&(Global_1731647.f_5[iVar0 /*53*/].f_28[2 /*6*/]), sParam11, 24);
	}
}

int func_203(int iParam0)//Position - 0x852A
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 <= (Global_1731647 - 1))
	{
		if (iParam0 > Global_1731647.f_5[iVar0 /*53*/].f_1)
		{
			func_204(iVar0);
			return iVar0;
		}
		iVar0++;
	}
	Global_1731647++;
	if (Global_1731647 > 5)
	{
		Global_1731647 = 5;
		return Global_1731647;
	}
	return (Global_1731647 - 1);
}

void func_204(int iParam0)//Position - 0x858C
{
	int iVar0;
	
	iVar0 = 4;
	while (iVar0 >= iParam0 + 1)
	{
		Global_1731647.f_5[iVar0 /*53*/] = { Global_1731647.f_5[(iVar0 - 1) /*53*/] };
		iVar0 = (iVar0 + -1);
	}
}

int func_205(int iParam0, int iParam1)//Position - 0x85C5
{
	int iVar0;
	
	if (iParam0 == player::player_id())
	{
		iVar0 = func_206(-1, 0) == 8;
	}
	else
	{
		iVar0 = Global_1587816[iParam0 /*444*/].f_195 == 8;
	}
	if (iParam1 == 1)
	{
		if (network::network_is_player_active(iParam0))
		{
			iVar0 = player::get_player_team(iParam0) == 8;
		}
	}
	return iVar0;
}

int func_206(int iParam0, int iParam1)//Position - 0x8610
{
	int iVar0;
	int iVar1;
	
	iVar1 = iParam0;
	if (iVar1 == -1)
	{
		iVar1 = func_77();
	}
	if (Global_1315891[iVar1] == 1)
	{
		if (iParam1)
		{
		}
		iVar0 = 8;
	}
	else
	{
		iVar0 = Global_1312741[iVar1];
		if (iParam1)
		{
		}
	}
	return iVar0;
}

int func_207()//Position - 0x8651
{
	return dlc2::is_dlc_present(-1762644250);
}

var func_208(char* sParam0)//Position - 0x8662
{
	char cVar0[64];
	
	StringCopy(&cVar0, "<C>", 64);
	StringConCat(&cVar0, sParam0, 64);
	StringConCat(&cVar0, "</C>~s~", 64);
	return func_209(&cVar0);
}

var func_209(char[4] cParam0)//Position - 0x8686
{
	return cParam0;
}

int func_210(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x8690
{
	int iVar0;
	
	if (func_231(iParam0))
	{
		if (iParam2)
		{
			return 0;
		}
		else
		{
			return 1;
		}
	}
	if (func_231(player::player_id()) || (func_230() && func_229()))
	{
		iVar0 = func_228();
		if (entity::does_entity_exist(iVar0))
		{
			if (ped::is_ped_a_player(iVar0))
			{
				if (network::_network_get_ped_player(iVar0) != -1)
				{
					if (func_44(network::_network_get_ped_player(iVar0), 0, 1))
					{
						if ((iParam1 > -1 && network::network_is_activity_session()) && iParam1 < 4)
						{
							if (Global_1617902.f_73330[iParam1] != -1)
							{
								return func_227(iParam1, iParam0, 0);
							}
							else
							{
								return func_217(iParam0, network::_network_get_ped_player(iVar0), iParam1, iParam2, iParam3);
							}
						}
						else
						{
							return func_217(iParam0, network::_network_get_ped_player(iVar0), iParam1, iParam2, iParam3);
						}
					}
				}
			}
			else if ((iParam1 > -1 && network::network_is_activity_session()) && iParam1 < 4)
			{
				if (Global_1617902.f_73330[iParam1] != -1)
				{
					return func_227(iParam1, iParam0, 0);
				}
				else
				{
					return func_211(0, -1, 0);
				}
			}
			else
			{
				return func_211(0, -1, 0);
			}
		}
	}
	if ((iParam1 > -1 && network::network_is_activity_session()) && iParam1 < 4)
	{
		if (Global_1617902.f_73330[iParam1] != -1)
		{
			return func_227(iParam1, iParam0, 0);
		}
		else
		{
			return func_217(iParam0, player::player_id(), iParam1, iParam2, iParam3);
		}
	}
	return func_217(iParam0, player::player_id(), iParam1, iParam2, iParam3);
}

int func_211(int iParam0, int iParam1, int iParam2)//Position - 0x8818
{
	return func_212(player::player_id(), iParam0, iParam1, iParam2);
}

int func_212(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x882E
{
	int iVar0;
	
	iVar0 = player::get_player_team(iParam0);
	if (iParam1)
	{
		if (iParam2 > -1)
		{
			if (func_82(iVar0, iParam2, 0) && !gameplay::is_bit_set(Global_1617902.f_15, 18))
			{
				if (iVar0 == iParam2)
				{
					return func_216(1);
				}
				else
				{
					return func_216(0);
				}
			}
			else if (iParam3)
			{
				return 28;
			}
			else if (gameplay::is_bit_set(Global_1617902.f_4, 20))
			{
				return func_213(iVar0, iParam2, 1);
			}
			else
			{
				return func_213(iVar0, iParam2, 0);
			}
		}
		return 28;
	}
	if (iVar0 == iParam2 || iParam2 == -1)
	{
		return func_216(1);
	}
	return func_216(0);
}

int func_213(int iParam0, int iParam1, int iParam2)//Position - 0x88E2
{
	int iVar0;
	
	iVar0 = func_215(iParam0, iParam1);
	if (func_214(Global_1617902.f_76918))
	{
		if (iVar0 == 1)
		{
			iVar0 = 0;
		}
	}
	if (iParam2)
	{
		switch (iVar0)
		{
			case 0:
				return 28;
			
			case 1:
				return 29;
			
			case 2:
				return 30;
			
			case 3:
				return 31;
			
			case 4:
				return 32;
			
			case 5:
				return 33;
			
			case 6:
				return 34;
			
			case 7:
				return 35;
			
			default:
		}
	}
	else
	{
		switch (iVar0)
		{
			case 0:
				return 28;
			
			case 1:
				return 29;
			
			case 2:
				return 30;
			}
		
		default:
	}
	return 28;
}

bool func_214(int iParam0)//Position - 0x899F
{
	int iVar0;
	
	if (iParam0 == 0)
	{
		return false;
	}
	iVar0 = 0;
	while (iVar0 <= 6)
	{
		if (iParam0 == Global_262145.f_7549[iVar0])
		{
			return true;
		}
		iVar0++;
	}
	return false;
}

int func_215(int iParam0, int iParam1)//Position - 0x89D8
{
	int iVar0;
	int iVar1;
	
	iVar0 = 0;
	while (iVar0 < 4)
	{
		if (iVar0 == iParam1)
		{
			return iVar1;
		}
		else if (!iParam0 == iVar0)
		{
			if (!func_82(iParam0, iVar0, 0))
			{
				iVar1++;
			}
		}
		iVar0++;
	}
	return -1;
}

int func_216(int iParam0)//Position - 0x8A1E
{
	if (iParam0)
	{
		return 118;
	}
	return 116;
}

int func_217(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4)//Position - 0x8A35
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	if (iParam2 == -2)
	{
		iVar0 = player::get_player_team(iParam0);
	}
	else
	{
		iVar0 = iParam2;
	}
	if (Global_1587816[player::player_id() /*444*/] == 148)
	{
		iVar1 = true;
	}
	iVar2 = iParam0;
	if (iVar2 > -1)
	{
		if (Global_1587816[iVar2 /*444*/] == 148)
		{
			iVar1 = true;
		}
	}
	if (!iVar1)
	{
		if (iVar0 != -1)
		{
			if ((func_226(iParam1, iParam0, iVar0, 0) && !gameplay::is_bit_set(Global_1617902.f_15, 18)) || ((func_82(player::get_player_team(iParam1), player::get_player_team(iParam0), 0) && gameplay::is_bit_set(Global_1617902.f_15, 23)) && !gameplay::is_bit_set(Global_1617902.f_15, 18)))
			{
				return func_216(1);
			}
			else if (gameplay::is_bit_set(Global_1617902.f_15, 26))
			{
				return func_225(1);
			}
			else
			{
				return func_212(iParam1, 1, iVar0, iParam4);
			}
		}
		else if ((Global_1573837 || Global_1573828) || Global_1587816[iParam0 /*444*/] == 0)
		{
			if (iParam0 == iParam1 || (Global_1573837 == 1 && Global_1573847 == 0))
			{
				return func_216(1);
			}
			else
			{
				return func_212(iParam1, 1, iVar0, iParam4);
			}
		}
		if (Global_1573832 && Global_1573410.f_14 == iParam0)
		{
			return 28;
		}
	}
	iVar3 = func_220(iParam0);
	if (!iVar3 == -1)
	{
		return func_218(iVar3);
	}
	if (iParam3)
	{
		return 0;
	}
	return 1;
}

int func_218(int iParam0)//Position - 0x8BB8
{
	int iVar0;
	
	iVar0 = func_219(iParam0);
	switch (iVar0)
	{
		case 0:
			return 192;
		
		case 1:
			return 193;
		
		case 2:
			return 194;
		
		case 3:
			return 195;
		
		case 4:
			return 196;
		
		case 5:
			return 197;
		
		case 6:
			return 198;
		
		case 7:
			return 199;
		
		case 8:
			return 200;
		
		case 9:
			return 201;
		
		case 10:
			return 202;
		
		case 11:
			return 203;
		
		case 12:
			return 204;
		
		case 13:
			return 205;
		
		case 14:
			return 206;
		
		default:
	}
	return 1;
}

var func_219(var uParam0)//Position - 0x8C75
{
	return Global_2413817.f_1946.f_44[uParam0 /*2*/].f_1;
}

int func_220(int iParam0)//Position - 0x8C8C
{
	if (!iParam0 == func_224())
	{
		if (func_222(iParam0, 1))
		{
			return Global_2413817.f_1946.f_11[func_221(iParam0)];
		}
	}
	return -1;
}

int func_221(int iParam0)//Position - 0x8CBE
{
	if (iParam0 != func_224())
	{
		return Global_1610705[iParam0 /*178*/].f_10;
	}
	return func_224();
}

int func_222(int iParam0, int iParam1)//Position - 0x8CE0
{
	if (!iParam1)
	{
		if (func_223(iParam0))
		{
			return false;
		}
	}
	return Global_1610705[iParam0 /*178*/].f_10 != func_224();
}

int func_223(int iParam0)//Position - 0x8D0A
{
	if (iParam0 != func_224())
	{
		if (Global_1610705[iParam0 /*178*/].f_10 != func_224())
		{
			return Global_1610705[iParam0 /*178*/].f_10 == iParam0;
		}
	}
	return false;
}

int func_224()//Position - 0x8D3D
{
	return -1;
}

int func_225(int iParam0)//Position - 0x8D46
{
	if (iParam0)
	{
		return 119;
	}
	return 116;
}

int func_226(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x8D5D
{
	if (iParam2 == -2)
	{
		if (iParam3 == 0)
		{
			if (player::get_player_team(iParam0) == -1 && player::get_player_team(iParam1) == -1)
			{
				return false;
			}
		}
		return player::get_player_team(iParam0) == player::get_player_team(iParam1);
	}
	else
	{
		if (iParam3 == 0)
		{
			if (player::get_player_team(iParam0) == -1 && iParam2 == -1)
			{
				return false;
			}
		}
		return player::get_player_team(iParam0) == iParam2;
	}
	return player::get_player_team(iParam0) == iParam2;
}

int func_227(int iParam0, int iParam1, int iParam2)//Position - 0x8DD5
{
	int iVar0;
	
	if (Global_1617902.f_73330[iParam0] != -1 && Global_1617902.f_73330[iParam0] <= 4)
	{
		if (Global_1617902.f_73330[iParam0] == 0)
		{
			iVar0 = 15;
		}
		else if (Global_1617902.f_73330[iParam0] == 1)
		{
			iVar0 = 18;
		}
		else if (Global_1617902.f_73330[iParam0] == 2)
		{
			iVar0 = 24;
		}
		else if (Global_1617902.f_73330[iParam0] == 4)
		{
			if (gameplay::is_bit_set(Global_1617902.f_15, 29))
			{
				iVar0 = 21;
			}
			else
			{
				iVar0 = 6;
			}
		}
		else
		{
			iVar0 = Global_1617902.f_73330[iParam0];
		}
	}
	else
	{
		iVar0 = func_212(iParam1, !iParam2, iParam0, 0);
	}
	return iVar0;
}

var func_228()//Position - 0x8E9A
{
	return Global_2359301.f_2;
}

int func_229()//Position - 0x8EA8
{
	return gameplay::is_bit_set(Global_2359301, 4);
}

int func_230()//Position - 0x8EB9
{
	return gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_39.f_18, 14);
}

bool func_231(int iParam0)//Position - 0x8ED6
{
	if (func_205(iParam0, 0))
	{
		return true;
	}
	if (func_232())
	{
		if (iParam0 == player::player_id())
		{
			return true;
		}
	}
	if (gameplay::is_bit_set(Global_2418529[iParam0 /*313*/].f_194, 2))
	{
		return true;
	}
	return false;
}

int func_232()//Position - 0x8F18
{
	return gameplay::is_bit_set(Global_2359301, 3);
}

void func_233(int iParam0, int iParam1)//Position - 0x8F29
{
	int iVar0;
	int iVar1;
	
	if (iParam1)
	{
		iVar1 = func_234(1);
	}
	else
	{
		iVar1 = func_234(0);
	}
	iVar0 = ((*iParam0 / 100) * iVar1);
	*iParam0 = (*iParam0 - iVar0);
}

int func_234(int iParam0)//Position - 0x8F5B
{
	if (iParam0)
	{
		return system::round((0.05f * 100f));
	}
	return Global_262145.f_10577;
}

var func_235()//Position - 0x8F81
{
	return Global_262145.f_10576;
}

var func_236()//Position - 0x8F90
{
	return Global_1610705[player::player_id() /*178*/].f_10;
}

int func_237(int iParam0)//Position - 0x8FA4
{
	return func_222(player::player_id(), iParam0);
}

int func_238()//Position - 0x8FB6
{
	return func_223(player::player_id());
}

float func_239(int iParam0)//Position - 0x8FC6
{
	switch (iParam0)
	{
		case 131:
		case 138:
		case 140:
		case 139:
		case 141:
		case 146:
			return 0f;
		
		case 144:
			return 0f;
		
		default:
	}
	return 1f;
}

int func_240(int iParam0)//Position - 0x9008
{
	int iVar0;
	
	iVar0 = iParam0;
	if (iVar0 != -1)
	{
		return Global_1610705[iVar0 /*178*/];
	}
	return -1;
}

int func_241(int iParam0)//Position - 0x9026
{
	int iVar0;
	
	iVar0 = iParam0;
	if (iVar0 != -1)
	{
		return Global_1610705[iVar0 /*178*/] != -1;
	}
	return false;
}

int func_242(int iParam0, int iParam1)//Position - 0x9046
{
	float fVar0;
	
	switch (iParam1)
	{
		case 0:
			break;
		
		case 1:
			if (iParam0 > 0)
			{
				fVar0 = (system::to_float(iParam0) * Global_262145);
				iParam0 = system::round(fVar0);
			}
			break;
		
		default:
			break;
	}
	return iParam0;
}

bool func_243(float fParam0)//Position - 0x9087
{
	iLocal_556 = network::_0x02C40BF885C567B6(Local_96.f_29);
	if (iLocal_556 >= 0)
	{
		if (ped::is_synchronized_scene_running(iLocal_556))
		{
			if (ped::get_synchronized_scene_phase(iLocal_556) >= fParam0)
			{
				return true;
			}
		}
	}
	return false;
}

bool func_244()//Position - 0x90BD
{
	iLocal_556 = network::_0x02C40BF885C567B6(Local_96.f_29);
	if (iLocal_556 >= 0)
	{
		if (ped::is_synchronized_scene_running(iLocal_556))
		{
			if (ped::get_synchronized_scene_phase(iLocal_556) >= 1f)
			{
				return true;
			}
		}
	}
	return false;
}

void func_245()//Position - 0x90F2
{
	func_246();
}

bool func_246()//Position - 0x90FF
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	
	if (!network::network_has_control_of_network_id(Local_96))
	{
		return false;
	}
	if (func_407(Local_96))
	{
		if (!gameplay::is_bit_set(Local_490.f_53, 3))
		{
			ped::clear_facial_idle_anim_override(network::net_to_ped(Local_96));
			gameplay::set_bit(&(Local_490.f_53), 3);
		}
		return false;
	}
	switch (Local_96.f_3)
	{
		case 0:
			ped::set_ped_reset_flag(network::net_to_ped(Local_96), 71, true);
			break;
		
		case 1:
			if (!gameplay::is_bit_set(Local_96.f_23, 4) && !gameplay::is_bit_set(Local_96.f_23, 12))
			{
				if (gameplay::is_bit_set(Local_96.f_23, 13))
				{
					if (!gameplay::is_bit_set(Local_490.f_52, 17))
					{
						ped::_set_ped_ragdoll_flag(network::net_to_ped(Local_96), 16);
						ai::task_look_at_entity(network::net_to_ped(Local_96), player::player_ped_id(), -1, 0, 2);
						if (ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
						{
							func_252(10);
						}
						else if (gameplay::is_bit_set(Local_96.f_24, 0))
						{
							if (!gameplay::is_bit_set(Local_96.f_24, 11))
							{
								if (!gameplay::is_bit_set(Local_96.f_24, 12))
								{
									func_252(13);
								}
								else
								{
									func_252(20);
								}
							}
							else
							{
								func_252(17);
							}
							gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 25);
						}
						else if (!gameplay::is_bit_set(Local_96.f_24, 11))
						{
							if (!gameplay::is_bit_set(Local_96.f_24, 12))
							{
								func_252(0);
							}
							else
							{
								func_252(18);
							}
						}
						else
						{
							func_252(15);
						}
						gameplay::set_bit(&(Local_490.f_52), 17);
					}
					else if (ai::get_script_task_status(network::net_to_ped(Local_96), -875674219) != 1 && ai::get_script_task_status(network::net_to_ped(Local_96), -875674219) != 0)
					{
						if (func_17(&uLocal_585, 5000, 0))
						{
							func_13(&uLocal_585);
							if (!iLocal_546)
							{
								ai::task_turn_ped_to_face_entity(network::net_to_ped(Local_96), player::player_ped_id(), 10000);
							}
							ai::task_look_at_entity(network::net_to_ped(Local_96), player::player_ped_id(), -1, 0, 2);
						}
					}
				}
			}
			ped::set_ped_reset_flag(network::net_to_ped(Local_96), 71, true);
			break;
		
		case 2:
			if (!gameplay::is_bit_set(Local_96.f_23, 7) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 0))
			{
				iVar1 = player::player_ped_id();
				if (Local_96.f_32 > -1)
				{
					if (network::network_is_participant_active(player::int_to_participantindex(Local_96.f_32)))
					{
						iVar0 = network::network_get_player_index(player::int_to_participantindex(Local_96.f_32));
						iVar1 = player::get_player_ped(iVar0);
					}
				}
				if (!ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
				{
					ai::task_look_at_entity(network::net_to_ped(Local_96), iVar1, -1, 0, 2);
					ped::_set_ped_ragdoll_flag(network::net_to_ped(Local_96), 16);
					ai::task_play_anim(network::net_to_ped(Local_96), "mp_am_hold_up", "WARY_LOOP", 4f, -4f, -1, 49, 0f, 0, 0, 0);
					gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 0);
				}
			}
			else if (ai::get_script_task_status(network::net_to_ped(Local_96), -875674219) != 1 && ai::get_script_task_status(network::net_to_ped(Local_96), -875674219) != 0)
			{
				if (func_17(&uLocal_585, 5000, 0))
				{
					iVar1 = player::player_ped_id();
					if (Local_96.f_32 > -1)
					{
						if (network::network_is_participant_active(player::int_to_participantindex(Local_96.f_32)))
						{
							iVar0 = network::network_get_player_index(player::int_to_participantindex(Local_96.f_32));
							iVar1 = player::get_player_ped(iVar0);
						}
					}
					func_13(&uLocal_585);
					ai::task_turn_ped_to_face_entity(network::net_to_ped(Local_96), iVar1, 10000);
					ai::task_look_at_entity(network::net_to_ped(Local_96), iVar1, -1, 0, 2);
				}
			}
			if (gameplay::is_bit_set(Local_96.f_23, 16))
			{
				ped::_set_ped_ragdoll_flag(network::net_to_ped(Local_96), 16);
			}
			ped::set_ped_reset_flag(network::net_to_ped(Local_96), 71, true);
			break;
		
		case 3:
			if (!gameplay::is_bit_set(Local_490.f_52, 25))
			{
				if (ai::get_script_task_status(network::net_to_ped(Local_96), 1920390111) != 0 && ai::get_script_task_status(network::net_to_ped(Local_96), 1920390111) != 1)
				{
					ped::set_ped_keep_task(network::net_to_ped(Local_96), true);
					ped::set_ped_flee_attributes(network::net_to_ped(Local_96), 2, false);
					ped::set_ped_flee_attributes(network::net_to_ped(Local_96), 8, true);
					ped::set_ped_flee_attributes(network::net_to_ped(Local_96), 16, true);
					ped::_set_ped_ragdoll_flag(network::net_to_ped(Local_96), 16);
					ai::task_achieve_heading(network::net_to_ped(Local_96), Local_96.f_42, -1);
					gameplay::set_bit(&(Local_490.f_52), 25);
				}
			}
			break;
		
		case 4:
			if (!gameplay::is_bit_set(Local_96.f_23, 17) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 3))
			{
				if (network::network_is_host_of_this_script())
				{
					Global_2464975.f_8 = 1;
				}
				iVar2 = player::player_ped_id();
				if (Global_2464975.f_9 != func_224())
				{
					if (func_44(Global_2464975.f_9, 1, 1))
					{
						iVar2 = player::get_player_ped(Global_2464975.f_9);
					}
				}
				ai::task_look_at_entity(network::net_to_ped(Local_96), iVar2, 30000, 0, 3);
				ped::set_facial_idle_anim_override(network::net_to_ped(Local_96), "mood_stressed_1", 0);
				gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 3);
			}
			else
			{
				iLocal_556 = network::_0x02C40BF885C567B6(Local_96.f_29);
				if (iLocal_556 >= 0)
				{
					if (ped::is_synchronized_scene_running(iLocal_556))
					{
						fLocal_790 = (Local_96.f_33 + 0.6f);
						if (fLocal_790 < 0.75f)
						{
							fLocal_790 = 0.75f;
						}
						if (gameplay::is_bit_set(Local_96.f_24, 4))
						{
							fLocal_790 = (fLocal_790 + 0.25f);
						}
						if (fLocal_790 > 1.75f)
						{
							fLocal_790 = 1.75f;
						}
						ped::set_synchronized_scene_rate(iLocal_556, fLocal_790);
					}
				}
			}
			break;
		
		case 5:
			if (!gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 10))
			{
				if (ai::get_script_task_status(network::net_to_ped(Local_96), 242628503) != 0 && ai::get_script_task_status(network::net_to_ped(Local_96), 242628503) != 1)
				{
					if (!ped::is_ped_ragdoll(network::net_to_ped(Local_96)))
					{
						iLocal_556 = network::_0x02C40BF885C567B6(Local_96.f_29);
						if ((iLocal_556 >= 0 && !ped::is_synchronized_scene_running(iLocal_556)) || iLocal_556 < 0)
						{
							ai::task_perform_sequence(network::net_to_ped(Local_96), iLocal_565);
							ped::_set_ped_ragdoll_flag(network::net_to_ped(Local_96), 16);
							ped::set_ped_keep_task(network::net_to_ped(Local_96), true);
							gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 10);
						}
					}
				}
			}
			else if (ai::get_script_task_status(network::net_to_ped(Local_96), -875674219) != 1 && ai::get_script_task_status(network::net_to_ped(Local_96), -875674219) != 0)
			{
				if (func_17(&uLocal_585, 5000, 0))
				{
					func_13(&uLocal_585);
					iVar1 = player::player_ped_id();
					if (Local_96.f_32 > -1)
					{
						if (network::network_is_participant_active(player::int_to_participantindex(Local_96.f_32)))
						{
							iVar0 = network::network_get_player_index(player::int_to_participantindex(Local_96.f_32));
							iVar1 = player::get_player_ped(iVar0);
						}
					}
					ai::task_turn_ped_to_face_entity(network::net_to_ped(Local_96), iVar1, 10000);
					ai::task_look_at_entity(network::net_to_ped(Local_96), player::player_ped_id(), -1, 0, 2);
				}
			}
			break;
		
		case 6:
			if (!gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 10))
			{
				if ((iLocal_556 < 0 || !ped::is_synchronized_scene_running(iLocal_556)) || ped::get_synchronized_scene_phase(iLocal_556) >= 0.95f)
				{
					func_251();
					iVar1 = player::player_ped_id();
					if (Local_96.f_32 > -1)
					{
						if (network::network_is_participant_active(player::int_to_participantindex(Local_96.f_32)))
						{
							iVar0 = network::network_get_player_index(player::int_to_participantindex(Local_96.f_32));
							iVar1 = player::get_player_ped(iVar0);
						}
					}
					ai::task_hands_up(network::net_to_ped(Local_96), -1, iVar1, -1, 1);
					ped::_0x2208438012482A1A(network::net_to_ped(Local_96), 0, 0);
					ped::_set_ped_ragdoll_flag(network::net_to_ped(Local_96), 16);
					ped::set_ped_keep_task(network::net_to_ped(Local_96), true);
					gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 10);
				}
			}
			break;
		
		case 7:
			if (ai::get_script_task_status(network::net_to_ped(Local_96), -1442466670) != 0 && ai::get_script_task_status(network::net_to_ped(Local_96), -1442466670) != 1)
			{
				if (!func_169())
				{
					func_250();
					ai::clear_ped_tasks(network::net_to_ped(Local_96));
					ai::task_combat_hated_targets_around_ped(network::net_to_ped(Local_96), 20f, 0);
					func_252(4);
				}
			}
			break;
		
		case 8:
			if (!gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 9))
			{
				func_251();
				iLocal_556 = network::_0x02C40BF885C567B6(Local_96.f_29);
				if ((iLocal_556 >= 0 && !ped::is_synchronized_scene_running(iLocal_556)) || iLocal_556 < 0)
				{
					if ((!gameplay::is_bit_set(Local_96.f_23, 27) && !func_36()) && !func_35())
					{
						if (gameplay::is_bit_set(Local_96.f_24, 2))
						{
							if (!gameplay::is_bit_set(Local_96.f_24, 3))
							{
								ai::task_perform_sequence(network::net_to_ped(Local_96), iLocal_567);
								iVar3 = 1;
							}
							else
							{
								func_250();
								ai::task_perform_sequence(network::net_to_ped(Local_96), iLocal_568);
								iVar3 = 1;
							}
						}
					}
					else
					{
						ai::task_smart_flee_coord(network::net_to_ped(Local_96), vLocal_552, 250f, -1, 1, 0);
						iVar3 = 1;
					}
					if (iVar3 == 1)
					{
						func_252(25);
						ped::set_ped_keep_task(network::net_to_ped(Local_96), true);
						func_6(Local_490.f_50, 1, func_7());
						gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 9);
					}
				}
			}
			else if (!gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 19))
			{
				iVar4 = ai::get_navmesh_route_result(network::net_to_ped(Local_96));
				if (iVar4 == 3)
				{
					ai::clear_ped_secondary_task(network::net_to_ped(Local_96));
					gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 19);
				}
				else if (iVar4 == 2)
				{
					ai::clear_ped_tasks(network::net_to_ped(Local_96));
					if (!gameplay::is_bit_set(Local_96.f_24, 3))
					{
						ai::task_perform_sequence(network::net_to_ped(Local_96), iLocal_569);
					}
					else
					{
						ai::task_combat_hated_targets_around_ped(network::net_to_ped(Local_96), 20f, 0);
					}
					gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 19);
				}
			}
			break;
	}
	func_247();
	return true;
}

void func_247()//Position - 0x99D6
{
	if ((Local_96.f_3 != 8 && Local_96.f_3 != 7) && Local_96.f_2 == 3)
	{
		if ((((!gameplay::is_bit_set(Local_96.f_23, 14) || !gameplay::is_bit_set(Local_96.f_23, 15)) || !gameplay::is_bit_set(Local_96.f_23, 22)) || !gameplay::is_bit_set(Local_96.f_23, 23)) || !gameplay::is_bit_set(Local_96.f_23, 30))
		{
			iLocal_556 = network::_0x02C40BF885C567B6(Local_96.f_29);
			if (iLocal_556 >= 0)
			{
				if (ped::is_synchronized_scene_running(iLocal_556))
				{
					if (!func_169())
					{
						if (!gameplay::is_bit_set(Local_96.f_23, 14) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 6))
						{
							func_252(2);
							gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 6);
						}
						if (!gameplay::is_bit_set(Local_96.f_23, 15) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 7))
						{
							if (ped::get_synchronized_scene_phase(iLocal_556) > 0.87f)
							{
								func_252(3);
								gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 7);
							}
						}
						if (!gameplay::is_bit_set(Local_96.f_23, 22) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 22))
						{
							if (gameplay::is_bit_set(Local_96.f_23, 24) && !func_169())
							{
								func_252(11);
								gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 22);
							}
						}
						if (!gameplay::is_bit_set(Local_96.f_23, 23) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 23))
						{
							if (gameplay::is_bit_set(Local_96.f_23, 25) && !func_169())
							{
								func_252(12);
								gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 23);
							}
						}
					}
				}
			}
		}
		if (!gameplay::is_bit_set(Local_96.f_23, 9))
		{
			if (!gameplay::is_bit_set(Local_96.f_23, 26) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 24))
			{
				if (gameplay::is_bit_set(Local_96.f_23, 7))
				{
					if (!func_169())
					{
						if (!gameplay::is_bit_set(Local_96.f_24, 11))
						{
							if (!gameplay::is_bit_set(Local_96.f_24, 12))
							{
								func_252(1);
							}
							else
							{
								func_252(19);
							}
						}
						else
						{
							func_252(16);
						}
						gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 24);
						return;
					}
					else
					{
						func_248();
						return;
					}
				}
			}
			if (((!gameplay::is_bit_set(Local_96.f_23, 30) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 25)) && !gameplay::is_bit_set(Local_96.f_23, 7)) && !gameplay::is_bit_set(Local_96.f_23, 4))
			{
				if (gameplay::is_bit_set(Local_96.f_24, 0) && !func_169())
				{
					if ((gameplay::is_bit_set(Local_96.f_23, 7) && gameplay::is_bit_set(Local_96.f_23, 4)) || (!gameplay::is_bit_set(Local_96.f_23, 7) && !gameplay::is_bit_set(Local_96.f_23, 4)))
					{
						if (!gameplay::is_bit_set(Local_96.f_24, 11))
						{
							if (!gameplay::is_bit_set(Local_96.f_24, 12))
							{
								func_252(13);
							}
							else
							{
								func_252(20);
							}
						}
						else
						{
							func_252(17);
						}
						gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 25);
						return;
					}
				}
			}
			if (!gameplay::is_bit_set(Local_96.f_23, 31) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 26))
			{
				if (gameplay::is_bit_set(Local_96.f_24, 1) && !func_169())
				{
					func_252(14);
					gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 26);
					return;
				}
			}
			if (!gameplay::is_bit_set(Local_96.f_24, 9) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 31))
			{
				if (gameplay::is_bit_set(Local_96.f_24, 8) && !func_169())
				{
					func_252(22);
					gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 31);
					return;
				}
			}
			if (!gameplay::is_bit_set(Local_96.f_1, 3) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/].f_1, 3))
			{
				if (gameplay::is_bit_set(Local_96.f_1, 2) && !func_169())
				{
					func_252(24);
					gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/].f_1), 3);
					return;
				}
			}
			if (!gameplay::is_bit_set(Local_96.f_24, 14) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 20))
			{
				if (gameplay::is_bit_set(Local_96.f_24, 13) && !func_169())
				{
					func_252(23);
					gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 20);
					return;
				}
			}
		}
	}
	if (!gameplay::is_bit_set(Local_96.f_24, 6) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 29))
	{
		if (gameplay::is_bit_set(Local_96.f_24, 5))
		{
			if (!func_169())
			{
				func_252(21);
				gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 29);
				return;
			}
		}
	}
}

void func_248()//Position - 0x9E75
{
	Global_14578 = 0;
	func_249();
}

void func_249()//Position - 0x9E85
{
	audio::restart_scripted_conversation();
	Global_16723 = 0;
	if (audio::is_scripted_conversation_ongoing())
	{
		audio::stop_scripted_conversation(false);
		Global_15712 = 6;
	}
}

void func_250()//Position - 0x9EA6
{
	int iVar0;
	
	iVar0 = gameplay::get_random_int_in_range(0, 12);
	if (iVar0 < 3)
	{
		weapon::give_delayed_weapon_to_ped(network::net_to_ped(Local_96), joaat("weapon_pistol"), 25000, 0);
		ped::set_ped_accuracy(network::net_to_ped(Local_96), gameplay::get_random_int_in_range(10, 35));
	}
	else if (iVar0 < 6)
	{
		weapon::give_delayed_weapon_to_ped(network::net_to_ped(Local_96), joaat("weapon_combatpistol"), 25000, 0);
		ped::set_ped_accuracy(network::net_to_ped(Local_96), gameplay::get_random_int_in_range(15, 40));
	}
	else if (iVar0 == 6)
	{
		weapon::give_delayed_weapon_to_ped(network::net_to_ped(Local_96), joaat("weapon_microsmg"), 25000, 0);
		ped::set_ped_accuracy(network::net_to_ped(Local_96), gameplay::get_random_int_in_range(10, 25));
	}
	else if (iVar0 == 7)
	{
		weapon::give_delayed_weapon_to_ped(network::net_to_ped(Local_96), joaat("weapon_combatmg"), 25000, 0);
		ped::set_ped_accuracy(network::net_to_ped(Local_96), gameplay::get_random_int_in_range(5, 15));
	}
	else if (iVar0 == 8)
	{
		weapon::give_delayed_weapon_to_ped(network::net_to_ped(Local_96), joaat("weapon_bat"), 25000, 0);
		ped::set_ped_accuracy(network::net_to_ped(Local_96), gameplay::get_random_int_in_range(20, 40));
	}
	else if (iVar0 == 9)
	{
		weapon::give_delayed_weapon_to_ped(network::net_to_ped(Local_96), joaat("weapon_assaultrifle"), 25000, 0);
		ped::set_ped_accuracy(network::net_to_ped(Local_96), gameplay::get_random_int_in_range(5, 30));
	}
	else if (iVar0 == 10)
	{
		weapon::give_delayed_weapon_to_ped(network::net_to_ped(Local_96), joaat("weapon_sawnoffshotgun"), 25000, 0);
		ped::set_ped_accuracy(network::net_to_ped(Local_96), gameplay::get_random_int_in_range(5, 20));
	}
	else
	{
		weapon::give_delayed_weapon_to_ped(network::net_to_ped(Local_96), joaat("weapon_pumpshotgun"), 25000, 0);
		ped::set_ped_accuracy(network::net_to_ped(Local_96), gameplay::get_random_int_in_range(10, 25));
	}
	func_6(Local_490.f_50, 1, func_7());
	ped::set_ped_relationship_group_hash(network::net_to_ped(Local_96), Global_1574256);
	ped::set_ped_as_enemy(network::net_to_ped(Local_96), 1);
	ped::set_ped_combat_movement(network::net_to_ped(Local_96), 1);
	ped::set_ped_sphere_defensive_area(network::net_to_ped(Local_96), vLocal_549, 20f, 0, 0);
	ped::set_ped_keep_task(network::net_to_ped(Local_96), true);
}

void func_251()//Position - 0xA06C
{
	iLocal_556 = network::_0x02C40BF885C567B6(Local_96.f_29);
	if (iLocal_556 >= 0)
	{
		if (ped::is_synchronized_scene_running(iLocal_556))
		{
			network::network_stop_synchronised_scene(Local_96.f_29);
		}
	}
}

void func_252(int iParam0)//Position - 0xA098
{
	struct<2> Var0;
	int iVar4;
	
	if (gameplay::is_bit_set(Local_96.f_23, 13))
	{
		if (!func_407(Local_96))
		{
			if (network::network_has_control_of_network_id(Local_96) || (!network::_0xA1607996431332DF(Local_96) && network::network_is_host_of_this_script()))
			{
				if (!ped::is_ped_ragdoll(network::net_to_ped(Local_96)))
				{
					if (Local_96.f_45 == 0)
					{
						StringCopy(&Var0, "RB_SH2", 16);
					}
					else if (Local_96.f_45 == 1)
					{
						StringCopy(&Var0, "RB_12_F", 16);
					}
					else
					{
						StringCopy(&Var0, "RB_SH3", 16);
					}
					StringIntConCat(&Var0, Local_96.f_31, 16);
					StringIntConCat(&Var0, iParam0, 16);
					if (gameplay::are_strings_equal(&Var0, "RB_SH241"))
					{
						if (weapon::get_current_ped_weapon(player::player_ped_id(), &iVar4, 1))
						{
							if ((((((iVar4 == joaat("weapon_unarmed") || iVar4 == 0) || iVar4 == joaat("object")) || iVar4 == joaat("weapon_flare")) || iVar4 == joaat("weapon_snowball")) || func_270(iVar4)) || func_269(iVar4))
							{
								StringCopy(&Var0, "RB_SH211", 16);
							}
						}
					}
					func_406(&uLocal_613, 3, network::net_to_ped(Local_96), &(Local_96.f_46), 1, 0);
					switch (iParam0)
					{
						case 0:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SHOP_GREET", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						
						case 1:
							func_253(&uLocal_613, "RB_12AU", &Var0, 12, 1, 0, 1);
							break;
						
						case 2:
							func_253(&uLocal_613, "RB_12AU", &Var0, 12, 1, 0, 1);
							break;
						
						case 3:
							func_253(&uLocal_613, "RB_12AU", &Var0, 12, 1, 0, 1);
							break;
						
						case 4:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SHOP_BRAVE", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						
						case 10:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SHOP_REMOVE_VEHICLE", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						
						case 11:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SHOP_REACT_TO_SHOUT", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						
						case 12:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SHOP_HURRYING", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						
						case 13:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SHOP_NO_COPS", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						
						case 14:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SHOP_THREATENED", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						
						case 15:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SHOP_GREET_START", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						
						case 16:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SHOP_SCARED_START", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						
						case 17:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SHOP_NO_COPS_START", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						
						case 18:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SHOP_GREET_END", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						
						case 19:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SHOP_SCARED_END", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						
						case 20:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SHOP_NO_COPS_END", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						
						case 21:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SHOP_COPS_ARRIVED", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						
						case 22:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SHOP_SELL", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						
						case 23:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SHOP_NO_ENTRY", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						
						case 24:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SHOP_STEAL", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						
						case 25:
							audio::_play_ambient_speech_with_voice(network::net_to_ped(Local_96), "SCREAM_PANIC", &(Local_96.f_50), "SPEECH_PARAMS_FORCE", 1);
							break;
						}
					}
				}
			}
	}
}

int func_253(var uParam0, char* sParam1, char* sParam2, int iParam3, int iParam4, int iParam5, int iParam6)//Position - 0xA449
{
	func_268(uParam0, 145, sParam1, iParam4, iParam5, iParam6);
	if (iParam3 > 7)
	{
		if (iParam3 < 12)
		{
			iParam3 = 7;
		}
	}
	Global_15719 = 0;
	Global_15721 = 0;
	Global_15726 = 0;
	Global_16703 = 0;
	Global_16705 = 0;
	Global_16709 = 0;
	Global_2621441 = 0;
	return func_254(sParam2, iParam3, 0);
}

bool func_254(char* sParam0, int iParam1, int iParam2)//Position - 0xA497
{
	Global_15713 = 0;
	if (Global_15712 == 0 || Global_15714 == 2)
	{
		if (Global_15712 != 0)
		{
			if (iParam1 > Global_15714)
			{
				if (Global_15719 == 0)
				{
					audio::stop_scripted_conversation(false);
					Global_14413.f_1 = 3;
					Global_15712 = 0;
					Global_15713 = 1;
					Global_15765 = 0;
					Global_15708 = 0;
					Global_15709 = 0;
					Global_15723 = 0;
					Global_15722 = 0;
					Global_14412 = 0;
				}
				else
				{
					func_267();
					return false;
				}
			}
			else
			{
				return false;
			}
		}
		if (audio::is_scripted_conversation_ongoing())
		{
			return false;
		}
		if (func_266(8, -1))
		{
			return false;
		}
		Global_15788 = { Global_15782 };
		func_265();
		Global_15001 = { Global_15166 };
		Global_15718 = Global_15719;
		Global_15725 = Global_15726;
		Global_2621442 = Global_2621441;
		Global_15727 = { Global_15743 };
		Global_15720 = Global_15721;
		Global_16702 = Global_16703;
		Global_16710 = { Global_16716 };
		Global_16704 = Global_16705;
		Global_16706 = Global_16707;
		Global_16708 = Global_16709;
		Global_15331.f_370 = Global_16701;
		Global_15331.f_368 = Global_16699;
		Global_15331.f_369 = Global_16700;
		Global_15708 = Global_15709;
		if (Global_15718)
		{
			gameplay::clear_bit(&Global_2283, 20);
			gameplay::clear_bit(&Global_2284, 17);
			gameplay::clear_bit(&Global_2285, 0);
			if (iParam2)
			{
				func_259();
				if (Global_3088[Global_14413 /*2811*/][0 /*281*/].f_259 == 2)
				{
					if (iParam1 == 13)
					{
					}
					else
					{
						return false;
					}
				}
				if (Global_14413.f_1 > 3)
				{
					return false;
				}
			}
			if (Global_14379 == 1)
			{
				return false;
			}
			if (player::is_player_playing(player::player_id()))
			{
				if (ped::is_ped_in_melee_combat(player::player_ped_id()))
				{
					return false;
				}
				if (func_258())
				{
					return false;
				}
				if (ai::is_ped_sprinting(player::player_ped_id()))
				{
					return false;
				}
				if (ped::is_ped_ragdoll(player::player_ped_id()))
				{
					return false;
				}
				if (ped::is_ped_in_parachute_free_fall(player::player_ped_id()))
				{
					return false;
				}
				if (weapon::get_is_ped_gadget_equipped(player::player_ped_id(), joaat("gadget_parachute")))
				{
					return false;
				}
				if (!Global_69521)
				{
					if (entity::is_entity_in_water(player::player_ped_id()))
					{
						return false;
					}
					if (player::is_player_climbing(player::player_id()))
					{
						return false;
					}
					if (ped::is_ped_planting_bomb(player::player_ped_id()))
					{
						return false;
					}
					if (player::is_special_ability_active(player::player_id()))
					{
						return false;
					}
				}
			}
			if (func_257())
			{
				return false;
			}
			else
			{
				switch (Global_14413.f_1)
				{
					case 7:
						return false;
						break;
					
					case 8:
						return false;
						break;
					
					case 9:
						break;
					
					case 10:
						break;
					
					default:
						break;
				}
				if (gameplay::is_bit_set(Global_2283, 9))
				{
					return false;
				}
			}
			func_256();
			Global_15722 = iParam2;
		}
		Global_15714 = iParam1;
		StringCopy(&Global_15331, sParam0, 24);
		Global_14578 = 0;
		func_255();
		return true;
	}
	if (Global_15712 == 5)
	{
		return false;
	}
	if (iParam1 < Global_15714 || iParam1 == Global_15714)
	{
		return false;
	}
	if (iParam1 == 2)
	{
	}
	else
	{
		func_267();
	}
	return false;
}

void func_255()//Position - 0xA763
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 <= 69)
	{
		StringCopy(&(Global_14580[iVar0 /*6*/]), "", 24);
		iVar0++;
	}
	audio::stop_scripted_conversation(false);
	Global_15712 = 1;
}

void func_256()//Position - 0xA795
{
	Global_15765 = Global_15764;
	Global_15759 = Global_15760;
	Global_15806 = { Global_15794 };
	Global_15812 = { Global_15800 };
	Global_15767 = Global_15766;
	Global_15836 = { Global_15818 };
	Global_15842 = { Global_15824 };
	Global_15848 = { Global_15830 };
	Global_15854 = { Global_15860 };
	Global_1598 = Global_1599;
	Global_1600 = Global_1601;
	Global_15723 = Global_15724;
	Global_15725 = Global_15726;
	Global_15727 = { Global_15743 };
	Global_15716 = Global_15717;
	Global_16728 = 0;
	Global_15761 = 0;
	Global_15762 = 0;
	gameplay::clear_bit(&Global_2284, 16);
}

bool func_257()//Position - 0xA82A
{
	if (Global_14413.f_1 == 1 || Global_14413.f_1 == 0)
	{
		return true;
	}
	return false;
}

bool func_258()//Position - 0xA851
{
	int iVar0;
	int iVar1;
	
	if (Global_69521)
	{
		iVar0 = 0;
		weapon::get_current_ped_weapon(player::player_ped_id(), &iVar1, 1);
		if (player::is_player_playing(player::player_id()))
		{
			if ((iVar1 == joaat("weapon_sniperrifle") || iVar1 == joaat("weapon_heavysniper")) || iVar1 == joaat("weapon_remotesniper"))
			{
				iVar0 = 1;
			}
		}
		if (cam::is_aim_cam_active() && iVar0 == 1)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	if (player::is_player_playing(player::player_id()))
	{
		if (ped::get_ped_config_flag(player::player_ped_id(), 78, 1))
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	return true;
}

void func_259()//Position - 0xA8EA
{
	if (func_119(14))
	{
		if (!entity::is_entity_dead(player::player_ped_id(), 0))
		{
			if (entity::get_entity_model(player::player_ped_id()) == Global_101186.f_32651[0 /*29*/])
			{
				Global_14413 = 0;
			}
			else if (entity::get_entity_model(player::player_ped_id()) == Global_101186.f_32651[1 /*29*/])
			{
				Global_14413 = 1;
			}
			else if (entity::get_entity_model(player::player_ped_id()) == Global_101186.f_32651[2 /*29*/])
			{
				Global_14413 = 2;
			}
			else
			{
				Global_14413 = 0;
			}
		}
	}
	else
	{
		Global_14413 = func_260();
		if (Global_14413 == 145)
		{
			Global_14413 = 3;
		}
		if (Global_69521)
		{
			Global_14413 = 3;
		}
		if (Global_14413 > 3)
		{
			Global_14413 = 3;
		}
	}
}

var func_260()//Position - 0xA98C
{
	func_261();
	return Global_101186.f_1902.f_539.f_3549;
}

void func_261()//Position - 0xA9A5
{
	int iVar0;
	
	if (entity::does_entity_exist(player::player_ped_id()))
	{
		if (func_264(Global_101186.f_1902.f_539.f_3549) != entity::get_entity_model(player::player_ped_id()))
		{
			iVar0 = func_263(player::player_ped_id());
			if (func_262(iVar0) && (!func_119(14) || Global_100138))
			{
				if (Global_101186.f_1902.f_539.f_3549 != iVar0 && func_262(Global_101186.f_1902.f_539.f_3549))
				{
					Global_101186.f_1902.f_539.f_3550 = Global_101186.f_1902.f_539.f_3549;
				}
				Global_101186.f_1902.f_539.f_3551 = iVar0;
				Global_101186.f_1902.f_539.f_3549 = iVar0;
				return;
			}
		}
		else
		{
			if (Global_101186.f_1902.f_539.f_3549 != 145)
			{
				Global_101186.f_1902.f_539.f_3551 = Global_101186.f_1902.f_539.f_3549;
			}
			return;
		}
	}
	Global_101186.f_1902.f_539.f_3549 = 145;
}

int func_262(int iParam0)//Position - 0xAAA2
{
	return iParam0 < 3;
}

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

int func_264(int iParam0)//Position - 0xAAEB
{
	if (func_262(iParam0))
	{
		return Global_101186.f_32651[iParam0 /*29*/];
	}
	else if (iParam0 != 145)
	{
	}
	return 0;
}

void func_265()//Position - 0xAB15
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 <= 15)
	{
		Global_15001[iVar0 /*10*/] = 0;
		StringCopy(&(Global_15001[iVar0 /*10*/].f_1), "", 24);
		Global_15001[iVar0 /*10*/].f_7 = 0;
		Global_15001[iVar0 /*10*/].f_8 = 0;
		iVar0++;
	}
	Global_15001.f_161 = -99;
	Global_15001.f_162 = { 0f, 0f, 0f };
}

int func_266(int iParam0, int iParam1)//Position - 0xAB6D
{
	switch (iParam0)
	{
		case 5:
			if (iParam1 > -1)
			{
				return Global_1338622.f_203[iParam1];
			}
			break;
	}
	return gameplay::is_bit_set(Global_1338622.f_949, iParam0);
}

void func_267()//Position - 0xABA8
{
	audio::restart_scripted_conversation();
	Global_16723 = 0;
	if ((audio::is_mobile_phone_call_ongoing() || Global_14413.f_1 == 9) || Global_14412 == 1)
	{
		audio::stop_scripted_conversation(false);
		Global_15712 = 6;
		Global_14413.f_1 = 3;
		return;
	}
	if (audio::is_scripted_conversation_ongoing())
	{
		audio::stop_scripted_conversation(true);
		Global_15712 = 6;
		return;
	}
}

void func_268(var uParam0, int iParam1, char* sParam2, int iParam3, int iParam4, var uParam5)//Position - 0xABFF
{
	Global_15166 = { *uParam0 };
	Global_1599 = iParam1;
	StringCopy(&Global_15782, sParam2, 24);
	Global_16701 = uParam5;
	if (iParam3 == 0)
	{
		Global_16699 = 1;
		Global_16697 = 0;
	}
	else
	{
		Global_16699 = 0;
		Global_16697 = 1;
	}
	if (iParam4 == 0)
	{
		Global_16700 = 1;
		Global_16698 = 0;
	}
	else
	{
		Global_16700 = 0;
		Global_16698 = 1;
	}
}

bool func_269(int iParam0)//Position - 0xAC55
{
	switch (iParam0)
	{
		case joaat("weapon_molotov"):
		case joaat("weapon_smokegrenade"):
		case joaat("weapon_grenade"):
		case joaat("weapon_stickybomb"):
		case joaat("weapon_proxmine"):
			return true;
			break;
	}
	return false;
}

bool func_270(int iParam0)//Position - 0xAC8A
{
	switch (iParam0)
	{
		case joaat("weapon_knife"):
		case joaat("weapon_bat"):
		case joaat("weapon_nightstick"):
		case joaat("weapon_hammer"):
		case joaat("weapon_golfclub"):
		case joaat("weapon_crowbar"):
		case joaat("weapon_bottle"):
		case joaat("weapon_dagger"):
		case joaat("weapon_knuckle"):
		case joaat("weapon_hatchet"):
		case joaat("weapon_machete"):
		case joaat("weapon_switchblade"):
			return true;
			break;
	}
	return false;
}

void func_271()//Position - 0xACE9
{
	int iVar0;
	
	iVar0 = network::get_num_reserved_mission_peds(false);
	if (Local_96.f_43 != iVar0)
	{
		if (Local_96.f_43 < iVar0 || func_278(Local_96.f_43, 0, 1))
		{
			network::reserve_network_mission_peds(Local_96.f_43);
		}
	}
	iVar0 = network::get_num_reserved_mission_objects(false);
	if (Local_96.f_44 != iVar0)
	{
		if (Local_96.f_44 < iVar0 || func_272(Local_96.f_44, 0, 1))
		{
			network::reserve_network_mission_objects(Local_96.f_44);
		}
	}
}

int func_272(int iParam0, int iParam1, int iParam2)//Position - 0xAD55
{
	return func_273(2, iParam0, 1, iParam1, iParam2);
}

bool func_273(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4)//Position - 0xAD69
{
	int iVar0;
	int iVar1;
	
	if (!gameplay::is_bit_set(Global_1348828, 0))
	{
		return false;
	}
	if ((iParam2 && !iParam3) && iParam1 <= (func_277(iParam0) - func_276(iParam0, 0)))
	{
		return true;
	}
	else
	{
		if (iParam3)
		{
			if (iParam2)
			{
				iVar0 = (iParam1 - func_276(iParam0, 0));
			}
			else
			{
				iVar0 = iParam1;
			}
			iVar1 = (func_277(iParam0) - func_275(iParam0));
		}
		else
		{
			if (iParam2)
			{
				iVar0 = (iParam1 - func_276(iParam0, 0));
			}
			else
			{
				iVar0 = iParam1;
			}
			iVar1 = (func_277(iParam0) - func_276(iParam0, 1));
		}
		if (!iParam4 && Global_1587816[player::player_id() /*444*/] != 3)
		{
			iVar1 = (iVar1 - func_274(iParam0));
		}
		if (iVar0 < iVar1)
		{
			return true;
		}
	}
	return false;
}

int func_274(int iParam0)//Position - 0xAE32
{
	switch (iParam0)
	{
		case 0:
			return 10;
			break;
		
		case 1:
			return 10;
			break;
		
		case 2:
			return 10;
			break;
	}
	return 0;
}

int func_275(int iParam0)//Position - 0xAE6C
{
	switch (iParam0)
	{
		case 0:
			return Global_1348828.f_1;
			break;
		
		case 1:
			return Global_1348828.f_2;
			break;
		
		case 2:
			return Global_1348828.f_3;
			break;
	}
	return 0;
}

int func_276(int iParam0, int iParam1)//Position - 0xAEB2
{
	int iVar0;
	
	iVar0 = player::player_id();
	switch (iParam0)
	{
		case 0:
			if (!network::network_get_this_script_is_network_script())
			{
				return Global_2418529[iVar0 /*313*/].f_207;
			}
			else
			{
				return network::get_num_reserved_mission_peds(!iParam1);
			}
			break;
		
		case 1:
			if (!network::network_get_this_script_is_network_script())
			{
				return Global_2418529[iVar0 /*313*/].f_208;
			}
			else
			{
				return network::get_num_reserved_mission_vehicles(!iParam1);
			}
			break;
		
		case 2:
			if (!network::network_get_this_script_is_network_script())
			{
				return Global_2418529[iVar0 /*313*/].f_209;
			}
			else
			{
				return network::get_num_reserved_mission_objects(!iParam1);
			}
			break;
	}
	return 0;
}

int func_277(int iParam0)//Position - 0xAF4C
{
	switch (iParam0)
	{
		case 0:
			return Global_1348836;
			break;
		
		case 1:
			return Global_1348837;
			break;
		
		case 2:
			return Global_1348838;
			break;
	}
	return 0;
}

int func_278(int iParam0, int iParam1, int iParam2)//Position - 0xAF8C
{
	return func_273(0, iParam0, 1, iParam1, iParam2);
}

void func_279()//Position - 0xAFA0
{
	float fVar0;
	int iVar1;
	int iVar2;
	vector3 vVar3;
	int iVar6;
	int iVar7;
	int iVar8;
	var uVar9;
	
	switch (iLocal_808)
	{
		case 0:
			if (!gameplay::is_bit_set(Local_490.f_53, 0))
			{
				if (network::network_does_network_id_exist(Local_96.f_14))
				{
					if (func_285(vLocal_814))
					{
						vLocal_814 = { entity::get_offset_from_entity_in_world_coords(network::net_to_obj(Local_96.f_14), 0f, -0.5f, 0f) };
						gameplay::set_bit(&(Local_490.f_53), 0);
					}
				}
			}
			if ((((entity::is_entity_at_coord(player::player_ped_id(), vLocal_814, 0.5f, 0.5f, 1f, false, true, 0) && (func_407(Local_96) || Local_96.f_3 > 7)) && !gameplay::is_bit_set(Local_96.f_23, 20)) && !gameplay::is_bit_set(Local_96.f_23, 11)) && fire::get_number_of_fires_in_range(vLocal_557, 1.5f) == 0)
			{
				if (((((!ped::is_ped_in_any_vehicle(player::player_ped_id(), 0) && !func_164(0)) && !func_284()) && !ui::is_pause_menu_active()) && !func_37(player::player_id(), 146)) && network::network_does_network_id_exist(Local_96.f_14))
				{
					func_144("FHU_MANR", -1);
					Global_2464975.f_4981.f_4 = 1;
					iLocal_808 = 1;
				}
			}
			break;
		
		case 1:
			if (((((!gameplay::is_bit_set(Local_96.f_24, 16) && !gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 12)) && !gameplay::is_bit_set(Local_96.f_23, 20)) && !gameplay::is_bit_set(Local_96.f_23, 11)) && entity::is_entity_at_coord(player::player_ped_id(), vLocal_814, 0.5f, 0.5f, 1f, false, true, 0)) && (!func_135(player::player_id()) || func_165(player::player_id()) == 154))
			{
				if (((controls::is_control_just_pressed(0, 51) && !func_283(0)) && !func_284()) && !ui::is_pause_menu_active())
				{
					if (func_143("FHU_MANR"))
					{
						ui::clear_help(1);
					}
					player::set_player_control(player::get_player_index(), false, 640);
					gameplay::set_bit(&(Local_169[network::participant_id_to_int() /*10*/]), 12);
					iLocal_808 = 2;
				}
				else if ((gameplay::get_game_timer() % 1000) < 50)
				{
					if (iLocal_813 == 0)
					{
						func_280(&iLocal_813, 4, "FHU_MANR", 0, 0, 0, 0);
					}
				}
			}
			else if (func_143("FHU_MANR"))
			{
				ui::clear_help(1);
			}
			break;
		
		case 2:
			if (!ped::is_ped_injured(player::player_ped_id()))
			{
				vVar3 = { entity::get_entity_coords(player::player_ped_id(), 1) };
				vLocal_814.z = (vVar3.y - 1f);
				entity::set_entity_coords(player::player_ped_id(), vLocal_814, 1, false, 0, 1);
				entity::set_entity_heading(player::player_ped_id(), gameplay::get_heading_from_vector_2d((vLocal_577.x - vLocal_814.x), (vLocal_577.y - vLocal_814.y)));
				ai::clear_sequence_task(&iVar6);
				ai::open_sequence_task(&iVar6);
				ai::task_play_anim(0, "oddjobs@shop_robbery@rob_till", "enter", 8f, -8f, 4000, 262144, 0f, 0, 0, 0);
				ai::task_play_anim(0, "oddjobs@shop_robbery@rob_till", "loop", 8f, -8f, 4000, 262145, 0f, 0, 0, 0);
				ai::task_play_anim(0, "oddjobs@shop_robbery@rob_till", "exit", 8f, -8f, 4000, 262144, 0f, 0, 0, 0);
				ai::close_sequence_task(iVar6);
				ai::task_perform_sequence(player::player_ped_id(), iVar6);
				ped::set_ped_using_action_mode(player::player_ped_id(), false, -1, 0);
				ped::set_ped_reset_flag(player::player_ped_id(), 200, true);
				ped::set_ped_reset_flag(player::player_ped_id(), 71, true);
				iVar2 = weapon::get_current_ped_weapon(player::player_ped_id(), &iLocal_812, 1);
				if (iVar2)
				{
					weapon::set_current_ped_weapon(player::player_ped_id(), joaat("weapon_unarmed"), true);
				}
				ped::_0x2208438012482A1A(player::player_ped_id(), 0, 0);
				if (!cam::does_cam_exist(iLocal_809))
				{
					iLocal_809 = cam::create_camera_with_params(26379945, 0f, 0f, 0f, 0f, 0f, 0f, 50f, 0, 2);
				}
				cam::attach_cam_to_entity(iLocal_809, player::player_ped_id(), -0.1878f, 3.0635f, 0.68f, 1);
				cam::point_cam_at_entity(iLocal_809, player::player_ped_id(), -0.0129f, 0.0927f, 0.3008f, 1);
				cam::set_cam_fov(iLocal_809, 35f);
				cam::shake_cam(iLocal_809, "HAND_SHAKE", 0.1f);
				cam::set_cam_active(iLocal_809, true);
				cam::render_script_cams(true, false, 3000, 1, 0, 0);
			}
			iLocal_808 = 3;
			break;
		
		case 3:
			if (!ped::is_ped_injured(player::player_ped_id()))
			{
				if (!cam::does_cam_exist(iLocal_810))
				{
					iLocal_810 = cam::create_camera_with_params(26379945, 0f, 0f, 0f, 0f, 0f, 0f, 50f, 0, 2);
				}
				cam::attach_cam_to_entity(iLocal_810, player::player_ped_id(), -1.0346f, 2.9183f, 0.68f, 1);
				cam::point_cam_at_entity(iLocal_810, player::player_ped_id(), -0.0574f, 0.1074f, 0.3008f, 1);
				cam::set_cam_fov(iLocal_810, 35f);
				cam::shake_cam(iLocal_810, "HAND_SHAKE", 0.1f);
				cam::set_cam_active_with_interp(iLocal_810, iLocal_809, 6000, 1, 1);
				ped::set_ped_reset_flag(player::player_ped_id(), 71, true);
				ped::set_ped_using_action_mode(player::player_ped_id(), false, -1, 0);
				ped::set_ped_reset_flag(player::player_ped_id(), 200, true);
			}
			iLocal_808 = 4;
			break;
		
		case 4:
			if (!cam::is_cam_interpolating(iLocal_810))
			{
				iLocal_808 = 5;
			}
			else if (!ped::is_ped_injured(player::player_ped_id()))
			{
				if (entity::is_entity_playing_anim(player::player_ped_id(), "oddjobs@shop_robbery@rob_till", "loop", 3))
				{
					fVar0 = entity::get_entity_anim_current_time(player::player_ped_id(), "oddjobs@shop_robbery@rob_till", "loop");
					if ((fVar0 > 0.374f && fVar0 <= 0.484f) || (fVar0 > 0.824f && fVar0 <= 0.92f))
					{
						if (!iLocal_811)
						{
							iVar7 = system::round(((IntToFloat(iLocal_582) * 0.75f) / 4f));
							iVar8 = system::round(((IntToFloat(iLocal_583) * 0.75f) / 4f));
							iVar1 = gameplay::get_random_int_in_range(iVar7, iVar8 + 1);
							iVar1 = func_242(iVar1, 1);
							if (iVar1 > (Global_262145.f_164 / 4))
							{
								iVar1 = (Global_262145.f_164 / 4);
							}
							if (func_241(player::player_id()) && func_239(func_240(player::player_id())) < 1f)
							{
								if (Global_262145.f_4222 > 1f)
								{
									Global_262145.f_4222 = 1f;
								}
								iVar1 = system::round((system::to_float(iVar1) * Global_262145.f_4222));
							}
							if (!func_136(player::player_id()) && func_165(player::player_id()) != 154)
							{
								func_198(&iVar1, 1);
							}
							if (iVar1 > 0)
							{
								if (func_197())
								{
									func_188(1734805203, iVar1, &uVar9, 0, 0, 0);
								}
								else
								{
									func_184(iVar1, 1, 1, 1092616192);
									networkcash::network_earn_from_holdups(iVar1);
								}
							}
							Global_2464975.f_4981 = (Global_2464975.f_4981 + iVar1);
							iLocal_807 = (iLocal_807 + iVar1);
							func_172(1, iLocal_807);
							audio::play_sound_frontend(-1, "ROBBERY_MONEY_TOTAL", "HUD_FRONTEND_CUSTOM_SOUNDSET", 1);
							iLocal_811 = 1;
						}
					}
					else if (iLocal_811)
					{
						iLocal_811 = 0;
					}
				}
				ped::set_ped_reset_flag(player::player_ped_id(), 71, true);
				ped::set_ped_using_action_mode(player::player_ped_id(), false, -1, 0);
				ped::set_ped_reset_flag(player::player_ped_id(), 200, true);
			}
			break;
		
		case 5:
			if (iLocal_812 != joaat("weapon_unarmed") && !ped::is_ped_injured(player::player_ped_id()))
			{
				weapon::set_current_ped_weapon(player::player_ped_id(), iLocal_812, true);
			}
			ped::set_ped_using_action_mode(player::player_ped_id(), true, -1, 0);
			cam::set_gameplay_cam_relative_heading(0f);
			cam::set_gameplay_cam_relative_pitch(0f, 1065353216);
			if (cam::does_cam_exist(iLocal_809))
			{
				cam::destroy_cam(iLocal_809, 0);
			}
			if (cam::does_cam_exist(iLocal_810))
			{
				cam::destroy_cam(iLocal_810, 0);
			}
			cam::render_script_cams(false, false, 3000, 1, 0, 0);
			player::set_player_control(player::player_id(), true, 0);
			Global_2464975.f_4981.f_2 = 1;
			Global_2464975.f_4981.f_5 = 1;
			iLocal_808 = 7;
			break;
		
		case 6:
			cam::set_cam_active(iLocal_810, false);
			cam::render_script_cams(false, false, 3000, 1, 0, 0);
			if (!ped::is_ped_injured(player::player_ped_id()))
			{
				ai::clear_ped_tasks_immediately(player::player_ped_id());
			}
			iLocal_808 = 5;
			break;
	}
}

void func_280(int iParam0, int iParam1, char* sParam2, int iParam3, char* sParam4, int iParam5, int iParam6)//Position - 0xB701
{
	int iVar0;
	
	if (script::_get_number_of_instances_of_streamed_script(joaat("context_controller")) < 1)
	{
	}
	if (streaming::is_player_switch_in_progress())
	{
		if (!*iParam0 == -1)
		{
			func_281(iParam0);
		}
		return;
	}
	if (!*iParam0 == -1)
	{
		return;
	}
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < 6)
	{
		if (!Global_36442[iVar0 /*32*/])
		{
			Global_36442[iVar0 /*32*/] = 1;
			Global_36442[iVar0 /*32*/].f_1 = Global_36643;
			Global_36643++;
			Global_36442[iVar0 /*32*/].f_4 = 0;
			Global_36442[iVar0 /*32*/].f_29 = 0;
			Global_36442[iVar0 /*32*/].f_5 = 0;
			Global_36442[iVar0 /*32*/].f_2 = iParam1;
			StringCopy(&(Global_36442[iVar0 /*32*/].f_8), sParam2, 16);
			Global_36442[iVar0 /*32*/].f_6 = iParam3;
			Global_36442[iVar0 /*32*/].f_31 = script::get_id_of_this_thread();
			Global_36442[iVar0 /*32*/].f_7 = 0;
			Global_36442[iVar0 /*32*/].f_3 = iParam5;
			if (!gameplay::is_string_null_or_empty(sParam4))
			{
				Global_36442[iVar0 /*32*/].f_12 = 1;
				StringCopy(&(Global_36442[iVar0 /*32*/].f_13), sParam4, 64);
				Global_36442[iVar0 /*32*/].f_30 = iParam6;
			}
			else
			{
				Global_36442[iVar0 /*32*/].f_12 = 0;
				Global_36442[iVar0 /*32*/].f_30 = 0;
			}
			*iParam0 = Global_36442[iVar0 /*32*/].f_1;
			return;
		}
		iVar0++;
	}
}

void func_281(var uParam0)//Position - 0xB82C
{
	int iVar0;
	
	if (*uParam0 == -1)
	{
		return;
	}
	iVar0 = func_282(*uParam0);
	if (iVar0 == -1)
	{
		*uParam0 = -1;
		return;
	}
	if (iVar0 > -1 && iVar0 < 6)
	{
		if (Global_36442[iVar0 /*32*/])
		{
			Global_36442[iVar0 /*32*/].f_7 = 1;
			*uParam0 = -1;
			return;
		}
	}
	*uParam0 = -1;
}

int func_282(int iParam0)//Position - 0xB883
{
	int iVar0;
	
	if (iParam0 < 0)
	{
		return -1;
	}
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < 6)
	{
		if (Global_36442[iVar0 /*32*/].f_1 == iParam0)
		{
			return iVar0;
		}
		iVar0++;
	}
	return -1;
}

bool func_283(int iParam0)//Position - 0xB8BE
{
	if (iParam0 == 1)
	{
		if (Global_14413.f_1 > 3)
		{
			if (gameplay::is_bit_set(Global_2283, 14))
			{
				if (Global_14412 == 1)
				{
					return true;
				}
				else
				{
					return false;
				}
			}
			else
			{
				return false;
			}
		}
		else
		{
			return false;
		}
	}
	if (script::_get_number_of_instances_of_streamed_script(joaat("cellphone_flashhand")) > 0)
	{
		if (Global_14412 == 1)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	if (Global_14413.f_1 > 3)
	{
		if (Global_14412 == 1)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	return false;
}

int func_284()//Position - 0xB942
{
	return gameplay::get_game_timer() <= Global_17257.f_5745 + 100;
}

bool func_285(vector3 vParam0)//Position - 0xB957
{
	if ((vParam0.x == 0f && vParam0.y == 0f) && vParam0.y == 0f)
	{
		return true;
	}
	return false;
}

void func_286(var uParam0, var uParam1, var uParam2, var uParam3, vector3 vParam4, var uParam7, int iParam8, int iParam9, int iParam10)//Position - 0xB981
{
	int iVar0;
	int iVar1;
	vector3 vVar2;
	vector3 vVar5;
	int iVar8;
	char* sVar9;
	float fVar10;
	int iVar11;
	int iVar12;
	
	if (((uParam7->f_4 >= 1000 || (uParam7->f_4 + uParam0->f_51) >= 1000) || func_404(&(uParam7->f_5))) || (func_139(&(Global_2464975.f_10)) && !func_403(Global_2464975.f_10, 300000, 0)))
	{
		if (func_139(&(Global_2464975.f_10)))
		{
			if ((gameplay::get_game_timer() % 2500) < 50)
			{
			}
		}
		if (!uParam0->f_34)
		{
			uParam0->f_34 = 1;
			if (!func_139(&(Global_2464975.f_10)))
			{
				func_18(&(Global_2464975.f_10), 0, 0);
			}
		}
	}
	else
	{
		if (func_139(&(Global_2464975.f_10)))
		{
			func_13(&(Global_2464975.f_10));
		}
		if (uParam0->f_34)
		{
			uParam0->f_34 = 0;
		}
	}
	if ((gameplay::get_game_timer() % 5000) < 50)
	{
	}
	if ((((((uParam7->f_3 < 2 && func_44(player::player_id(), 1, 1)) && gameplay::is_bit_set(uParam0->f_52, 26)) && !func_402(-1082130432)) && player::get_player_wanted_level(player::player_id()) < 1) && !iParam9) && !func_407(*uParam7))
	{
		iVar8 = 0;
		if ((ui::is_pause_menu_active() && uParam0->f_54 != 0) && !network::_0x2EAC52B4019E2782())
		{
			if (!iParam10)
			{
				uParam0->f_54 = 0;
				func_401(uParam0, &(iParam8->f_3));
			}
		}
		switch (uParam0->f_54)
		{
			case 0:
				if ((((!ui::is_pause_menu_active() && !ped::is_ped_in_any_vehicle(player::player_ped_id(), 1)) && !ai::is_ped_running(player::player_ped_id())) && (!func_135(player::player_id()) || func_165(player::player_id()) == 154)) && !func_400(player::player_id(), 21))
				{
					if (func_399(*uParam0, &uParam1, vParam4.y, &(uParam0->f_16[0 /*3*/]), &(uParam0->f_16[1 /*3*/]), &(uParam0->f_23), &(uParam0->f_26)))
					{
						vVar2 = { entity::get_entity_coords(player::player_ped_id(), 1) };
						vVar5 = { entity::get_entity_coords(network::net_to_ped(*uParam7), 1) };
						if ((gameplay::get_distance_between_coords(vVar2, uParam0->f_23, 1) < 5f && gameplay::absf((vVar2.y - vVar5.y)) < 0.25f) || func_444(1))
						{
							if (entity::is_entity_in_angled_area(player::player_ped_id(), uParam0->f_16[0 /*3*/], uParam0->f_16[1 /*3*/], uParam0->f_26, 0, true, 0) || func_444(1))
							{
								if (ped::_0xFCF37A457CB96DC0(player::player_ped_id(), uParam0->f_23, 135f) || func_444(1))
								{
									if (uParam0->f_34)
									{
										if (func_444(1))
										{
											func_421();
										}
										if (((!func_143("SHR_HOLDUP_1") && !func_143("SHR_MENU")) && !func_398()) && func_397())
										{
											func_144("SHR_SOLD_OUT", -1);
											uParam0->f_54 = 10;
										}
									}
									else
									{
										if (func_444(1))
										{
										}
										uParam0->f_14 = -1;
										func_280(&(uParam0->f_14), 4, "SHR_MENU", 0, 0, 0, 0);
										uParam0->f_54 = 2;
									}
								}
								else if ((gameplay::get_game_timer() % 8000) < 50)
								{
								}
							}
							else
							{
								if ((gameplay::get_game_timer() % 8000) < 50)
								{
								}
								unk_0x0A25F80D5BADC013(vVar2, uParam0->f_16[0 /*3*/], 0, 0, 255, 255);
								unk_0x0A25F80D5BADC013(vVar2, uParam0->f_16[1 /*3*/], 0, 0, 255, 255);
							}
						}
						else
						{
							if ((gameplay::get_game_timer() % 8000) < 50)
							{
							}
							unk_0x0A25F80D5BADC013(vVar2, uParam0->f_23, 0, 0, 255, 255);
						}
					}
				}
				else
				{
					if (func_143("SHR_MENU"))
					{
						ui::clear_help(1);
					}
					if (func_38(player::player_id()))
					{
						if (!gameplay::is_bit_set(uParam0->f_53, 4))
						{
							func_144("SHR_FM_CRIT", -1);
							unk_0xB9C362BABECDDC7A(3, 21, 200, 0, 0);
							gameplay::set_bit(&(uParam0->f_53), 4);
						}
					}
					if ((gameplay::get_game_timer() % 8000) < 50)
					{
					}
				}
				break;
			
			case 2:
				vVar2 = { entity::get_entity_coords(player::player_ped_id(), 1) };
				vVar5 = { entity::get_entity_coords(network::net_to_ped(*uParam7), 1) };
				if ((!ped::_0xFCF37A457CB96DC0(player::player_ped_id(), uParam0->f_23, 135f) || gameplay::absf((vVar2.y - vVar5.y)) >= 0.25f) && !func_444(1))
				{
					if (func_143("SHR_MENU"))
					{
						ui::clear_help(1);
					}
					func_281(&(uParam0->f_14));
					uParam0->f_54 = 0;
				}
				if (ui::is_pause_menu_active())
				{
					if (func_143("SHR_MENU"))
					{
						ui::clear_help(1);
					}
					func_281(&(uParam0->f_14));
					uParam0->f_54 = 0;
				}
				if (func_164(0) || func_163())
				{
					if (func_143("SHR_MENU"))
					{
						ui::clear_help(1);
					}
					func_281(&(uParam0->f_14));
					func_158(1, *uParam0);
					gameplay::clear_bit(&(uParam0->f_52), 26);
					uParam0->f_54 = 0;
				}
				if (!ai::is_ped_running(player::player_ped_id()))
				{
					if (func_396(uParam0->f_14, 1) || func_444(1))
					{
						if (func_444(1))
						{
							func_421();
						}
						if (func_143("SHR_MENU"))
						{
							ui::clear_help(1);
						}
						func_394(&(uParam0->f_44));
						func_281(&(uParam0->f_14));
						func_388(0, 0);
						gameplay::set_bit(&(uParam0->f_53), 7);
						func_438(player::player_id(), 0, 66048);
						ui::_0xA8FDB297A8D25FBA();
						if (!ped::is_ped_injured(player::player_ped_id()) && !func_407(*uParam7))
						{
							ai::task_turn_ped_to_face_entity(player::player_ped_id(), network::net_to_ped(*uParam7), 0);
							gameplay::clear_bit(&(iParam8->f_1), 1);
						}
						func_387();
						uParam0->f_54 = 3;
					}
				}
				break;
			
			case 3:
				if (!iParam10)
				{
					if (!cam::does_cam_exist(uParam0->f_1))
					{
						uParam0->f_1 = cam::create_camera_with_params(26379945, 0f, 0f, 0f, 0f, 0f, 0f, 50f, 0, 2);
						func_386(*uParam0, &(uParam0->f_2), &(uParam0->f_5), &fVar10);
						cam::set_cam_coord(uParam0->f_1, uParam0->f_2);
						cam::set_cam_rot(uParam0->f_1, uParam0->f_5, 2);
						cam::set_cam_fov(uParam0->f_1, fVar10);
						cam::shake_cam(uParam0->f_1, "HAND_SHAKE", 0.1f);
						cam::set_cam_active(uParam0->f_1, true);
						cam::render_script_cams(true, false, 3000, 1, 0, 0);
					}
					uParam0->f_37 = func_409(*uParam0);
				}
				if (player::is_player_control_on(player::player_id()))
				{
					player::set_player_control(player::player_id(), false, 0);
				}
				uParam0->f_13 = 6;
				func_385(0);
				func_384(1, 1, 0, 0, 0);
				func_383(1, 2, 1, 1, 1);
				func_382("SNK_ITEM");
				if (!iParam10)
				{
					func_380(1, uParam0->f_37, uParam0->f_37);
				}
				iVar11 = 0;
				while (iVar11 < uParam0->f_13)
				{
					func_375(iVar11, func_379(iVar11), 0, 1, 0, 0);
					if (uParam7->f_5[iVar11] >= 10 || ((func_139(&(Global_2464975.f_12[iVar11 /*2*/])) && !func_403(Global_2464975.f_12[iVar11 /*2*/], 150000, 0)) && *uParam0 == Global_2464975.f_27))
					{
						func_375(iVar11, "", 1, 1, 0, 0);
						func_374(15, 0);
						if (func_139(&(Global_2464975.f_12[iVar11 /*2*/])) && !func_403(Global_2464975.f_12[iVar11 /*2*/], 150000, 0))
						{
							uParam7->f_5[iVar11] = 10;
						}
						if (!func_139(&(Global_2464975.f_12[iVar11 /*2*/])))
						{
							Global_2464975.f_27 = *uParam0;
							func_18(&(Global_2464975.f_12[iVar11 /*2*/]), 0, 0);
						}
					}
					else if (func_371(iVar11))
					{
						func_375(iVar11, "SNK_FULL", 0, 1, 0, 0);
					}
					else if (!iParam10)
					{
						func_375(iVar11, "ITEM_COST", 1, 1, 0, 0);
						func_367(func_370(uParam0, iVar11), 0);
					}
					else
					{
						func_375(iVar11, "SNK_FREE", 0, 1, 0, 0);
					}
					iVar11++;
				}
				func_366(0);
				func_365(uParam0->f_12, 1, 1);
				if (uParam0->f_35)
				{
					if (!iParam10)
					{
						func_364("SNK_BOUGHT", 0, 0);
					}
					else
					{
						func_364("SNK_STORED", 0, 0);
					}
				}
				else if (uParam7->f_5[uParam0->f_12] >= 10)
				{
					func_364("SNK_SOUT", 0, 0);
				}
				else
				{
					func_364(func_363(uParam0->f_12), 0, 0);
				}
				func_362(201, "ITEM_SELECT", -1, 0);
				func_362(202, "ITEM_BACK", -1, 0);
				if (!iParam10)
				{
					func_362(203, "SNK_LIFT", -1, 0);
					func_333(1, *uParam0, 1, 0, 1, -1082130432, 0, 0);
				}
				uParam0->f_54 = 4;
				break;
			
			case 4:
				if (player::is_player_control_on(player::player_id()))
				{
					player::set_player_control(player::player_id(), false, 0);
				}
				if (ai::get_script_task_status(player::player_ped_id(), -875674219) == 7)
				{
					if (!gameplay::is_bit_set(iParam8->f_1, 1))
					{
						if (!iParam10)
						{
							func_438(player::player_id(), 0, 98816);
						}
						else
						{
							func_438(player::player_id(), 0, 256);
						}
						gameplay::set_bit(&(iParam8->f_1), 1);
					}
				}
				iVar8 = 0;
				if (gameplay::is_pc_version())
				{
					if (controls::_is_input_just_disabled(2))
					{
						controls::disable_control_action(0, 1, 1);
						controls::disable_control_action(0, 2, 1);
						controls::enable_control_action(0, 237, 1);
						controls::enable_control_action(0, 238, 1);
						controls::enable_control_action(0, 241, 1);
						controls::enable_control_action(0, 242, 1);
						func_329(0, 0, 0, 1);
						func_328(0, -1, 1);
						if (func_327())
						{
							if (Global_2566787 != uParam0->f_12)
							{
								audio::play_sound_frontend(-1, "NAV_UP_DOWN", "HUD_FRONTEND_DEFAULT_SOUNDSET", 1);
								uParam0->f_12 = Global_2566787;
								func_365(uParam0->f_12, 1, 1);
								uParam0->f_27 = 0;
								uParam0->f_29 = 0;
								uParam0->f_30 = 0;
								uParam0->f_32 = 0;
								sVar9 = func_363(uParam0->f_12);
								if (ui::does_text_label_exist(sVar9))
								{
									func_364(sVar9, 0, 0);
								}
							}
							else
							{
								iVar8 = 1;
							}
						}
					}
				}
				if (!iParam10)
				{
					func_333(1, *uParam0, 1, 0, 1, -1082130432, 0, 0);
				}
				func_316(uParam0, &(uParam7->f_5), iParam10);
				if ((uParam7->f_2 > 2 && gameplay::is_bit_set(uParam7->f_1, 0)) && gameplay::is_bit_set(iParam8->f_1, 0))
				{
					gameplay::clear_bit(&(iParam8->f_1), 0);
				}
				if ((controls::is_control_just_pressed(2, 201) || iVar8 == 1) || uParam0->f_47)
				{
					if (!uParam0->f_47)
					{
						uParam0->f_27 = 1;
						uParam0->f_29 = 0;
						uParam0->f_30 = 0;
						uParam0->f_32 = 0;
						func_394(&(uParam0->f_44));
					}
					if ((uParam0->f_28 && uParam0->f_31) && uParam0->f_33)
					{
						if (func_197())
						{
							uParam0->f_47 = 1;
							uParam0->f_48 = 0;
							uParam0->f_49 = -1;
							iVar0 = 0;
							if (!iParam10)
							{
								iVar0 = func_370(uParam0, uParam0->f_12);
							}
							func_306(uParam0, -1303831698, 537254313, iVar0);
							uParam0->f_54 = 5;
						}
						else
						{
							uParam0->f_35 = 1;
							audio::play_sound_frontend(-1, "PURCHASE", "HUD_LIQUOR_STORE_SOUNDSET", 1);
							uParam7->f_5[uParam0->f_12]++;
							uParam0->f_54 = 6;
						}
					}
					else
					{
						uParam0->f_35 = 0;
						if (!uParam0->f_28 && !uParam0->f_36)
						{
							iVar0 = 0;
							if (!iParam10)
							{
								iVar0 = func_370(uParam0, uParam0->f_12);
							}
							func_305(gameplay::get_hash_key(func_363(uParam0->f_12)), iVar0, 0);
							func_298(0, 31, 3);
							uParam0->f_54 = 11;
						}
						audio::play_sound_frontend(-1, "ERROR", "HUD_LIQUOR_STORE_SOUNDSET", 1);
					}
					if (!uParam0->f_33)
					{
						uParam0->f_54 = 3;
					}
				}
				if (!iParam10)
				{
					if (controls::is_control_just_pressed(2, 203) && !uParam0->f_47)
					{
						uParam0->f_27 = 1;
						if (uParam7->f_5[uParam0->f_12] < 10)
						{
							uParam0->f_33 = 1;
						}
						else
						{
							uParam0->f_33 = 0;
						}
						func_394(&(uParam0->f_44));
						if (!uParam0->f_33)
						{
							audio::play_sound_frontend(-1, "ERROR", "HUD_LIQUOR_STORE_SOUNDSET", 1);
						}
						else if (!uParam0->f_31)
						{
							audio::play_sound_frontend(-1, "ERROR", "HUD_LIQUOR_STORE_SOUNDSET", 1);
						}
						else
						{
							ai::task_play_anim(player::player_ped_id(), func_154(), func_297(), 8f, -8f, -1, 1048576, 0f, 0, 0, 0);
							uParam0->f_54 = 8;
							uParam0->f_15 = gameplay::get_game_timer();
							audio::play_sound_frontend(-1, "SELECT", "HUD_LIQUOR_STORE_SOUNDSET", 1);
							if (!iParam10)
							{
								func_401(uParam0, &(iParam8->f_3));
							}
						}
					}
				}
				if (controls::is_control_just_pressed(2, 202) || controls::is_control_just_released(2, 238))
				{
					if (func_444(1))
					{
						func_421();
					}
					uParam0->f_54 = 9;
					uParam0->f_15 = gameplay::get_game_timer();
					if (!iParam10)
					{
						audio::play_sound_frontend(-1, "CANCEL", "HUD_LIQUOR_STORE_SOUNDSET", 1);
						func_401(uParam0, &(iParam8->f_3));
					}
					else
					{
						audio::play_sound_frontend(-1, "BACK", "HUD_FREEMODE_SOUNDSET", 1);
						Global_2444121 = 1;
					}
				}
				if (uParam0->f_34)
				{
					uParam0->f_54 = 10;
					uParam0->f_15 = gameplay::get_game_timer();
					if (!iParam10)
					{
						func_401(uParam0, &(iParam8->f_3));
					}
					func_144("SHR_SOLD_OUT", -1);
				}
				iVar12 = 0;
				while (iVar12 < uParam0->f_13)
				{
					if (func_139(&(Global_2464975.f_12[iVar12 /*2*/])) && func_403(Global_2464975.f_12[iVar12 /*2*/], 150000, 0))
					{
						func_13(&(Global_2464975.f_12[iVar12 /*2*/]));
						uParam7->f_5[iVar12] = 0;
						uParam0->f_54 = 3;
					}
					iVar12++;
				}
				break;
			
			case 5:
				iVar0 = 0;
				if (!iParam10)
				{
					func_333(1, *uParam0, 1, 0, 1, -1082130432, 0, 0);
					iVar0 = func_370(uParam0, uParam0->f_12);
				}
				if (func_306(uParam0, -1303831698, 537254313, iVar0))
				{
				}
				else
				{
					switch (uParam0->f_49)
					{
						case 0:
							uParam0->f_35 = 0;
							if (!uParam0->f_28 && !uParam0->f_36)
							{
								if (!iParam10)
								{
									iVar0 = func_370(uParam0, uParam0->f_12);
								}
								func_305(gameplay::get_hash_key(func_363(uParam0->f_12)), iVar0, 0);
								func_298(0, 31, 3);
								func_296();
								func_295();
								uParam0->f_54 = 11;
							}
							else
							{
								if (func_444(1))
								{
									func_421();
								}
								uParam0->f_54 = 9;
								uParam0->f_15 = gameplay::get_game_timer();
								audio::play_sound_frontend(-1, "CANCEL", "HUD_LIQUOR_STORE_SOUNDSET", 1);
								if (!iParam10)
								{
									func_401(uParam0, &(iParam8->f_3));
								}
							}
							break;
						
						case 2:
							uParam0->f_35 = 1;
							audio::play_sound_frontend(-1, "PURCHASE", "HUD_LIQUOR_STORE_SOUNDSET", 1);
							uParam7->f_5[uParam0->f_12]++;
							uParam0->f_54 = 6;
							break;
						
						default:
							break;
						}
				}
				break;
			
			case 6:
				if (!iParam10)
				{
					func_333(1, *uParam0, 1, 0, 1, -1082130432, 0, 0);
				}
				if (func_197())
				{
					unk3::_network_shop_set_telemetry_nonce_seed(func_293(func_294()));
				}
				if (iParam10)
				{
					if (!gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_250.f_80, 6))
					{
						unk_0x0D30EB83668E63C5(1, uParam0->f_12, 0, 1);
						gameplay::set_bit(&(Global_1587816[player::player_id() /*444*/].f_250.f_80), 6);
					}
					iVar1 = 0;
					switch (uParam0->f_12)
					{
						case 3:
							func_104(1268, 1, -1);
							func_103(16, 1, -1, 1);
							break;
						
						case 1:
							func_104(1269, 1, -1);
							func_103(15, 1, -1, 1);
							break;
						
						case 2:
							func_103(14, 1, -1, 1);
							func_104(1270, 1, -1);
							break;
						
						case 4:
							uParam0->f_55 = 20;
							if (func_123(1090, -1, 0) + 20 > 20)
							{
								uParam0->f_55 = (20 - func_123(1090, -1, 0));
							}
							func_104(1090, uParam0->f_55, -1);
							break;
						
						case 0:
							func_104(62, 1, -1);
							break;
						
						case 5:
							func_104(63, 1, -1);
							break;
					}
				}
				else
				{
					switch (uParam0->f_12)
					{
						case 3:
							if (func_292(player::player_id(), 1, 0))
							{
								iVar1 = 0;
							}
							else
							{
								iVar1 = func_370(uParam0, uParam0->f_12);
							}
							func_104(1268, 1, -1);
							func_103(16, 1, -1, 1);
							networkcash::network_buy_item(iVar1, gameplay::get_hash_key("SNK_ITEM1"), 12, 1, false, 0, 0, 0, 0, true);
							break;
						
						case 1:
							if (func_292(player::player_id(), 1, 0))
							{
								iVar1 = 0;
							}
							else
							{
								iVar1 = func_370(uParam0, uParam0->f_12);
							}
							func_104(1269, 1, -1);
							func_103(15, 1, -1, 1);
							networkcash::network_buy_item(iVar1, gameplay::get_hash_key("SNK_ITEM2"), 12, 1, false, 0, 0, 0, 0, true);
							break;
						
						case 2:
							if (func_292(player::player_id(), 1, 0))
							{
								iVar1 = 0;
							}
							else
							{
								iVar1 = func_370(uParam0, uParam0->f_12);
							}
							func_103(14, 1, -1, 1);
							func_104(1270, 1, -1);
							networkcash::network_buy_item(iVar1, gameplay::get_hash_key("SNK_ITEM3"), 12, 1, false, 0, 0, 0, 0, true);
							break;
						
						case 4:
							if (func_292(player::player_id(), 1, 0))
							{
								iVar1 = 0;
							}
							else
							{
								iVar1 = func_370(uParam0, uParam0->f_12);
							}
							uParam0->f_55 = 20;
							if (func_123(1090, -1, 0) + 20 > 20)
							{
								uParam0->f_55 = (20 - func_123(1090, -1, 0));
							}
							func_104(1090, uParam0->f_55, -1);
							networkcash::network_buy_item(iVar1, gameplay::get_hash_key("SNK_ITEM4"), 12, 1, false, 0, 0, 0, 0, true);
							break;
						
						case 0:
							if (func_292(player::player_id(), 1, 0))
							{
								iVar1 = 0;
							}
							else
							{
								iVar1 = func_370(uParam0, uParam0->f_12);
							}
							func_104(62, 1, -1);
							networkcash::network_buy_item(iVar1, gameplay::get_hash_key("SNK_ITEM5"), 12, 1, false, 0, 0, 0, 0, true);
							break;
						
						case 5:
							if (func_292(player::player_id(), 1, 0))
							{
								iVar1 = 0;
							}
							else
							{
								iVar1 = func_370(uParam0, uParam0->f_12);
							}
							func_104(63, 1, -1);
							networkcash::network_buy_item(iVar1, gameplay::get_hash_key("SNK_ITEM6"), 12, 1, false, 0, 0, 0, 0, true);
							break;
						}
				}
				if (func_197())
				{
					func_191(func_294());
				}
				func_291(-iVar1, 0);
				uParam0->f_51 = (uParam0->f_51 + iVar1);
				if (!gameplay::is_bit_set(*iParam8, 30))
				{
					gameplay::set_bit(iParam8, 30);
				}
				if (!gameplay::is_bit_set(iParam8->f_1, 0))
				{
					gameplay::set_bit(&(iParam8->f_1), 0);
					iParam8->f_2 = uParam0->f_12;
				}
				if (uParam0->f_34 || uParam0->f_51 >= 1000)
				{
					uParam0->f_54 = 10;
					if (!iParam10)
					{
						func_401(uParam0, &(iParam8->f_3));
					}
					func_144("SHR_SOLD_OUT", -1);
				}
				else if (uParam7->f_5[uParam0->f_12] >= 10 || func_371(uParam0->f_12))
				{
					uParam0->f_54 = 3;
				}
				else
				{
					uParam0->f_54 = 4;
				}
				break;
			
			case 8:
				func_178(1);
				switch (uParam0->f_12)
				{
					case 3:
						func_289(0, 1f, 3);
						func_104(1268, 1, -1);
						func_103(13, 1, -1, 1);
						break;
					
					case 1:
						func_289(1, 1f, 3);
						func_104(1269, 1, -1);
						func_103(13, 1, -1, 1);
						break;
					
					case 2:
						func_289(2, 1f, 3);
						func_104(1270, 1, -1);
						func_103(13, 1, -1, 1);
						break;
					
					case 4:
						uParam0->f_55 = 20;
						if (func_123(1090, -1, 0) + 20 > 20)
						{
							uParam0->f_55 = (20 - func_123(1090, -1, 0));
						}
						func_289(5, system::to_float(uParam0->f_55), 3);
						func_104(1090, uParam0->f_55, -1);
						break;
					
					case 0:
						func_289(3, 1f, 3);
						func_104(62, 1, -1);
						break;
					
					case 5:
						func_289(4, 1f, 3);
						func_104(63, 1, -1);
						break;
				}
				if (!iParam10)
				{
					func_438(player::player_id(), 1, 0);
				}
				if (player::get_player_wanted_level(player::player_id()) < 1 && !func_287(player::player_id()))
				{
					player::report_crime(player::player_id(), 37, player::get_wanted_level_threshold(1));
					gameplay::set_bit(iParam8, 25);
					if (!gameplay::is_bit_set(*iParam8, 1))
					{
						gameplay::set_bit(iParam8, 2);
					}
				}
				if (!gameplay::is_bit_set(iParam8->f_1, 2))
				{
					gameplay::set_bit(&(iParam8->f_1), 2);
				}
				uParam0->f_54 = 12;
				break;
			
			case 11:
				if (!Global_91362.f_1352 && !network::_0x2EAC52B4019E2782())
				{
					uParam0->f_54 = 4;
				}
				break;
			
			case 10:
				if (!iParam10)
				{
					func_438(player::player_id(), 1, 0);
				}
				if ((gameplay::get_game_timer() - uParam0->f_15) > 1000)
				{
					uParam0->f_54 = 12;
				}
				else
				{
					controls::set_input_exclusive(2, 203);
					controls::set_input_exclusive(2, 202);
					controls::set_input_exclusive(2, 188);
					controls::set_input_exclusive(2, 187);
					controls::set_input_exclusive(2, 189);
					controls::set_input_exclusive(2, 190);
				}
				break;
			
			case 9:
				if ((gameplay::get_game_timer() - uParam0->f_15) > 1000)
				{
					uParam0->f_54 = 0;
				}
				else
				{
					controls::set_input_exclusive(2, 203);
					controls::set_input_exclusive(2, 202);
					controls::set_input_exclusive(2, 188);
					controls::set_input_exclusive(2, 187);
					controls::set_input_exclusive(2, 189);
					controls::set_input_exclusive(2, 190);
				}
				break;
			
			case 12:
				if (gameplay::is_bit_set(uParam7->f_1, 3))
				{
					if (gameplay::is_bit_set(iParam8->f_1, 2))
					{
						gameplay::clear_bit(&(iParam8->f_1), 2);
					}
					if (gameplay::is_bit_set(iParam8->f_1, 3))
					{
						gameplay::clear_bit(&(iParam8->f_1), 3);
					}
				}
				break;
		}
	}
	else
	{
		if ((gameplay::get_game_timer() % 8000) < 50)
		{
		}
		if (gameplay::is_bit_set(uParam7->f_1, 3))
		{
			if (gameplay::is_bit_set(iParam8->f_1, 2))
			{
				gameplay::clear_bit(&(iParam8->f_1), 2);
			}
			if (gameplay::is_bit_set(iParam8->f_1, 3))
			{
				gameplay::clear_bit(&(iParam8->f_1), 3);
			}
		}
		if ((uParam0->f_54 != 12 && gameplay::is_bit_set(uParam0->f_52, 26)) && !network::_0x2EAC52B4019E2782())
		{
			if ((((uParam0->f_54 == 4 || uParam0->f_54 == 3) || uParam0->f_54 == 6) || uParam0->f_54 == 11) || uParam0->f_54 == 5)
			{
				func_401(uParam0, &(iParam8->f_3));
			}
			uParam0->f_54 = 12;
		}
		if (uParam0->f_14 != -1)
		{
			func_281(&(uParam0->f_14));
		}
	}
}

bool func_287(int iParam0)//Position - 0xCE37
{
	if ((func_38(iParam0) || func_288(iParam0)) && func_239(func_240(iParam0)) == 0f)
	{
		return true;
	}
	return false;
}

int func_288(int iParam0)//Position - 0xCE6A
{
	int iVar0;
	
	iVar0 = iParam0;
	if (iVar0 != -1)
	{
		return gameplay::is_bit_set(Global_1610705[iVar0 /*178*/].f_1, 7);
	}
	return false;
}

void func_289(int iParam0, float fParam1, int iParam2)//Position - 0xCE8F
{
	struct<8> Var0;
	vector3 vVar8;
	int iVar11;
	int iVar12;
	
	if (fParam1 > 0f)
	{
		if (func_290(iParam0, &Var0))
		{
			vVar8 = { entity::get_entity_coords(player::player_ped_id(), 0) };
			func_178(1);
			iVar12 = -1;
			iVar11 = 0;
			while (iVar11 < 20)
			{
				if (Global_2428549.f_774[iVar11 /*30*/].f_6 == 0 || Global_2428549.f_774[iVar11 /*30*/].f_6 == 7)
				{
					iVar12 = iVar11;
					iVar11 = 20;
				}
				iVar11++;
			}
			if (iVar12 != -1)
			{
				Global_2428549.f_774[iVar12 /*30*/] = { vVar8 };
				Global_2428549.f_774[iVar12 /*30*/].f_6 = 1;
				Global_2428549.f_774[iVar12 /*30*/].f_4 = func_177(Global_2428549.f_774[iVar12 /*30*/], &Global_1312317, &Global_1312318);
				Global_2428549.f_774[iVar12 /*30*/].f_5 = fParam1;
				Global_2428549.f_774[iVar12 /*30*/].f_7 = network::get_network_time();
				Global_2428549.f_774[iVar12 /*30*/].f_8 = iParam2;
				Global_2428549.f_774[iVar12 /*30*/].f_14 = { Var0 };
				Global_2428549.f_774[iVar12 /*30*/].f_9 = func_176();
				Global_2428549.f_774[iVar12 /*30*/].f_10 = func_175();
			}
		}
	}
}

bool func_290(int iParam0, char* sParam1)//Position - 0xCFB1
{
	switch (iParam0)
	{
		case 0:
			StringCopy(sParam1, "PU_REWARD_S1", 32);
			return true;
		
		case 1:
			StringCopy(sParam1, "PU_REWARD_S2", 32);
			return true;
		
		case 2:
			StringCopy(sParam1, "PU_REWARD_S3", 32);
			return true;
		
		case 3:
			StringCopy(sParam1, "PU_REWARD_D1", 32);
			return true;
		
		case 4:
			StringCopy(sParam1, "PU_REWARD_D2", 32);
			return true;
		
		case 5:
			StringCopy(sParam1, "PU_REWARD_11", 32);
			return true;
		
		case 6:
			StringCopy(sParam1, "PU_REWARD_PC", 32);
			return true;
		
		default:
	}
	return false;
}

void func_291(int iParam0, int iParam1)//Position - 0xD03F
{
	func_186(iParam0, 1, 1, 0);
	if (iParam1 == 1)
	{
		func_187(iParam0, 0);
	}
}

bool func_292(int iParam0, int iParam1, int iParam2)//Position - 0xD05D
{
	if (iParam0 == func_224())
	{
		return false;
	}
	if (gameplay::is_bit_set(Global_1587816[iParam0 /*444*/].f_250.f_7, 0))
	{
		return true;
	}
	if (iParam1)
	{
		if (gameplay::is_bit_set(Global_1587816[iParam0 /*444*/].f_250.f_7, 1))
		{
			return true;
		}
	}
	if (iParam2)
	{
		if (Global_2418529[iParam0 /*313*/].f_305.f_1 != -1)
		{
			return true;
		}
	}
	return false;
}

int func_293(int iParam0)//Position - 0xD0C5
{
	if (iParam0 >= 0 && iParam0 < 5)
	{
		return Global_2562803[iParam0 /*73*/];
	}
	return -1;
}

int func_294()//Position - 0xD0E9
{
	int iVar0;
	
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < 5)
	{
		if (func_293(iVar0) != 2147483647)
		{
			if (func_194(iVar0))
			{
				return iVar0;
			}
		}
		iVar0++;
	}
	return -1;
}

void func_295()//Position - 0xD123
{
	Global_2434839.f_660.f_32 = 1;
}

void func_296()//Position - 0xD135
{
	Global_2434839.f_660.f_28 = 1;
	Global_2434839.f_660.f_32 = 0;
	Global_2434839.f_660.f_31 = gameplay::get_hash_key(script::get_this_script_name());
	func_13(&(Global_2434839.f_660.f_29));
}

char* func_297()//Position - 0xD16F
{
	if (func_12())
	{
		return "Shoplift_Mid";
	}
	return "Shoplift_Low";
}

void func_298(int iParam0, int iParam1, int iParam2)//Position - 0xD189
{
	int iVar0;
	
	if (!network::_0x883D79C4071E18B3())
	{
		return;
	}
	if (network::network_is_game_in_progress() && func_302(player::player_id(), 1))
	{
		return;
	}
	if (controls::is_control_pressed(2, 199) || controls::is_disabled_control_pressed(2, 199))
	{
		return;
	}
	if (ui::get_pause_menu_state() != 0)
	{
		return;
	}
	if (ui::is_pause_menu_active())
	{
		return;
	}
	if (player::is_system_ui_being_displayed())
	{
		return;
	}
	if (ui::is_warning_message_active())
	{
		return;
	}
	if (func_301())
	{
		return;
	}
	if (!func_299())
	{
		return;
	}
	if (network::network_is_game_in_progress() || iParam0)
	{
		if (!Global_91362.f_1352 && !network::_0x2EAC52B4019E2782())
		{
			iVar0 = 18;
			ui::_set_warning_message_2("BRSCRWTEX", "BRDISTEX", iVar0, "BRSHETEX", 0, -1, 0, 0, 1);
			Global_2445110 = iParam1;
			Global_91362.f_1352 = 1;
			Global_91362.f_1353 = iParam2;
		}
	}
}

bool func_299()//Position - 0xD262
{
	if (func_300())
	{
		return false;
	}
	if (network::network_is_cloud_available() == 0)
	{
		return false;
	}
	return true;
}

var func_300()//Position - 0xD282
{
	return Global_2444558;
}

var func_301()//Position - 0xD28E
{
	return Global_2445217;
}

bool func_302(int iParam0, int iParam1)//Position - 0xD29A
{
	if (iParam1)
	{
		if (func_303(iParam0))
		{
			return true;
		}
	}
	if (Global_1587816[iParam0 /*444*/] == -1)
	{
		return false;
	}
	return true;
}

int func_303(var uParam0)//Position - 0xD2C6
{
	return func_304(uParam0);
}

int func_304(var uParam0)//Position - 0xD2D4
{
	return gameplay::is_bit_set(Global_1587816[uParam0 /*444*/].f_13.f_1, 0);
}

void func_305(int iParam0, int iParam1, int iParam2)//Position - 0xD2EE
{
	Global_91362.f_1354 = iParam0;
	Global_91362.f_1355 = iParam1;
	Global_91362.f_1356 = iParam2;
}

bool func_306(var uParam0, int iParam1, int iParam2, int iParam3)//Position - 0xD311
{
	int iVar0;
	int iVar1;
	int iVar2;
	char[] cVar3[8];
	char* sVar4;
	
	if (uParam0->f_47)
	{
		switch (uParam0->f_48)
		{
			case 0:
				iVar0 = 0;
				iVar1 = 0;
				iVar2 = iParam3;
				if (networkcash::_0x76EF28DA05EA395A() > 0)
				{
					if (networkcash::_0x76EF28DA05EA395A() >= iVar2)
					{
						iVar1 = iVar2;
					}
					else
					{
						iVar1 = (iVar2 - (iVar2 - networkcash::_0x76EF28DA05EA395A()));
					}
					iVar2 = (iVar2 - iVar1);
				}
				if (iVar2 > 0)
				{
					if (networkcash::_0xA40F9C2623F6A8B5(-1) > 0)
					{
						if (networkcash::_0xA40F9C2623F6A8B5(-1) >= iVar2)
						{
							iVar0 = iVar2;
						}
						else
						{
							iVar0 = (iVar2 - (iVar2 - networkcash::_0xA40F9C2623F6A8B5(-1)));
						}
						iVar2 = (iVar2 - iVar0);
					}
				}
				cVar3 = func_379(uParam0->f_12);
				func_314(&sVar4, cVar3, func_315(uParam0));
				if (func_311(78225582, iParam1, gameplay::get_hash_key(&sVar4), iParam2, 1, iParam3, 1, 8, 0, 3))
				{
					if (func_309())
					{
						ui::_0x170F541E1CADD1DE(1);
						ui::_set_player_cash_change(-iVar0, -iVar1);
						uParam0->f_48 = 1;
					}
					else
					{
						uParam0->f_48 = 3;
					}
				}
				else
				{
					uParam0->f_48 = 3;
				}
				break;
			
			case 1:
				if (func_308(func_294()))
				{
					if (func_307(func_294()) == 2)
					{
						uParam0->f_48 = 2;
					}
					else
					{
						uParam0->f_48 = 3;
					}
				}
				break;
			
			case 2:
				uParam0->f_47 = 0;
				uParam0->f_48 = 0;
				ui::_0x170F541E1CADD1DE(0);
				ui::hide_hud_component_this_frame(13);
				uParam0->f_49 = 2;
				return false;
				break;
			
			case 3:
				func_191(func_294());
				uParam0->f_47 = 0;
				uParam0->f_48 = 0;
				ui::_0x170F541E1CADD1DE(0);
				ui::hide_hud_component_this_frame(13);
				uParam0->f_49 = 0;
				return false;
				break;
		}
		return true;
	}
	uParam0->f_48 = 0;
	uParam0->f_49 = -1;
	return false;
}

int func_307(int iParam0)//Position - 0xD48E
{
	if (iParam0 >= 0 && iParam0 < 5)
	{
		return Global_2562803[iParam0 /*73*/].f_2;
	}
	return 0;
}

int func_308(int iParam0)//Position - 0xD4B4
{
	if (iParam0 >= 0 && iParam0 < 5)
	{
		return Global_2562803[iParam0 /*73*/].f_2 != 1;
	}
	return false;
}

bool func_309()//Position - 0xD4DC
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	iVar0 = false;
	if (!func_197())
	{
		iVar0 = true;
	}
	iVar1 = func_294();
	if (iVar1 == -1)
	{
		return false;
	}
	if (!iVar0)
	{
		if (!unk3::_0xB24F0944DA203D9E(func_77()) || unk3::_0x810E8431C0614BF9())
		{
			if (func_310(Global_2562803[iVar1 /*73*/].f_6, Global_2562803[iVar1 /*73*/].f_4, Global_2562803[iVar1 /*73*/].f_1) == 1)
			{
				Global_2563294 = 1;
			}
			return false;
		}
		if (Global_2445217)
		{
			if (Global_2562803[iVar1 /*73*/].f_6 == 1067618600 || Global_2562803[iVar1 /*73*/].f_6 == -1303831698)
			{
				Global_2563295 = 1;
				return false;
			}
		}
	}
	iVar2 = func_293(iVar1);
	if (iVar2 != 2147483647)
	{
		if (iVar0 || unk3::_network_shop_checkout_start(iVar2))
		{
			if (iVar0)
			{
				Global_2562803[iVar1 /*73*/].f_66 = 1;
			}
			Global_2562803[iVar1 /*73*/].f_72 = 0;
			Global_2563285 = 1;
			return true;
		}
	}
	return false;
}

int func_310(int iParam0, int iParam1, int iParam2)//Position - 0xD5CE
{
	if (iParam0 == -433440095 || iParam0 == 1474183246)
	{
		switch (iParam1)
		{
			case 1940862352:
				if (iParam2 >= 10000)
				{
					return 1;
				}
				else
				{
					return 0;
				}
				break;
			
			case -31156877:
				if (iParam2 >= 1000)
				{
					return 1;
				}
				else
				{
					return 2;
				}
				break;
			
			case 1718438689:
			case -1027218631:
			case -1398318418:
			case 1652884147:
			case -57868256:
			case -1216489292:
			case -46622315:
			case -352356931:
			case -990286235:
			case 563463121:
			case 1734805203:
			case 941287179:
			case -1186079845:
			case -1985150258:
			case -1127021384:
			case -109201286:
			case 312105838:
			case 1982688246:
			case -661030418:
			case 1301046174:
			case -1586170317:
			case 393059668:
			case 23796958:
			case -1077156170:
			case 1780666425:
			case -2043695058:
			case -1922554349:
			case 1287308202:
			case 691372038:
			case 1480707108:
			case 1512499951:
			case 562283735:
			case -154732333:
			case -1362660491:
			case 645708827:
			case 767907967:
			case -1970151306:
			case 718859568:
			case -1955564771:
			case 892388724:
			case 1349151477:
			case 1620609399:
			case 1961641934:
			case 210955503:
			case -59668082:
			case 1736933716:
			case -1468524125:
			case 111573502:
			case 1525644423:
			case 968073639:
			case 1577781788:
			case -934465332:
			case -1194253122:
			case -212607085:
			case -815546555:
			case 1048226110:
			case 569170531:
			case -856006867:
			case 848090538:
			case -47546905:
				return 1;
				break;
			
			case 1515774909:
			case 1173654533:
			case -899802304:
			case -663944335:
			case 1208553146:
			case -613221010:
			case -671062876:
			case 291576838:
			case -1276678868:
			case 711665950:
			case -407201236:
			case -754024203:
			case -1885444887:
			case 1931729587:
			case 1064954035:
			case -180141073:
			case 2131324797:
			case 283351220:
			case 1108628223:
			case -876847842:
			case 68030260:
				return 2;
				break;
			
			default:
				return 0;
				break;
		}
	}
	else if ((iParam0 == -1134853190 || iParam0 == 925407197) || iParam0 == -1589378882)
	{
		return 0;
	}
	return 1;
}

bool func_311(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4, var uParam5, int iParam6, int iParam7, int iParam8, int iParam9)//Position - 0xD858
{
	int iVar0;
	int iVar1;
	struct<4> Var2;
	
	iVar0 = false;
	if (!func_197())
	{
		iVar0 = true;
	}
	if (!iVar0)
	{
		if (!unk3::_0xB24F0944DA203D9E(func_77()) || unk3::_0x810E8431C0614BF9())
		{
			Global_2563294 = 1;
			return false;
		}
		if (Global_2445217)
		{
			if (iParam1 == 1067618600 || iParam1 == -1303831698)
			{
				Global_2563295 = 1;
				return false;
			}
		}
	}
	iVar1 = func_294();
	if (iVar1 == -1)
	{
		if (!func_313(&iVar1, iParam0, iParam1, iParam3, iParam7, iParam9))
		{
			return false;
		}
	}
	if (iVar1 != -1)
	{
		if (iParam8 != 0 && func_312(iParam1))
		{
			Var2 = iParam8;
			Var2.f_1 = iParam2;
			Var2.f_2 = uParam5;
			Var2.f_3 = iParam6;
		}
		else
		{
			Var2 = iParam2;
			Var2.f_1 = iParam8;
			Var2.f_2 = uParam5;
			Var2.f_3 = iParam6;
		}
		Global_2562803[iVar1 /*73*/].f_70 = Var2;
		Global_2562803[iVar1 /*73*/].f_71 = Var2.f_1;
		if (iVar0 || unk3::_network_shop_basket_add_item(&Var2, iParam4))
		{
			return true;
		}
	}
	return false;
}

bool func_312(int iParam0)//Position - 0xD95C
{
	switch (iParam0)
	{
		case -221807075:
		case -1224924353:
		case -2121967344:
		case 1394405165:
		case -2052814106:
		case 1701289268:
		case -1796535835:
		case -1928802392:
		case 581564040:
		case 23048035:
		case 2117376854:
		case -1377881127:
		case -504675202:
		case 1906937290:
		case -1616616027:
		case -1799524201:
		case 269396419:
		case 69656641:
			return true;
			break;
	}
	return false;
}

bool func_313(int iParam0, var uParam1, int iParam2, int iParam3, int iParam4, var uParam5)//Position - 0xD9DF
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	iVar0 = false;
	if (!func_197())
	{
		iVar0 = true;
	}
	if (!iVar0)
	{
		if (!unk3::_0xB24F0944DA203D9E(func_77()) || unk3::_0x810E8431C0614BF9())
		{
			Global_2563294 = 1;
			return false;
		}
		if (Global_2445217)
		{
			if (iParam2 == 1067618600 || iParam2 == -1303831698)
			{
				Global_2563295 = 1;
				return false;
			}
		}
	}
	iVar2 = false;
	iVar1 = 0;
	while (iVar1 < 5)
	{
		if (Global_2562803[iVar1 /*73*/].f_2 == 0)
		{
			iVar2 = true;
		}
		else if (Global_2562803[iVar1 /*73*/].f_5 == 1)
		{
			return false;
		}
		iVar1++;
	}
	if (!iVar2)
	{
		return false;
	}
	*iParam0 = 0;
	if (!iVar0)
	{
		if (unk3::_network_shop_basket_end())
		{
			unk_0xFA336E7F40C0A0D0();
		}
	}
	if (iVar0 || unk3::_network_shop_basket_start(&iVar3, iParam2, iParam3, iParam4))
	{
		*iParam0 = func_196(iVar3, uParam1, -2085313189, iParam3, iParam2, 0, 1, iParam4, uParam5);
		return true;
	}
	return false;
}

void func_314(char* sParam0, char* sParam1, int iParam2)//Position - 0xDAD4
{
	StringCopy(sParam0, "MT_", 64);
	StringConCat(sParam0, sParam1, 64);
	StringConCat(sParam0, "_t0_v", 64);
	StringIntConCat(sParam0, iParam2, 64);
}

int func_315(var uParam0)//Position - 0xDAF8
{
	if (func_292(player::player_id(), 1, 0))
	{
		return 3;
	}
	else if (uParam0->f_50 >= 10 && uParam0->f_50 <= 14)
	{
		return 0;
	}
	else if (uParam0->f_50 >= 15 && uParam0->f_50 <= 19)
	{
		return 1;
	}
	else
	{
		return 2;
	}
	return -1;
}

void func_316(var uParam0, var uParam1, int iParam2)//Position - 0xDB53
{
	char* sVar0;
	
	if (!uParam0->f_29)
	{
	}
	if (func_326(uParam0))
	{
		uParam0->f_27 = 0;
		func_325(&(uParam0->f_44));
		uParam0->f_12 = (uParam0->f_12 - 1);
		if (uParam0->f_12 < 0)
		{
			uParam0->f_12 = (uParam0->f_13 - 1);
		}
		audio::play_sound_frontend(-1, "NAV_UP_DOWN", "HUD_LIQUOR_STORE_SOUNDSET", 1);
		func_365(uParam0->f_12, 1, 1);
		sVar0 = func_363(uParam0->f_12);
		uParam0->f_29 = 0;
		uParam0->f_30 = 0;
		uParam0->f_32 = 0;
		if (ui::does_text_label_exist(sVar0))
		{
			func_364(sVar0, 0, 0);
		}
	}
	if (func_322(uParam0))
	{
		uParam0->f_27 = 0;
		func_325(&(uParam0->f_44));
		uParam0->f_12++;
		if (uParam0->f_12 > (uParam0->f_13 - 1))
		{
			uParam0->f_12 = 0;
		}
		audio::play_sound_frontend(-1, "NAV_UP_DOWN", "HUD_LIQUOR_STORE_SOUNDSET", 1);
		func_365(uParam0->f_12, 1, 1);
		sVar0 = func_363(uParam0->f_12);
		uParam0->f_29 = 0;
		uParam0->f_30 = 0;
		uParam0->f_32 = 0;
		if (ui::does_text_label_exist(sVar0))
		{
			func_364(sVar0, 0, 0);
		}
	}
	if (!uParam0->f_29)
	{
		if (func_321(1) >= func_370(uParam0, uParam0->f_12))
		{
			if (networkcash::_has_item_been_unlocked(func_370(uParam0, uParam0->f_12), false, true, 0, -1))
			{
				uParam0->f_28 = 1;
			}
			else
			{
				uParam0->f_28 = 0;
				uParam0->f_36 = 1;
			}
		}
		else
		{
			uParam0->f_28 = 0;
			uParam0->f_36 = 0;
		}
		uParam0->f_29 = 1;
	}
	if (!uParam0->f_30)
	{
		uParam0->f_31 = 1;
		if (uParam0->f_12 == 3)
		{
			uParam0->f_31 = func_123(1268, -1, 0) < 30;
		}
		else if (uParam0->f_12 == 1)
		{
			uParam0->f_31 = func_123(1269, -1, 0) < 15;
		}
		else if (uParam0->f_12 == 2)
		{
			uParam0->f_31 = func_123(1270, -1, 0) < 5;
		}
		else if (uParam0->f_12 == 4)
		{
			uParam0->f_31 = func_123(1090, -1, 0) < 20;
		}
		else if (uParam0->f_12 == 0)
		{
			uParam0->f_31 = func_123(62, -1, 0) < 10;
		}
		else if (uParam0->f_12 == 5)
		{
			uParam0->f_31 = func_123(63, -1, 0) < 10;
		}
		uParam0->f_30 = 1;
	}
	if (!uParam0->f_32)
	{
		if ((*uParam1)[uParam0->f_12] < 10)
		{
			uParam0->f_33 = 1;
		}
		else
		{
			uParam0->f_33 = 0;
			func_364("SNK_SOUT", 0, 0);
		}
		uParam0->f_32 = 1;
	}
	if (uParam0->f_27)
	{
		if (func_317(&(uParam0->f_44)) < 3f)
		{
			if (uParam0->f_35)
			{
				if (!iParam2)
				{
					func_364("SNK_BOUGHT", 0, 0);
				}
				else
				{
					func_364("SNK_STORED", 0, 0);
				}
			}
			else if (!uParam0->f_28)
			{
				func_364("SNK_AFFORD", 0, 0);
			}
			else if (!uParam0->f_33)
			{
				func_364("SNK_SOUT", 0, 0);
			}
			else if (!uParam0->f_31)
			{
				if (uParam0->f_12 == 3)
				{
					func_364("SNK_SNK1FU", 0, 0);
				}
				else if (uParam0->f_12 == 1)
				{
					func_364("SNK_SNK2FU", 0, 0);
				}
				else if (uParam0->f_12 == 2)
				{
					func_364("SNK_SNK3FU", 0, 0);
				}
				else if (uParam0->f_12 == 4)
				{
					func_364("SNK_SMOKFU", 0, 0);
				}
				else if (uParam0->f_12 == 0)
				{
					func_364("SNK_DRK1FU", 0, 0);
				}
				else if (uParam0->f_12 == 5)
				{
					func_364("SNK_DRK2FU", 0, 0);
				}
				else
				{
					func_364("SNK_NEEDED", 0, 0);
				}
				gameplay::set_bit(&(uParam0->f_53), 26);
			}
		}
		else
		{
			uParam0->f_27 = 0;
			uParam0->f_35 = 0;
			func_325(&(uParam0->f_44));
			sVar0 = func_363(uParam0->f_12);
			if (ui::does_text_label_exist(sVar0))
			{
				func_364(sVar0, 0, 0);
			}
		}
	}
}

float func_317(var uParam0)//Position - 0xDEAC
{
	if (func_320(uParam0))
	{
		if (func_319(uParam0))
		{
			return uParam0->f_2;
		}
		else
		{
			return (func_318(gameplay::is_bit_set(*uParam0, 4)) - uParam0->f_1);
		}
	}
	return 0f;
}

float func_318(int iParam0)//Position - 0xDEE8
{
	float fVar0;
	float fVar1;
	int iVar2;
	
	if (iParam0)
	{
		fVar0 = system::to_float(gameplay::get_game_timer());
		fVar1 = (fVar0 / 1000f);
		return fVar1;
	}
	if (network::network_is_game_in_progress())
	{
		iVar2 = network::get_network_time();
		return (system::to_float(iVar2) / 1000f);
	}
	return (system::to_float(gameplay::get_game_timer()) / 1000f);
}

int func_319(var uParam0)//Position - 0xDF38
{
	return gameplay::is_bit_set(*uParam0, 2);
}

int func_320(var uParam0)//Position - 0xDF48
{
	return gameplay::is_bit_set(*uParam0, 1);
}

int func_321(int iParam0)//Position - 0xDF58
{
	int iVar0;
	
	if (iParam0)
	{
		iVar0 = networkcash::_0x76EF28DA05EA395A();
	}
	iVar0 = (iVar0 + networkcash::_0xA40F9C2623F6A8B5(-1));
	return iVar0;
}

bool func_322(var uParam0)//Position - 0xDF77
{
	float fVar0;
	
	fVar0 = controls::get_control_normal(2, 219);
	if ((fVar0 > 0.8f || controls::is_control_pressed(2, 187)) || controls::is_control_just_pressed(2, 242))
	{
		if (!func_320(&(uParam0->f_41)))
		{
			func_324(&(uParam0->f_41));
			return true;
		}
		else if (func_323(&(uParam0->f_41)) > 0.25f)
		{
			func_394(&(uParam0->f_41));
			return true;
		}
	}
	else if (func_320(&(uParam0->f_41)))
	{
		func_325(&(uParam0->f_41));
	}
	return false;
}

float func_323(var uParam0)//Position - 0xDFFC
{
	if (func_320(uParam0))
	{
		if (func_319(uParam0))
		{
			return uParam0->f_2;
		}
		else
		{
			return (func_318(gameplay::is_bit_set(*uParam0, 4)) - uParam0->f_1);
		}
	}
	return uParam0->f_1;
}

void func_324(int iParam0)//Position - 0xE03B
{
	if (!func_320(iParam0))
	{
		func_394(iParam0);
	}
}

void func_325(var uParam0)//Position - 0xE053
{
	uParam0->f_1 = 0f;
	uParam0->f_2 = 0f;
	*uParam0 = 0;
}

bool func_326(var uParam0)//Position - 0xE069
{
	float fVar0;
	
	fVar0 = controls::get_control_normal(2, 219);
	if ((fVar0 < -0.8f || controls::is_control_pressed(2, 188)) || controls::is_control_just_pressed(2, 241))
	{
		if (!func_320(&(uParam0->f_38)))
		{
			func_324(&(uParam0->f_38));
			return true;
		}
		else if (func_323(&(uParam0->f_38)) > 0.25f)
		{
			func_394(&(uParam0->f_38));
			return true;
		}
	}
	else if (func_320(&(uParam0->f_38)))
	{
		func_325(&(uParam0->f_38));
	}
	return false;
}

bool func_327()//Position - 0xE0EE
{
	if (controls::_is_input_disabled(2))
	{
		if (Global_2566787 > -1)
		{
			if (controls::is_control_just_pressed(2, 237))
			{
				return true;
			}
		}
	}
	return false;
}

bool func_328(int iParam0, int iParam1, int iParam2)//Position - 0xE115
{
	if (!controls::_is_input_disabled(2))
	{
		return false;
	}
	if (ui::is_pause_menu_active() || ui::is_warning_message_active())
	{
		return false;
	}
	if (iParam2)
	{
		ui::_show_cursor_this_frame();
	}
	if (Global_2566787 == -6)
	{
		ui::_set_cursor_sprite(4);
		if (iParam0 && controls::is_control_pressed(2, 237))
		{
			return true;
		}
		else
		{
			Global_2566787 = -1;
			return false;
		}
	}
	if (((Global_2566787 > -1 || Global_2566787 == -3) || Global_2566787 == -2) || ui::_0x3D9ACB1EB139E702())
	{
		ui::_set_cursor_sprite(1);
		return false;
	}
	if (Global_2566787 == -1 && iParam0)
	{
		if (controls::is_control_pressed(2, 237))
		{
			ui::_set_cursor_sprite(4);
			Global_2566787 = -6;
			return true;
		}
		else
		{
			ui::_set_cursor_sprite(3);
			return false;
		}
	}
	ui::_set_cursor_sprite(1);
	return false;
}

void func_329(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0xE1F5
{
	float fVar0;
	float fVar1;
	float fVar2;
	float fVar3;
	float fVar4;
	float fVar5;
	float fVar6;
	float fVar7;
	float fVar8;
	float fVar9;
	int iVar10;
	int iVar11;
	int iVar12;
	int iVar13;
	
	fVar6 = (0.034722f / 2f);
	iVar13 = -1;
	if (!controls::_is_input_disabled(2))
	{
		Global_2566787 = -1;
		return;
	}
	controls::_0x5B73C77D9EB66E24(1);
	fVar0 = Global_17254;
	fVar2 = (fVar0 + Global_17256);
	fVar3 = Global_17257.f_5600;
	fVar1 = (Global_17257.f_5600 - (IntToFloat(Global_17257.f_5602) * 0.034722f));
	if (iParam2)
	{
		fVar3 = (fVar3 + 0.034722f);
		fVar1 = (fVar1 + 0.034722f);
	}
	if (Global_17257.f_5602 < 1)
	{
		fVar1 = (Global_17257.f_5600 - 0.034722f);
	}
	graphics::_set_screen_draw_position(76, 84);
	graphics::_0xF5A2C681787E579D(-0.05f, -0.05f, 0f, 0f);
	fVar4 = fVar0;
	fVar5 = fVar1;
	graphics::_0x6DD8F5AA635EB4B2(fVar0, fVar1, &fVar0, &fVar1);
	graphics::_0x6DD8F5AA635EB4B2(fVar2, fVar3, &fVar2, &fVar3);
	graphics::_0xE3A3DB414A373DAB();
	func_332();
	if (Global_2566787 == -6)
	{
		return;
	}
	Global_2566787 = -1;
	fVar7 = Global_2566781;
	fVar8 = Global_2566782;
	if (Global_17257.f_5603 > Global_17257.f_5602)
	{
		if (((Global_2566781 >= fVar0 && Global_2566781 <= fVar2) && Global_2566782 >= fVar3) && Global_2566782 < (fVar3 + fVar6))
		{
			Global_2566787 = -2;
			if (iParam3)
			{
				func_331(0);
			}
			return;
		}
		if (((Global_2566781 >= fVar0 && Global_2566781 <= fVar2) && Global_2566782 >= (fVar3 + fVar6)) && Global_2566782 < (fVar3 + 0.034722f))
		{
			Global_2566787 = -3;
			if (iParam3)
			{
				func_331(0);
			}
			return;
		}
	}
	if (((fVar7 >= fVar0 && fVar7 <= fVar2) && fVar8 >= fVar1) && fVar8 <= fVar3)
	{
		fVar9 = (fVar8 - fVar1);
		iVar13 = system::floor((fVar9 / 0.034722f));
		if (Global_17257.f_5603 == -1)
		{
			Global_2566787 = 0;
			iVar13 = 0;
			return;
		}
		iVar11 = 148;
		iVar12 = (iVar11 / Global_17257.f_5602);
		iVar10 = (32 + (iVar11 - (iVar12 * iVar13)));
		if (iParam3)
		{
			if (!iParam1 || iVar13 != 0)
			{
				graphics::_set_screen_draw_position(76, 84);
				graphics::_0xF5A2C681787E579D(-0.05f, -0.05f, 0f, 0f);
				func_330(fVar4, (fVar5 + (IntToFloat(iVar13) * 0.034722f)), Global_17256, (0.034722f - 0.0015f), 255, 255, 255, iVar10);
				graphics::_0xE3A3DB414A373DAB();
			}
		}
		Global_2566787 = Global_17257.f_7520[iVar13];
		return;
	}
	if (!iParam0)
	{
		if (fVar7 < fVar2)
		{
			Global_2566787 = -4;
			return;
		}
		if (fVar8 > 0.9f)
		{
			Global_2566787 = -5;
			return;
		}
	}
	else if (fVar7 < fVar2 && fVar8 < (fVar3 + 0.25f))
	{
		Global_2566787 = -4;
		return;
	}
	Global_2566787 = -1;
}

void func_330(float fParam0, float fParam1, float fParam2, float fParam3, int iParam4, int iParam5, int iParam6, int iParam7)//Position - 0xE4A1
{
	graphics::draw_rect((fParam0 + (fParam2 * 0.5f)), (fParam1 + (fParam3 * 0.5f)), fParam2, fParam3, iParam4, iParam5, iParam6, iParam7, 0);
}

void func_331(int iParam0)//Position - 0xE4D0
{
	float fVar0;
	float fVar1;
	float fVar2;
	int iVar3;
	
	fVar2 = (0.034722f / 2f);
	if (iParam0)
	{
		iVar3 = 48;
	}
	else
	{
		iVar3 = 210;
	}
	fVar0 = Global_17254;
	fVar1 = Global_17257.f_5600;
	graphics::_set_screen_draw_position(76, 84);
	graphics::_0xF5A2C681787E579D(-0.05f, -0.05f, 0f, 0f);
	if (Global_2566787 == -2)
	{
		func_330(fVar0, fVar1, Global_17256, fVar2, 255, 255, 255, iVar3);
	}
	else if (Global_2566787 == -3)
	{
		func_330(fVar0, (fVar1 + fVar2), Global_17256, fVar2, 255, 255, 255, iVar3);
	}
	graphics::_0xE3A3DB414A373DAB();
}

void func_332()//Position - 0xE559
{
	Global_2566783 = Global_2566781;
	Global_2566784 = Global_2566782;
	Global_2566781 = controls::get_disabled_control_normal(2, 239);
	Global_2566782 = controls::get_disabled_control_normal(2, 240);
	Global_2566785 = (Global_2566781 - Global_2566783);
	Global_2566786 = (Global_2566782 - Global_2566784);
}

void func_333(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4, float fParam5, int iParam6, int iParam7)//Position - 0xE5A1
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	int iVar6;
	int iVar7;
	int iVar8;
	int iVar9;
	int iVar10;
	int iVar11;
	int iVar12;
	int iVar13;
	int iVar14;
	int iVar15;
	int iVar16;
	int iVar17;
	int iVar18;
	int iVar19;
	int iVar20;
	int iVar21;
	int iVar22;
	int iVar23;
	int iVar24;
	int iVar25;
	int iVar26;
	int iVar27;
	int iVar28;
	int iVar29;
	int iVar30;
	int iVar31;
	int iVar32;
	float fVar33;
	float fVar34;
	float fVar35;
	float fVar36;
	vector3 vVar37;
	int iVar40;
	float fVar41;
	float fVar42;
	float fVar43;
	float fVar44;
	float fVar45;
	int iVar46;
	int iVar47;
	int iVar48;
	float fVar49;
	int iVar50;
	int iVar51;
	int iVar52;
	int iVar53;
	float fVar54;
	float fVar55;
	float fVar56;
	int iVar57;
	int iVar58;
	float fVar59;
	float fVar60;
	float fVar61;
	float fVar62;
	int iVar63;
	float fVar64;
	float fVar65;
	int iVar66;
	int iVar67;
	int iVar68;
	int iVar69;
	int iVar70;
	
	if (!func_160(&iVar0, 0, iParam1))
	{
		return;
	}
	if (iVar0 == -1)
	{
	}
	if (!func_360(0, iParam6))
	{
		return;
	}
	graphics::_set_screen_draw_position(76, 84);
	graphics::_0xF5A2C681787E579D(-0.05f, -0.05f, 0f, 0f);
	fVar55 = 0f;
	if (Global_17257)
	{
		if (func_358(29, 1, 1, &fVar35, &fVar36, iParam7))
		{
			fVar55 = fVar36;
			fVar55 = (fVar55 + 0f);
		}
		else
		{
			Global_17257 = 0;
		}
	}
	if (gameplay::get_hash_key(&(Global_17257.f_1)) == gameplay::get_hash_key("HIDE"))
	{
		fVar56 = Global_17255;
	}
	else
	{
		fVar56 = (((Global_17255 + fVar55) + 0.034722f) + 0f);
	}
	if (fParam5 == -1f)
	{
		fParam5 = Global_17256;
	}
	fVar59 = 1f;
	if (iParam7)
	{
		graphics::_get_screen_active_resolution(&iVar57, &iVar58);
		fVar60 = graphics::_get_screen_aspect_ratio(0);
		if (func_357())
		{
			iVar57 = system::round((system::to_float(iVar58) * fVar60));
		}
		fVar61 = (system::to_float(iVar57) / system::to_float(iVar58));
		fVar59 = (fVar61 / fVar60);
		if (func_357())
		{
			fVar59 = 1f;
		}
		iVar57 = system::round((system::to_float(iVar57) / fVar59));
		iVar58 = system::round((system::to_float(iVar58) / fVar59));
	}
	else
	{
		graphics::get_screen_resolution(&iVar57, &iVar58);
	}
	iVar5 = 0;
	while (iVar5 < 2)
	{
		if (iVar5 == 1 && Global_17257.f_5598)
		{
			if (gameplay::get_hash_key(&(Global_17257.f_1)) == gameplay::get_hash_key("HIDE"))
			{
				fVar49 = Global_17255;
			}
			else
			{
				if (Global_17257)
				{
					graphics::draw_sprite(func_356(29), func_354(29, 1), (Global_17254 + (fParam5 * 0.5f)), (Global_17255 + ((fVar55 - 0f) * 0.5f)), fParam5, (fVar55 - 0f), 0f, 255, 255, 255, 255, 0);
				}
				if (Global_17257.f_7864)
				{
					iVar1 = Global_17257.f_7860;
					iVar2 = Global_17257.f_7861;
					iVar3 = Global_17257.f_7862;
					iVar4 = Global_17257.f_7863;
				}
				else
				{
					iVar1 = 0;
					iVar2 = 0;
					iVar3 = 0;
					iVar4 = 255;
				}
				func_330(Global_17254, (Global_17255 + fVar55), fParam5, 0.034722f, iVar1, iVar2, iVar3, iVar4);
				fVar49 = (((Global_17255 + fVar55) + 0.034722f) + 0f);
				if (gameplay::get_hash_key(&(Global_17257.f_1)) != 0)
				{
					func_353();
					ui::_set_text_entry(&(Global_17257.f_1));
					iVar15 = 0;
					iVar16 = 0;
					iVar17 = 0;
					iVar18 = 0;
					iVar14 = 0;
					while (iVar14 < Global_17257.f_68)
					{
						if (Global_17257.f_5[iVar14] == 2)
						{
							ui::add_text_component_integer(Global_17257.f_10[iVar15]);
							iVar15++;
						}
						else if (Global_17257.f_5[iVar14] == 3)
						{
							ui::add_text_component_float(Global_17257.f_14[iVar16], Global_17257.f_18[iVar16]);
							iVar16++;
						}
						else if (Global_17257.f_5[iVar14] == 1)
						{
							ui::_add_text_component_item_string(&(Global_17257.f_22[iVar17 /*4*/]));
							iVar17++;
						}
						else if (Global_17257.f_5[iVar14] == 8)
						{
							ui::_add_text_component_item_string(&(Global_17257.f_22[iVar17 /*4*/]));
							iVar17++;
						}
						else if (Global_17257.f_5[iVar14] == 5)
						{
							ui::add_text_component_substring_player_name(&(Global_17257.f_35[iVar18 /*16*/]));
							iVar18++;
						}
						else if (Global_17257.f_5[iVar14] == 6)
						{
							ui::_add_text_component_item_string(&(Global_17257.f_35[iVar18 /*16*/]));
							iVar18++;
						}
						else if (Global_17257.f_5[iVar14] == 7)
						{
							ui::add_text_component_substring_player_name(&(Global_17257.f_35[iVar18 /*16*/]));
							iVar18++;
						}
						iVar14++;
					}
					ui::_draw_text((Global_17254 + 0.00390625f), ((Global_17255 + fVar55) + 0.00416664f), 0);
				}
				if (Global_17257.f_5601 > Global_17257.f_5095)
				{
					if (Global_17257.f_5604 != 0)
					{
						func_353();
						func_351((((Global_17254 + fParam5) - 0.00390625f) - func_352("CM_ITEM_COUNT", Global_17257.f_5604, Global_17257.f_5603)), ((Global_17255 + fVar55) + 0.00416664f), "CM_ITEM_COUNT", Global_17257.f_5604, Global_17257.f_5603);
					}
				}
			}
			iVar6 = Global_17257.f_5605;
			iVar9 = 0;
			fVar62 = fVar49;
			if (Global_17257.f_7874)
			{
				iVar1 = Global_17257.f_7870;
				iVar2 = Global_17257.f_7871;
				iVar3 = Global_17257.f_7872;
				iVar4 = Global_17257.f_7873;
			}
			else
			{
				ui::get_hud_colour(140, &iVar1, &iVar2, &iVar3, &iVar4);
			}
			while (iVar9 < Global_17257.f_5095 && iVar6 <= Global_17257.f_5088)
			{
				if (iVar6 >= 0)
				{
					if (Global_17257.f_5355[iVar6])
					{
						if (Global_17257.f_5226[iVar6] && iVar6 != Global_17257.f_5605)
						{
							fVar49 = (fVar49 + 0.00277776f);
						}
						fVar54 = 0.034722f;
						if (Global_17257.f_5612[iVar6] != 0f)
						{
							fVar54 = Global_17257.f_5612[iVar6];
						}
						fVar49 = (fVar49 + fVar54);
						iVar9++;
					}
				}
				iVar6++;
			}
			if (iParam3)
			{
				if (iVar9 <= 1)
				{
					fVar54 = 0.034722f;
					fVar49 = (fVar49 + fVar54);
					iVar9++;
					if (Global_17257.f_5088 <= 1)
					{
						Global_17257.f_5088++;
					}
					iVar52 = 1;
				}
			}
			graphics::draw_sprite("CommonMenu", "Gradient_Bgd", (Global_17254 + (fParam5 * 0.5f)), ((fVar62 + ((fVar49 - fVar62) * 0.5f)) - 0.00138888f), fParam5, (fVar49 - fVar62), 0f, 255, 255, 255, 255, 0);
			if (Global_17257.f_5601 > Global_17257.f_5095)
			{
				if (Global_17257.f_7879)
				{
					iVar1 = Global_17257.f_7875;
					iVar2 = Global_17257.f_7876;
					iVar3 = Global_17257.f_7877;
					iVar4 = Global_17257.f_7878;
				}
				else
				{
					iVar1 = 0;
					iVar2 = 0;
					iVar3 = 0;
					iVar4 = 204;
				}
				func_330(Global_17254, (fVar49 + 0f), fParam5, 0.034722f, iVar1, iVar2, iVar3, iVar4);
				vVar37 = { graphics::get_texture_resolution("CommonMenu", "shop_arrows_upANDdown") };
				vVar37.x = (vVar37.x * (0.5f / fVar59));
				vVar37.y = (vVar37.y * (0.5f / fVar59));
				if (Global_17257.f_7892)
				{
					iVar1 = 0;
					iVar2 = 0;
					iVar3 = 0;
					iVar4 = 255;
				}
				else
				{
					ui::get_hud_colour(1, &iVar1, &iVar2, &iVar3, &iVar4);
				}
				graphics::draw_sprite("CommonMenu", "shop_arrows_upANDdown", (Global_17254 + (fParam5 * 0.5f)), ((fVar49 + 0f) + (0.034722f * 0.5f)), ((vVar37.x / 1280f) * fVar59), ((vVar37.y / 720f) * fVar59), 0f, iVar1, iVar2, iVar3, iVar4, 0);
				fVar49 = (fVar49 + (0f + 0.034722f));
			}
			if (gameplay::get_hash_key(&(Global_17257.f_4562)) != 0 && Global_17257.f_4636 != -1)
			{
				fVar49 = (fVar49 + (0.00277776f * 2f));
				fVar41 = (Global_17254 + 0.0046875f);
				if (Global_17257.f_4638 != 0)
				{
					func_358(Global_17257.f_4638, 1, 1, &fVar35, &fVar36, iParam7);
					fVar41 = (((Global_17254 + fVar35) + (0.00078125f * 4f)) - (0.00078125f * 1f));
				}
				func_350(fVar41);
				ui::_set_text_gxt_entry(&(Global_17257.f_4562));
				iVar15 = 0;
				iVar16 = 0;
				iVar17 = 0;
				iVar14 = 0;
				while (iVar14 < Global_17257.f_4632)
				{
					if (Global_17257.f_4566[iVar14] == 2)
					{
						ui::add_text_component_integer(Global_17257.f_4571[iVar15]);
						iVar15++;
					}
					else if (Global_17257.f_4566[iVar14] == 3)
					{
						ui::add_text_component_float(Global_17257.f_4575[iVar16], Global_17257.f_4579[iVar16]);
						iVar16++;
					}
					else if (Global_17257.f_4566[iVar14] == 1)
					{
						ui::_add_text_component_item_string(&(Global_17257.f_4583[iVar17 /*16*/]));
						iVar17++;
					}
					else if (Global_17257.f_4566[iVar14] == 5)
					{
						ui::add_text_component_substring_player_name(&(Global_17257.f_4583[iVar17 /*16*/]));
						iVar17++;
					}
					else if (Global_17257.f_4566[iVar14] == 6)
					{
						ui::_add_text_component_item_string(&(Global_17257.f_4583[iVar17 /*16*/]));
						iVar17++;
					}
					else if (Global_17257.f_4566[iVar14] == 7)
					{
						ui::add_text_component_substring_player_name(&(Global_17257.f_4583[iVar17 /*16*/]));
						iVar17++;
					}
					iVar14++;
				}
				iVar6 = ui::_0x9040DFB09BE75706(fVar41, (fVar49 + 0.00277776f));
				ui::get_hud_colour(2, &iVar1, &iVar2, &iVar3, &iVar4);
				func_330(Global_17254, (fVar49 - 0.00277776f), fParam5, 0.00277776f, iVar1, iVar2, iVar3, iVar4);
				if (Global_17257.f_7884)
				{
					iVar1 = Global_17257.f_7880;
					iVar2 = Global_17257.f_7881;
					iVar3 = Global_17257.f_7882;
					iVar4 = Global_17257.f_7883;
				}
				else
				{
					ui::get_hud_colour(140, &iVar1, &iVar2, &iVar3, &iVar4);
				}
				graphics::draw_sprite("CommonMenu", "Gradient_Bgd", (Global_17254 + (fParam5 * 0.5f)), ((fVar49 + ((((ui::_get_text_scale_height(0.35f, 0) * IntToFloat(iVar6)) + (0.00138888f * 13f)) + ((0.00138888f * 5f) * IntToFloat((iVar6 - 1)))) * 0.5f)) - 0.00138888f), fParam5, (((ui::_get_text_scale_height(0.35f, 0) * IntToFloat(iVar6)) + (0.00138888f * 13f)) + ((0.00138888f * 5f) * IntToFloat((iVar6 - 1)))), 0f, iVar1, iVar2, iVar3, iVar4, 0);
				func_350(fVar41);
				ui::_set_text_entry(&(Global_17257.f_4562));
				iVar15 = 0;
				iVar16 = 0;
				iVar17 = 0;
				iVar14 = 0;
				while (iVar14 < Global_17257.f_4632)
				{
					if (Global_17257.f_4566[iVar14] == 2)
					{
						ui::add_text_component_integer(Global_17257.f_4571[iVar15]);
						iVar15++;
					}
					else if (Global_17257.f_4566[iVar14] == 3)
					{
						ui::add_text_component_float(Global_17257.f_4575[iVar16], Global_17257.f_4579[iVar16]);
						iVar16++;
					}
					else if (Global_17257.f_4566[iVar14] == 1)
					{
						ui::_add_text_component_item_string(&(Global_17257.f_4583[iVar17 /*16*/]));
						iVar17++;
					}
					else if (Global_17257.f_4566[iVar14] == 5)
					{
						ui::add_text_component_substring_player_name(&(Global_17257.f_4583[iVar17 /*16*/]));
						iVar17++;
					}
					else if (Global_17257.f_4566[iVar14] == 6)
					{
						ui::_add_text_component_item_string(&(Global_17257.f_4583[iVar17 /*16*/]));
						iVar17++;
					}
					else if (Global_17257.f_4566[iVar14] == 7)
					{
						ui::add_text_component_substring_player_name(&(Global_17257.f_4583[iVar17 /*16*/]));
						iVar17++;
					}
					else if (Global_17257.f_4566[iVar14] == 8)
					{
						ui::_add_text_component_item_string(&(Global_17257.f_4583[iVar17 /*16*/]));
						iVar17++;
					}
					iVar14++;
				}
				ui::_draw_text(fVar41, (fVar49 + 0.00277776f), 0);
				if (Global_17257.f_4638 != 0)
				{
					func_358(Global_17257.f_4638, 1, 1, &fVar35, &fVar36, iParam7);
					func_349(Global_17257.f_4638, 1, &iVar46, &iVar47, &iVar48);
					graphics::draw_sprite(func_356(Global_17257.f_4638), func_354(Global_17257.f_4638, 1), ((Global_17254 + (fVar35 * 0.5f)) + (0.00078125f * 2f)), ((fVar49 + (fVar36 * 0.5f)) - (0.00138888f * 4f)), fVar35, fVar36, 0f, iVar46, iVar47, iVar48, 255, 0);
				}
				fVar49 = (fVar49 + (((ui::_get_text_scale_height(0.35f, 0) * IntToFloat(iVar6)) + (0.00138888f * 13f)) + ((0.00138888f * 5f) * IntToFloat((iVar6 - 1)))));
				if (Global_17257.f_4636 > 0)
				{
					if ((gameplay::get_game_timer() - Global_17257.f_4637) > Global_17257.f_4636)
					{
						StringCopy(&(Global_17257.f_4562), "", 16);
						Global_17257.f_4636 = -1;
					}
				}
			}
			if (gameplay::get_hash_key(&(Global_2566711.f_21)) != 0 && Global_2566711.f_65 != -1)
			{
				fVar49 = (fVar49 + (0.00277776f * 2f));
				fVar41 = (Global_17254 + 0.0046875f);
				if (Global_2566711.f_67 != 0)
				{
					func_358(Global_2566711.f_67, 1, 1, &fVar35, &fVar36, iParam7);
					fVar41 = (((Global_17254 + fVar35) + (0.00078125f * 4f)) - (0.00078125f * 1f));
				}
				func_350(fVar41);
				ui::_set_text_gxt_entry(&(Global_2566711.f_21));
				iVar15 = 0;
				iVar16 = 0;
				iVar17 = 0;
				iVar14 = 0;
				while (iVar14 < Global_2566711.f_61)
				{
					if (Global_2566711.f_25[iVar14] == 2)
					{
						ui::add_text_component_integer(Global_2566711.f_30[iVar15]);
						iVar15++;
					}
					else if (Global_2566711.f_25[iVar14] == 3)
					{
						ui::add_text_component_float(Global_2566711.f_34[iVar16], Global_2566711.f_38[iVar16]);
						iVar16++;
					}
					else if (Global_2566711.f_25[iVar14] == 1)
					{
						ui::_add_text_component_item_string(&(Global_2566711.f_42[iVar17 /*6*/]));
						iVar17++;
					}
					else if (Global_2566711.f_25[iVar14] == 5)
					{
						ui::add_text_component_substring_player_name(&(Global_2566711.f_42[iVar17 /*6*/]));
						iVar17++;
					}
					else if (Global_2566711.f_25[iVar14] == 6)
					{
						ui::_add_text_component_item_string(&(Global_2566711.f_42[iVar17 /*6*/]));
						iVar17++;
					}
					else if (Global_2566711.f_25[iVar14] == 7)
					{
						ui::add_text_component_substring_player_name(&(Global_2566711.f_42[iVar17 /*6*/]));
						iVar17++;
					}
					else if (Global_2566711.f_25[iVar14] == 8)
					{
						ui::_add_text_component_item_string(&(Global_2566711.f_42[iVar17 /*6*/]));
						iVar17++;
					}
					iVar14++;
				}
				iVar6 = ui::_0x9040DFB09BE75706(fVar41, (fVar49 + 0.00277776f));
				ui::get_hud_colour(2, &iVar1, &iVar2, &iVar3, &iVar4);
				func_330(Global_17254, (fVar49 - 0.00277776f), fParam5, 0.00277776f, iVar1, iVar2, iVar3, iVar4);
				if (Global_17257.f_7884)
				{
					iVar1 = Global_17257.f_7880;
					iVar2 = Global_17257.f_7881;
					iVar3 = Global_17257.f_7882;
					iVar4 = Global_17257.f_7883;
				}
				else
				{
					ui::get_hud_colour(140, &iVar1, &iVar2, &iVar3, &iVar4);
				}
				graphics::draw_sprite("CommonMenu", "Gradient_Bgd", (Global_17254 + (fParam5 * 0.5f)), ((fVar49 + ((((ui::_get_text_scale_height(0.35f, 0) * IntToFloat(iVar6)) + (0.00138888f * 13f)) + ((0.00138888f * 5f) * IntToFloat((iVar6 - 1)))) * 0.5f)) - 0.00138888f), fParam5, (((ui::_get_text_scale_height(0.35f, 0) * IntToFloat(iVar6)) + (0.00138888f * 13f)) + ((0.00138888f * 5f) * IntToFloat((iVar6 - 1)))), 0f, iVar1, iVar2, iVar3, iVar4, 0);
				func_350(fVar41);
				ui::_set_text_entry(&(Global_2566711.f_21));
				iVar15 = 0;
				iVar16 = 0;
				iVar17 = 0;
				iVar14 = 0;
				while (iVar14 < Global_2566711.f_61)
				{
					if (Global_2566711.f_25[iVar14] == 2)
					{
						ui::add_text_component_integer(Global_2566711.f_30[iVar15]);
						iVar15++;
					}
					else if (Global_2566711.f_25[iVar14] == 3)
					{
						ui::add_text_component_float(Global_2566711.f_34[iVar16], Global_2566711.f_38[iVar16]);
						iVar16++;
					}
					else if (Global_2566711.f_25[iVar14] == 1)
					{
						ui::_add_text_component_item_string(&(Global_2566711.f_42[iVar17 /*6*/]));
						iVar17++;
					}
					else if (Global_2566711.f_25[iVar14] == 8)
					{
						ui::_add_text_component_item_string(&(Global_2566711.f_42[iVar17 /*6*/]));
						iVar17++;
					}
					else if (Global_2566711.f_25[iVar14] == 5)
					{
						ui::add_text_component_substring_player_name(&(Global_2566711.f_42[iVar17 /*6*/]));
						iVar17++;
					}
					else if (Global_2566711.f_25[iVar14] == 6)
					{
						ui::_add_text_component_item_string(&(Global_2566711.f_42[iVar17 /*6*/]));
						iVar17++;
					}
					else if (Global_2566711.f_25[iVar14] == 7)
					{
						ui::add_text_component_substring_player_name(&(Global_2566711.f_42[iVar17 /*6*/]));
						iVar17++;
					}
					iVar14++;
				}
				ui::_draw_text(fVar41, (fVar49 + 0.00277776f), 0);
				if (Global_2566711.f_67 != 0)
				{
					func_358(Global_2566711.f_67, 1, 1, &fVar35, &fVar36, iParam7);
					func_349(Global_2566711.f_67, 1, &iVar46, &iVar47, &iVar48);
					graphics::draw_sprite(func_356(Global_2566711.f_67), func_354(Global_2566711.f_67, 1), ((Global_17254 + (fVar35 * 0.5f)) + (0.00078125f * 2f)), ((fVar49 + (fVar36 * 0.5f)) - (0.00138888f * 4f)), fVar35, fVar36, 0f, iVar46, iVar47, iVar48, 255, 0);
				}
				fVar49 = (fVar49 + (((ui::_get_text_scale_height(0.35f, 0) * IntToFloat(iVar6)) + (0.00138888f * 13f)) + ((0.00138888f * 5f) * IntToFloat((iVar6 - 1)))));
				if (Global_2566711.f_65 > 0)
				{
					if ((gameplay::get_game_timer() - Global_2566711.f_66) > Global_2566711.f_65)
					{
						StringCopy(&(Global_2566711.f_21), "", 16);
						Global_2566711.f_65 = -1;
					}
				}
			}
			func_344(iVar57, iParam1, 0, 0, 0, 0, iParam4, 1, 0);
			graphics::_set_screen_draw_position(76, 84);
			graphics::_0xF5A2C681787E579D(-0.05f, -0.05f, 0f, 0f);
		}
		if (iVar5 == 1 || !Global_17257.f_5598)
		{
			iVar19 = 0;
			iVar23 = 0;
			iVar20 = 0;
			iVar21 = 0;
			iVar22 = 0;
			iVar9 = 0;
			iVar10 = 0;
			iVar11 = 0;
			iVar12 = 0;
			iVar13 = 0;
			iVar63 = Global_17257.f_5088;
			if (Global_17257.f_5599)
			{
				iVar63 = (Global_17257.f_5602 - 1);
			}
			fVar64 = 0f;
			fVar65 = 0f;
			iVar7 = 0;
			while (iVar7 <= iVar63)
			{
				fVar54 = 0.034722f;
				if (Global_17257.f_5612[iVar6] != 0f)
				{
					fVar54 = Global_17257.f_5612[iVar6];
				}
				if (Global_17257.f_5599)
				{
					iVar6 = Global_17257.f_7520[iVar7];
				}
				else
				{
					iVar6 = iVar7;
				}
				iVar12 = iVar13;
				iVar32 = false;
				if (iVar6 >= Global_17257.f_5605 && iVar9 < Global_17257.f_5095)
				{
					iVar32 = true;
					if (Global_17257.f_5606 == iVar6)
					{
						fVar65 = fVar64;
					}
					if (Global_17257.f_5226[iVar6])
					{
						iVar12++;
					}
					fVar34 = (((fVar56 + fVar64) + (0.00277776f * IntToFloat(iVar12))) + 0.00277776f);
				}
				Global_17257.f_5746[iVar6] = fVar34;
				fVar33 = (Global_17254 + 0.0046875f);
				iVar40 = false;
				iVar31 = Global_17257.f_5606 == iVar6;
				if ((iVar31 && iVar5 == 1) && iVar32)
				{
					iVar66 = 255;
					iVar67 = 255;
					iVar68 = 255;
					iVar69 = 255;
					if (Global_17257.f_7886)
					{
						ui::get_hud_colour(Global_17257.f_7885, &iVar66, &iVar67, &iVar68, &iVar69);
					}
					else
					{
						ui::get_hud_colour(1, &iVar66, &iVar67, &iVar68, &iVar69);
					}
					graphics::draw_sprite("CommonMenu", "Gradient_Nav", (Global_17254 + (fParam5 * 0.5f)), (((fVar56 + fVar65) + (0.00277776f * IntToFloat(iVar12))) + (fVar54 * 0.5f)), fParam5, fVar54, 0f, iVar66, iVar67, iVar68, iVar69, 0);
					Global_17257.f_5744 = fVar34;
				}
				if (iVar52 && iVar7 == iVar63)
				{
					func_342(iVar31, 1, 0, 0, 0, 0);
					ui::_set_text_entry("DFLT_MNU_OPT");
					ui::_draw_text(fVar33, fVar34, 0);
					iVar40 = true;
				}
				else
				{
					iVar8 = 0;
					while (iVar8 < Global_17257.f_5096)
					{
						if (gameplay::is_bit_set(Global_17257.f_4959[iVar6], iVar8) || Global_17257.f_4926[iVar8] == 5)
						{
							if (Global_17257.f_5599)
							{
								iVar19 = Global_17257.f_7531[((iVar9 * Global_17257.f_5096) + iVar8)];
								iVar20 = Global_17257.f_7572[((iVar9 * Global_17257.f_5096) + iVar8)];
								iVar21 = Global_17257.f_7613[((iVar9 * Global_17257.f_5096) + iVar8)];
								iVar22 = Global_17257.f_7654[((iVar9 * Global_17257.f_5096) + iVar8)];
								iVar23 = Global_17257.f_7695[((iVar9 * Global_17257.f_5096) + iVar8)];
							}
							else
							{
								Global_17257.f_7531[((iVar9 * Global_17257.f_5096) + iVar8)] = iVar19;
								Global_17257.f_7572[((iVar9 * Global_17257.f_5096) + iVar8)] = iVar20;
								Global_17257.f_7613[((iVar9 * Global_17257.f_5096) + iVar8)] = iVar21;
								Global_17257.f_7654[((iVar9 * Global_17257.f_5096) + iVar8)] = iVar22;
								Global_17257.f_7695[((iVar9 * Global_17257.f_5096) + iVar8)] = iVar23;
							}
							iVar70 = 0;
							iVar53 = false;
							if (Global_17257.f_5878[0] != -1)
							{
								if ((iVar6 * 5 + iVar8) == Global_17257.f_5875[0])
								{
									iVar53 = true;
									iVar70 = 0;
								}
							}
							if (Global_17257.f_5878[1] != -1)
							{
								if ((iVar6 * 5 + iVar8) == Global_17257.f_5875[1])
								{
									iVar53 = true;
									iVar70 = 1;
								}
							}
							if (Global_17257.f_4932[iVar8] != -1f)
							{
								fVar33 = ((Global_17254 + 0.0046875f) + Global_17257.f_4932[iVar8]);
							}
							if ((iVar8 < 4 && Global_17257.f_4932[iVar8 + 1] != -1f) && fVar33 < Global_17257.f_4932[iVar8 + 1])
							{
								fVar45 = (Global_17257.f_4932[iVar8 + 1] - fVar33);
							}
							else
							{
								fVar45 = (((Global_17254 + Global_17256) - 0.0046875f) - fVar33);
							}
							if ((Global_17257.f_4945[iVar8] && Global_17257.f_5741) && iVar31)
							{
								iVar51 = true;
							}
							else
							{
								iVar51 = false;
							}
							switch (Global_17257.f_4926[iVar8])
							{
								case 0:
									break;
								
								case 1:
									iVar24 = iVar19;
									if (iVar5 == 1 && iVar32)
									{
										if (!Global_17257.f_5599)
										{
											fVar42 = 0f;
											fVar43 = 0f;
											iVar25 = 0;
											iVar26 = 0;
											iVar27 = 0;
											iVar28 = 0;
											iVar29 = 0;
											if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
											{
												iVar50 = false;
												iVar14 = 0;
												while (iVar14 < 4)
												{
													if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 5 || Global_17257.f_2124[iVar24 /*5*/][iVar14] == 8)
													{
														iVar50 = true;
													}
													iVar14++;
												}
												func_342(iVar31, Global_17257.f_1610[iVar24], Global_17257.f_1867[iVar24], iVar53, iVar70, iVar50);
												ui::_set_text_entry_for_width(&(Global_17257.f_73[iVar24 /*6*/]));
											}
											iVar14 = 0;
											while (iVar14 < 4)
											{
												if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 1)
												{
													iVar25++;
													if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
													{
														ui::_add_text_component_item_string(&(Global_17257.f_73[(iVar24 + iVar25) /*6*/]));
													}
												}
												else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 8)
												{
													iVar25++;
													if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
													{
														ui::_add_text_component_item_string(&(Global_17257.f_73[(iVar24 + iVar25) /*6*/]));
													}
												}
												else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 5)
												{
													if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
													{
														ui::add_text_component_substring_player_name(&(Global_2444596[(iVar23 + iVar29) /*16*/]));
													}
													iVar29++;
												}
												else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 6)
												{
													if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
													{
														ui::_add_text_component_item_string(&(Global_2444596[(iVar23 + iVar29) /*16*/]));
													}
													iVar29++;
												}
												else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 7)
												{
													if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
													{
														ui::add_text_component_substring_player_name(&(Global_2444596[(iVar23 + iVar29) /*16*/]));
													}
													iVar29++;
												}
												else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 2)
												{
													if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
													{
														ui::add_text_component_integer(Global_17257.f_3918[(iVar20 + iVar26)]);
													}
													iVar26++;
												}
												else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 3)
												{
													if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
													{
														ui::add_text_component_float(Global_17257.f_4175[(iVar21 + iVar27)], Global_17257.f_4304[(iVar21 + iVar27)]);
													}
													iVar27++;
												}
												else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 4)
												{
													iVar28++;
												}
												iVar14++;
											}
											if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
											{
												fVar42 = ui::_get_text_screen_width(1);
											}
											if (iVar28 > 0)
											{
												iVar14 = 0;
												while (iVar14 < iVar28)
												{
													if (func_358(Global_17257.f_4433[(iVar22 + iVar14)], iVar31, 0, &fVar35, &fVar36, iParam7))
													{
														fVar43 = (fVar43 + fVar35);
														if (iVar14 > 0)
														{
															fVar43 = (fVar43 - (0.00078125f * 4f));
														}
														if (Global_17257.f_4433[(iVar22 + iVar14)] == 2 || Global_17257.f_4433[(iVar22 + iVar14)] == 48)
														{
															fVar43 = (fVar43 - (0.00078125f * 5f));
														}
													}
													iVar14++;
												}
											}
											fVar41 = 0f;
											if (Global_17257.f_4953[iVar8] == 2)
											{
												fVar41 = (fVar41 + ((fVar45 - (fVar42 + fVar43)) + (0.00078125f * 1f)));
											}
											else if (Global_17257.f_4953[iVar8] == 0)
											{
												fVar41 = (fVar41 + (((fVar45 - fVar33) * 0.5f) - ((fVar42 + fVar43) * 0.5f)));
											}
											Global_17257.f_7736[((iVar9 * Global_17257.f_5096) + iVar8)] = fVar41;
											Global_17257.f_7777[((iVar9 * Global_17257.f_5096) + iVar8)] = fVar42;
											Global_17257.f_7818[((iVar9 * Global_17257.f_5096) + iVar8)] = fVar43;
										}
										else
										{
											fVar41 = Global_17257.f_7736[((iVar9 * Global_17257.f_5096) + iVar8)];
											fVar42 = Global_17257.f_7777[((iVar9 * Global_17257.f_5096) + iVar8)];
											fVar43 = Global_17257.f_7818[((iVar9 * Global_17257.f_5096) + iVar8)];
										}
										if (iVar51)
										{
											if (func_358(26, 1, 0, &fVar35, &fVar36, iParam7))
											{
												if (Global_17257.f_4953[iVar8] == 2)
												{
													fVar41 = (fVar41 - (fVar35 * 2f));
												}
												fVar44 = (fVar35 * 0.5f);
												if (func_358(26, 1, 1, &fVar35, &fVar36, iParam7))
												{
													func_349(26, 1, &iVar46, &iVar47, &iVar48);
													graphics::draw_sprite(func_356(26), func_354(26, 1), ((fVar33 + fVar41) + fVar44), ((fVar34 - 0.00277776f) + (fVar54 * 0.5f)), fVar35, fVar36, 0f, iVar46, iVar47, iVar48, 255, 0);
												}
											}
											if (func_358(27, 1, 0, &fVar35, &fVar36, iParam7))
											{
												fVar41 = (fVar41 + fVar35);
												fVar44 = (fVar35 * 0.5f);
												if (func_358(27, 1, 1, &fVar35, &fVar36, iParam7))
												{
													func_349(27, 1, &iVar46, &iVar47, &iVar48);
													graphics::draw_sprite(func_356(27), func_354(27, 1), (((fVar33 + fVar41) + fVar44) + (fVar42 + fVar43)), ((fVar34 - 0.00277776f) + (fVar54 * 0.5f)), fVar35, fVar36, 0f, iVar46, iVar47, iVar48, 255, 0);
												}
											}
										}
										iVar25 = 0;
										iVar26 = 0;
										iVar27 = 0;
										iVar28 = 0;
										iVar29 = 0;
										iVar30 = 0;
										if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
										{
											iVar50 = false;
											iVar14 = 0;
											while (iVar14 < 4)
											{
												if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 5 || Global_17257.f_2124[iVar24 /*5*/][iVar14] == 8)
												{
													iVar50 = true;
												}
												iVar14++;
											}
											func_342(iVar31, Global_17257.f_1610[iVar24], Global_17257.f_1867[iVar24], iVar53, 0, iVar50);
											if (Global_17257.f_7890 && Global_17257.f_7891 == iVar6)
											{
												func_341(iVar31);
											}
											ui::_set_text_entry(&(Global_17257.f_73[iVar24 /*6*/]));
										}
										iVar14 = 0;
										while (iVar14 < 4)
										{
											if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 1)
											{
												iVar25++;
												if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
												{
													ui::_add_text_component_item_string(&(Global_17257.f_73[(iVar24 + iVar25) /*6*/]));
												}
												iVar30 = 1;
											}
											else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 8)
											{
												iVar25++;
												if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
												{
													ui::_add_text_component_item_string(&(Global_17257.f_73[(iVar24 + iVar25) /*6*/]));
												}
												iVar30 = 8;
											}
											else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 5)
											{
												if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
												{
													ui::add_text_component_substring_player_name(&(Global_2444596[(iVar23 + iVar29) /*16*/]));
												}
												iVar29++;
												iVar30 = 5;
											}
											else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 6)
											{
												if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
												{
													ui::_add_text_component_item_string(&(Global_2444596[(iVar23 + iVar29) /*16*/]));
												}
												iVar29++;
												iVar30 = 6;
											}
											else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 7)
											{
												if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
												{
													ui::add_text_component_substring_player_name(&(Global_2444596[(iVar23 + iVar29) /*16*/]));
												}
												iVar29++;
												iVar30 = 6;
											}
											else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 2)
											{
												if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
												{
													ui::add_text_component_integer(Global_17257.f_3918[(iVar20 + iVar26)]);
												}
												iVar26++;
												iVar30 = 2;
											}
											else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 3)
											{
												if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
												{
													ui::add_text_component_float(Global_17257.f_4175[(iVar21 + iVar27)], Global_17257.f_4304[(iVar21 + iVar27)]);
												}
												iVar27++;
												iVar30 = 3;
											}
											else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 4)
											{
												if (Global_17257.f_4433[(iVar22 + iVar28)] == 2 || Global_17257.f_4433[(iVar22 + iVar28)] == 48)
												{
													if (func_358(Global_17257.f_4433[(iVar22 + iVar28)], iVar31, 0, &fVar35, &fVar36, iParam7))
													{
														fVar41 = (fVar41 + (fVar35 * 0.5f));
														if (func_358(Global_17257.f_4433[(iVar22 + iVar28)], iVar31, 1, &fVar35, &fVar36, iParam7))
														{
															func_349(Global_17257.f_4433[(iVar22 + iVar28)], iVar31, &iVar46, &iVar47, &iVar48);
															if (Global_17257.f_4953[iVar8] == 2)
															{
																graphics::draw_sprite(func_356(Global_17257.f_4433[(iVar22 + iVar28)]), func_354(Global_17257.f_4433[(iVar22 + iVar28)], iVar31), (((fVar33 + fVar41) - (0.00078125f * 8f)) + (0.00078125f * 4f)), ((fVar34 - 0.00277776f) + (fVar54 * 0.5f)), fVar35, fVar36, 0f, iVar46, iVar47, iVar48, 255, 0);
															}
															else
															{
																graphics::draw_sprite(func_356(Global_17257.f_4433[(iVar22 + iVar28)]), func_354(Global_17257.f_4433[(iVar22 + iVar28)], iVar31), ((fVar33 + fVar41) - (0.00078125f * 8f)), ((fVar34 - 0.00277776f) + (fVar54 * 0.5f)), fVar35, fVar36, 0f, iVar46, iVar47, iVar48, 255, 0);
															}
															fVar41 = (fVar41 + (0.00078125f * 3f));
														}
													}
												}
												iVar28++;
												iVar30 = 4;
											}
											iVar14++;
										}
										if (gameplay::get_hash_key(&(Global_17257.f_73[iVar24 /*6*/])) != 0)
										{
											if (iVar30 == 4 && Global_17257.f_4953[iVar8] == 2)
											{
												ui::_draw_text(((fVar33 + fVar41) + (0.00078125f * 7f)), fVar34, 0);
											}
											else
											{
												ui::_draw_text((fVar33 + fVar41), fVar34, 0);
											}
										}
										if (iVar28 > 0)
										{
											fVar41 = (fVar41 + (6f * 0.00078125f));
											iVar14 = 0;
											while (iVar14 < iVar28)
											{
												if (Global_17257.f_4433[(iVar22 + iVar14)] != 2 && Global_17257.f_4433[(iVar22 + iVar14)] != 48)
												{
													if (func_358(Global_17257.f_4433[(iVar22 + iVar14)], iVar31, 0, &fVar35, &fVar36, iParam7))
													{
														fVar41 = (fVar41 + (fVar35 * 0.5f));
														if (func_358(Global_17257.f_4433[(iVar22 + iVar14)], iVar31, 1, &fVar35, &fVar36, iParam7))
														{
															func_349(Global_17257.f_4433[(iVar22 + iVar14)], iVar31, &iVar46, &iVar47, &iVar48);
															if (Global_17257.f_4433[(iVar22 + iVar14)] == 30)
															{
																graphics::draw_sprite(func_356(Global_17257.f_4433[(iVar22 + iVar14)]), func_354(Global_17257.f_4433[(iVar22 + iVar14)], iVar31), (Global_17254 + (fVar35 * 0.5f)), (((fVar34 + 0.00277776f) + (fVar36 * 0.5f)) - (0.00078125f * 11f)), fVar35, fVar36, 0f, iVar46, iVar47, iVar48, 255, 0);
															}
															else if (Global_17257.f_4953[iVar8] == 2)
															{
																graphics::draw_sprite(func_356(Global_17257.f_4433[(iVar22 + iVar14)]), func_354(Global_17257.f_4433[(iVar22 + iVar14)], iVar31), ((((fVar33 + fVar41) + fVar42) - (0.00078125f * 8f)) + (0.00078125f * 4f)), ((fVar34 - 0.00277776f) + (fVar54 * 0.5f)), fVar35, fVar36, 0f, iVar46, iVar47, iVar48, 255, 0);
															}
															else
															{
																graphics::draw_sprite(func_356(Global_17257.f_4433[(iVar22 + iVar14)]), func_354(Global_17257.f_4433[(iVar22 + iVar14)], iVar31), (((fVar33 + fVar41) + fVar42) - (0.00078125f * 12f)), ((fVar34 - 0.00277776f) + (fVar54 * 0.5f)), fVar35, fVar36, 0f, iVar46, iVar47, iVar48, 255, 0);
															}
														}
														fVar41 = (fVar41 + (12f * 0.00078125f));
													}
												}
												iVar14++;
											}
										}
									}
									iVar40 = true;
									iVar19++;
									iVar14 = 0;
									while (iVar14 < 4)
									{
										if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 1)
										{
											iVar19++;
										}
										else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 8)
										{
											iVar19++;
										}
										else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 2)
										{
											iVar20++;
										}
										else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 3)
										{
											iVar21++;
										}
										else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 4)
										{
											iVar22++;
										}
										else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 5)
										{
											iVar23++;
										}
										else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 6)
										{
											iVar23++;
										}
										else if (Global_17257.f_2124[iVar24 /*5*/][iVar14] == 7)
										{
											iVar23++;
										}
										iVar14++;
									}
									break;
								
								case 2:
									if (iVar5 == 1 && iVar32)
									{
										if (!Global_17257.f_5599)
										{
											func_342(iVar31, Global_17257.f_1610[iVar24], Global_17257.f_1867[iVar24], iVar53, 0, 0);
											if (Global_17257.f_7890 && Global_17257.f_7891 == iVar6)
											{
												func_341(iVar31);
											}
											ui::_set_text_entry_for_width("NUMBER");
											ui::add_text_component_integer(Global_17257.f_3918[iVar20]);
											fVar42 = ui::_get_text_screen_width(1);
											fVar41 = 0f;
											if (Global_17257.f_4953[iVar8] == 2)
											{
												fVar41 = (fVar41 + ((fVar45 - fVar42) + (0.00078125f * 1f)));
											}
											else if (Global_17257.f_4953[iVar8] == 0)
											{
												fVar41 = (fVar41 + (((fVar45 - fVar33) * 0.5f) - (fVar42 * 0.5f)));
											}
											Global_17257.f_7736[((iVar9 * Global_17257.f_5096) + iVar8)] = fVar41;
											Global_17257.f_7777[((iVar9 * Global_17257.f_5096) + iVar8)] = fVar42;
										}
										else
										{
											fVar41 = Global_17257.f_7736[((iVar9 * Global_17257.f_5096) + iVar8)];
											fVar42 = Global_17257.f_7777[((iVar9 * Global_17257.f_5096) + iVar8)];
										}
										if (iVar51)
										{
											if (func_358(26, 1, 0, &fVar35, &fVar36, iParam7))
											{
												if (Global_17257.f_4953[iVar8] == 2)
												{
													fVar41 = (fVar41 - (fVar35 * 2f));
												}
												fVar44 = (fVar35 * 0.5f);
												if (func_358(26, 1, 1, &fVar35, &fVar36, iParam7))
												{
													func_349(26, 1, &iVar46, &iVar47, &iVar48);
													graphics::draw_sprite(func_356(26), func_354(26, 1), ((fVar33 + fVar41) + fVar44), ((fVar34 - 0.00277776f) + (fVar54 * 0.5f)), fVar35, fVar36, 0f, iVar46, iVar47, iVar48, 255, 0);
												}
											}
											if (func_358(27, 1, 0, &fVar35, &fVar36, iParam7))
											{
												fVar41 = (fVar41 + fVar35);
												fVar44 = (fVar35 * 0.5f);
												if (func_358(27, 1, 1, &fVar35, &fVar36, iParam7))
												{
													func_349(27, 1, &iVar46, &iVar47, &iVar48);
													graphics::draw_sprite(func_356(27), func_354(27, 1), (((fVar33 + fVar41) + fVar44) + (fVar42 + fVar43)), ((fVar34 - 0.00277776f) + (fVar54 * 0.5f)), fVar35, fVar36, 0f, iVar46, iVar47, iVar48, 255, 0);
												}
											}
										}
										func_342(iVar31, Global_17257.f_1610[iVar24], Global_17257.f_1867[iVar24], iVar53, 0, 0);
										func_340((fVar33 + fVar41), fVar34, "NUMBER", Global_17257.f_3918[iVar20], 0);
									}
									iVar40 = true;
									iVar20++;
									break;
								
								case 3:
									if (iVar5 == 1 && iVar32)
									{
										if (!Global_17257.f_5599)
										{
											func_342(iVar31, Global_17257.f_1610[iVar24], Global_17257.f_1867[iVar24], iVar53, 0, 0);
											if (Global_17257.f_7890 && Global_17257.f_7891 == iVar6)
											{
												func_341(iVar31);
											}
											ui::_set_text_entry_for_width("NUMBER");
											ui::add_text_component_float(Global_17257.f_4175[iVar21], Global_17257.f_4304[iVar21]);
											fVar42 = ui::_get_text_screen_width(1);
											fVar41 = 0f;
											if (Global_17257.f_4953[iVar8] == 2)
											{
												fVar41 = (fVar41 + ((fVar45 - fVar42) + (0.00078125f * 1f)));
											}
											else if (Global_17257.f_4953[iVar8] == 0)
											{
												fVar41 = (fVar41 + (((fVar45 - fVar33) * 0.5f) - (fVar42 * 0.5f)));
											}
											Global_17257.f_7736[((iVar9 * Global_17257.f_5096) + iVar8)] = fVar41;
											Global_17257.f_7777[((iVar9 * Global_17257.f_5096) + iVar8)] = fVar42;
										}
										else
										{
											fVar41 = Global_17257.f_7736[((iVar9 * Global_17257.f_5096) + iVar8)];
											fVar42 = Global_17257.f_7777[((iVar9 * Global_17257.f_5096) + iVar8)];
										}
										if (iVar51)
										{
											if (func_358(26, 1, 0, &fVar35, &fVar36, 0))
											{
												if (Global_17257.f_4953[iVar8] == 2)
												{
													fVar41 = (fVar41 - (fVar35 * 2f));
												}
												fVar44 = (fVar35 * 0.5f);
												if (func_358(26, 1, 1, &fVar35, &fVar36, iParam7))
												{
													func_349(26, 1, &iVar46, &iVar47, &iVar48);
													graphics::draw_sprite(func_356(26), func_354(26, 1), ((fVar33 + fVar41) + fVar44), ((fVar34 - 0.00277776f) + (fVar54 * 0.5f)), fVar35, fVar36, 0f, iVar46, iVar47, iVar48, 255, 0);
												}
											}
											if (func_358(27, 1, 0, &fVar35, &fVar36, iParam7))
											{
												fVar41 = (fVar41 + fVar35);
												fVar44 = (fVar35 * 0.5f);
												if (func_358(27, 1, 1, &fVar35, &fVar36, iParam7))
												{
													func_349(27, 1, &iVar46, &iVar47, &iVar48);
													graphics::draw_sprite(func_356(27), func_354(27, 1), (((fVar33 + fVar41) + fVar44) + (fVar42 + fVar43)), ((fVar34 - 0.00277776f) + (fVar54 * 0.5f)), fVar35, fVar36, 0f, iVar46, iVar47, iVar48, 255, 0);
												}
											}
										}
										func_342(iVar31, Global_17257.f_1610[iVar24], Global_17257.f_1867[iVar24], iVar53, 0, 0);
										func_339((fVar33 + fVar41), fVar34, "NUMBER", Global_17257.f_4175[iVar21], Global_17257.f_4304[iVar21]);
									}
									iVar40 = true;
									iVar21++;
									break;
								
								case 4:
									if (iVar5 == 1 && iVar32)
									{
										if (func_358(Global_17257.f_4433[iVar22], iVar31, 0, &fVar35, &fVar36, iParam7))
										{
											if (!Global_17257.f_5599)
											{
												fVar43 = fVar35;
												fVar41 = 0f;
												if (Global_17257.f_4953[iVar8] == 2)
												{
													fVar41 = (fVar41 + ((fVar45 - fVar43) + (0.00078125f * 1f)));
												}
												else if (Global_17257.f_4953[iVar8] == 0)
												{
													fVar41 = (fVar41 + (((fVar45 - fVar33) * 0.5f) - (fVar43 * 0.5f)));
												}
												Global_17257.f_7736[((iVar9 * Global_17257.f_5096) + iVar8)] = fVar41;
												Global_17257.f_7818[((iVar9 * Global_17257.f_5096) + iVar8)] = fVar43;
											}
											else
											{
												fVar41 = Global_17257.f_7736[((iVar9 * Global_17257.f_5096) + iVar8)];
												fVar43 = Global_17257.f_7818[((iVar9 * Global_17257.f_5096) + iVar8)];
											}
											if (iVar51)
											{
												if (func_358(26, 1, 0, &fVar35, &fVar36, iParam7))
												{
													if (Global_17257.f_4953[iVar8] == 2)
													{
														fVar41 = (fVar41 - (fVar35 * 2f));
													}
													fVar44 = (fVar35 * 0.5f);
													if (func_358(26, 1, 1, &fVar35, &fVar36, iParam7))
													{
														func_349(26, 1, &iVar46, &iVar47, &iVar48);
														graphics::draw_sprite(func_356(26), func_354(26, 1), ((fVar33 + fVar41) + fVar44), ((fVar34 - 0.00277776f) + (fVar54 * 0.5f)), fVar35, fVar36, 0f, iVar46, iVar47, iVar48, 255, 0);
													}
												}
												if (func_358(27, 1, 0, &fVar35, &fVar36, iParam7))
												{
													fVar41 = (fVar41 + fVar35);
													fVar44 = (fVar35 * 0.5f);
													if (func_358(27, 1, 1, &fVar35, &fVar36, iParam7))
													{
														func_349(27, 1, &iVar46, &iVar47, &iVar48);
														graphics::draw_sprite(func_356(27), func_354(27, 1), (((fVar33 + fVar41) + fVar44) + (fVar42 + fVar43)), ((fVar34 - 0.00277776f) + (fVar54 * 0.5f)), fVar35, fVar36, 0f, iVar46, iVar47, iVar48, 255, 0);
													}
												}
											}
											if (func_358(Global_17257.f_4433[iVar22], iVar31, 1, &fVar35, &fVar36, iParam7))
											{
												func_349(Global_17257.f_4433[iVar22], iVar31, &iVar46, &iVar47, &iVar48);
												graphics::draw_sprite(func_356(Global_17257.f_4433[iVar22]), func_354(Global_17257.f_4433[iVar22], iVar31), ((fVar33 + fVar41) + (fVar35 * 0.5f)), ((fVar34 - 0.00277776f) + (fVar54 * 0.5f)), (fVar35 * func_338(Global_17257.f_4433[iVar22])), (fVar36 * func_338(Global_17257.f_4433[iVar22])), 0f, iVar46, iVar47, iVar48, 255, 0);
											}
										}
									}
									iVar40 = true;
									iVar22++;
									break;
								
								case 5:
									iVar40 = true;
									break;
							}
							if (Global_17257.f_4926[iVar8] == 5)
							{
								if (Global_17257.f_4938[iVar8] > 0.05f)
								{
									fVar33 = (fVar33 + Global_17257.f_4938[iVar8]);
								}
								else
								{
									fVar33 = (fVar33 + 0.05f);
								}
							}
							else
							{
								fVar33 = (fVar33 + Global_17257.f_4938[iVar8]);
								if (Global_17257.f_4945[iVar8])
								{
									if (func_358(26, 1, 1, &fVar35, &fVar36, iParam7))
									{
										fVar33 = (fVar33 - fVar35);
									}
								}
							}
						}
						else
						{
							fVar33 = (fVar33 + Global_17257.f_4938[iVar8]);
						}
						iVar8++;
					}
				}
				if (iVar40)
				{
					if (iVar32)
					{
						Global_17257.f_7520[iVar9] = iVar6;
						Global_17257.f_5607 = iVar6;
						iVar9++;
						if (Global_17257.f_5226[iVar6])
						{
							iVar13++;
						}
						if (Global_17257.f_5612[iVar6] != 0f)
						{
							fVar64 = (fVar64 + Global_17257.f_5612[iVar6]);
						}
						else
						{
							fVar64 = (fVar64 + 0.034722f);
						}
					}
					if (!Global_17257.f_5598)
					{
						Global_17257.f_5355[iVar6] = 1;
						if (Global_17257.f_5097[iVar6])
						{
							if (iVar31)
							{
								Global_17257.f_5604 = 0;
							}
						}
						else
						{
							iVar11++;
							if (iVar31)
							{
								Global_17257.f_5604 = iVar11;
							}
						}
						iVar10++;
					}
				}
				iVar7++;
			}
			if (!Global_17257.f_5598)
			{
				Global_17257.f_5600 = ((fVar56 + fVar64) + (0.00277776f * IntToFloat(iVar12)));
				Global_17257.f_5603 = iVar11;
				Global_17257.f_5601 = iVar10;
				Global_17257.f_5598 = 1;
			}
		}
		iVar5++;
	}
	if (!Global_17257.f_5599)
	{
		Global_17257.f_5602 = iVar9;
		Global_17257.f_5599 = 1;
	}
	Global_17257.f_5743 = fVar49;
	Global_17257.f_5745 = gameplay::get_game_timer();
	ui::_0x55598D21339CB998(Global_17257.f_5743);
	if (!Global_17257.f_7859)
	{
		func_335();
	}
	Global_17257.f_7859 = 0;
	if (iParam2)
	{
		ui::hide_hud_component_this_frame(10);
	}
	ui::hide_hud_component_this_frame(6);
	ui::hide_hud_component_this_frame(7);
	ui::hide_hud_component_this_frame(9);
	ui::hide_hud_component_this_frame(8);
	if (iParam0)
	{
		func_334(1);
	}
	graphics::_0xE3A3DB414A373DAB();
}

void func_334(int iParam0)//Position - 0x10F02
{
	Global_1339962.f_932 = iParam0;
}

void func_335()//Position - 0x10F13
{
	if (!Global_14413.f_1 == 1)
	{
		if (func_164(0))
		{
			func_336(0);
		}
		gameplay::set_bit(&Global_2284, 2);
	}
}

void func_336(int iParam0)//Position - 0x10F3B
{
	if (Global_14571)
	{
		func_337(0, 0);
	}
	if (Global_14413.f_1 == 10 || Global_14413.f_1 == 9)
	{
		gameplay::set_bit(&Global_2284, 16);
	}
	if (audio::is_mobile_phone_call_ongoing())
	{
		audio::stop_scripted_conversation(false);
	}
	Global_15712 = 5;
	if (iParam0 == 1)
	{
		gameplay::set_bit(&Global_2283, 30);
	}
	else
	{
		gameplay::clear_bit(&Global_2283, 30);
	}
	if (!func_257())
	{
		Global_14413.f_1 = 3;
	}
}

void func_337(int iParam0, int iParam1)//Position - 0x10FAB
{
	if (iParam0)
	{
		if (func_164(0))
		{
			Global_14571 = 1;
			if (iParam1)
			{
				mobile::get_mobile_phone_position(&Global_14350);
			}
			Global_14341 = { Global_14359[Global_14358 /*3*/] };
			mobile::set_mobile_phone_position(Global_14341);
		}
	}
	else if (Global_14571 == 1)
	{
		Global_14571 = 0;
		Global_14341 = { Global_14366[Global_14358 /*3*/] };
		if (iParam1)
		{
			mobile::set_mobile_phone_position(Global_14350);
		}
		else
		{
			mobile::set_mobile_phone_position(Global_14341);
		}
	}
}

float func_338(int iParam0)//Position - 0x1101F
{
	switch (iParam0)
	{
		case 35:
		case 34:
		case 47:
		case 46:
		case 42:
		case 36:
		case 37:
		case 39:
		case 40:
		case 38:
		case 50:
		case 43:
		case 44:
		case 45:
			return 0.85f;
			break;
	}
	return 1f;
}

void func_339(float fParam0, float fParam1, char* sParam2, float fParam3, int iParam4)//Position - 0x1108E
{
	ui::_set_text_entry(sParam2);
	ui::add_text_component_float(fParam3, iParam4);
	ui::_draw_text(fParam0, fParam1, 0);
}

void func_340(float fParam0, float fParam1, char* sParam2, int iParam3, int iParam4)//Position - 0x110AD
{
	ui::_set_text_entry(sParam2);
	ui::add_text_component_integer(iParam3);
	ui::_draw_text(fParam0, fParam1, iParam4);
}

void func_341(int iParam0)//Position - 0x110CB
{
	int iVar0;
	int iVar1;
	int iVar2;
	var uVar3;
	
	if (iParam0)
	{
		ui::get_hud_colour(Global_17257.f_7887[0], &iVar0, &iVar1, &iVar2, &uVar3);
	}
	else
	{
		ui::get_hud_colour(Global_17257.f_7887[1], &iVar0, &iVar1, &iVar2, &uVar3);
	}
	ui::set_text_colour(iVar0, iVar1, iVar2, 255);
}

void func_342(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4, int iParam5)//Position - 0x11111
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	if (iParam2)
	{
		if (iParam3)
		{
			func_343(Global_17257.f_5878[iParam4], &iVar0, &iVar1, &iVar2);
			if ((iVar0 < 20 && iVar1 < 20) && iVar2 < 20)
			{
				if (iParam0 == 0)
				{
					ui::get_hud_colour(1, &iVar0, &iVar1, &iVar2, &iVar3);
				}
			}
			else if ((iVar0 > 230 && iVar1 > 230) && iVar2 > 230)
			{
				if (iParam0)
				{
					iVar0 = 0;
					iVar1 = 0;
					iVar2 = 0;
				}
			}
			ui::set_text_colour(iVar0, iVar1, iVar2, 255);
		}
		else if (iParam1)
		{
			if (iParam0)
			{
				ui::get_hud_colour(14, &iVar0, &iVar1, &iVar2, &iVar3);
				ui::set_text_colour(iVar0, iVar1, iVar2, 255);
			}
			else
			{
				ui::get_hud_colour(12, &iVar0, &iVar1, &iVar2, &iVar3);
				ui::set_text_colour(iVar0, iVar1, iVar2, 255);
			}
		}
		else if (iParam0)
		{
			ui::set_text_colour(155, 155, 155, 255);
		}
		else
		{
			ui::set_text_colour(155, 155, 155, 255);
		}
	}
	else if (iParam1)
	{
		if (iParam0)
		{
			ui::set_text_colour(0, 0, 0, system::floor((255f * 0.8f)));
		}
		else
		{
			ui::get_hud_colour(1, &iVar0, &iVar1, &iVar2, &iVar3);
			ui::set_text_colour(iVar0, iVar1, iVar2, iVar3);
		}
	}
	else if (iParam0)
	{
		ui::set_text_colour(155, 155, 155, 255);
	}
	else
	{
		ui::set_text_colour(155, 155, 155, 255);
	}
	ui::set_text_scale(0f, 0.35f);
	ui::set_text_justification(1);
	if (iParam5)
	{
		ui::set_text_scale(0f, 0.425f);
		ui::set_text_font(4);
	}
	else
	{
		ui::set_text_font(0);
	}
	ui::set_text_wrap(0f, 1f);
	ui::set_text_centre(0);
	ui::set_text_dropshadow(0, 0, 0, 0, 0);
	ui::set_text_edge(0, 0, 0, 0, 0);
}

void func_343(int iParam0, var uParam1, var uParam2, var uParam3)//Position - 0x112A8
{
	switch (iParam0)
	{
		case 0:
			*uParam1 = 8;
			*uParam2 = 8;
			*uParam3 = 8;
			break;
		
		case 1:
			*uParam1 = 37;
			*uParam2 = 37;
			*uParam3 = 39;
			break;
		
		case 22:
			*uParam1 = 140;
			*uParam2 = 146;
			*uParam3 = 154;
			break;
		
		case 23:
			*uParam1 = 91;
			*uParam2 = 93;
			*uParam3 = 94;
			break;
		
		case 6:
			*uParam1 = 81;
			*uParam2 = 84;
			*uParam3 = 89;
			break;
		
		case 111:
			*uParam1 = 240;
			*uParam2 = 240;
			*uParam3 = 240;
			break;
		
		case 28:
			*uParam1 = 150;
			*uParam2 = 8;
			*uParam3 = 0;
			break;
		
		case 34:
			*uParam1 = 38;
			*uParam2 = 3;
			*uParam3 = 6;
			break;
		
		case 88:
			*uParam1 = 245;
			*uParam2 = 137;
			*uParam3 = 15;
			break;
		
		case 45:
			*uParam1 = 74;
			*uParam2 = 22;
			*uParam3 = 7;
			break;
		
		case 56:
			*uParam1 = 45;
			*uParam2 = 58;
			*uParam3 = 53;
			break;
		
		case 58:
			*uParam1 = 71;
			*uParam2 = 120;
			*uParam3 = 60;
			break;
		
		case 54:
			*uParam1 = 77;
			*uParam2 = 98;
			*uParam3 = 104;
			break;
		
		case 73:
			*uParam1 = 14;
			*uParam2 = 49;
			*uParam3 = 109;
			break;
		
		case 68:
			*uParam1 = 22;
			*uParam2 = 34;
			*uParam3 = 72;
			break;
		
		case 140:
			*uParam1 = 0;
			*uParam2 = 174;
			*uParam3 = 239;
			break;
		
		case 131:
			*uParam1 = 255;
			*uParam2 = 183;
			*uParam3 = 0;
			break;
		
		case 90:
			*uParam1 = 142;
			*uParam2 = 140;
			*uParam3 = 70;
			break;
		
		case 97:
			*uParam1 = 156;
			*uParam2 = 141;
			*uParam3 = 113;
			break;
		
		case 89:
			*uParam1 = 145;
			*uParam2 = 115;
			*uParam3 = 71;
			break;
		
		case 105:
			*uParam1 = 98;
			*uParam2 = 68;
			*uParam3 = 40;
			break;
		
		case 100:
			*uParam1 = 124;
			*uParam2 = 27;
			*uParam3 = 68;
			break;
		
		case 99:
			*uParam1 = 114;
			*uParam2 = 42;
			*uParam3 = 63;
			break;
		
		case 136:
			*uParam1 = 246;
			*uParam2 = 151;
			*uParam3 = 153;
			break;
		
		case 49:
			*uParam1 = 32;
			*uParam2 = 32;
			*uParam3 = 44;
			break;
		
		case 146:
			*uParam1 = 26;
			*uParam2 = 1;
			*uParam3 = 23;
			break;
		
		default:
			*uParam1 = 255;
			*uParam2 = 255;
			*uParam3 = 255;
			break;
	}
}

void func_344(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8)//Position - 0x11532
{
	var uVar0;
	int iVar1;
	int iVar2;
	
	if (!func_160(&uVar0, 0, iParam1))
	{
		return;
	}
	iParam0 = iParam0;
	if (iParam3 && !func_360(iParam4, iParam8))
	{
		return;
	}
	if (func_347())
	{
		return;
	}
	if (network::_network_is_text_chat_active())
	{
		return;
	}
	if (iParam7 == 0)
	{
		if (func_205(player::player_id(), 0))
		{
			return;
		}
	}
	if (gameplay::is_pc_version())
	{
		if (gameplay::update_onscreen_keyboard() == 0 || network::_network_is_text_chat_active())
		{
			return;
		}
	}
	if (Global_17257.f_4639 != 0)
	{
		if (controls::_0x6CD79468A1E595C6(2))
		{
			iVar1 = 0;
			while (iVar1 < Global_17257.f_4639)
			{
				if (Global_17257.f_4896[iVar1] != 345)
				{
					StringCopy(&(Global_17257.f_4641[iVar1 /*16*/]), controls::_get_control_action_name(2, Global_17257.f_4896[iVar1], true), 64);
				}
				else if (Global_17257.f_4909[iVar1] != 32)
				{
					StringCopy(&(Global_17257.f_4641[iVar1 /*16*/]), controls::_0x80C2FD58D720C801(2, Global_17257.f_4909[iVar1], true), 64);
				}
				iVar1++;
			}
			Global_17257.f_4640 = 0;
		}
		if (!Global_17257.f_4640)
		{
			graphics::_push_scaleform_movie_function(Global_17257.f_5530[uVar0 /*10*/], "CLEAR_ALL");
			graphics::_pop_scaleform_movie_function_void();
			graphics::_push_scaleform_movie_function(Global_17257.f_5530[uVar0 /*10*/], "SET_MAX_WIDTH");
			graphics::_push_scaleform_movie_function_parameter_float((1f - (Global_17257.f_4951 / 100f)));
			graphics::_pop_scaleform_movie_function_void();
			if (gameplay::is_pc_version())
			{
				graphics::_push_scaleform_movie_function(Global_17257.f_5530[uVar0 /*10*/], "TOGGLE_MOUSE_BUTTONS");
				graphics::_push_scaleform_movie_function_parameter_bool(true);
				graphics::_pop_scaleform_movie_function_void();
			}
			iVar1 = 0;
			while (iVar1 < Global_17257.f_4639)
			{
				if (gameplay::get_hash_key(&(Global_17257.f_4834[iVar1 /*4*/])) != gameplay::get_hash_key("PREV"))
				{
					graphics::_push_scaleform_movie_function(Global_17257.f_5530[uVar0 /*10*/], "SET_DATA_SLOT");
					graphics::_push_scaleform_movie_function_parameter_int(iVar1);
					func_346(&(Global_17257.f_4641[iVar1 /*16*/]));
					iVar2 = iVar1 + 1;
					while (iVar2 < 12 && gameplay::get_hash_key(&(Global_17257.f_4834[iVar2 /*4*/])) == gameplay::get_hash_key("PREV"))
					{
						func_346(&(Global_17257.f_4641[iVar2 /*16*/]));
						iVar2++;
					}
					if (Global_17257.f_4883[iVar1] == -1)
					{
						func_345(&(Global_17257.f_4834[iVar1 /*4*/]));
					}
					else
					{
						graphics::_begin_text_component(&(Global_17257.f_4834[iVar1 /*4*/]));
						if (iParam5)
						{
							ui::add_text_component_substring_time(iParam2, 70);
						}
						else
						{
							ui::add_text_component_integer(iParam2);
						}
						graphics::_end_text_component();
					}
					if (gameplay::is_pc_version())
					{
						if (Global_17257.f_4896[iVar1] != 345 && gameplay::is_bit_set(Global_17257.f_4922, iVar1))
						{
							graphics::_push_scaleform_movie_function_parameter_bool(true);
							graphics::_push_scaleform_movie_function_parameter_int(Global_17257.f_4896[iVar1]);
						}
						else
						{
							graphics::_push_scaleform_movie_function_parameter_bool(false);
							graphics::_push_scaleform_movie_function_parameter_int(345);
						}
					}
					graphics::_pop_scaleform_movie_function_void();
				}
				iVar1++;
			}
			if (gameplay::get_hash_key(&(Global_2566711.f_16)) != gameplay::get_hash_key(""))
			{
				graphics::_push_scaleform_movie_function(Global_17257.f_5530[uVar0 /*10*/], "SET_DATA_SLOT");
				graphics::_push_scaleform_movie_function_parameter_int(Global_17257.f_4639);
				func_346(&Global_2566711);
				if (Global_2566711.f_20 == -1)
				{
					func_345(&(Global_2566711.f_16));
				}
				else
				{
					graphics::_begin_text_component(&(Global_2566711.f_16));
					if (iParam5)
					{
						ui::add_text_component_substring_time(iParam2, 70);
					}
					else
					{
						ui::add_text_component_integer(iParam2);
					}
					graphics::_end_text_component();
				}
				graphics::_pop_scaleform_movie_function_void();
			}
			graphics::_push_scaleform_movie_function(Global_17257.f_5530[uVar0 /*10*/], "SET_BACKGROUND_COLOUR");
			graphics::_push_scaleform_movie_function_parameter_int(0);
			graphics::_push_scaleform_movie_function_parameter_int(0);
			graphics::_push_scaleform_movie_function_parameter_int(0);
			graphics::_push_scaleform_movie_function_parameter_int(80);
			graphics::_pop_scaleform_movie_function_void();
			graphics::_push_scaleform_movie_function(Global_17257.f_5530[uVar0 /*10*/], "DRAW_INSTRUCTIONAL_BUTTONS");
			if (Global_17257.f_4952)
			{
				graphics::_push_scaleform_movie_function_parameter_int(1);
			}
			else
			{
				graphics::_push_scaleform_movie_function_parameter_int(0);
			}
			graphics::_pop_scaleform_movie_function_void();
			Global_17257.f_4640 = 1;
		}
		iVar1 = 0;
		while (iVar1 < Global_17257.f_4639)
		{
			if (Global_17257.f_4883[iVar1] != -1)
			{
				if (iParam2 > 0)
				{
					graphics::_push_scaleform_movie_function(Global_17257.f_5530[uVar0 /*10*/], "OVERRIDE_RESPAWN_TEXT");
					graphics::_push_scaleform_movie_function_parameter_int(iVar1);
					graphics::_begin_text_component(&(Global_17257.f_4834[iVar1 /*4*/]));
					if (iParam5)
					{
						ui::add_text_component_substring_time(iParam2, 70);
					}
					else
					{
						ui::add_text_component_integer(iParam2);
					}
					graphics::_end_text_component();
					graphics::_pop_scaleform_movie_function_void();
				}
			}
			iVar1++;
		}
		if (Global_2566711.f_20 != -1)
		{
			if (iParam2 > 0)
			{
				graphics::_push_scaleform_movie_function(Global_17257.f_5530[uVar0 /*10*/], "OVERRIDE_RESPAWN_TEXT");
				graphics::_push_scaleform_movie_function_parameter_int(iVar1);
				graphics::_begin_text_component(&(Global_2566711.f_16));
				if (iParam5)
				{
					ui::add_text_component_substring_time(iParam2, 70);
				}
				else
				{
					ui::add_text_component_integer(iParam2);
				}
				graphics::_end_text_component();
				graphics::_pop_scaleform_movie_function_void();
			}
		}
		graphics::_set_screen_draw_position(76, 66);
		graphics::_0xF5A2C681787E579D(0f, 0f, 0f, 0f);
		if (iParam6)
		{
			if (!Global_17257.f_7894)
			{
				ui::set_hud_component_position(15, 0f, -0.0375f);
				Global_17257.f_7894 = 1;
			}
		}
		else if (Global_17257.f_7894)
		{
			ui::reset_hud_component_values(15);
			Global_17257.f_7894 = 0;
		}
		graphics::_0xE3A3DB414A373DAB();
		if (Global_17257.f_4925)
		{
			graphics::_set_screen_draw_position(82, 66);
			graphics::_0xF5A2C681787E579D(0f, 0f, 0f, 0f);
			graphics::draw_scaleform_movie(Global_17257.f_5530[uVar0 /*10*/], Global_17257.f_4923, Global_17257.f_4924, 1f, 1f, 255, 255, 255, 255, 0);
			graphics::_0xE3A3DB414A373DAB();
		}
		else
		{
			graphics::draw_scaleform_movie_fullscreen(Global_17257.f_5530[uVar0 /*10*/], 255, 255, 255, 255, 0);
		}
	}
}

void func_345(char* sParam0)//Position - 0x11A0E
{
	graphics::_begin_text_component(sParam0);
	graphics::_end_text_component();
}

void func_346(char* sParam0)//Position - 0x11A20
{
	graphics::_0xE83A3E3557A56640(sParam0);
}

bool func_347()//Position - 0x11A2E
{
	vector3 vVar0;
	
	if (Global_14413.f_1 > 3)
	{
		return true;
	}
	if (func_348())
	{
		vVar0 = { 0f, -500f, 0f };
		mobile::get_mobile_phone_position(&vVar0);
		if (Global_14358 == 0)
		{
			if (vVar0.y > -119f)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		else if (vVar0.y > -101f)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	return false;
}

bool func_348()//Position - 0x11A9C
{
	if (script::_get_number_of_instances_of_streamed_script(joaat("cellphone_flashhand")) > 0)
	{
		return true;
	}
	return false;
}

void func_349(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4)//Position - 0x11AB6
{
	var uVar0;
	
	ui::get_hud_colour(1, iParam2, iParam3, iParam4, &uVar0);
	switch (iParam0)
	{
		case 28:
			*iParam2 = 194;
			*iParam3 = 80;
			*iParam4 = 80;
			break;
		
		case 15:
		case 4:
		case 16:
		case 26:
		case 27:
		case 35:
		case 34:
		case 47:
		case 46:
		case 42:
		case 36:
		case 37:
		case 50:
		case 39:
		case 40:
		case 38:
		case 43:
		case 44:
		case 45:
		case 49:
			if (iParam1)
			{
				*iParam2 = 0;
				*iParam3 = 0;
				*iParam4 = 0;
			}
			break;
	}
}

void func_350(float fParam0)//Position - 0x11B76
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	ui::get_hud_colour(1, &iVar0, &iVar1, &iVar2, &iVar3);
	ui::set_text_font(0);
	ui::set_text_scale(0f, 0.35f);
	ui::set_text_leading(2);
	ui::set_text_colour(iVar0, iVar1, iVar2, iVar3);
	ui::set_text_wrap(fParam0, ((Global_17254 + Global_17256) - 0.0046875f));
	ui::set_text_centre(0);
	ui::set_text_dropshadow(0, 0, 0, 0, 0);
	ui::set_text_edge(0, 0, 0, 0, 0);
}

void func_351(float fParam0, float fParam1, char* sParam2, int iParam3, int iParam4)//Position - 0x11BD5
{
	ui::_set_text_entry(sParam2);
	ui::add_text_component_integer(iParam3);
	ui::add_text_component_integer(iParam4);
	ui::_draw_text(fParam0, fParam1, 0);
}

float func_352(char* sParam0, int iParam1, int iParam2)//Position - 0x11BF8
{
	if (!gameplay::is_string_null(sParam0))
	{
		if (gameplay::get_hash_key(sParam0) == 0)
		{
			return 0f;
		}
	}
	else
	{
		return 0f;
	}
	func_353();
	ui::_set_text_entry_for_width(sParam0);
	ui::add_text_component_integer(iParam1);
	ui::add_text_component_integer(iParam2);
	return ui::_get_text_screen_width(1);
}

void func_353()//Position - 0x11C3A
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	ui::get_hud_colour(1, &iVar0, &iVar1, &iVar2, &iVar3);
	if (Global_17257.f_7869)
	{
		iVar0 = Global_17257.f_7865;
		iVar1 = Global_17257.f_7866;
		iVar2 = Global_17257.f_7867;
		iVar3 = Global_17257.f_7868;
	}
	ui::set_text_font(0);
	ui::set_text_scale(0f, 0.35f);
	ui::set_text_colour(iVar0, iVar1, iVar2, iVar3);
	ui::set_text_wrap((Global_17254 + 0.0046875f), ((Global_17254 + Global_17256) - 0.0046875f));
	ui::set_text_centre(0);
	ui::set_text_dropshadow(0, 0, 0, 0, 0);
	ui::set_text_edge(0, 0, 0, 0, 0);
}

var func_354(int iParam0, int iParam1)//Position - 0x11CC4
{
	char* sVar0[2];
	
	if (!gameplay::is_string_null_or_empty(&(Global_17257.f_6703[iParam0 /*16*/])))
	{
		return func_355(&(Global_17257.f_6703[iParam0 /*16*/]));
	}
	switch (iParam0)
	{
		case 3:
			sVar0[0] = "MP_hostCrown";
			sVar0[1] = "MP_hostCrown";
			break;
		
		case 21:
			sVar0[0] = "MP_SpecItem_Coke";
			sVar0[1] = "MP_SpecItem_Coke";
			break;
		
		case 22:
			sVar0[0] = "MP_SpecItem_Heroin";
			sVar0[1] = "MP_SpecItem_Heroin";
			break;
		
		case 23:
			sVar0[0] = "MP_SpecItem_Weed";
			sVar0[1] = "MP_SpecItem_Weed";
			break;
		
		case 24:
			sVar0[0] = "MP_SpecItem_Meth";
			sVar0[1] = "MP_SpecItem_Meth";
			break;
		
		case 25:
			sVar0[0] = "MP_SpecItem_Cash";
			sVar0[1] = "MP_SpecItem_Cash";
			break;
		
		case 1:
			sVar0[0] = "shop_NEW_Star";
			sVar0[1] = "shop_NEW_Star";
			break;
		
		case 2:
			sVar0[0] = "shop_NEW_Star";
			sVar0[1] = "shop_NEW_Star";
			break;
		
		case 4:
			sVar0[0] = "Shop_Tick_Icon";
			sVar0[1] = "Shop_Tick_Icon";
			break;
		
		case 6:
			sVar0[0] = "Shop_Box_CrossB";
			sVar0[1] = "Shop_Box_Cross";
			break;
		
		case 7:
			sVar0[0] = "Shop_Box_BlankB";
			sVar0[1] = "Shop_Box_Blank";
			break;
		
		case 5:
			sVar0[0] = "Shop_Box_TickB";
			sVar0[1] = "Shop_Box_Tick";
			break;
		
		case 8:
			sVar0[0] = "shop_NEW_Star";
			sVar0[1] = "shop_NEW_Star";
			break;
		
		case 9:
			sVar0[0] = "Shop_Clothing_Icon_B";
			sVar0[1] = "Shop_Clothing_Icon_A";
			break;
		
		case 10:
			sVar0[0] = "Shop_GunClub_Icon_B";
			sVar0[1] = "Shop_GunClub_Icon_A";
			break;
		
		case 17:
			sVar0[0] = "Shop_Ammo_Icon_B";
			sVar0[1] = "Shop_Ammo_Icon_A";
			break;
		
		case 18:
			sVar0[0] = "Shop_Armour_Icon_B";
			sVar0[1] = "Shop_Armour_Icon_A";
			break;
		
		case 19:
			sVar0[0] = "Shop_Health_Icon_B";
			sVar0[1] = "Shop_Health_Icon_A";
			break;
		
		case 20:
			sVar0[0] = "Shop_MakeUp_Icon_B";
			sVar0[1] = "Shop_MakeUp_Icon_A";
			break;
		
		case 11:
			sVar0[0] = "Shop_Tattoos_Icon_B";
			sVar0[1] = "Shop_Tattoos_Icon_A";
			break;
		
		case 12:
			sVar0[0] = "Shop_Garage_Icon_B";
			sVar0[1] = "Shop_Garage_Icon_A";
			break;
		
		case 13:
			sVar0[0] = "Shop_Garage_Bike_Icon_B";
			sVar0[1] = "Shop_Garage_Bike_Icon_A";
			break;
		
		case 14:
			sVar0[0] = "Shop_Barber_Icon_B";
			sVar0[1] = "Shop_Barber_Icon_A";
			break;
		
		case 15:
			sVar0[0] = "shop_Lock";
			sVar0[1] = "shop_Lock";
			break;
		
		case 16:
			sVar0[0] = "Shop_Tick_Icon";
			sVar0[1] = "Shop_Tick_Icon";
			break;
		
		case 26:
			sVar0[0] = "arrowleft";
			sVar0[1] = "arrowleft";
			break;
		
		case 27:
			sVar0[0] = "arrowright";
			sVar0[1] = "arrowright";
			break;
		
		case 28:
			sVar0[0] = "MP_AlertTriangle";
			sVar0[1] = "MP_AlertTriangle";
			break;
		
		case 29:
			sVar0[0] = "shop_NEW_Star";
			sVar0[1] = "shop_NEW_Star";
			break;
		
		case 31:
			sVar0[0] = "Shop_Michael_Icon_B";
			sVar0[1] = "Shop_Michael_Icon_A";
			break;
		
		case 32:
			sVar0[0] = "Shop_Franklin_Icon_B";
			sVar0[1] = "Shop_Franklin_Icon_A";
			break;
		
		case 33:
			sVar0[0] = "Shop_Trevor_Icon_B";
			sVar0[1] = "Shop_Trevor_Icon_A";
			break;
		
		case 48:
			sVar0[0] = "SaleIcon";
			sVar0[1] = "SaleIcon";
			break;
		
		case 49:
			sVar0[0] = "Shop_Tick_Icon";
			sVar0[1] = "Shop_Tick_Icon";
			break;
		
		case 0:
			sVar0[0] = "";
			sVar0[1] = "";
			break;
	}
	if (iParam1)
	{
		return sVar0[0];
	}
	return sVar0[1];
}

var func_355(var uParam0)//Position - 0x120C1
{
	return uParam0;
}

char* func_356(int iParam0)//Position - 0x120CB
{
	if (!gameplay::is_string_null_or_empty(&(Global_17257.f_5886[iParam0 /*16*/])))
	{
		return func_355(&(Global_17257.f_5886[iParam0 /*16*/]));
	}
	if (iParam0 == 48)
	{
		return "MPShopSale";
	}
	return "CommonMenu";
}

bool func_357()//Position - 0x12108
{
	int iVar0;
	int iVar1;
	float fVar2;
	
	graphics::_get_screen_active_resolution(&iVar0, &iVar1);
	fVar2 = (system::to_float(iVar0) / system::to_float(iVar1));
	if (fVar2 > 3.5f)
	{
		return true;
	}
	return false;
}

bool func_358(int iParam0, int iParam1, int iParam2, float fParam3, float fParam4, int iParam5)//Position - 0x1213A
{
	char* sVar0;
	char* sVar1;
	int iVar2;
	int iVar3;
	float fVar4;
	float fVar5;
	float fVar6;
	vector3 vVar7;
	
	sVar0 = func_356(iParam0);
	sVar1 = func_354(iParam0, iParam1);
	if (gameplay::get_hash_key(sVar1) != 0)
	{
		fVar4 = 1f;
		if (iParam5)
		{
			graphics::_get_screen_active_resolution(&iVar2, &iVar3);
			fVar5 = graphics::_get_screen_aspect_ratio(0);
			if (func_357())
			{
				iVar2 = system::round((system::to_float(iVar3) * fVar5));
			}
			fVar6 = (system::to_float(iVar2) / system::to_float(iVar3));
			fVar4 = (fVar6 / fVar5);
			if (func_357())
			{
				fVar4 = 1f;
			}
			if (script::_get_number_of_instances_of_streamed_script(joaat("director_mode")) > 0)
			{
				graphics::get_screen_resolution(&iVar2, &iVar3);
			}
			iVar2 = system::round((system::to_float(iVar2) / fVar4));
			iVar3 = system::round((system::to_float(iVar3) / fVar4));
		}
		else
		{
			graphics::get_screen_resolution(&iVar2, &iVar3);
		}
		vVar7 = { graphics::get_texture_resolution(sVar0, sVar1) };
		vVar7.x = (vVar7.x * (func_359(iParam0) / fVar4));
		vVar7.y = (vVar7.y * (func_359(iParam0) / fVar4));
		if (!iParam2)
		{
			vVar7.x = (vVar7.x - 2f);
			vVar7.y = (vVar7.y - 2f);
		}
		if (iParam0 == 30)
		{
			vVar7.x = 288f;
			vVar7.y = 106f;
		}
		*fParam3 = ((vVar7.x / IntToFloat(iVar2)) * IntToFloat((iVar2 / iVar3)));
		*fParam4 = (((vVar7.y / IntToFloat(iVar3)) / (vVar7.x / IntToFloat(iVar2))) * *fParam3);
		if (!iParam5)
		{
			if (!graphics::get_is_widescreen() && iParam0 != 30)
			{
				*fParam3 = (*fParam3 * 1.33f);
			}
		}
		if (iParam0 == 29)
		{
			if (*fParam3 > Global_17256)
			{
				*fParam4 = (*fParam4 * (Global_17256 / *fParam3));
				*fParam3 = Global_17256;
			}
		}
		return true;
	}
	return false;
}

float func_359(int iParam0)//Position - 0x122B6
{
	switch (iParam0)
	{
		case 33:
		case 4:
		case 11:
		case 31:
		case 20:
		case 15:
		case 10:
		case 12:
		case 13:
		case 32:
		case 9:
		case 5:
		case 6:
		case 7:
		case 14:
		case 18:
		case 19:
		case 17:
		case 28:
		case 26:
		case 27:
		case 49:
			return 0.5f;
			break;
	}
	return 1f;
}

bool func_360(int iParam0, int iParam1)//Position - 0x12355
{
	if (Global_2428549.f_1378.f_688 != 0)
	{
		return true;
	}
	if ((((((((!cam::is_screen_faded_in() || (func_266(8, -1) && func_361() != 64)) || (ui::get_pause_menu_state() != 0 && !iParam1)) || (streaming::is_player_switch_in_progress() && !iParam0)) || network::_0x2EAC52B4019E2782()) || Global_69781) || Global_17257.f_7893) || ui::is_warning_message_active()) || Global_91362.f_1352)
	{
		return false;
	}
	return true;
}

var func_361()//Position - 0x123F2
{
	return Global_1315846;
}

void func_362(int iParam0, char* sParam1, int iParam2, int iParam3)//Position - 0x123FE
{
	char* sVar0;
	
	sVar0 = controls::_get_control_action_name(2, iParam0, true);
	if (Global_17257.f_4639 >= 12)
	{
		StringCopy(&Global_2566711, sVar0, 64);
		StringCopy(&(Global_2566711.f_16), sParam1, 16);
		Global_2566711.f_20 = iParam2;
		return;
		return;
	}
	if (!iParam3)
	{
		gameplay::set_bit(&(Global_17257.f_4922), Global_17257.f_4639);
	}
	StringCopy(&(Global_17257.f_4641[Global_17257.f_4639 /*16*/]), sVar0, 64);
	StringCopy(&(Global_17257.f_4834[Global_17257.f_4639 /*4*/]), sParam1, 16);
	Global_17257.f_4883[Global_17257.f_4639] = iParam2;
	Global_17257.f_4896[Global_17257.f_4639] = iParam0;
	Global_17257.f_4909[Global_17257.f_4639] = 32;
	Global_17257.f_4639++;
}

char* func_363(int iParam0)//Position - 0x124B3
{
	int iVar0;
	
	if (iParam0 != -1)
	{
		iVar0 = iParam0;
	}
	else
	{
		iVar0 = 6;
	}
	switch (iVar0)
	{
		case 6:
			return "SNK_AFFORD";
		
		case 3:
			return "SNK_ITEM1_D";
		
		case 1:
			return "SNK_ITEM2_D";
		
		case 2:
			return "SNK_ITEM3_D";
		
		case 4:
			return "SNK_ITEM4_D";
		
		case 0:
			return "SNK_ITEM5_D";
		
		case 5:
			return "SNK_ITEM6_D";
		
		default:
	}
	return "";
}

void func_364(char* sParam0, int iParam1, int iParam2)//Position - 0x12531
{
	int iVar0;
	
	StringCopy(&(Global_17257.f_4562), sParam0, 16);
	Global_17257.f_4632 = 0;
	Global_17257.f_4633 = 0;
	Global_17257.f_4634 = 0;
	Global_17257.f_4635 = 0;
	Global_17257.f_4636 = iParam1;
	Global_17257.f_4637 = gameplay::get_game_timer();
	Global_17257.f_4638 = iParam2;
	iVar0 = 0;
	while (iVar0 < 4)
	{
		Global_17257.f_4566[iVar0] = 0;
		iVar0++;
	}
}

void func_365(var uParam0, int iParam1, int iParam2)//Position - 0x12596
{
	int iVar0;
	int iVar1;
	
	Global_17257.f_5606 = uParam0;
	Global_17257.f_5741 = iParam2;
	if (Global_17257.f_5606 < Global_17257.f_5605)
	{
		Global_17257.f_5605 = Global_17257.f_5606;
	}
	else if ((Global_17257.f_5599 && Global_17257.f_5606 > Global_17257.f_5607) || (!Global_17257.f_5599 && Global_17257.f_5606 >= (Global_17257.f_5605 + Global_17257.f_5095)))
	{
		iVar0 = Global_17257.f_5605;
		while (iVar0 <= Global_17257.f_5606)
		{
			if (iVar0 >= 0 && iVar0 < 127)
			{
				if (Global_17257.f_4959[iVar0] != 0)
				{
					iVar1++;
				}
			}
			iVar0++;
		}
		while (iVar1 > Global_17257.f_5095 && Global_17257.f_5605 < 128)
		{
			Global_17257.f_5605++;
			iVar1 = 0;
			iVar0 = Global_17257.f_5605;
			while (iVar0 <= Global_17257.f_5606)
			{
				if (iVar0 >= 0 && iVar0 < 127)
				{
					if (Global_17257.f_4959[iVar0] != 0)
					{
						iVar1++;
					}
				}
				iVar0++;
			}
		}
	}
	Global_17257.f_5598 = 0;
	Global_17257.f_5599 = 0;
	if (iParam1)
	{
		StringCopy(&(Global_17257.f_4562), "", 16);
		StringCopy(&(Global_2566711.f_21), "", 16);
	}
}

void func_366(int iParam0)//Position - 0x126E8
{
	Global_17257.f_5605 = iParam0;
}

void func_367(var uParam0, int iParam1)//Position - 0x126F8
{
	float fVar0;
	float fVar1;
	var uVar2;
	float fVar3;
	
	if (Global_17257.f_5092 >= 256)
	{
		return;
	}
	if (Global_17257.f_5610 >= 4)
	{
		return;
	}
	if (Global_17257.f_5611 != 1)
	{
		return;
	}
	if (Global_17257.f_5610 >= Global_17257.f_5608)
	{
		return;
	}
	Global_17257.f_3918[Global_17257.f_5092] = uParam0;
	Global_17257.f_5092++;
	Global_17257.f_2124[Global_17257.f_5609 /*5*/][Global_17257.f_5610] = 2;
	Global_17257.f_5610++;
	if (Global_17257.f_5610 >= Global_17257.f_5608)
	{
		fVar0 = func_369();
		if (Global_17257.f_4945[Global_17257.f_5089] && Global_17257.f_5610 == Global_17257.f_5608)
		{
			func_358(26, 1, 0, &fVar1, &uVar2, 0);
			fVar0 = (fVar0 + (fVar1 * 2f));
		}
		if (fVar0 > Global_17257.f_4938[(Global_17257.f_5089 - 1)])
		{
			Global_17257.f_4938[(Global_17257.f_5089 - 1)] = fVar0;
		}
	}
	if (iParam1)
	{
		if (Global_17257.f_5610 >= Global_17257.f_5608)
		{
			fVar3 = func_368();
			if (fVar3 > Global_17257.f_5612[Global_17257.f_5088])
			{
				Global_17257.f_5612[Global_17257.f_5088] = fVar3;
			}
		}
	}
}

float func_368()//Position - 0x12833
{
	int iVar0;
	int iVar1;
	float fVar2;
	var uVar3;
	float fVar4;
	
	iVar0 = 0;
	while (iVar0 < Global_17257.f_5610)
	{
		if (Global_17257.f_2124[Global_17257.f_5609 /*5*/][iVar0] == 4)
		{
			iVar1++;
		}
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 < iVar1)
	{
		if (Global_17257.f_4433[((Global_17257.f_5094 - iVar1) + iVar0)] != 0)
		{
			if (func_358(Global_17257.f_4433[((Global_17257.f_5094 - iVar1) + iVar0)], 1, 0, &uVar3, &fVar4, 0))
			{
				if (fVar4 > fVar2)
				{
					fVar2 = fVar4;
				}
			}
		}
		iVar0++;
	}
	if (fVar2 > ui::_get_text_scale_height(0.35f, 0))
	{
		return fVar2;
	}
	return ui::_get_text_scale_height(0.35f, 0);
}

float func_369()//Position - 0x128E6
{
	float fVar0;
	float fVar1;
	var uVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	int iVar6;
	int iVar7;
	int iVar8;
	int iVar9;
	int iVar10;
	int iVar11;
	
	iVar7 = 0;
	while (iVar7 < Global_17257.f_5610)
	{
		if (Global_17257.f_2124[Global_17257.f_5609 /*5*/][iVar7] == 1)
		{
		}
		else if (Global_17257.f_2124[Global_17257.f_5609 /*5*/][iVar7] == 8)
		{
		}
		else if (Global_17257.f_2124[Global_17257.f_5609 /*5*/][iVar7] == 2)
		{
			iVar3++;
		}
		else if (Global_17257.f_2124[Global_17257.f_5609 /*5*/][iVar7] == 3)
		{
			iVar4++;
		}
		else if (Global_17257.f_2124[Global_17257.f_5609 /*5*/][iVar7] == 4)
		{
			iVar5++;
		}
		else if (Global_17257.f_2124[Global_17257.f_5609 /*5*/][iVar7] == 5)
		{
			iVar6++;
		}
		else if (Global_17257.f_2124[Global_17257.f_5609 /*5*/][iVar7] == 6)
		{
			iVar6++;
		}
		else if (Global_17257.f_2124[Global_17257.f_5609 /*5*/][iVar7] == 7)
		{
			iVar6++;
		}
		iVar7++;
	}
	func_342(0, 1, 0, 0, 0, iVar6 > 0);
	if (gameplay::get_hash_key(&(Global_17257.f_73[Global_17257.f_5609 /*6*/])) != 0)
	{
		ui::_set_text_entry_for_width(&(Global_17257.f_73[Global_17257.f_5609 /*6*/]));
	}
	iVar7 = 0;
	while (iVar7 < Global_17257.f_5610)
	{
		if (Global_17257.f_2124[Global_17257.f_5609 /*5*/][iVar7] == 1)
		{
			iVar8++;
			if (gameplay::get_hash_key(&(Global_17257.f_73[Global_17257.f_5609 /*6*/])) != 0)
			{
				ui::_add_text_component_item_string(&(Global_17257.f_73[(Global_17257.f_5609 + iVar8) /*6*/]));
			}
		}
		else if (Global_17257.f_2124[Global_17257.f_5609 /*5*/][iVar7] == 8)
		{
			iVar8++;
			if (gameplay::get_hash_key(&(Global_17257.f_73[Global_17257.f_5609 /*6*/])) != 0)
			{
				ui::_add_text_component_item_string(&(Global_17257.f_73[(Global_17257.f_5609 + iVar8) /*6*/]));
			}
		}
		else if (Global_17257.f_2124[Global_17257.f_5609 /*5*/][iVar7] == 2)
		{
			if (gameplay::get_hash_key(&(Global_17257.f_73[Global_17257.f_5609 /*6*/])) != 0)
			{
				ui::add_text_component_integer(Global_17257.f_3918[((Global_17257.f_5092 - iVar3) + iVar9)]);
			}
			iVar9++;
		}
		else if (Global_17257.f_2124[Global_17257.f_5609 /*5*/][iVar7] == 3)
		{
			if (gameplay::get_hash_key(&(Global_17257.f_73[Global_17257.f_5609 /*6*/])) != 0)
			{
				ui::add_text_component_float(Global_17257.f_4175[((Global_17257.f_5093 - iVar4) + iVar10)], Global_17257.f_4304[((Global_17257.f_5093 - iVar4) + iVar10)]);
			}
			iVar10++;
		}
		else if (Global_17257.f_2124[Global_17257.f_5609 /*5*/][iVar7] == 5)
		{
			if (gameplay::get_hash_key(&(Global_17257.f_73[Global_17257.f_5609 /*6*/])) != 0)
			{
				ui::add_text_component_substring_player_name(&(Global_2444596[((Global_17257.f_5091 - iVar6) + iVar11) /*16*/]));
			}
			iVar11++;
		}
		else if (Global_17257.f_2124[Global_17257.f_5609 /*5*/][iVar7] == 6)
		{
			if (gameplay::get_hash_key(&(Global_17257.f_73[Global_17257.f_5609 /*6*/])) != 0)
			{
				ui::_add_text_component_item_string(&(Global_2444596[((Global_17257.f_5091 - iVar6) + iVar11) /*16*/]));
			}
			iVar11++;
		}
		else if (Global_17257.f_2124[Global_17257.f_5609 /*5*/][iVar7] == 7)
		{
			if (gameplay::get_hash_key(&(Global_17257.f_73[Global_17257.f_5609 /*6*/])) != 0)
			{
				ui::add_text_component_substring_player_name(&(Global_2444596[((Global_17257.f_5091 - iVar6) + iVar11) /*16*/]));
			}
			iVar11++;
		}
		iVar7++;
	}
	if (gameplay::get_hash_key(&(Global_17257.f_73[Global_17257.f_5609 /*6*/])) != 0)
	{
		fVar0 = ui::_get_text_screen_width(1);
	}
	iVar7 = 0;
	while (iVar7 < iVar5)
	{
		if (Global_17257.f_4433[((Global_17257.f_5094 - iVar5) + iVar7)] != 0)
		{
			func_358(Global_17257.f_4433[((Global_17257.f_5094 - iVar5) + iVar7)], 1, 0, &fVar1, &uVar2, 0);
			fVar0 = (fVar0 + fVar1);
		}
		iVar7++;
	}
	return fVar0;
}

int func_370(var uParam0, int iParam1)//Position - 0x12CC1
{
	int iVar0;
	
	iVar0 = iParam1;
	switch (func_315(uParam0))
	{
		case 0:
			switch (iVar0)
			{
				case 3:
					return 2;
				
				case 1:
					return 3;
				
				case 2:
					return 5;
				
				case 4:
					return 7;
				
				case 0:
					return 2;
				
				case 5:
					return 2;
				
				default:
			}
			break;
		
		case 1:
			switch (iVar0)
			{
				case 3:
					return 1;
				
				case 1:
					return 2;
				
				case 2:
					return 3;
				
				case 4:
					return 8;
				
				case 0:
					return 2;
				
				case 5:
					return 5;
				
				default:
			}
			break;
		
		case 2:
			switch (iVar0)
			{
				case 3:
					return 1;
				
				case 1:
					return 2;
				
				case 2:
					return 4;
				
				case 4:
					return 6;
				
				case 0:
					return 3;
				
				case 5:
					return 4;
				
				default:
			}
			break;
	}
	return 0;
}

bool func_371(int iParam0)//Position - 0x12DBE
{
	if (func_123(func_373(iParam0), -1, 0) >= func_372(iParam0))
	{
		return true;
	}
	return false;
}

int func_372(var uParam0)//Position - 0x12DE0
{
	int iVar0;
	
	iVar0 = uParam0;
	switch (iVar0)
	{
		case 3:
			return 30;
		
		case 1:
			return 15;
		
		case 2:
			return 5;
		
		case 4:
			return 20;
		
		case 0:
			return 10;
		
		case 5:
			return 10;
		
		default:
	}
	return 0;
}

int func_373(var uParam0)//Position - 0x12E35
{
	int iVar0;
	
	iVar0 = uParam0;
	switch (iVar0)
	{
		case 3:
			return 1268;
		
		case 1:
			return 1269;
		
		case 2:
			return 1270;
		
		case 4:
			return 1090;
		
		case 0:
			return 62;
		
		case 5:
			return 63;
		
		default:
	}
	return 3976;
}

void func_374(int iParam0, int iParam1)//Position - 0x12E91
{
	float fVar0;
	float fVar1;
	var uVar2;
	float fVar3;
	
	if (Global_17257.f_5094 >= 128)
	{
		return;
	}
	if (Global_17257.f_5610 >= 4)
	{
		return;
	}
	if (Global_17257.f_5611 != 1)
	{
		return;
	}
	if (Global_17257.f_5610 >= Global_17257.f_5608)
	{
		return;
	}
	Global_17257.f_4433[Global_17257.f_5094] = iParam0;
	Global_17257.f_5094++;
	Global_17257.f_2124[Global_17257.f_5609 /*5*/][Global_17257.f_5610] = 4;
	Global_17257.f_5610++;
	if (Global_17257.f_5610 >= Global_17257.f_5608)
	{
		fVar0 = func_369();
		if (Global_17257.f_4945[Global_17257.f_5089] && Global_17257.f_5610 == Global_17257.f_5608)
		{
			func_358(26, 1, 0, &fVar1, &uVar2, 0);
			fVar0 = (fVar0 + (fVar1 * 2f));
		}
		if (fVar0 > Global_17257.f_4938[(Global_17257.f_5089 - 1)])
		{
			Global_17257.f_4938[(Global_17257.f_5089 - 1)] = fVar0;
		}
	}
	if (iParam1)
	{
		if (Global_17257.f_5610 >= Global_17257.f_5608)
		{
			fVar3 = func_368();
			if (fVar3 > Global_17257.f_5612[Global_17257.f_5088])
			{
				Global_17257.f_5612[Global_17257.f_5088] = fVar3;
			}
		}
	}
}

void func_375(int iParam0, char* sParam1, int iParam2, int iParam3, int iParam4, int iParam5)//Position - 0x12FCB
{
	int iVar0;
	float fVar1;
	float fVar2;
	var uVar3;
	float fVar4;
	
	if (Global_17257.f_5088 > iParam0)
	{
		return;
	}
	if (Global_17257.f_5088 >= 128)
	{
		return;
	}
	if (Global_17257.f_5090 >= 256)
	{
		return;
	}
	if (Global_17257.f_5610 < Global_17257.f_5608)
	{
		return;
	}
	if (Global_17257.f_5088 != iParam0)
	{
		Global_17257.f_5088 = iParam0;
		Global_17257.f_5089 = 0;
	}
	iVar0 = Global_17257.f_4926[Global_17257.f_5089];
	if (iVar0 != 1)
	{
		while (Global_17257.f_5089 < 4 && iVar0 != 1)
		{
			Global_17257.f_5089++;
			iVar0 = Global_17257.f_4926[Global_17257.f_5089];
		}
		if (iVar0 != 1)
		{
			return;
		}
	}
	StringCopy(&(Global_17257.f_73[Global_17257.f_5090 /*6*/]), sParam1, 24);
	if (!gameplay::is_string_null_or_empty(sParam1) && !ui::does_text_label_exist(sParam1))
	{
	}
	Global_17257.f_1610[Global_17257.f_5090] = iParam3;
	Global_17257.f_1867[Global_17257.f_5090] = iParam4;
	Global_17257.f_5090++;
	if (!iParam3)
	{
		func_378(Global_17257.f_5088, 1);
	}
	else
	{
		func_378(Global_17257.f_5088, 0);
	}
	if (iParam2 == 0)
	{
		fVar1 = func_377(&(Global_17257.f_73[Global_17257.f_5090 /*6*/]));
		if (Global_17257.f_4945[Global_17257.f_5089])
		{
			func_358(26, 1, 0, &fVar2, &uVar3, 0);
			fVar1 = (fVar1 + (fVar2 * 2f));
		}
		if (fVar1 > Global_17257.f_4938[Global_17257.f_5089])
		{
			Global_17257.f_4938[Global_17257.f_5089] = fVar1;
		}
	}
	if (iParam5)
	{
		if (iParam2 == 0)
		{
			fVar4 = func_376(&(Global_17257.f_73[Global_17257.f_5090 /*6*/]));
			if (fVar4 > Global_17257.f_5612[iParam0])
			{
				Global_17257.f_5612[iParam0] = fVar4;
			}
		}
	}
	gameplay::set_bit(&(Global_17257.f_4959[iParam0]), Global_17257.f_5089);
	Global_17257.f_5089++;
	Global_17257.f_5611 = 1;
	Global_17257.f_5609 = (Global_17257.f_5090 - 1);
	Global_17257.f_5610 = 0;
	Global_17257.f_5608 = iParam2;
}

float func_376(char* sParam0)//Position - 0x131D7
{
	if (!ui::does_text_label_exist(sParam0))
	{
	}
	return ui::_get_text_scale_height(0.35f, 0);
}

float func_377(char* sParam0)//Position - 0x131F3
{
	if (!gameplay::is_string_null(sParam0))
	{
		if (gameplay::get_hash_key(sParam0) == 0)
		{
			return 0f;
		}
	}
	else
	{
		return 0f;
	}
	func_342(0, 1, 0, 0, 0, 0);
	ui::_set_text_entry_for_width(sParam0);
	return ui::_get_text_screen_width(1);
}

void func_378(int iParam0, int iParam1)//Position - 0x1322F
{
	int iVar0;
	
	iVar0 = system::floor((system::to_float(iParam0) / 32f));
	if (iParam1)
	{
		gameplay::set_bit(&(Global_17257.f_5881[iVar0]), (iParam0 - iVar0 * 32));
	}
	else
	{
		gameplay::clear_bit(&(Global_17257.f_5881[iVar0]), (iParam0 - iVar0 * 32));
	}
}

char* func_379(int iParam0)//Position - 0x1327B
{
	int iVar0;
	
	iVar0 = iParam0;
	switch (iVar0)
	{
		case 3:
			return "SNK_ITEM1";
		
		case 1:
			return "SNK_ITEM2";
		
		case 2:
			return "SNK_ITEM3";
		
		case 4:
			return "SNK_ITEM4";
		
		case 0:
			return "SNK_ITEM5";
		
		case 5:
			return "SNK_ITEM6";
		
		default:
	}
	return "";
}

void func_380(int iParam0, char* sParam1, char* sParam2)//Position - 0x132E0
{
	Global_17257 = iParam0;
	func_381(29, sParam1, sParam2);
}

void func_381(int iParam0, char* sParam1, char* sParam2)//Position - 0x132F7
{
	StringCopy(&(Global_17257.f_5886[iParam0 /*16*/]), sParam1, 64);
	StringCopy(&(Global_17257.f_6703[iParam0 /*16*/]), sParam2, 64);
}

void func_382(char* sParam0)//Position - 0x1331B
{
	int iVar0;
	
	StringCopy(&(Global_17257.f_1), sParam0, 16);
	Global_17257.f_68 = 0;
	Global_17257.f_69 = 0;
	Global_17257.f_70 = 0;
	Global_17257.f_71 = 0;
	Global_17257.f_72 = 0;
	iVar0 = 0;
	while (iVar0 < 4)
	{
		Global_17257.f_5[iVar0] = 0;
		iVar0++;
	}
}

void func_383(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4)//Position - 0x13366
{
	Global_17257.f_4953[0] = iParam0;
	Global_17257.f_4953[1] = iParam1;
	Global_17257.f_4953[2] = iParam2;
	Global_17257.f_4953[3] = iParam3;
	Global_17257.f_4953[4] = iParam4;
}

void func_384(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4)//Position - 0x133A5
{
	Global_17257.f_4926[0] = iParam0;
	Global_17257.f_4926[1] = iParam1;
	Global_17257.f_4926[2] = iParam2;
	Global_17257.f_4926[3] = iParam3;
	Global_17257.f_4926[4] = iParam4;
	Global_17257.f_5096 = 0;
	if (iParam0 != 0)
	{
		Global_17257.f_5096++;
	}
	if (iParam1 != 0)
	{
		Global_17257.f_5096++;
	}
	if (iParam2 != 0)
	{
		Global_17257.f_5096++;
	}
	if (iParam3 != 0)
	{
		Global_17257.f_5096++;
	}
	if (iParam4 != 0)
	{
		Global_17257.f_5096++;
	}
}

void func_385(int iParam0)//Position - 0x1344F
{
	int iVar0;
	int iVar1;
	float fVar2;
	
	iVar0 = 0;
	while (iVar0 < 256)
	{
		StringCopy(&(Global_17257.f_73[iVar0 /*6*/]), "", 24);
		iVar1 = 0;
		while (iVar1 < 4)
		{
			Global_17257.f_2124[iVar0 /*5*/][iVar1] = 0;
			iVar1++;
		}
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 < 32)
	{
		StringCopy(&(Global_2444596[iVar0 /*16*/]), "", 64);
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 < 256)
	{
		Global_17257.f_3918[iVar0] = 0;
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 < 128)
	{
		Global_17257.f_4175[iVar0] = 0f;
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 < 128)
	{
		Global_17257.f_4433[iVar0] = 0;
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 < 128)
	{
		Global_17257.f_4959[iVar0] = 0;
		Global_17257.f_5097[iVar0] = 0;
		Global_17257.f_5226[iVar0] = 0;
		Global_17257.f_5746[iVar0] = 0f;
		Global_17257.f_5355[iVar0] = 0;
		Global_17257.f_5612[iVar0] = 0f;
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 < 5)
	{
		Global_17257.f_4926[iVar0] = 0;
		Global_17257.f_4938[iVar0] = 0f;
		Global_17257.f_4932[iVar0] = -1f;
		Global_17257.f_4945[iVar0] = 0;
		Global_17257.f_4953[iVar0] = 1;
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 < 12)
	{
		StringCopy(&(Global_17257.f_4834[iVar0 /*4*/]), "", 16);
		Global_17257.f_4883[iVar0] = -1;
		Global_17257.f_4896[iVar0] = 345;
		Global_17257.f_4909[iVar0] = 32;
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 < 51)
	{
		StringCopy(&(Global_17257.f_5886[iVar0 /*16*/]), "", 64);
		StringCopy(&(Global_17257.f_6703[iVar0 /*16*/]), "", 64);
		iVar0++;
	}
	StringCopy(&(Global_2566711.f_16), "", 16);
	Global_2566711.f_20 = -1;
	Global_17257 = 0;
	Global_17257.f_5088 = 0;
	Global_17257.f_5089 = 0;
	Global_17257.f_5090 = 0;
	Global_17257.f_5092 = 0;
	Global_17257.f_5093 = 0;
	Global_17257.f_5094 = 0;
	Global_17257.f_5091 = 0;
	Global_17257.f_5741 = 0;
	Global_17257.f_5606 = 0;
	Global_17257.f_5605 = 0;
	Global_17257.f_5607 = 0;
	StringCopy(&(Global_17257.f_4562), "", 16);
	Global_17257.f_4632 = 0;
	Global_17257.f_4633 = 0;
	Global_17257.f_4634 = 0;
	Global_17257.f_4635 = 0;
	Global_17257.f_4636 = 0;
	Global_17257.f_4637 = 0;
	iVar0 = 0;
	while (iVar0 < 4)
	{
		Global_17257.f_4566[iVar0] = 0;
		iVar0++;
	}
	Global_17257.f_4638 = 0;
	StringCopy(&(Global_2566711.f_21), "", 16);
	Global_2566711.f_61 = 0;
	Global_2566711.f_62 = 0;
	Global_2566711.f_63 = 0;
	Global_2566711.f_64 = 0;
	Global_2566711.f_65 = 0;
	Global_2566711.f_66 = 0;
	iVar0 = 0;
	while (iVar0 < 4)
	{
		Global_2566711.f_25[iVar0] = 0;
		iVar0++;
	}
	Global_2566711.f_67 = 0;
	StringCopy(&(Global_17257.f_1), "", 16);
	Global_17257.f_4944 = 0f;
	Global_17257.f_68 = 0;
	Global_17257.f_69 = 0;
	Global_17257.f_70 = 0;
	Global_17257.f_71 = 0;
	Global_17257.f_72 = 0;
	iVar0 = 0;
	while (iVar0 < 4)
	{
		Global_17257.f_5[iVar0] = 0;
		iVar0++;
	}
	Global_17257.f_5611 = 0;
	Global_17257.f_5610 = 0;
	Global_17257.f_5608 = 0;
	Global_17257.f_5609 = 0;
	Global_17257.f_4639 = 0;
	Global_17257.f_4640 = 0;
	Global_17257.f_5095 = 10;
	Global_17257.f_5096 = 0;
	Global_17257.f_5743 = 0f;
	Global_17257.f_5744 = 0f;
	Global_17257.f_5598 = 0;
	Global_17257.f_5599 = 0;
	Global_17257.f_5600 = 0f;
	Global_17257.f_5601 = 0;
	Global_17257.f_5603 = 0;
	Global_17257.f_5602 = 0;
	Global_17257.f_5604 = 0;
	Global_17257.f_7890 = 0;
	iVar0 = 0;
	while (iVar0 < 2)
	{
		Global_17257.f_5875[iVar0] = -1;
		Global_17257.f_5878[iVar0] = -1;
		iVar0++;
	}
	Global_17257.f_4951 = 0f;
	Global_17257.f_4922 = 0;
	Global_17257.f_4952 = 0;
	iVar0 = 0;
	while (iVar0 < Global_17257.f_5881)
	{
		Global_17257.f_5881[iVar0] = 0;
		iVar0++;
	}
	Global_17257.f_7869 = 0;
	Global_17257.f_7864 = 0;
	Global_17257.f_7874 = 0;
	Global_17257.f_7879 = 0;
	Global_17257.f_7884 = 0;
	Global_17257.f_7886 = 0;
	Global_17257.f_7892 = 0;
	Global_17254 = 0.05f;
	Global_17255 = 0.05f;
	Global_17256 = 0.225f;
	fVar2 = graphics::_get_screen_aspect_ratio(0);
	if (iParam0)
	{
		Global_17256 = (0.225f * ((16f / 9f) / fVar2));
	}
	else if (fVar2 < 1.77777f)
	{
		Global_17256 = (0.225f * ((16f / 9f) / fVar2));
	}
	else
	{
		Global_17256 = 0.225f;
	}
}

bool func_386(int iParam0, var uParam1, var uParam2, var uParam3)//Position - 0x1390D
{
	vector3 vVar0;
	float fVar3;
	
	switch (iParam0)
	{
		case 0:
			*uParam1 = { object::_get_object_offset_from_coords(-706.6382f, -913.6887f, 19.21f, -89.999f, 2.40015f, -7.75244f, 1.0825f) };
			*uParam2 = -4.2069f;
			uParam2->f_1 = -0.027f;
			uParam2->f_2 = (-89.999f + 22.8175f);
			*uParam3 = 32.8283f;
			break;
		
		case 1:
			*uParam1 = { object::_get_object_offset_from_coords(-47.19871f, -1757.67f, 29.42f, -130f, 2.40015f, -7.75244f, 1.0825f) };
			*uParam2 = -4.2069f;
			uParam2->f_1 = -0.027f;
			uParam2->f_2 = (-130f + 22.8175f);
			*uParam3 = 32.8283f;
			break;
		
		case 2:
			*uParam1 = { object::_get_object_offset_from_coords(1164.21f, -322.89f, 69.2f, -80f, 2.40015f, -7.75244f, 1.0825f) };
			*uParam2 = -4.2069f;
			uParam2->f_1 = -0.027f;
			uParam2->f_2 = (-80f + 22.8175f);
			*uParam3 = 32.8283f;
			break;
		
		case 3:
			*uParam1 = { object::_get_object_offset_from_coords(1698.307f, 4923.371f, 42.06f, 145f, 2.40015f, -7.75244f, 1.0825f) };
			*uParam2 = -4.2069f;
			uParam2->f_1 = -0.027f;
			uParam2->f_2 = (145f + 22.8175f);
			*uParam3 = 32.8283f;
			break;
		
		case 4:
			*uParam1 = { object::_get_object_offset_from_coords(-1820.465f, 793.8166f, 138.09f, -47.53f, 2.40015f, -7.75244f, 1.0825f) };
			*uParam2 = -4.2069f;
			uParam2->f_1 = -0.027f;
			uParam2->f_2 = (-47.53f + 22.8175f);
			*uParam3 = 32.8283f;
			break;
		
		case 5:
			vVar0 = { 1165.958f, 2710.201f, 38.14286f };
			fVar3 = -1.15f;
			*uParam1 = { object::_get_object_offset_from_coords(vVar0, fVar3, 3.80296f, -5.391f, 1.213f) };
			*uParam2 = -9.3866f;
			uParam2->f_1 = -0.0011f;
			uParam2->f_2 = (fVar3 + 46.9866f);
			*uParam3 = 35f;
			break;
		
		case 6:
			vVar0 = { -2967.027f, 390.9038f, 15.02f };
			fVar3 = -94.76f;
			*uParam1 = { object::_get_object_offset_from_coords(vVar0, fVar3, 3.80296f, -5.391f, 1.213f) };
			*uParam2 = -9.3866f;
			uParam2->f_1 = -0.0011f;
			uParam2->f_2 = (fVar3 + 46.9866f);
			*uParam3 = 35f;
			break;
		
		case 7:
			vVar0 = { -1222.331f, -907.8234f, 12.31f };
			fVar3 = -147.297f;
			*uParam1 = { object::_get_object_offset_from_coords(vVar0, fVar3, 3.80296f, -5.391f, 1.213f) };
			*uParam2 = -9.3866f;
			uParam2->f_1 = -0.0011f;
			uParam2->f_2 = (fVar3 + 46.9866f);
			*uParam3 = 35f;
			break;
		
		case 8:
			vVar0 = { 1134.811f, -982.3615f, 46.4f };
			fVar3 = 96.68562f;
			*uParam1 = { object::_get_object_offset_from_coords(vVar0, fVar3, 3.80296f, -5.391f, 1.213f) };
			*uParam2 = -9.3866f;
			uParam2->f_1 = -0.0011f;
			uParam2->f_2 = (fVar3 + 46.9866f);
			*uParam3 = 35f;
			break;
		
		case 9:
			vVar0 = { -1486.673f, -378.4638f, 40.15f };
			fVar3 = -46.229f;
			*uParam1 = { object::_get_object_offset_from_coords(vVar0, fVar3, 3.80296f, -5.391f, 1.213f) };
			*uParam2 = -9.3866f;
			uParam2->f_1 = -0.0011f;
			uParam2->f_2 = (fVar3 + 46.9866f);
			*uParam3 = 35f;
			break;
		
		case 10:
			vVar0 = { -3244.573f, 1000.658f, 12.83f };
			fVar3 = 175.074f;
			*uParam1 = { object::_get_object_offset_from_coords(vVar0, fVar3, 2.97963f, -3.39452f, 0.934498f) };
			*uParam2 = -8.483f;
			uParam2->f_1 = 0.0149f;
			uParam2->f_2 = (fVar3 + 53.5519f);
			*uParam3 = 35f;
			break;
		
		case 11:
			vVar0 = { -3041.357f, 584.2665f, 7.9f };
			fVar3 = -162.241f;
			*uParam1 = { object::_get_object_offset_from_coords(vVar0, fVar3, 2.97963f, -3.39452f, 0.934498f) };
			*uParam2 = -8.483f;
			uParam2->f_1 = 0.0149f;
			uParam2->f_2 = (fVar3 + 53.5519f);
			*uParam3 = 35f;
			break;
		
		case 12:
			vVar0 = { 548.9015f, 2668.941f, 42.15f };
			fVar3 = -82.5f;
			*uParam1 = { object::_get_object_offset_from_coords(vVar0, fVar3, 2.97963f, -3.39452f, 0.934498f) };
			*uParam2 = -8.483f;
			uParam2->f_1 = 0.0149f;
			uParam2->f_2 = (fVar3 + 53.5519f);
			*uParam3 = 35f;
			break;
		
		case 13:
			vVar0 = { 2554.875f, 381.3857f, 108.62f };
			fVar3 = 177.716f;
			*uParam1 = { object::_get_object_offset_from_coords(vVar0, fVar3, 2.97963f, -3.39452f, 0.934498f) };
			*uParam2 = -8.483f;
			uParam2->f_1 = 0.0149f;
			uParam2->f_2 = (fVar3 + 53.5519f);
			*uParam3 = 35f;
			break;
		
		case 14:
			vVar0 = { 2676.212f, 3280.969f, 55.24f };
			fVar3 = 150.87f;
			*uParam1 = { object::_get_object_offset_from_coords(vVar0, fVar3, 2.97963f, -3.39452f, 0.934498f) };
			*uParam2 = -8.483f;
			uParam2->f_1 = 0.0149f;
			uParam2->f_2 = (fVar3 + 53.5519f);
			*uParam3 = 35f;
			break;
		
		case 15:
			vVar0 = { 1729.329f, 6417.123f, 35.03f };
			fVar3 = 63.641f;
			*uParam1 = { object::_get_object_offset_from_coords(vVar0, fVar3, 2.97963f, -3.39452f, 0.934498f) };
			*uParam2 = -8.483f;
			uParam2->f_1 = 0.0149f;
			uParam2->f_2 = (fVar3 + 53.5519f);
			*uParam3 = 35f;
			break;
		
		case 16:
			vVar0 = { 1959.323f, 3742.29f, 32.34f };
			fVar3 = 120f;
			*uParam1 = { object::_get_object_offset_from_coords(vVar0, fVar3, 2.97963f, -3.39452f, 0.934498f) };
			*uParam2 = -8.483f;
			uParam2->f_1 = 0.0149f;
			uParam2->f_2 = (fVar3 + 53.5519f);
			*uParam3 = 35f;
			break;
		
		case 17:
			vVar0 = { 24.94562f, -1344.954f, 29.49f };
			fVar3 = 90f;
			*uParam1 = { object::_get_object_offset_from_coords(vVar0, fVar3, 2.97963f, -3.39452f, 0.934498f) };
			*uParam2 = -8.483f;
			uParam2->f_1 = 0.0149f;
			uParam2->f_2 = (fVar3 + 53.5519f);
			*uParam3 = 35f;
			break;
		
		case 18:
			vVar0 = { 373.5954f, 328.5892f, 103.56f };
			fVar3 = 75.885f;
			*uParam1 = { object::_get_object_offset_from_coords(vVar0, fVar3, 2.97963f, -3.39452f, 0.934498f) };
			*uParam2 = -8.483f;
			uParam2->f_1 = 0.0149f;
			uParam2->f_2 = (fVar3 + 53.5519f);
			*uParam3 = 35f;
			break;
		
		case -2:
			*uParam1 = { 1390.653f, 3598.966f, 35.6115f };
			*uParam2 = { -3.6091f, 0.022f, -8.6461f };
			*uParam3 = 35f;
			break;
	}
	return true;
}

void func_387()//Position - 0x140A9
{
	if (gameplay::is_pc_version())
	{
		controls::_0xFC695459D4D0E219(0.325f, 0.3f);
	}
}

void func_388(int iParam0, int iParam1)//Position - 0x140C7
{
	if (!func_302(player::player_id(), 1) || iParam1)
	{
		if (!func_393())
		{
			Global_1312416.f_1 = 1;
			Global_1610705[player::player_id() /*178*/].f_9 = 1;
			if (iParam0 == 1)
			{
				Global_1312416.f_2 = 1;
			}
			func_389();
		}
	}
}

void func_389()//Position - 0x14117
{
	if (!func_393())
	{
		Global_1312416 = 1;
		func_392();
		if (((!network::network_is_activity_session() && !func_391()) && !func_390(player::player_id())) && !func_135(player::player_id()))
		{
			Global_978174 = 1;
		}
		Global_1610705[player::player_id() /*178*/].f_8 = 1;
	}
}

bool func_390(int iParam0)//Position - 0x14170
{
	if (func_302(iParam0, 1))
	{
		if (Global_1587816[iParam0 /*444*/] != 6)
		{
			return true;
		}
	}
	return false;
}

var func_391()//Position - 0x14194
{
	return Global_2434839.f_716;
}

void func_392()//Position - 0x141A3
{
	if (network::network_is_game_in_progress())
	{
		if (!func_393())
		{
			if (func_44(player::player_id(), 1, 0))
			{
				ped::set_ped_can_be_dragged_out(player::player_ped_id(), 1);
				ped::set_ped_config_flag(player::player_ped_id(), 342, false);
				ped::set_ped_config_flag(player::player_ped_id(), 122, false);
			}
			player::set_player_vehicle_defense_modifier(player::player_id(), 1f);
			network::_0x1B857666604B1A74(0);
			network::network_set_friendly_fire_option(1);
			if (Global_1312416.f_1 == 0 || Global_1312416.f_2 == 1)
			{
				Global_1312416.f_2 = 0;
				network::use_player_colour_instead_of_team_colour(0, 0);
			}
		}
		else
		{
			if (func_44(player::player_id(), 1, 1))
			{
				ped::set_ped_can_be_dragged_out(player::player_ped_id(), 0);
				weapon::set_current_ped_weapon(player::player_ped_id(), joaat("weapon_unarmed"), true);
				ped::set_ped_config_flag(player::player_ped_id(), 342, true);
				ped::set_ped_config_flag(player::player_ped_id(), 122, true);
				player::set_player_vehicle_defense_modifier(player::player_id(), 0.5f);
				if (Global_1312416.f_1 == 0 || Global_1312416.f_2 == 1)
				{
					network::use_player_colour_instead_of_team_colour(1, 0);
				}
			}
			network::_0x1B857666604B1A74(1);
			network::network_set_friendly_fire_option(0);
		}
	}
}

var func_393()//Position - 0x14294
{
	return Global_1312416;
}

void func_394(int iParam0)//Position - 0x142A0
{
	func_395(iParam0, 0f);
}

void func_395(int iParam0, float fParam1)//Position - 0x142AF
{
	iParam0->f_1 = (func_318(gameplay::is_bit_set(*iParam0, 4)) - fParam1);
	gameplay::set_bit(iParam0, 1);
	gameplay::clear_bit(iParam0, 2);
	iParam0->f_2 = 0f;
}

bool func_396(int iParam0, int iParam1)//Position - 0x142DD
{
	int iVar0;
	
	iVar0 = func_282(iParam0);
	if (iVar0 == -1)
	{
		return false;
	}
	if (!player::is_player_playing(player::get_player_index()))
	{
		return false;
	}
	if (func_164(0))
	{
		return false;
	}
	if (cutscene::is_cutscene_playing())
	{
		return false;
	}
	if (iVar0 > -1 && iVar0 < 6)
	{
		if (Global_36442[iVar0 /*32*/] == 1 && Global_36442[iVar0 /*32*/].f_4 == 1)
		{
			if (iParam1)
			{
				if (Global_36442[iVar0 /*32*/].f_29)
				{
					return false;
				}
			}
			Global_36442[iVar0 /*32*/].f_5 = 1;
			Global_36442[iVar0 /*32*/].f_29 = 1;
			return true;
		}
		else
		{
			if (Global_36442[iVar0 /*32*/] == 0)
			{
			}
			if (Global_36442[iVar0 /*32*/].f_7)
			{
			}
		}
	}
	return false;
}

bool func_397()//Position - 0x14395
{
	if (Global_101186.f_25011.f_145 > 0)
	{
		return false;
	}
	return true;
}

var func_398()//Position - 0x143B2
{
	return Global_17116;
}

bool func_399(int iParam0, var uParam1, float fParam2, var uParam3, var uParam4, var uParam5, var uParam6)//Position - 0x143BD
{
	switch (iParam0)
	{
		case 0:
		case 1:
		case 2:
		case 3:
		case 4:
			*uParam3 = { object::_get_object_offset_from_coords(*uParam1, fParam2, 1.46991f, -0.814453f, -0.97226f) };
			*uParam4 = { object::_get_object_offset_from_coords(*uParam1, fParam2, -1.5828f, -0.814453f, 0.84774f) };
			*uParam5 = { object::_get_object_offset_from_coords(*uParam1, fParam2, 0.0586548f, 0.178162f, 0f) };
			*uParam6 = 0.75f;
			break;
		
		case 5:
		case 6:
		case 7:
		case 8:
		case 9:
			*uParam3 = { object::_get_object_offset_from_coords(*uParam1, fParam2, -1.55054f, -0.920414f, -0.998837f) };
			*uParam4 = { object::_get_object_offset_from_coords(*uParam1, fParam2, 1.54138f, -0.920414f, 0.901165f) };
			*uParam5 = { object::_get_object_offset_from_coords(*uParam1, fParam2, 0.0586548f, 0.178162f, 0f) };
			*uParam6 = 0.75f;
			break;
		
		case 10:
		case 11:
		case 12:
		case 13:
		case 14:
		case 15:
		case 16:
		case 17:
		case 18:
			*uParam3 = { object::_get_object_offset_from_coords(*uParam1, fParam2, -2.60296f, -0.851523f, -0.999289f) };
			*uParam4 = { object::_get_object_offset_from_coords(*uParam1, fParam2, 0.443411f, -0.851523f, 0.820711f) };
			*uParam5 = { object::_get_object_offset_from_coords(*uParam1, fParam2, -1.17421f, 0.39005f, 0f) };
			*uParam6 = 0.75f;
			break;
		
		case -2:
			*uParam3 = { 1390.955f, 3604.379f, 33.98091f };
			*uParam4 = { 1394.475f, 3605.664f, 35.98091f };
			*uParam5 = { 1392.551f, 3605.449f, 35.30949f };
			*uParam6 = 0.75f;
			break;
	}
	return true;
}

int func_400(int iParam0, int iParam1)//Position - 0x145A3
{
	return gameplay::is_bit_set(Global_2418529[iParam0 /*313*/].f_206, iParam1);
}

void func_401(var uParam0, var uParam1)//Position - 0x145BC
{
	ai::clear_ped_tasks(player::player_ped_id());
	func_438(player::player_id(), 1, 0);
	cam::set_gameplay_cam_relative_heading(0f);
	cam::set_gameplay_cam_relative_pitch(0f, 1065353216);
	if (uParam0->f_51 > 0)
	{
		*uParam1 = uParam0->f_51;
		uParam0->f_51 = 0;
	}
	func_422();
	gameplay::clear_bit(&(uParam0->f_53), 7);
	if (func_143("SHR_MENU"))
	{
		ui::clear_help(1);
	}
	if (uParam0->f_14 != -1)
	{
		func_281(&(uParam0->f_14));
	}
	if (cam::does_cam_exist(uParam0->f_1))
	{
		cam::destroy_cam(uParam0->f_1, 0);
	}
	cam::render_script_cams(false, false, 3000, 1, 0, 0);
}

int func_402(float fParam0)//Position - 0x14646
{
	if (entity::does_entity_exist(player::player_ped_id()) && !entity::is_entity_dead(player::player_ped_id(), 0))
	{
		if (fParam0 <= 0f)
		{
			return ped::_0x5407B7288D0478B7(player::player_ped_id()) > 0;
		}
		else
		{
			return ped::_0x336B3D200AB007CB(player::player_ped_id(), entity::get_entity_coords(player::player_ped_id(), 1), fParam0) > 0;
		}
	}
	return false;
}

bool func_403(int iParam0, var uParam1, int iParam2, int iParam3)//Position - 0x14698
{
	if (iParam2 == -1)
	{
		return true;
	}
	if (network::network_is_game_in_progress() && !iParam3)
	{
		if (gameplay::absi(network::get_time_difference(network::get_network_time(), iParam0)) >= iParam2)
		{
			return true;
		}
	}
	else if (gameplay::absi(network::get_time_difference(gameplay::get_game_timer(), iParam0)) >= iParam2)
	{
		return true;
	}
	return false;
}

bool func_404(var uParam0)//Position - 0x146EB
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < 6)
	{
		if ((*uParam0)[iVar0] < 10)
		{
			return false;
		}
		iVar0++;
	}
	return true;
}

void func_405()//Position - 0x14715
{
	ai::open_sequence_task(&iLocal_565);
	ai::task_look_at_entity(0, player::player_ped_id(), -1, 0, 2);
	ai::task_play_anim(0, "mp_am_hold_up", "handsup_enter", 8f, -8f, -1, 262192, 0f, 0, 0, 0);
	ai::task_play_anim(0, "mp_am_hold_up", "handsup_base", 8f, -4f, -1, 262193, 0f, 0, 0, 0);
	ai::close_sequence_task(iLocal_565);
	ai::open_sequence_task(&iLocal_566);
	ai::task_play_anim(0, "mp_am_hold_up", "handsup_base", 4f, -4f, -1, 262193, 0f, 0, 0, 0);
	ai::close_sequence_task(iLocal_566);
	ai::open_sequence_task(&iLocal_567);
	ai::task_follow_nav_mesh_to_coord(0, vLocal_552, 2f, -1, 0.25f, 0, fLocal_555);
	ai::task_play_anim(0, "mp_am_hold_up", "cower_intro", 8f, -4f, -1, 262144, 0f, 0, 0, 0);
	ai::task_play_anim(0, "mp_am_hold_up", "cower_loop", 8f, -4f, -1, 270337, 0f, 0, 0, 0);
	ai::task_smart_flee_coord(0, vLocal_552, 250f, -1, 1, 0);
	ai::task_set_blocking_of_non_temporary_events(0, 0);
	ai::close_sequence_task(iLocal_567);
	ai::open_sequence_task(&iLocal_569);
	ai::task_play_anim(0, "mp_am_hold_up", "cower_intro", 8f, -4f, -1, 262144, 0f, 0, 0, 0);
	ai::task_play_anim(0, "mp_am_hold_up", "cower_loop", 8f, -4f, -1, 270337, 0f, 0, 0, 0);
	ai::task_set_blocking_of_non_temporary_events(0, 0);
	ai::close_sequence_task(iLocal_569);
	ai::open_sequence_task(&iLocal_568);
	ai::task_follow_nav_mesh_to_coord(0, vLocal_552, 2f, -1, 0.25f, 0, (fLocal_555 - 180f));
	ai::task_swap_weapon(0, 1);
	ai::task_combat_hated_targets_around_ped(0, 20f, 0);
	ai::close_sequence_task(iLocal_568);
}

void func_406(var uParam0, int iParam1, int iParam2, char* sParam3, int iParam4, int iParam5)//Position - 0x1489C
{
	if ((uParam0[iParam1 /*10*/])->f_7 == 1)
	{
	}
	(*uParam0)[iParam1 /*10*/] = iParam2;
	StringCopy(&((uParam0[iParam1 /*10*/])->f_1), sParam3, 24);
	(uParam0[iParam1 /*10*/])->f_7 = 1;
	(uParam0[iParam1 /*10*/])->f_8 = iParam4;
	(uParam0[iParam1 /*10*/])->f_9 = iParam5;
	if (!Global_69521)
	{
		if (!ped::is_ped_injured(iParam2))
		{
			if ((uParam0[iParam1 /*10*/])->f_8 == 0)
			{
				ped::set_ped_can_play_ambient_anims(iParam2, 0);
			}
			else
			{
				ped::set_ped_can_play_ambient_anims(iParam2, 1);
			}
		}
		if (!ped::is_ped_injured(iParam2))
		{
			if ((uParam0[iParam1 /*10*/])->f_9 == 0)
			{
				ped::set_ped_can_use_auto_conversation_lookat(iParam2, 0);
			}
			else
			{
				ped::set_ped_can_use_auto_conversation_lookat(iParam2, 1);
			}
		}
	}
}

int func_407(int iParam0)//Position - 0x14937
{
	if (network::network_does_network_id_exist(iParam0))
	{
		return ped::is_ped_injured(network::net_to_ped(iParam0));
	}
	return true;
}

var func_408()//Position - 0x14956
{
	return Local_96.f_12;
}

char* func_409(int iParam0)//Position - 0x14962
{
	switch (iParam0)
	{
		case 0:
		case 1:
		case 2:
		case 3:
		case 4:
			return "ShopUI_Title_GasStation";
		
		case 5:
			return "ShopUI_Title_LiquorStore3";
		
		case 6:
		case 7:
		case 8:
		case 9:
			return "ShopUI_Title_LiquorStore2";
		
		case 10:
		case 11:
		case 12:
		case 13:
		case 14:
		case 15:
		case 16:
		case 17:
		case 18:
			return "ShopUI_Title_ConvenienceStore";
		
		case -2:
			return "ShopUI_Title_LiquorStore";
		
		default:
	}
	return "NULL";
}

bool func_410()//Position - 0x14A0E
{
	vector3 vVar0;
	
	if (func_418(&(Local_490.f_50), 0))
	{
		func_416(Local_490.f_50, &iLocal_589, &iLocal_590, &iLocal_591, &iLocal_592, &vLocal_593, &vLocal_596);
		func_415(Local_490.f_50, &vLocal_599, &vLocal_602, &fLocal_605);
		func_414(Local_490.f_50, &vLocal_606, &vLocal_609, &fLocal_612);
		switch (Local_490.f_50)
		{
			case 0:
				vLocal_557 = { 1393.1f, 3605.89f, (35.2f - 0.2f) };
				vLocal_560 = { 0f, 0f, 21.89f };
				iLocal_548 = func_50(0);
				vLocal_552 = { 1394.852f, 3609.509f, 33.9809f };
				fLocal_555 = 116.5329f;
				iLocal_584 = 1;
				if (func_412(6, 18))
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 0;
					iLocal_778[1] = 0;
					iLocal_784[1] = 0;
					iLocal_778[2] = 0;
					iLocal_784[2] = 0;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 0;
					iLocal_784[4] = 0;
				}
				else
				{
					iLocal_778[0] = 1;
					iLocal_784[0] = 0;
					iLocal_778[1] = 1;
					iLocal_784[1] = 1;
					iLocal_778[2] = 1;
					iLocal_784[2] = 2;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 0;
					iLocal_784[4] = 0;
				}
				break;
			
			case 1:
				vLocal_560 = { 0f, 0f, -160f };
				vLocal_557 = { -3041.38f, 584.35f, (8.11f - 0.2f) };
				iLocal_548 = func_50(0);
				vLocal_552 = { -3047.512f, 588.9807f, 6.9089f };
				fLocal_555 = 178.8753f;
				iLocal_584 = 1;
				if (func_412(6, 18))
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 1;
					iLocal_778[1] = 1;
					iLocal_784[1] = 0;
					iLocal_778[2] = 0;
					iLocal_784[2] = 1;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 0;
					iLocal_784[4] = 1;
				}
				else
				{
					iLocal_778[0] = 2;
					iLocal_784[0] = 0;
					iLocal_778[1] = 0;
					iLocal_784[1] = 0;
					iLocal_778[2] = 1;
					iLocal_784[2] = 2;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 0;
					iLocal_784[4] = 1;
				}
				break;
			
			case 2:
				vLocal_557 = { -3244.56f, 1000.74f, (13.03f - 0.2f) };
				vLocal_560 = { 0f, 0f, 175.52f };
				iLocal_548 = func_50(0);
				vLocal_552 = { -3249.114f, 1006.558f, 11.8307f };
				fLocal_555 = 191.594f;
				iLocal_584 = 1;
				if (func_412(6, 18))
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 2;
					iLocal_778[1] = 1;
					iLocal_784[1] = 1;
					iLocal_778[2] = 0;
					iLocal_784[2] = 2;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 0;
					iLocal_784[4] = 2;
				}
				else
				{
					iLocal_778[0] = 2;
					iLocal_784[0] = 1;
					iLocal_778[1] = 0;
					iLocal_784[1] = 0;
					iLocal_778[2] = 1;
					iLocal_784[2] = 0;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 0;
					iLocal_784[4] = 2;
				}
				break;
			
			case 3:
				vLocal_560 = { 0f, 0f, -82.38f };
				vLocal_557 = { 548.82f, 2668.93f, (42.36f - 0.2f) };
				iLocal_548 = func_50(0);
				vLocal_552 = { 543.0796f, 2663.967f, 41.1565f };
				fLocal_555 = 228.4295f;
				iLocal_584 = 1;
				if (func_412(6, 18))
				{
					iLocal_778[0] = 1;
					iLocal_784[0] = 0;
					iLocal_778[1] = 2;
					iLocal_784[1] = 0;
					iLocal_778[2] = 1;
					iLocal_784[2] = 0;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 0;
					iLocal_784[4] = 0;
				}
				else
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 0;
					iLocal_778[1] = 2;
					iLocal_784[1] = 1;
					iLocal_778[2] = 1;
					iLocal_784[2] = 1;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 0;
					iLocal_784[4] = 0;
				}
				break;
			
			case 4:
				vLocal_560 = { 0f, 0f, 180f };
				vLocal_557 = { 2554.88f, 381.47f, (108.82f - 0.2f) };
				iLocal_548 = func_50(0);
				vLocal_552 = { 2549.85f, 387.1622f, 107.623f };
				fLocal_555 = 197.2994f;
				iLocal_584 = 1;
				if (func_412(6, 18))
				{
					iLocal_778[0] = 2;
					iLocal_784[0] = 0;
					iLocal_778[1] = 2;
					iLocal_784[1] = 1;
					iLocal_778[2] = 1;
					iLocal_784[2] = 1;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 0;
					iLocal_784[4] = 1;
				}
				else
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 1;
					iLocal_778[1] = 1;
					iLocal_784[1] = 0;
					iLocal_778[2] = 0;
					iLocal_784[2] = 2;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 0;
					iLocal_784[4] = 1;
				}
				break;
			
			case 5:
				vLocal_560 = { 0f, 0f, 155f };
				vLocal_557 = { 2676.26f, 3281.04f, (55.44f - 0.2f) };
				iLocal_548 = func_50(0);
				vLocal_552 = { 2671.351f, 3283.136f, 54.2411f };
				fLocal_555 = 296.5427f;
				iLocal_584 = 1;
				if (func_412(6, 18))
				{
					iLocal_778[0] = 2;
					iLocal_784[0] = 1;
					iLocal_778[1] = 0;
					iLocal_784[1] = 0;
					iLocal_778[2] = 1;
					iLocal_784[2] = 2;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 0;
					iLocal_784[4] = 2;
				}
				else
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 2;
					iLocal_778[1] = 2;
					iLocal_784[1] = 1;
					iLocal_778[2] = 0;
					iLocal_784[2] = 2;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 0;
					iLocal_784[4] = 2;
				}
				break;
			
			case 6:
				vLocal_560 = { 0f, 0f, 63.3f };
				vLocal_557 = { 1729.4f, 6417.08f, (35.24f - 0.2f) };
				iLocal_548 = func_50(0);
				vLocal_552 = { 1733.967f, 6421.495f, 34.0372f };
				fLocal_555 = 130.9518f;
				iLocal_584 = 1;
				if (func_412(6, 18))
				{
					iLocal_778[0] = 2;
					iLocal_784[0] = 2;
					iLocal_778[1] = 1;
					iLocal_784[1] = 0;
					iLocal_778[2] = 0;
					iLocal_784[2] = 0;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 0;
					iLocal_784[4] = 0;
				}
				else
				{
					iLocal_778[0] = 1;
					iLocal_784[0] = 0;
					iLocal_778[1] = 0;
					iLocal_784[1] = 0;
					iLocal_778[2] = 1;
					iLocal_784[2] = 0;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 0;
					iLocal_784[4] = 0;
				}
				break;
			
			case 7:
				vLocal_560 = { 0f, 0f, 117f };
				vLocal_557 = { 1959.4f, 3742.33f, (32.54f - 0.2f) };
				iLocal_548 = func_50(0);
				vLocal_552 = { 1958.92f, 3746.267f, 31.3438f };
				fLocal_555 = 73.6245f;
				iLocal_584 = 1;
				if (func_412(6, 18))
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 0;
					iLocal_778[1] = 1;
					iLocal_784[1] = 1;
					iLocal_778[2] = 0;
					iLocal_784[2] = 1;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 0;
					iLocal_784[4] = 1;
				}
				else
				{
					iLocal_778[0] = 2;
					iLocal_784[0] = 0;
					iLocal_778[1] = 0;
					iLocal_784[1] = 0;
					iLocal_778[2] = 1;
					iLocal_784[2] = 1;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 0;
					iLocal_784[4] = 1;
				}
				break;
			
			case 8:
				vLocal_560 = { 0f, 0f, 92f };
				vLocal_557 = { 25.03f, -1344.96f, (29.69f - 0.2f) };
				iLocal_548 = func_50(0);
				vLocal_552 = { 30.5721f, -1339.782f, 28.4939f };
				fLocal_555 = 110.7699f;
				iLocal_584 = 1;
				if (func_412(6, 18))
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 1;
					iLocal_778[1] = 2;
					iLocal_784[1] = 0;
					iLocal_778[2] = 0;
					iLocal_784[2] = 2;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 0;
					iLocal_784[4] = 2;
				}
				else
				{
					iLocal_778[0] = 2;
					iLocal_784[0] = 1;
					iLocal_778[1] = 1;
					iLocal_784[1] = 0;
					iLocal_778[2] = 1;
					iLocal_784[2] = 2;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 0;
					iLocal_784[4] = 2;
				}
				break;
			
			case 9:
				vLocal_560 = { 0f, 0f, 75f };
				vLocal_557 = { 373.68f, 328.56f, (103.77f - 0.2f) };
				iLocal_548 = func_50(0);
				vLocal_552 = { 376.2976f, 331.8158f, 102.5664f };
				fLocal_555 = 52.0064f;
				iLocal_584 = 1;
				if (func_412(6, 18))
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 2;
					iLocal_778[1] = 2;
					iLocal_784[1] = 1;
					iLocal_778[2] = 1;
					iLocal_784[2] = 0;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 0;
					iLocal_784[4] = 0;
				}
				else
				{
					iLocal_778[0] = 2;
					iLocal_784[0] = 2;
					iLocal_778[1] = 1;
					iLocal_784[1] = 1;
					iLocal_778[2] = 0;
					iLocal_784[2] = 0;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 0;
					iLocal_784[4] = 0;
				}
				break;
			
			case 10:
				vLocal_560 = { 0f, 0f, 0f };
				vLocal_557 = { 1165.96f, 2710.2f, (38.25f - 0.105f) };
				iLocal_548 = func_50(0);
				vLocal_552 = { 1168.971f, 2719.118f, 36.0632f };
				fLocal_555 = 136.5945f;
				iLocal_584 = 3;
				if (func_412(10, 22))
				{
					iLocal_778[0] = 1;
					iLocal_784[0] = 0;
					iLocal_778[1] = 0;
					iLocal_784[1] = 0;
					iLocal_778[2] = 1;
					iLocal_784[2] = 1;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				else
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 0;
					iLocal_778[1] = 2;
					iLocal_784[1] = 0;
					iLocal_778[2] = 0;
					iLocal_784[2] = 1;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				break;
			
			case 11:
				vLocal_560 = { 0f, 0f, -92f };
				vLocal_557 = { -2967.03f, 390.9f, (15.23f - 0.2f) };
				iLocal_548 = func_50(0);
				vLocal_552 = { -2962.983f, 391.9788f, 14.0433f };
				fLocal_555 = 176.1174f;
				iLocal_584 = 3;
				if (func_412(10, 22))
				{
					iLocal_778[0] = 2;
					iLocal_784[0] = 0;
					iLocal_778[1] = 1;
					iLocal_784[1] = 0;
					iLocal_778[2] = 1;
					iLocal_784[2] = 2;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				else
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 1;
					iLocal_778[1] = 2;
					iLocal_784[1] = 1;
					iLocal_778[2] = 0;
					iLocal_784[2] = 2;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				break;
			
			case 12:
				vLocal_560 = { 0f, 0f, -145f };
				vLocal_557 = { -1222.33f, -907.82f, (12.52f - 0.2f) };
				iLocal_548 = func_50(0);
				vLocal_552 = { -1218.283f, -915.7103f, 10.3264f };
				fLocal_555 = 43.8031f;
				iLocal_584 = 3;
				if (func_412(10, 22))
				{
					iLocal_778[0] = 2;
					iLocal_784[0] = 1;
					iLocal_778[1] = 1;
					iLocal_784[1] = 1;
					iLocal_778[2] = 0;
					iLocal_784[2] = 0;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				else
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 2;
					iLocal_778[1] = 1;
					iLocal_784[1] = 0;
					iLocal_778[2] = 1;
					iLocal_784[2] = 0;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				break;
			
			case 13:
				vLocal_560 = { 0f, 0f, 103f };
				vLocal_557 = { 1134.81f, -982.36f, (46.6f - 0.2f) };
				iLocal_548 = func_50(0);
				vLocal_552 = { 1130.155f, -979.2816f, 45.4158f };
				fLocal_555 = 269.2587f;
				iLocal_584 = 3;
				if (func_412(10, 22))
				{
					iLocal_778[0] = 2;
					iLocal_784[0] = 2;
					iLocal_778[1] = 2;
					iLocal_784[1] = 0;
					iLocal_778[2] = 0;
					iLocal_784[2] = 1;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				else
				{
					iLocal_778[0] = 1;
					iLocal_784[0] = 0;
					iLocal_778[1] = 0;
					iLocal_784[1] = 0;
					iLocal_778[2] = 1;
					iLocal_784[2] = 1;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				break;
			
			case 14:
				vLocal_560 = { 0f, 0f, -41f };
				vLocal_557 = { -1486.67f, -378.46f, (40.35f - 0.2f) };
				iLocal_548 = func_50(0);
				vLocal_552 = { -1479.163f, -375.0302f, 38.1633f };
				fLocal_555 = 36.5415f;
				iLocal_584 = 3;
				if (func_412(10, 22))
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 0;
					iLocal_778[1] = 2;
					iLocal_784[1] = 1;
					iLocal_778[2] = 0;
					iLocal_784[2] = 2;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				else
				{
					iLocal_778[0] = 2;
					iLocal_784[0] = 0;
					iLocal_778[1] = 1;
					iLocal_784[1] = 0;
					iLocal_778[2] = 1;
					iLocal_784[2] = 2;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				break;
			
			case 15:
				vLocal_560 = { 0f, 0f, 145f };
				vLocal_557 = { (1698.33f - 0.04f), 4923.33f, (42.12f - 0.06f) };
				iLocal_548 = func_50(0);
				vLocal_552 = { 1707.303f, 4918.31f, 41.0636f };
				fLocal_555 = 24.9178f;
				iLocal_584 = 2;
				if (func_412(8, 20))
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 1;
					iLocal_778[1] = 0;
					iLocal_784[1] = 0;
					iLocal_778[2] = 1;
					iLocal_784[2] = 0;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				else
				{
					iLocal_778[0] = 2;
					iLocal_784[0] = 1;
					iLocal_778[1] = 1;
					iLocal_784[1] = 1;
					iLocal_778[2] = 0;
					iLocal_784[2] = 0;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				break;
			
			case 16:
				vLocal_560 = { 0f, 0f, -87f };
				vLocal_557 = { -706.69f, -913.69f, (19.27f - 0.06f) };
				iLocal_548 = func_50(0);
				vLocal_552 = { -709.7998f, -907.1352f, 18.2156f };
				fLocal_555 = 291.6504f;
				iLocal_584 = 2;
				if (func_412(8, 20))
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 2;
					iLocal_778[1] = 1;
					iLocal_784[1] = 0;
					iLocal_778[2] = 1;
					iLocal_784[2] = 1;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				else
				{
					iLocal_778[0] = 2;
					iLocal_784[0] = 2;
					iLocal_778[1] = 2;
					iLocal_784[1] = 0;
					iLocal_778[2] = 0;
					iLocal_784[2] = 1;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				break;
			
			case 17:
				vLocal_560 = { 0f, 0f, -125f };
				vLocal_557 = { -47.23f, -1757.64f, (29.48f - 0.06f) };
				iLocal_548 = func_50(0);
				vLocal_552 = { -40.42f, -1751.423f, 28.421f };
				fLocal_555 = 145.6553f;
				iLocal_584 = 2;
				if (func_412(8, 20))
				{
					iLocal_778[0] = 1;
					iLocal_784[0] = 0;
					iLocal_778[1] = 1;
					iLocal_784[1] = 1;
					iLocal_778[2] = 1;
					iLocal_784[2] = 2;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				else
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 0;
					iLocal_778[1] = 2;
					iLocal_784[1] = 0;
					iLocal_778[2] = 0;
					iLocal_784[2] = 2;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				break;
			
			case 18:
				vLocal_560 = { 0f, 0f, -74f };
				vLocal_557 = { 1164.16f, -322.9f, (69.26f - 0.06f) };
				iLocal_548 = func_50(0);
				vLocal_552 = { 1159.682f, -314.254f, 68.2051f };
				fLocal_555 = 232.6337f;
				iLocal_584 = 2;
				if (func_412(8, 20))
				{
					iLocal_778[0] = 2;
					iLocal_784[0] = 0;
					iLocal_778[1] = 2;
					iLocal_784[1] = 1;
					iLocal_778[2] = 0;
					iLocal_784[2] = 0;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				else
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 1;
					iLocal_778[1] = 2;
					iLocal_784[1] = 0;
					iLocal_778[2] = 0;
					iLocal_784[2] = 0;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				break;
			
			case 19:
				vLocal_557 = { -1820.5f, 793.78f, (138.32f - 0.22f) };
				vLocal_560 = { 0f, 0f, -47.3f };
				iLocal_548 = func_50(0);
				vLocal_552 = { -1828.907f, 799.6096f, 137.1776f };
				fLocal_555 = 247.1234f;
				iLocal_584 = 2;
				if (func_412(8, 20))
				{
					iLocal_778[0] = 2;
					iLocal_784[0] = 1;
					iLocal_778[1] = 0;
					iLocal_784[1] = 0;
					iLocal_778[2] = 0;
					iLocal_784[2] = 1;
					iLocal_778[3] = 0;
					iLocal_784[3] = 0;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				else
				{
					iLocal_778[0] = 0;
					iLocal_784[0] = 2;
					iLocal_778[1] = 2;
					iLocal_784[1] = 1;
					iLocal_778[2] = 0;
					iLocal_784[2] = 1;
					iLocal_778[3] = 0;
					iLocal_784[3] = 1;
					iLocal_778[4] = 1;
					iLocal_784[4] = 0;
				}
				break;
		}
		vLocal_557 = { object::_get_object_offset_from_coords(vLocal_557, vLocal_560.y, 0f, 0.075f, 0f) };
		vLocal_549 = { ped::get_anim_initial_offset_position("mp_am_hold_up", "holdup_victim_20s", vLocal_557, vLocal_560, 0, 2) };
		vVar0 = { ped::get_anim_initial_offset_rotation("mp_am_hold_up", "holdup_victim_20s", vLocal_557, vLocal_560, 0, 2) };
		Local_96.f_42 = vVar0.y;
		vLocal_573 = { ped::get_anim_initial_offset_position("mp_am_hold_up", "holdup_victim_20s_bag", vLocal_557, vLocal_560, 0, 2) };
		vVar0 = { ped::get_anim_initial_offset_rotation("mp_am_hold_up", "holdup_victim_20s_bag", vLocal_557, vLocal_560, 0, 2) };
		fLocal_576 = vVar0.y;
		vLocal_577 = { ped::get_anim_initial_offset_position("mp_am_hold_up", "holdup_victim_20s_till", vLocal_557, vLocal_560, 0, 2) };
		vVar0 = { ped::get_anim_initial_offset_rotation("mp_am_hold_up", "holdup_victim_20s_till", vLocal_557, vLocal_560, 0, 2) };
		fLocal_580 = vVar0.y;
		Local_490 = func_411(Local_490.f_50);
		if (network::network_is_host_of_this_script())
		{
			Local_96.f_45 = iLocal_778[0];
			if (Local_96.f_45 == 0)
			{
				StringCopy(&(Local_96.f_50), "MP_M_SHOPKEEP_01_PAKISTANI_MINI_01", 64);
				StringCopy(&(Local_96.f_46), "StoreOwner2", 16);
			}
			else if (Local_96.f_45 == 1)
			{
				StringCopy(&(Local_96.f_50), "MP_M_SHOPKEEP_01_LATINO_MINI_01", 64);
				StringCopy(&(Local_96.f_46), "StoreOwner", 16);
			}
			else
			{
				StringCopy(&(Local_96.f_50), "MP_M_SHOPKEEP_01_CHINESE_MINI_01", 64);
				StringCopy(&(Local_96.f_46), "StoreOwner3", 16);
			}
		}
		if (!gameplay::is_bit_set(Local_490.f_52, 29))
		{
			entity::create_model_hide(vLocal_557, 0.5f, iLocal_581, 1);
			gameplay::set_bit(&(Local_490.f_52), 29);
		}
		return true;
	}
	return false;
}

int func_411(int iParam0)//Position - 0x15E9D
{
	switch (iParam0)
	{
		case 16:
			return 0;
		
		case 17:
			return 1;
		
		case 18:
			return 2;
		
		case 15:
			return 3;
		
		case 19:
			return 4;
		
		case 10:
			return 5;
		
		case 11:
			return 6;
		
		case 12:
			return 7;
		
		case 13:
			return 8;
		
		case 14:
			return 9;
		
		case 2:
			return 10;
		
		case 1:
			return 11;
		
		case 3:
			return 12;
		
		case 4:
			return 13;
		
		case 5:
			return 14;
		
		case 6:
			return 15;
		
		case 7:
			return 16;
		
		case 8:
			return 17;
		
		case 9:
			return 18;
		
		case 0:
			return -2;
		
		default:
	}
	return -1;
}

int func_412(int iParam0, int iParam1)//Position - 0x15F82
{
	return func_413(time::get_clock_hours(), iParam0, iParam1);
}

bool func_413(int iParam0, int iParam1, int iParam2)//Position - 0x15F96
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	if (iParam1 == 24)
	{
		iParam1 = 0;
	}
	if (iParam1 < 0 || iParam1 >= 24)
	{
		return false;
	}
	if (iParam2 == 24)
	{
		iParam2 = 0;
	}
	if (iParam2 < 0 || iParam2 >= 24)
	{
		return false;
	}
	if (iParam1 == iParam2)
	{
		return true;
	}
	iVar0 = iParam2 < iParam1;
	iVar1 = iParam1;
	iVar2 = iParam2;
	if (iVar0)
	{
		iVar2 = 24;
	}
	if (iParam0 >= iVar1 && iParam0 < iVar2)
	{
		return true;
	}
	if (!iVar0)
	{
		return false;
	}
	iVar1 = 0;
	iVar2 = iParam2;
	if (iParam0 >= iVar1 && iParam0 < iVar2)
	{
		return true;
	}
	return false;
}

void func_414(int iParam0, var uParam1, var uParam2, var uParam3)//Position - 0x1603F
{
	if (iParam0 == 0)
	{
		*uParam1 = { 1393.091f, 3607.383f, 33.9809f };
		*uParam2 = { 1391.178f, 3612.516f, (38.3614f - 0.2f) };
		*uParam3 = 12.5f;
	}
	else if (iParam0 == 1)
	{
		*uParam1 = { -3045.013f, 585.9666f, (10.35421f - 0.2f) };
		*uParam2 = { -3048.714f, 584.7961f, 6.948262f };
		*uParam3 = 8.25f;
	}
	else if (iParam0 == 2)
	{
		*uParam1 = { -3247.313f, 1003.657f, (15.27433f - 0.2f) };
		*uParam2 = { -3251.157f, 1003.984f, 11.83501f };
		*uParam3 = 8.25f;
	}
	else if (iParam0 == 3)
	{
		*uParam1 = { 546.5474f, 2665.642f, (44.60108f - 0.2f) };
		*uParam2 = { 547.054f, 2661.794f, 41.15667f };
		*uParam3 = 8.25f;
	}
	else if (iParam0 == 4)
	{
		*uParam1 = { 2552f, 384.2527f, (111.0656f - 0.2f) };
		*uParam2 = { 2548.145f, 384.4133f, 107.6241f };
		*uParam3 = 8.25f;
	}
	else if (iParam0 == 5)
	{
		*uParam1 = { 2674.946f, 3284.833f, (57.68088f - 0.2f) };
		*uParam2 = { 2671.569f, 3286.699f, 54.24464f };
		*uParam3 = 8.25f;
	}
	else if (iParam0 == 6)
	{
		*uParam1 = { 1733.119f, 6418.579f, (37.48002f - 0.2f) };
		*uParam2 = { 1734.839f, 6422.032f, 34.03751f };
		*uParam3 = 8.25f;
	}
	else if (iParam0 == 7)
	{
		*uParam1 = { 1960.224f, 3746.258f, (34.7878f - 0.2f) };
		*uParam2 = { 1958.295f, 3749.599f, 31.34522f };
		*uParam3 = 8.25f;
	}
	else if (iParam0 == 8)
	{
		*uParam1 = { 27.71382f, -1341.968f, (31.93314f - 0.2f) };
		*uParam2 = { 27.71049f, -1338.109f, 28.49479f };
		*uParam3 = 8.25f;
	}
	else if (iParam0 == 9)
	{
		*uParam1 = { 377.0183f, 330.808f, (106.0112f - 0.2f) };
		*uParam2 = { 377.9499f, 334.5523f, 102.567f };
		*uParam3 = 8.25f;
	}
	else if (iParam0 == 10)
	{
		*uParam1 = { 1167.015f, 2711.601f, (40.66147f - 0.2f) };
		*uParam2 = { 1167.082f, 2720.243f, 36.06501f };
		*uParam3 = 8.25f;
	}
	else if (iParam0 == 11)
	{
		*uParam1 = { -2965.705f, 389.6696f, (17.64162f - 0.2f) };
		*uParam2 = { -2957.095f, 389.139f, 13.04323f };
		*uParam3 = 8.75f;
	}
	else if (iParam0 == 12)
	{
		*uParam1 = { -1222.402f, -909.5575f, (14.92466f - 0.2f) };
		*uParam2 = { -1217.682f, -916.7974f, 10.33735f };
		*uParam3 = 8.75f;
	}
	else if (iParam0 == 13)
	{
		*uParam1 = { 1133.284f, -981.473f, (49.01414f - 0.2f) };
		*uParam2 = { 1124.708f, -982.6027f, 44.42008f };
		*uParam3 = 8.75f;
	}
	else if (iParam0 == 14)
	{
		*uParam1 = { -1484.883f, -378.2694f, (42.76172f - 0.2f) };
		*uParam2 = { -1478.771f, -372.1664f, 38.16948f };
		*uParam3 = 8.75f;
	}
	else if (iParam0 == 15)
	{
		*uParam1 = { 1704.556f, 4921.806f, (44.02687f - 0.2f) };
		*uParam2 = { 1708.285f, 4919.196f, 41.06359f };
		*uParam3 = 4f;
	}
	else if (iParam0 == 16)
	{
		*uParam1 = { -709.019f, -907.7159f, (21.17918f - 0.2f) };
		*uParam2 = { -709.0177f, -903.1516f, 18.21618f };
		*uParam3 = 4f;
	}
	else if (iParam0 == 17)
	{
		*uParam1 = { -45.16617f, -1751.578f, (31.37973f - 0.2f) };
		*uParam2 = { -42.22961f, -1748.09f, 28.42099f };
		*uParam3 = 4f;
	}
	else if (iParam0 == 18)
	{
		*uParam1 = { 1160.825f, -317.4214f, (71.16085f - 0.2f) };
		*uParam2 = { 1160.033f, -312.932f, 68.20509f };
		*uParam3 = 4f;
	}
	else if (iParam0 == 19)
	{
		*uParam1 = { -1826.218f, 796.6393f, (140.1334f - 0.2f) };
		*uParam2 = { -1829.301f, 799.9996f, 137.18f };
		*uParam3 = 4f;
	}
}

void func_415(int iParam0, var uParam1, var uParam2, var uParam3)//Position - 0x16500
{
	if (iParam0 == 0)
	{
		*uParam1 = { 1395.548f, 3600.575f, 33.98914f };
		*uParam2 = { 1392.08f, 3609.983f, (37.33543f - 0.2f) };
		*uParam3 = 12.25f;
	}
	if (iParam0 == 1)
	{
		*uParam1 = { -3038.657f, 589.5176f, 6.904751f };
		*uParam2 = { -3045.476f, 587.4066f, (11.31222f - 0.2f) };
		*uParam3 = 11f;
	}
	if (iParam0 == 2)
	{
		*uParam1 = { -3240.032f, 1004.482f, 11.8307f };
		*uParam2 = { -3247.188f, 1005.107f, (16.25224f - 0.2f) };
		*uParam3 = 11f;
	}
	if (iParam0 == 3)
	{
		*uParam1 = { 544.2278f, 2672.5f, 41.1565f };
		*uParam2 = { 545.201f, 2665.442f, (45.69155f - 0.2f) };
		*uParam3 = 11f;
	}
	if (iParam0 == 4)
	{
		*uParam1 = { 2559.176f, 385.3936f, 107.623f };
		*uParam2 = { 2552.054f, 385.6057f, (112.1638f - 0.2f) };
		*uParam3 = 11f;
	}
	if (iParam0 == 5)
	{
		*uParam1 = { 2681.864f, 3282.603f, 54.24114f };
		*uParam2 = { 2675.586f, 3285.981f, (58.79021f - 0.2f) };
		*uParam3 = 11f;
	}
	if (iParam0 == 6)
	{
		*uParam1 = { 1731.237f, 6411.557f, 34.03723f };
		*uParam2 = { 1734.383f, 6417.952f, (38.58461f - 0.2f) };
		*uParam3 = 11f;
	}
	if (iParam0 == 7)
	{
		*uParam1 = { 1964.999f, 3740.795f, 31.34375f };
		*uParam2 = { 1961.384f, 3746.928f, (35.89571f - 0.2f) };
		*uParam3 = 11f;
	}
	if (iParam0 == 8)
	{
		*uParam1 = { Vector(28.49392f, -1348.507f, 27.03358f) + Vector(0f, -0.4f, 2f) };
		*uParam2 = { Vector(33.03834f, -1341.382f, 27.05614f) - Vector(0.2f, 0.2f, 0.2f) + Vector(0f, -0.4f, 2f) };
		*uParam3 = 11f;
	}
	if (iParam0 == 9)
	{
		*uParam1 = { 376.6309f, 323.5533f, 102.5664f };
		*uParam2 = { 378.3253f, 330.4793f, (107.1095f - 0.2f) };
		*uParam3 = 11f;
	}
	if (iParam0 == 10)
	{
		*uParam1 = { 1166.497f, 2703.756f, 37.06307f };
		*uParam2 = { 1166.525f, 2711.974f, (41.66307f - 0.2f) };
		*uParam3 = 7.75f;
	}
	if (iParam0 == 11)
	{
		*uParam1 = { -2973.512f, 390.7873f, 14.04322f };
		*uParam2 = { -2965.288f, 390.2452f, (18.54322f - 0.2f) };
		*uParam3 = 7.75f;
	}
	if (iParam0 == 12)
	{
		*uParam1 = { -1226.417f, -902.6738f, 11.33496f };
		*uParam2 = { -1221.765f, -909.5887f, (15.82626f - 0.2f) };
		*uParam3 = 7.75f;
	}
	if (iParam0 == 13)
	{
		*uParam1 = { 1141.35f, -980.9322f, 45.41594f };
		*uParam2 = { 1132.976f, -982.0952f, (49.91574f - 0.2f) };
		*uParam3 = 7.75f;
	}
	if (iParam0 == 14)
	{
		*uParam1 = { -1490.949f, -383.4771f, 39.16332f };
		*uParam2 = { -1485.006f, -377.6167f, (43.66332f - 0.2f) };
		*uParam3 = 7.75f;
	}
	if (iParam0 == 15)
	{
		*uParam1 = { 1698.98f, 4929.093f, 41.06357f };
		*uParam2 = { 1705.233f, 4924.578f, (45.60386f - 0.2f) };
		*uParam3 = 14f;
	}
	if (iParam0 == 16)
	{
		*uParam1 = { -711.77f, -916.4685f, 18.21557f };
		*uParam2 = { -711.7368f, -908.7517f, (22.76488f - 0.2f) };
		*uParam3 = 14f;
	}
	if (iParam0 == 17)
	{
		*uParam1 = { -52.90452f, -1756.474f, 28.42097f };
		*uParam2 = { -47.92523f, -1750.614f, (32.94246f - 0.2f) };
		*uParam3 = 14f;
	}
	if (iParam0 == 18)
	{
		*uParam1 = { 1159.633f, -326.5087f, 68.20507f };
		*uParam2 = { 1158.335f, -318.9123f, (72.74828f - 0.2f) };
		*uParam3 = 14f;
	}
	if (iParam0 == 19)
	{
		*uParam1 = { -1822.373f, 788.2851f, 137.1876f };
		*uParam2 = { -1827.484f, 794.0739f, (141.6933f - 0.2f) };
		*uParam3 = 14f;
	}
}

void func_416(int iParam0, int iParam1, var uParam2, var uParam3, var uParam4, var uParam5, var uParam6)//Position - 0x169AD
{
	func_417(iParam0, uParam5, uParam6);
	switch (iParam0)
	{
		case 0:
			if (*iParam1 == 0)
			{
				*iParam1 = interior::get_interior_at_coords_with_type(*uParam5, "v_methlab");
			}
			*uParam2 = -1621784842;
			*uParam4 = -924210258;
			*uParam3 = -1;
			break;
		
		case 1:
		case 2:
		case 3:
		case 4:
		case 5:
		case 6:
		case 7:
		case 8:
		case 9:
			if (*iParam1 == 0)
			{
				*iParam1 = interior::get_interior_at_coords_with_type(*uParam5, "v_shop_247");
			}
			*uParam2 = 1569794095;
			*uParam4 = 462608346;
			*uParam3 = -1;
			break;
		
		case 10:
		case 11:
		case 12:
		case 13:
		case 14:
			if (*iParam1 == 0)
			{
				*iParam1 = interior::get_interior_at_coords_with_type(*uParam5, "v_gen_liquor");
			}
			*uParam2 = -278510267;
			*uParam4 = -1293435817;
			*uParam3 = -1;
			break;
		
		case 15:
		case 16:
		case 17:
		case 18:
		case 19:
			if (*iParam1 == 0)
			{
				*iParam1 = interior::get_interior_at_coords_with_type(*uParam5, "v_gasstation");
			}
			*uParam2 = -1659520475;
			*uParam4 = -1272390353;
			*uParam3 = -835664728;
			break;
	}
}

void func_417(int iParam0, var uParam1, var uParam2)//Position - 0x16AF6
{
	switch (iParam0)
	{
		case 0:
			*uParam1 = { 1394.169f, 3599.86f, 34.0121f };
			*uParam2 = { 1395.548f, 3600.575f, 33.98914f };
			break;
		
		case 1:
			*uParam1 = { -3038.908f, 589.5187f, 6.9048f };
			*uParam2 = { -3038.657f, 589.5176f, 6.904751f };
			break;
		
		case 2:
			*uParam1 = { -3240.317f, 1004.433f, 11.8307f };
			*uParam2 = { -3240.032f, 1004.482f, 11.8307f };
			break;
		
		case 3:
			*uParam1 = { 544.2802f, 2672.811f, 41.1566f };
			*uParam2 = { 544.2278f, 2672.5f, 41.1565f };
			break;
		
		case 4:
			*uParam1 = { 2559.247f, 385.5266f, 107.623f };
			*uParam2 = { 2559.176f, 385.3936f, 107.623f };
			break;
		
		case 5:
			*uParam1 = { 2682.003f, 3282.543f, 54.2411f };
			*uParam2 = { 2681.864f, 3282.603f, 54.24114f };
			break;
		
		case 6:
			*uParam1 = { 1731.21f, 6411.403f, 34.0372f };
			*uParam2 = { 1731.237f, 6411.557f, 34.03723f };
			break;
		
		case 7:
			*uParam1 = { 1965.054f, 3740.555f, 31.3448f };
			*uParam2 = { 1964.999f, 3740.795f, 31.34375f };
			break;
		
		case 8:
			*uParam1 = { Vector(28.5036f, -1348.813f, 27.0641f) + Vector(0f, -0.4f, 2f) };
			*uParam2 = { Vector(28.49392f, -1348.507f, 27.03358f) + Vector(0f, -0.4f, 2f) };
			break;
		
		case 9:
			*uParam1 = { 376.6533f, 323.6471f, 102.5664f };
			*uParam2 = { 376.6309f, 323.5533f, 102.5664f };
			break;
		
		case 10:
			*uParam1 = { Vector(37.1573f, 2703.114f, 1195.432f) + Vector(0f, 0.39f, -29.04f) };
			*uParam2 = { 1166.497f, 2703.756f, 37.06307f };
			break;
		
		case 11:
			*uParam1 = { -2973.262f, 390.8184f, 14.0433f };
			*uParam2 = { -2973.512f, 390.7873f, 14.04322f };
			break;
		
		case 12:
			*uParam1 = { -1226.464f, -902.5864f, 11.2783f };
			*uParam2 = { -1226.417f, -902.6738f, 11.33496f };
			break;
		
		case 13:
			*uParam1 = { 1141.36f, -980.8802f, 45.4155f };
			*uParam2 = { 1141.35f, -980.9322f, 45.41594f };
			break;
		
		case 14:
			*uParam1 = { -1491.057f, -383.5728f, 39.1706f };
			*uParam2 = { -1490.949f, -383.4771f, 39.16332f };
			break;
		
		case 15:
			*uParam1 = { 1698.808f, 4929.198f, 41.0783f };
			*uParam2 = { 1698.98f, 4929.093f, 41.06357f };
			break;
		
		case 16:
			*uParam1 = { -711.721f, -916.6965f, 18.2145f };
			*uParam2 = { -711.77f, -916.4685f, 18.21557f };
			break;
		
		case 17:
			*uParam1 = { -53.124f, -1756.405f, 28.421f };
			*uParam2 = { -52.90452f, -1756.474f, 28.42097f };
			break;
		
		case 18:
			*uParam1 = { 1159.542f, -326.6986f, 67.923f };
			*uParam2 = { 1159.633f, -326.5087f, 68.20507f };
			break;
		
		case 19:
			*uParam1 = { -1822.287f, 788.006f, 137.1859f };
			*uParam2 = { -1822.373f, 788.2851f, 137.1876f };
			break;
	}
}

bool func_418(var uParam0, int iParam1)//Position - 0x16ECD
{
	float fVar0;
	float fVar1;
	int iVar2;
	
	fVar1 = 9999.9f;
	iVar2 = 0;
	while (iVar2 < 20)
	{
		fVar0 = gameplay::get_distance_between_coords(func_85(player::player_id()), func_419(iVar2), 1);
		if (fVar0 < fVar1)
		{
			if (iParam1)
			{
				if (!gameplay::is_bit_set(Global_2418358.f_62, iVar2) && gameplay::is_bit_set(Global_2418358.f_64, iVar2))
				{
					fVar1 = fVar0;
					*uParam0 = iVar2;
				}
			}
			else
			{
				fVar1 = fVar0;
				*uParam0 = iVar2;
			}
		}
		iVar2++;
	}
	return true;
}

Vector3 func_419(int iParam0)//Position - 0x16F48
{
	vector3 vVar0;
	var uVar3;
	
	func_417(iParam0, &vVar0, &uVar3);
	return vVar0;
}

var func_420(int iParam0)//Position - 0x16F5E
{
	return Local_169[iParam0 /*10*/].f_4;
}

void func_421()//Position - 0x16F6E
{
	Global_2434839.f_660.f_28 = 0;
}

void func_422()//Position - 0x16F80
{
	if (Global_1312416.f_1 == 1)
	{
		func_423(0);
		Global_1312416.f_1 = 0;
		Global_1610705[player::player_id() /*178*/].f_9 = 0;
	}
}

void func_423(int iParam0)//Position - 0x16FAB
{
	if (func_393())
	{
		if (iParam0 == 1)
		{
			if (Global_2464975.f_4254 == -1)
			{
				Global_2464975.f_4254 = 60000;
			}
			func_424(&(Global_2464975.f_4252), 0, 0);
			if (Global_2464975.f_4257 == -1)
			{
				Global_2464975.f_4257 = 10000;
			}
			func_424(&(Global_2464975.f_4255), 0, 0);
		}
		else
		{
			Global_1312416 = 0;
			func_392();
		}
		if ((!network::network_is_activity_session() && !func_391()) && !func_390(player::player_id()))
		{
			Global_978174 = 0;
		}
		Global_1610705[player::player_id() /*178*/].f_8 = 0;
	}
}

void func_424(var uParam0, int iParam1, int iParam2)//Position - 0x17043
{
	if (network::network_is_game_in_progress() && !iParam1)
	{
		if (!iParam2)
		{
			*uParam0 = network::get_network_time();
		}
		else
		{
			*uParam0 = network::_0x89023FBBF9200E9F();
		}
	}
	else
	{
		*uParam0 = gameplay::get_game_timer();
	}
	uParam0->f_1 = 1;
}

void func_425()//Position - 0x17080
{
	int iVar0;
	int iVar1;
	int iVar2;
	var uVar3;
	var uVar4;
	var uVar5;
	
	if (!func_44(player::player_id(), 1, 1))
	{
		iVar0 = 1;
		if (gameplay::is_bit_set(Local_490.f_53, 6) && !gameplay::is_bit_set(Local_490.f_53, 5))
		{
			iVar1 = networkcash::_0xA40F9C2623F6A8B5(-1);
			iVar2 = 0;
			gameplay::set_bit(&iVar2, 8);
			gameplay::set_bit(&iVar2, 4);
			gameplay::set_bit(&iVar2, 1);
			if (iLocal_807 > Global_262145.f_164)
			{
				iLocal_807 = Global_262145.f_164;
			}
			if (iVar1 < iLocal_807)
			{
				if (iVar1 > 0)
				{
					if (func_49(func_50(1)))
					{
						if (networkcash::_0x7303E27CC6532080(iVar1, 0, 0, 0, &uVar3, -1))
						{
							if (func_197())
							{
								if (!gameplay::is_bit_set(Global_2464975.f_7, 1))
								{
									Global_2464975.f_4579 = iVar1;
									Global_2464975.f_4580 = iVar2;
									Global_2464975.f_4581 = { ped::get_dead_ped_pickup_coords(player::player_ped_id(), 1067030938, 1069547520) };
									func_189(&(Global_2464975.f_4578), -1135378931, 537254313, 1474183246, 1022400740, Global_2464975.f_4579, 1, 3);
									gameplay::set_bit(&(Global_2464975.f_7), 1);
									iLocal_807 = 0;
									gameplay::set_bit(&(Local_490.f_53), 5);
								}
							}
							else
							{
								object::create_ambient_pickup(joaat("pickup_money_variable"), ped::get_dead_ped_pickup_coords(player::player_ped_id(), 1067030938, 1069547520), iVar2, iVar1, func_50(1), 0, 0);
								func_184(-iVar1, 1, 1, 1092616192);
								networkcash::network_spent_holdups(iVar1, 0, 0);
								func_188(1022400740, iVar1, &uVar4, 0, 0, 0);
								iLocal_807 = 0;
								func_426();
								gameplay::set_bit(&(Local_490.f_53), 5);
							}
						}
					}
					else
					{
						iVar0 = 0;
					}
				}
			}
			else if (iLocal_807 > 0)
			{
				if (func_49(func_50(1)))
				{
					if (networkcash::_0x7303E27CC6532080(iLocal_807, 0, 0, 0, &uVar3, -1))
					{
						if (func_197())
						{
							if (!gameplay::is_bit_set(Global_2464975.f_7, 1))
							{
								Global_2464975.f_4579 = iLocal_807;
								Global_2464975.f_4580 = iVar2;
								Global_2464975.f_4581 = { ped::get_dead_ped_pickup_coords(player::player_ped_id(), 1067030938, 1069547520) };
								func_189(&(Global_2464975.f_4578), -1135378931, 537254313, 1474183246, 1022400740, Global_2464975.f_4579, 1, 3);
								gameplay::set_bit(&(Global_2464975.f_7), 1);
								iLocal_807 = 0;
								gameplay::set_bit(&(Local_490.f_53), 5);
							}
						}
						else
						{
							object::create_ambient_pickup(joaat("pickup_money_variable"), ped::get_dead_ped_pickup_coords(player::player_ped_id(), 1067030938, 1069547520), iVar2, iLocal_807, func_50(1), 0, 0);
							func_184(-iLocal_807, 1, 1, 1092616192);
							networkcash::network_spent_holdups(iLocal_807, 0, 0);
							func_188(1022400740, iLocal_807, &uVar5, 0, 0, 0);
							iLocal_807 = 0;
							func_426();
							gameplay::set_bit(&(Local_490.f_53), 5);
						}
					}
				}
				else
				{
					iVar0 = 0;
				}
			}
		}
		if (iVar0 == 1)
		{
			func_445();
		}
		else
		{
			return;
		}
	}
}

void func_426()//Position - 0x17338
{
	Global_2464975.f_269 = 0;
	Global_2464975.f_270 = 0;
	Global_2464975.f_271 = 0;
}

bool func_427()//Position - 0x17358
{
	int iVar0;
	
	func_434(&iVar0);
	if (iVar0)
	{
		return true;
	}
	if (Global_1315888 == 0)
	{
		if (!network::network_is_game_in_progress())
		{
			return true;
		}
	}
	if (func_433())
	{
		return true;
	}
	if (Global_2446452)
	{
		return true;
	}
	if (func_432())
	{
		return true;
	}
	if (func_431(157))
	{
		if (!func_430())
		{
			return true;
		}
	}
	if (func_431(155))
	{
		return true;
	}
	if (!network::network_is_signed_online())
	{
		return true;
	}
	if (func_428() != 0)
	{
		if (script::_get_number_of_instances_of_streamed_script(func_428()) == 0)
		{
			return true;
		}
	}
	return false;
}

int func_428()//Position - 0x173EB
{
	switch (func_429())
	{
		case 0:
			return joaat("freemode");
			break;
		
		case 2:
			return joaat("creator");
			break;
	}
	return 0;
}

var func_429()//Position - 0x1741F
{
	return Global_25152;
}

var func_430()//Position - 0x1742A
{
	return Global_2434839.f_575;
}

bool func_431(int iParam0)//Position - 0x17439
{
	if (script::get_event_exists(1, iParam0))
	{
		return true;
	}
	return false;
}

var func_432()//Position - 0x17450
{
	return Global_2444095;
}

var func_433()//Position - 0x1745C
{
	return Global_2434839.f_570;
}

void func_434(var uParam0)//Position - 0x1746B
{
	int iVar0;
	int iVar1;
	int iVar2;
	vector3 vVar4;
	
	iVar0 = 0;
	while (iVar0 < script::get_number_of_events(1))
	{
		iVar1 = script::get_event_at_index(1, iVar0);
		if (iVar1 == 168)
		{
			script::get_event_data(1, iVar0, &iVar2, 2);
			switch (iVar2)
			{
				case 347:
					func_435(iVar0);
					break;
				
				case 2:
					script::get_event_data(1, iVar0, &vVar4, 3);
					if (vVar4.y == 55)
					{
						*uParam0 = 1;
					}
					break;
				}
		}
		iVar0++;
	}
}

void func_435(int iParam0)//Position - 0x174DB
{
	vector3 vVar0;
	int iVar3;
	int iVar4;
	int iVar5;
	
	if (script::get_event_data(1, iParam0, &vVar0, 3))
	{
		if (func_44(vVar0.y, 1, 1))
		{
			iVar3 = player::get_player_ped(vVar0.y);
			if (entity::does_entity_exist(iVar3))
			{
				if (ped::is_ped_in_any_vehicle(iVar3, 0))
				{
					iVar4 = ped::get_vehicle_ped_is_in(iVar3, 0);
					if (vehicle::is_vehicle_window_intact(iVar4, vVar0.y) && network::network_get_this_script_is_network_script())
					{
						if (func_436(iVar4, &iVar5))
						{
							vehicle::remove_vehicle_window(iVar4, vVar0.y);
						}
						if (iVar5)
						{
							entity::set_vehicle_as_no_longer_needed(&iVar4);
						}
					}
				}
			}
		}
	}
}

bool func_436(int iParam0, var uParam1)//Position - 0x1755C
{
	if (entity::does_entity_exist(iParam0))
	{
		if (!entity::is_entity_a_mission_entity(iParam0))
		{
			if (network::network_get_entity_is_local(iParam0))
			{
				entity::set_entity_as_mission_entity(iParam0, false, 1);
				*uParam1 = 1;
			}
		}
		if (entity::does_entity_belong_to_this_script(iParam0, 0))
		{
			if (network::network_has_control_of_entity(iParam0))
			{
				return true;
			}
		}
	}
	return false;
}

void func_437()//Position - 0x175AA
{
	system::wait(0);
}

void func_438(int iParam0, int iParam1, int iParam2)//Position - 0x175B7
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	int iVar6;
	int iVar7;
	int iVar8;
	int iVar9;
	int iVar10;
	int iVar11;
	int iVar12;
	int iVar13;
	int iVar14;
	int iVar15;
	int iVar16;
	int iVar17;
	int iVar18;
	int iVar19;
	int iVar20;
	int iVar21;
	int iVar22;
	int iVar23;
	int iVar24;
	int iVar25;
	int iVar26;
	
	if (iParam1)
	{
		if (script::_get_no_loading_screen())
		{
			script::set_no_loading_screen(false);
		}
	}
	if (!network::network_is_game_in_progress())
	{
		iVar0 = iParam2;
		player::set_player_control(iParam0, iParam1, iVar0);
	}
	else
	{
		iVar1 = iParam2 & 2 != false;
		iVar2 = iParam2 & 4 != false;
		iVar3 = iParam2 & 8 != false;
		iVar4 = iParam2 & 16 != false;
		iVar5 = iParam2 & 32 != false;
		iVar6 = iParam2 & 64 != false;
		iVar7 = iParam2 & 128 != false;
		iVar8 = iParam2 & 256 != false;
		iVar9 = iParam2 & 512 != false;
		iVar10 = iParam2 & 1024 != false;
		iVar11 = iParam2 & 2048 != false;
		iVar12 = iParam2 & 4096 != false;
		iVar13 = iParam2 & 8192 != false;
		iVar14 = iParam2 & 16384 != false;
		iVar15 = iParam2 & 32768 != false;
		iVar16 = iParam2 & 65536 != false;
		iVar17 = iParam2 & 131072 != false;
		iVar18 = iParam2 & 262144 != false;
		iVar19 = iParam2 & 524288 != false;
		iVar20 = iParam2 & 1048576 != false;
		iVar21 = iParam2 & 2097152 != false;
		iVar22 = iParam2 & 4194304 != false;
		iVar23 = iParam2 & 8388608 != false;
		if (!func_442())
		{
			iVar24 = false;
			if (iParam1 == 1)
			{
				iVar24 = true;
			}
			if (iVar15 == 0 && !iVar20)
			{
				iVar24 = true;
			}
			if (iVar9 == 1)
			{
				iVar24 = true;
			}
			if (iVar24)
			{
				return;
			}
		}
		if (iVar17)
		{
		}
		if (network::network_is_player_active(iParam0) && player::is_player_playing(iParam0))
		{
			iVar25 = player::get_player_ped(iParam0);
			if (!iVar19)
			{
				if ((iVar18 && iParam1 == 0) && network::network_is_game_in_progress())
				{
					network::fade_out_local_player(1);
				}
				else
				{
					entity::set_entity_visible(iVar25, !iVar13, 0);
				}
				if (!iVar13)
				{
					if (network::network_is_game_in_progress() && !iVar18)
					{
						network::fade_out_local_player(0);
					}
					Global_2418529[iParam0 /*313*/].f_240 = 0;
				}
			}
			if (iParam1)
			{
				if (!func_441(iVar25) && !entity::is_entity_attached_to_any_vehicle(iVar25))
				{
					if (!iVar21)
					{
						entity::set_entity_collision(iVar25, true, 0);
					}
				}
				if (!entity::is_entity_attached(iVar25))
				{
					if (!iVar20)
					{
						entity::freeze_entity_position(iVar25, false);
					}
					entity::_0x3910051CCECDB00C(iVar25, true);
				}
				else if (!iVar20)
				{
					entity::freeze_entity_position(iVar25, false);
				}
				ped::set_ped_can_be_targetted(iVar25, true);
				player::set_player_invincible(iParam0, 0);
				ped::_0x4668D80430D6C299(iVar25);
				ped::set_ped_can_ragdoll(iVar25, 1);
				func_440();
				func_439();
				if (player::is_player_teleport_active())
				{
					if (!iVar22)
					{
					}
				}
				if (streaming::is_new_load_scene_active())
				{
				}
				Global_2418529[iParam0 /*313*/].f_241 = 0;
				if (!iVar23)
				{
					iVar2 = true;
				}
			}
			else
			{
				if (!func_441(iVar25) && !entity::is_entity_attached_to_any_vehicle(iVar25))
				{
					if (!iVar21)
					{
						entity::set_entity_collision(iVar25, !iVar14, 0);
					}
					if (!entity::is_entity_attached(iVar25))
					{
						if (!iVar20)
						{
							entity::freeze_entity_position(iVar25, iVar15);
						}
						if (!iVar15)
						{
							entity::_0x3910051CCECDB00C(iVar25, true);
						}
					}
				}
				if (iVar9)
				{
					player::set_player_invincible(iParam0, 0);
				}
				else
				{
					player::set_player_invincible(iParam0, 1);
				}
				ped::set_ped_can_be_targetted(iVar25, iVar16);
				if (iVar2)
				{
					if (!ped::is_ped_fatally_injured(iVar25) && !ped::is_ped_in_any_vehicle(iVar25, 0))
					{
						ai::clear_ped_tasks_immediately(iVar25);
					}
				}
			}
			iVar26 = 0;
			if (iVar1)
			{
				iVar26 |= 2;
			}
			if (iVar2)
			{
				iVar26 |= 4;
			}
			if (iVar3)
			{
				iVar26 |= 8;
			}
			if (iVar4)
			{
				iVar26 |= 16;
			}
			if (iVar5)
			{
				iVar26 |= 32;
			}
			if (iVar6)
			{
				iVar26 |= 64;
			}
			if (iVar7)
			{
				iVar26 |= 128;
			}
			if (iVar8)
			{
				iVar26 |= 256;
			}
			if (iVar9)
			{
				iVar26 |= 512;
			}
			if (iVar10)
			{
				iVar26 |= 1024;
			}
			if (iVar11)
			{
				iVar26 |= 2048;
			}
			if (iVar12)
			{
				iVar26 |= 4096;
			}
			player::set_player_control(iParam0, iParam1, iVar26);
		}
	}
}

void func_439()//Position - 0x17956
{
	struct<2> Var0;
	
	Global_2428549.f_724 = 0;
	Global_2428549.f_725 = 0;
	Global_2428549.f_726 = { 9999.9f, 9999.9f, 9999.9f };
	Global_2404993.f_1678 = { Var0 };
}

void func_440()//Position - 0x17993
{
	Global_2404993.f_627 = 0;
	Global_2404993.f_1719 = 0;
	Global_2404993.f_484 = 0;
	Global_2404993.f_559 = 0;
	Global_2418529[player::player_id() /*313*/].f_205 = 0;
}

bool func_441(int iParam0)//Position - 0x179C9
{
	int iVar0;
	
	if (ped::is_ped_in_any_vehicle(iParam0, 1))
	{
		return true;
	}
	else
	{
		iVar0 = ai::get_script_task_status(iParam0, -1794415470);
		if (iVar0 == 0)
		{
			return true;
		}
	}
	return false;
}

bool func_442()//Position - 0x179FA
{
	if (func_443() == 0)
	{
		return true;
	}
	return false;
}

var func_443()//Position - 0x17A0F
{
	return Global_1312466.f_18;
}

int func_444(int iParam0)//Position - 0x17A1D
{
	if (iParam0)
	{
		return (Global_2434839.f_660.f_28 && gameplay::get_hash_key(script::get_this_script_name()) == Global_2434839.f_660.f_31);
	}
	return Global_2434839.f_660.f_28;
}

void func_445()//Position - 0x17A59
{
	int iVar0;
	
	Global_2464975.f_8 = 0;
	if (network::network_is_game_in_progress())
	{
		if (!func_407(Local_96))
		{
			if (network::network_has_control_of_network_id(Local_96) || (!network::_0xA1607996431332DF(Local_96) && network::network_is_host_of_this_script()))
			{
				ped::_set_ped_ragdoll_flag(network::net_to_ped(Local_96), 0);
				ped::clear_facial_idle_anim_override(network::net_to_ped(Local_96));
				if (gameplay::is_bit_set(Local_490.f_52, 22))
				{
					if (gameplay::is_bit_set(Local_490.f_52, 20))
					{
						if (Local_96.f_3 != 7)
						{
							if (!gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 9))
							{
								ai::clear_ped_tasks(network::net_to_ped(Local_96));
								ai::task_perform_sequence(network::net_to_ped(Local_96), iLocal_567);
								ped::set_blocking_of_non_temporary_events(network::net_to_ped(Local_96), false);
							}
						}
						else if (ai::get_script_task_status(network::net_to_ped(Local_96), -1442466670) != 0 && ai::get_script_task_status(network::net_to_ped(Local_96), -1442466670) != 1)
						{
							ai::clear_ped_tasks(network::net_to_ped(Local_96));
							if (!weapon::has_ped_got_weapon(network::net_to_ped(Local_96), joaat("weapon_pistol"), 0))
							{
								weapon::give_delayed_weapon_to_ped(network::net_to_ped(Local_96), joaat("weapon_pistol"), 25000, 1);
								ped::set_ped_accuracy(network::net_to_ped(Local_96), 30);
							}
							func_252(4);
							ai::task_combat_hated_targets_around_ped(network::net_to_ped(Local_96), 20f, 0);
						}
					}
					else if ((gameplay::is_bit_set(Local_96.f_23, 3) || !func_9()) || !func_449())
					{
						if (!gameplay::is_bit_set(Local_169[network::participant_id_to_int() /*10*/], 9))
						{
							ai::clear_ped_tasks(network::net_to_ped(Local_96));
							ai::task_perform_sequence(network::net_to_ped(Local_96), iLocal_567);
							ped::set_blocking_of_non_temporary_events(network::net_to_ped(Local_96), false);
						}
					}
					else
					{
						ai::clear_ped_tasks(network::net_to_ped(Local_96));
						ped::set_ped_keep_task(network::net_to_ped(Local_96), true);
						ai::task_stand_still(network::net_to_ped(Local_96), -1);
						ped::set_blocking_of_non_temporary_events(network::net_to_ped(Local_96), false);
					}
				}
			}
		}
		if ((gameplay::is_bit_set(Local_96.f_23, 3) || !func_9()) || network::network_get_num_participants() <= 1)
		{
			if (network::network_does_network_id_exist(Local_96.f_13))
			{
				if (network::network_has_control_of_network_id(Local_96.f_13))
				{
					entity::detach_entity(network::net_to_obj(Local_96.f_13), 1, true);
					func_45(&(Local_96.f_13));
				}
			}
		}
		if (((gameplay::is_bit_set(Local_96.f_23, 3) || !func_9()) || gameplay::is_bit_set(Local_490.f_52, 20)) || network::network_get_num_participants() <= 1)
		{
			if (network::network_does_network_id_exist(Local_96.f_14))
			{
				if (network::network_has_control_of_network_id(Local_96.f_14))
				{
					func_45(&(Local_96.f_14));
				}
			}
		}
		if (func_197() && gameplay::is_bit_set(Global_2464975.f_7, 1))
		{
			if (func_307(Global_2464975.f_4578) == 1)
			{
				func_448(Global_2464975.f_4578, 4);
			}
			else
			{
				func_191(Global_2464975.f_4578);
			}
			gameplay::clear_bit(&(Global_2464975.f_7), 1);
		}
		if (Local_96.f_12 == 6)
		{
			if (network::network_does_network_id_exist(Local_96))
			{
				if (decorator::decor_exist_on(network::net_to_ped(Local_96), "XP_Blocker"))
				{
					decorator::decor_remove(network::net_to_ped(Local_96), "XP_Blocker");
				}
			}
		}
		if (network::network_is_host_of_this_script())
		{
			decisionevent::remove_shocking_event(Local_96.f_30);
		}
	}
	func_447();
	streaming::remove_anim_dict("mp_am_hold_up");
	player::_0x0032A6DBA562C518();
	if (func_143("SHR_MENU"))
	{
		ui::clear_help(1);
	}
	Global_2464975.f_9 = func_224();
	graphics::set_streamed_texture_dict_as_no_longer_needed(func_409(Local_490));
	func_158(1, Local_490);
	if (Local_490.f_14 != -1)
	{
		func_281(&(Local_490.f_14));
	}
	Global_2464975.f_27 = Local_490;
	if (Global_2464975.f_4981.f_4 == 1)
	{
		Global_2464975.f_4981.f_4 = 0;
	}
	if (Global_2464975.f_4981.f_5 == 1)
	{
		Global_2464975.f_4981.f_5 = 0;
	}
	if (gameplay::is_bit_set(Local_490.f_52, 29))
	{
		entity::remove_model_hide(vLocal_557, 0.5f, iLocal_581, true);
	}
	if (gameplay::is_bit_set(Local_490.f_53, 7))
	{
		func_422();
		gameplay::clear_bit(&(Local_490.f_53), 7);
	}
	if (network::network_is_game_in_progress())
	{
		if (gameplay::is_bit_set(Local_96.f_23, 6) || gameplay::is_bit_set(Local_96.f_23, 21))
		{
			if (gameplay::is_bit_set(Local_96.f_23, 21))
			{
				iVar0 = 1;
			}
			stats::_0xCB00196B31C39EB1(30, iLocal_806, iLocal_807, iVar0);
		}
	}
	if (cam::does_cam_exist(Local_490.f_1))
	{
		if (cam::is_cam_active(Local_490.f_1))
		{
			cam::render_script_cams(false, false, 3000, 1, 0, 0);
		}
		cam::destroy_cam(Local_490.f_1, 0);
	}
	func_446();
}

void func_446()//Position - 0x17E70
{
	script::terminate_this_thread();
}

void func_447()//Position - 0x17E7C
{
	ai::clear_sequence_task(&uLocal_564);
	ai::clear_sequence_task(&iLocal_565);
}

void func_448(int iParam0, int iParam1)//Position - 0x17E92
{
	if (func_293(iParam0) != -1)
	{
		if (Global_2562803[iParam0 /*73*/].f_2 == 1)
		{
			Global_2562803[iParam0 /*73*/].f_69 = iParam1;
		}
	}
}

bool func_449()//Position - 0x17EBE
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	iVar0 = 0;
	while (iVar0 < network::_network_get_num_participants_host())
	{
		if (network::network_is_participant_active(player::int_to_participantindex(iVar0)))
		{
			iVar1 = network::network_get_player_index(player::int_to_participantindex(iVar0));
			iVar2 = player::get_player_ped(iVar1);
			if (func_44(iVar1, 1, 1))
			{
				if (interior::get_interior_from_entity(iVar2) == iLocal_589)
				{
					return true;
				}
			}
		}
		iVar0++;
	}
	return false;
}

bool func_450(struct<20> Param0)//Position - 0x17F18
{
	int iVar0;
	
	func_456(func_457(Param0), Param0);
	network::reserve_network_mission_peds(2);
	network::reserve_network_mission_objects(8);
	func_454(0, -1, 0);
	network::network_register_host_broadcast_variables(&Local_96, 73);
	network::network_register_player_broadcast_variables(&Local_169, 321);
	gameplay::set_this_script_can_be_paused(0);
	if (!func_453())
	{
		return false;
	}
	if (network::network_is_host_of_this_script())
	{
		func_49(func_50(0));
		func_49(func_50(1));
		func_49(func_50(2));
		streaming::request_anim_dict("mp_am_hold_up");
		streaming::request_anim_dict("mp_missheist_countrybank@cower");
		Local_96.f_44 = 8;
		if (func_452())
		{
			gameplay::set_bit(&(Local_96.f_24), 11);
		}
		else if (func_451())
		{
			gameplay::set_bit(&(Local_96.f_24), 12);
		}
		Local_96.f_28 = gameplay::get_random_int_in_range(1, 11);
		Local_96.f_31 = gameplay::get_random_int_in_range(1, 5);
		if ((func_12() && !func_400(player::player_id(), 1)) && !func_400(player::player_id(), 2))
		{
			Local_96.f_43 = 2;
			gameplay::set_bit(&(Local_96.f_25), 0);
		}
		else
		{
			Local_96.f_43 = 1;
		}
		Local_96.f_71 = gameplay::get_random_float_in_range(18f, 28f);
	}
	if (func_165(player::player_id()) != 155)
	{
		object::_0x0BF3B3BD47D79C08(func_50(1), 0);
	}
	iVar0 = func_123(1183, -1, 0);
	if (gameplay::is_bit_set(iVar0, 20) && gameplay::is_bit_set(iVar0, 21))
	{
		gameplay::set_bit(&(Local_490.f_53), 1);
	}
	Local_169[network::participant_id_to_int() /*10*/].f_4 = 0;
	return true;
}

bool func_451()//Position - 0x18076
{
	if (Local_490.f_50 >= 0 && Local_490.f_50 <= 9)
	{
		if (func_412(5, 6) || func_412(17, 18))
		{
			return true;
		}
		return false;
	}
	if (Local_490.f_50 >= 10 && Local_490.f_50 <= 14)
	{
		if (func_412(9, 10) || func_412(21, 22))
		{
			return true;
		}
		return false;
	}
	if (Local_490.f_50 >= 15 && Local_490.f_50 <= 19)
	{
		if (func_412(7, 8) || func_412(19, 20))
		{
			return true;
		}
		return false;
	}
	return false;
}

bool func_452()//Position - 0x18122
{
	if (Local_490.f_50 >= 0 && Local_490.f_50 <= 9)
	{
		if (func_412(6, 7) || func_412(18, 19))
		{
			return true;
		}
		return false;
	}
	if (Local_490.f_50 >= 10 && Local_490.f_50 <= 14)
	{
		if (func_412(10, 11) || func_412(22, 23))
		{
			return true;
		}
		return false;
	}
	if (Local_490.f_50 >= 15 && Local_490.f_50 <= 19)
	{
		if (func_412(8, 9) || func_412(20, 21))
		{
			return true;
		}
		return false;
	}
	return false;
}

bool func_453()//Position - 0x181CE
{
	int iVar0;
	
	iVar0 = 0;
	while (true)
	{
		iVar0++;
		if (!network::network_is_game_in_progress())
		{
			return false;
		}
		if (network::_0x5D10B3795F3FC886())
		{
			return true;
		}
		if (func_433())
		{
			return false;
		}
		if (func_431(155))
		{
			return false;
		}
		if (iVar0 >= 3600)
		{
			return false;
		}
		system::wait(0);
	}
	return false;
}

bool func_454(int iParam0, int iParam1, int iParam2)//Position - 0x18227
{
	int iVar0;
	
	iVar0 = network::network_get_script_status();
	while (iVar0 != 2)
	{
		if (((iVar0 == 3 || iVar0 == 4) || iVar0 == 5) || iVar0 == 6)
		{
			if (!iParam2)
			{
				func_446();
			}
			else
			{
				return false;
			}
		}
		if (!func_455())
		{
			if (iParam0 == 0)
			{
				if (!network::network_is_game_in_progress())
				{
					if (!iParam2)
					{
						func_446();
					}
					else
					{
						return false;
					}
				}
				if (func_433())
				{
					if (!iParam2)
					{
						func_446();
					}
					else
					{
						return false;
					}
				}
				if (func_431(155))
				{
					if (!iParam2)
					{
						func_446();
					}
					else
					{
						return false;
					}
				}
			}
			else if (!network::network_is_in_session())
			{
				if (!iParam2)
				{
					func_446();
				}
				else
				{
					return false;
				}
			}
		}
		system::wait(0);
		iVar0 = network::network_get_script_status();
	}
	if (iParam1 > -1)
	{
		Global_1312502 = iVar0;
	}
	if (iParam0 == 0)
	{
		if (!network::network_is_game_in_progress())
		{
			if (!iParam2)
			{
				func_446();
			}
			else
			{
				return false;
			}
		}
	}
	else if (!network::network_is_in_session())
	{
		if (!iParam2)
		{
			func_446();
		}
		else
		{
			return false;
		}
	}
	return true;
}

var func_455()//Position - 0x1833C
{
	return Global_1315888;
}

void func_456(int iParam0, struct<17> Param1, var uParam18, var uParam19, var uParam20)//Position - 0x18348
{
	if (!network::network_is_game_in_progress())
	{
		func_446();
	}
	network::network_set_this_script_is_network_script(iParam0, 0, Param1.f_16);
}

int func_457(int iParam0)//Position - 0x18367
{
	switch (iParam0)
	{
		case 3:
			return 2;
		
		case 1:
			return 32;
		
		case 2:
			return 32;
		
		case 32:
			return 32;
		
		case 33:
			return 32;
		
		case 34:
			return 32;
		
		case 35:
			return 32;
		
		case 36:
			return 32;
		
		case 37:
			return 32;
		
		case 38:
			return 32;
		
		case 39:
			return 32;
		
		case 40:
			return 32;
		
		case 41:
			return 32;
		
		case 42:
			return 32;
		
		case 43:
			return 32;
		
		case 44:
			return 32;
		
		case 45:
			return 32;
		
		case 46:
			return 32;
		
		case 47:
			return 32;
		
		case 48:
			return 32;
		
		case 49:
			return 32;
		
		case 50:
			return 4;
		
		case 51:
			return 32;
		
		case 52:
			return 32;
		
		case 53:
			return 32;
		
		case 54:
			return 32;
		
		case 55:
			return 32;
		
		case 56:
			return 32;
		
		case 57:
			return 32;
		
		case 58:
			return 32;
		
		case 59:
			return 32;
		
		case 60:
			return 32;
		
		case 61:
			return 32;
		
		case 62:
			return 32;
		
		case 63:
			return 32;
		
		case 64:
			return 4;
		
		case 65:
			return 32;
		
		case 66:
			return 4;
		
		case 67:
			return 4;
		
		case 68:
			return 32;
		
		case 69:
			return 32;
		
		case 70:
			return 4;
		
		case 71:
			return 32;
		
		case 72:
			return 32;
		
		case 12:
			return 32;
		
		case 4:
			return 16;
		
		case 13:
			return 32;
		
		case 5:
			return 16;
		
		case 6:
			return 2;
		
		case 8:
			return 2;
		
		case 9:
			return 2;
		
		case 7:
			return 16;
		
		case 10:
			return 2;
		
		case 11:
			return 4;
		
		case 15:
			return 32;
		
		case 16:
			return 32;
		
		case 27:
			return 2;
		
		case 25:
			return 2;
		
		case 26:
			return 2;
		
		case 18:
			return 32;
		
		case 28:
			return 32;
		
		case 29:
			return 2;
		
		case 30:
			return 32;
		
		case 31:
			return 32;
		
		case 17:
			return 2;
		
		case 73:
			return 32;
		
		case 74:
			return 32;
		
		case 19:
			return 32;
		
		case 22:
			return 32;
		
		case 23:
			return 32;
		
		case 24:
			return 32;
		
		case 20:
			return 2;
		
		case 0:
			return 0;
		
		case 21:
			return 32;
		
		case 85:
			return 32;
		
		case 86:
			return 32;
		
		case 75:
			return 32;
		
		case 76:
			return 32;
		
		case 80:
			return 32;
		
		case 78:
			return 32;
		
		case 79:
			return 32;
		
		case 83:
			return 32;
		
		case 84:
			return 32;
		
		case 81:
			return 32;
		
		case 82:
			return 32;
		
		case 87:
			return 32;
		
		case 88:
			return 32;
		
		case 89:
			return 32;
		
		case 90:
			return 32;
		
		case 91:
			return 2;
		
		case 96:
			return 1;
		
		case 92:
			return 2;
		
		case 93:
			return 4;
		
		case 94:
			return 2;
		
		case 95:
			return 2;
		
		case 77:
			return 1;
		
		case 97:
			return 2;
		
		case 98:
		case 99:
		case 100:
		case 101:
		case 102:
		case 103:
			return 0;
		
		case 105:
			return 1;
		
		case 104:
			return 4;
		
		default:
	}
	return 0;
}

