#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 = 0;
	var uLocal_57 = 8;
	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 = 0;
	var uLocal_66 = 2;
	var uLocal_67 = 0;
	var uLocal_68 = 0;
	var uLocal_69 = 8;
	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 = 0;
	var uLocal_78 = 8;
	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;
	var uLocal_87 = 0;
	var uLocal_88 = 0;
	float fLocal_89 = 0f;
	var uLocal_90 = 0;
	var uLocal_91 = 0;
	float fLocal_92 = 0f;
	float fLocal_93 = 0f;
	float fLocal_94 = 0f;
	float fLocal_95 = 0f;
	float fLocal_96 = 0f;
	var uLocal_97 = 0;
	struct<48> Local_98 = { 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, -808831384, 588969535, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0 } ;
	var uLocal_146 = 0;
	vector3 vLocal_147[32] = {{ 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f } };
	int iLocal_244 = 0;
	int iLocal_245 = 0;
	int iLocal_246 = 0;
	int iLocal_247 = 0;
	int iLocal_248 = 0;
	int iLocal_249 = 0;
	int iLocal_250 = 0;
	int iLocal_251 = 0;
	var uLocal_252 = 0;
	var uLocal_253 = 0;
	var uLocal_254 = 0;
	var uLocal_255 = 0;
	var uLocal_256 = 0;
	var uLocal_257 = 0;
	var uLocal_258 = 0;
	struct<8> Local_259[3];
	var uLocal_284 = 0;
	var uLocal_285 = 0;
	struct<20> Local_286 = { 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_89 = ((0.05f + 0.275f) - 0.01f);
	fLocal_92 = -0.05f;
	fLocal_93 = 0.92f;
	fLocal_94 = 1.94f;
	fLocal_95 = 2.99f;
	fLocal_96 = 3.7f;
	iLocal_248 = 1076369579;
	iLocal_249 = 20;
	if (network::network_is_game_in_progress() && func_205(player::player_id(), 0, 1))
	{
		func_196(Local_286);
	}
	else
	{
		func_192();
	}
	while (true)
	{
		func_191();
		if (func_181() || func_177(17))
		{
			func_192();
		}
		if (network::network_is_in_tutorial_session())
		{
			func_192();
		}
		switch (func_176(network::participant_id_to_int()))
		{
			case 0:
				if (func_175() == 1)
				{
					func_174();
					func_173();
					if (func_172(60000))
					{
						if (!func_170())
						{
							if (!vehicle::is_this_model_a_bike(Local_98.f_10))
							{
								func_169("DSV_HELP1", -1);
							}
							else
							{
								func_169("DSV_HELP2", -1);
							}
						}
					}
					vLocal_147[network::participant_id_to_int() /*3*/] = 1;
				}
				else if (func_175() == 4)
				{
					vLocal_147[network::participant_id_to_int() /*3*/] = 3;
				}
				break;
			
			case 1:
				if (func_175() == 1)
				{
					func_40();
				}
				else if (func_175() == 4)
				{
					vLocal_147[network::participant_id_to_int() /*3*/] = 3;
				}
				break;
			
			case 3:
				func_39(&(Local_98.f_45));
				if (func_38(&(Local_98.f_45)))
				{
					vLocal_147[network::participant_id_to_int() /*3*/] = 4;
				}
				break;
			
			case 2:
				vLocal_147[network::participant_id_to_int() /*3*/] = 4;
			
			case 4:
				func_192();
				break;
		}
		if (network::network_is_host_of_this_script())
		{
			switch (func_175())
			{
				case 0:
					if (func_10())
					{
						func_174();
						func_9(&(Local_98.f_43), 0, 0);
						Local_98 = 1;
					}
					break;
				
				case 1:
					func_8();
					func_7();
					if (func_1())
					{
						Local_98 = 4;
					}
					break;
				
				case 4:
					break;
				}
		}
	}
}

bool func_1()//Position - 0x239
{
	if (func_2())
	{
		return true;
	}
	return false;
}

bool func_2()//Position - 0x24D
{
	struct<14> Var0;
	struct<14> Var14;
	
	if (Local_98.f_42 == 0)
	{
		if (Local_98 != 4)
		{
			if (entity::is_entity_dead(network::net_to_veh(Local_98.f_2)))
			{
				if (func_6(&(Local_98.f_47), 3000, 0))
				{
					if (Local_98.f_8 == func_5())
					{
						Var0.f_2 = 116;
						func_3(Var0, func_4(1));
					}
					else
					{
						Var0.f_2 = 117;
						Var0.f_10 = Local_98.f_8;
						func_3(Var0, func_4(1));
					}
					return true;
				}
			}
			if (func_6(&(Local_98.f_43), Global_262145.f_9041, 0))
			{
				Var14.f_2 = 118;
				func_3(Var14, func_4(1));
				return true;
			}
		}
	}
	return false;
}

void func_3(struct<2> Param0, var uParam2, var uParam3, var uParam4, var uParam5, var uParam6, var uParam7, var uParam8, var uParam9, var uParam10, var uParam11, var uParam12, var uParam13, int iParam14)//Position - 0x2EF
{
	Param0 = 0;
	Param0.f_1 = player::player_id();
	if (!iParam14 == 0)
	{
		script::trigger_script_event(1, &Param0, 14, iParam14);
	}
}

var func_4(int iParam0)//Position - 0x318
{
	var uVar0;
	int iVar1;
	int iVar2;
	
	iVar1 = 0;
	while (iVar1 < network::_network_get_num_participants_host())
	{
		if (network::network_is_participant_active(player::int_to_participantindex(iVar1)))
		{
			iVar2 = network::network_get_player_index(player::int_to_participantindex(iVar1));
			if (func_205(iVar2, 0, 0))
			{
				if (iVar2 != player::player_id() || iParam0)
				{
					gameplay::set_bit(&uVar0, iVar2);
				}
			}
		}
		iVar1++;
	}
	return uVar0;
}

int func_5()//Position - 0x375
{
	return -1;
}

bool func_6(var uParam0, int iParam1, int iParam2)//Position - 0x37E
{
	if (iParam1 == -1)
	{
		return true;
	}
	func_9(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_7()//Position - 0x3DC
{
	switch (Local_98.f_42)
	{
		case 0:
			break;
		
		case 1:
			break;
	}
}

void func_8()//Position - 0x3FF
{
	struct<14> Var0;
	int iVar14;
	
	if (Local_98 != 4)
	{
		iLocal_246 = 0;
		while (iLocal_246 < network::_network_get_num_participants_host())
		{
			if (network::network_is_participant_active(player::int_to_participantindex(iLocal_246)))
			{
				iVar14 = network::network_get_player_index(player::int_to_participantindex(iLocal_246));
				if (gameplay::is_bit_set(vLocal_147[iLocal_246 /*3*/].f_1, 0))
				{
					Var0.f_2 = 117;
					Var0.f_10 = iVar14;
					Local_98.f_8 = iVar14;
					func_3(Var0, func_4(1));
					Local_98 = 4;
					return;
				}
				if (!gameplay::is_bit_set(Local_98.f_1, 0))
				{
					if (gameplay::is_bit_set(vLocal_147[iLocal_246 /*3*/].f_1, 1))
					{
						gameplay::set_bit(&(Local_98.f_1), 0);
					}
					if (gameplay::is_bit_set(vLocal_147[iLocal_246 /*3*/].f_1, 2))
					{
						gameplay::set_bit(&(Local_98.f_1), 0);
					}
				}
				else
				{
					if (!gameplay::is_bit_set(Local_98.f_1, 1))
					{
						if (gameplay::is_bit_set(vLocal_147[iLocal_246 /*3*/].f_1, 3))
						{
							gameplay::set_bit(&(Local_98.f_1), 1);
						}
					}
					if (!gameplay::is_bit_set(Local_98.f_1, 2))
					{
						if (gameplay::is_bit_set(vLocal_147[iLocal_246 /*3*/].f_1, 4))
						{
							gameplay::set_bit(&(Local_98.f_1), 2);
						}
					}
					if (!gameplay::is_bit_set(Local_98.f_1, 3))
					{
						if (gameplay::is_bit_set(vLocal_147[iLocal_246 /*3*/].f_1, 5))
						{
							gameplay::set_bit(&(Local_98.f_1), 3);
						}
					}
					if (!gameplay::is_bit_set(Local_98.f_1, 4))
					{
						if (gameplay::is_bit_set(vLocal_147[iLocal_246 /*3*/].f_1, 6))
						{
							gameplay::set_bit(&(Local_98.f_1), 4);
						}
					}
				}
			}
			iLocal_246++;
		}
	}
}

void func_9(var uParam0, int iParam1, int iParam2)//Position - 0x54B
{
	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;
	}
}

bool func_10()//Position - 0x590
{
	if (func_37(Local_98.f_10) && func_37(Local_98.f_11))
	{
		if ((func_21() && func_19()) && func_11())
		{
			streaming::set_model_as_no_longer_needed(Local_98.f_10);
			streaming::set_model_as_no_longer_needed(Local_98.f_11);
			return true;
		}
	}
	return false;
}

bool func_11()//Position - 0x5DE
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < Local_98.f_14)
	{
		if ((!network::network_does_network_id_exist(Local_98.f_4[iVar0]) && func_37(Local_98.f_11)) && network::network_does_network_id_exist(Local_98.f_2))
		{
			if (func_17(Local_98.f_2))
			{
				if (Local_98.f_12 == 0)
				{
					if (func_16(&(Local_98.f_4[iVar0]), Local_98.f_2, 22, Local_98.f_11, iVar0, 1, 1, 1))
					{
						func_13(&(Local_98.f_4[iVar0]));
					}
				}
				else if (func_12(&(Local_98.f_4[iVar0]), 22, Local_98.f_11, Local_98.f_28[iVar0 /*3*/], Local_98.f_38[iVar0], 1, 1, 1))
				{
					func_13(&(Local_98.f_4[iVar0]));
				}
			}
		}
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 < Local_98.f_14)
	{
		if (!network::network_does_network_id_exist(Local_98.f_4[iVar0]))
		{
			return false;
		}
		iVar0++;
	}
	return true;
}

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

void func_13(var uParam0)//Position - 0x724
{
	int iVar0;
	
	ped::set_ped_relationship_group_hash(network::net_to_ped(*uParam0), Global_1574228);
	ped::set_ped_random_component_variation(network::net_to_ped(*uParam0), 0);
	ped::set_ped_keep_task(network::net_to_ped(*uParam0), true);
	weapon::give_delayed_weapon_to_ped(network::net_to_ped(*uParam0), func_15(), 25000, 1);
	iVar0 = gameplay::get_random_int_in_range(0, 10);
	if (iVar0 == 0 || iVar0 == 1)
	{
		ped::set_ped_combat_ability(network::net_to_ped(*uParam0), 0);
	}
	else if ((iVar0 == 2 || iVar0 == 3) || iVar0 == 4)
	{
		ped::set_ped_combat_ability(network::net_to_ped(*uParam0), 2);
	}
	else
	{
		ped::set_ped_combat_ability(network::net_to_ped(*uParam0), 1);
	}
	iVar0 = gameplay::get_random_int_in_range(0, 10);
	if ((iVar0 == 0 || iVar0 == 1) || iVar0 == 2)
	{
		ped::set_ped_combat_attributes(network::net_to_ped(*uParam0), 5, true);
	}
	else if (iVar0 == 3)
	{
		ped::set_ped_combat_attributes(network::net_to_ped(*uParam0), 17, true);
	}
	else if ((iVar0 == 4 || iVar0 == 5) || iVar0 == 6)
	{
		ped::set_ped_combat_attributes(network::net_to_ped(*uParam0), 13, true);
	}
	if (func_14())
	{
		ped::set_ped_combat_attributes(network::net_to_ped(*uParam0), 20, true);
	}
	ped::set_ped_combat_attributes(network::net_to_ped(*uParam0), 2, true);
	iVar0 = gameplay::get_random_int_in_range(0, 4);
	if (iVar0 == 0)
	{
		ped::set_ped_combat_movement(network::net_to_ped(*uParam0), 2);
	}
	else if (iVar0 == 1)
	{
		ped::set_ped_combat_movement(network::net_to_ped(*uParam0), 1);
	}
	else if (iVar0 == 2)
	{
		ped::set_ped_combat_movement(network::net_to_ped(*uParam0), 3);
	}
	ped::_0x49E50BDB8BA4DAB2(network::net_to_ped(*uParam0), 1);
	ped::set_ped_get_out_upside_down_vehicle(network::net_to_ped(*uParam0), 1);
	ped::set_ped_config_flag(network::net_to_ped(*uParam0), 29, true);
	ped::set_ped_can_be_knocked_off_vehicle(network::net_to_ped(*uParam0), 3);
	entity::set_entity_health(network::net_to_ped(*uParam0), system::round((200f * Global_262145.f_150)));
}

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

int func_15()//Position - 0x90D
{
	switch (Local_98.f_11)
	{
		case joaat("g_m_y_ballaorig_01"):
		case joaat("g_m_y_ballaeast_01"):
			switch (gameplay::get_random_int_in_range(0, 5))
			{
				case 0:
					return joaat("weapon_combatpistol");
				
				case 1:
					return joaat("weapon_pumpshotgun");
				
				case 2:
					return joaat("weapon_microsmg");
				
				case 3:
					return joaat("weapon_mg");
				
				case 4:
					return joaat("weapon_assaultrifle");
				
				default:
			}
			break;
		
		case joaat("g_m_y_mexgoon_02"):
		case joaat("g_f_y_vagos_01"):
			switch (gameplay::get_random_int_in_range(0, 5))
			{
				case 0:
					return joaat("weapon_pistol");
				
				case 1:
					return joaat("weapon_pumpshotgun");
				
				case 2:
					return joaat("weapon_microsmg");
				
				case 3:
					return joaat("weapon_mg");
				
				case 4:
					return joaat("weapon_assaultrifle");
				
				default:
			}
			break;
		
		case joaat("g_m_y_lost_01"):
		case joaat("g_f_y_lost_01"):
			switch (gameplay::get_random_int_in_range(0, 5))
			{
				case 0:
					return joaat("weapon_combatpistol");
				
				case 1:
					return joaat("weapon_sawnoffshotgun");
				
				case 2:
					return joaat("weapon_smg");
				
				case 3:
					return joaat("weapon_mg");
				
				case 4:
					return joaat("weapon_assaultrifle");
				
				default:
			}
			break;
		
		case joaat("g_m_m_chigoon_02"):
		case joaat("g_m_m_chigoon_01"):
			switch (gameplay::get_random_int_in_range(0, 5))
			{
				case 0:
					return joaat("weapon_pistol");
				
				case 1:
					return joaat("weapon_pumpshotgun");
				
				case 2:
					return joaat("weapon_advancedrifle");
				
				case 3:
					return joaat("weapon_mg");
				
				case 4:
					return joaat("weapon_carbinerifle");
				
				default:
			}
			break;
		
		case joaat("g_m_m_armgoon_01"):
		case joaat("g_m_y_armgoon_02"):
			switch (gameplay::get_random_int_in_range(0, 5))
			{
				case 0:
					return joaat("weapon_pistol");
				
				case 1:
					return joaat("weapon_sawnoffshotgun");
				
				case 2:
					return joaat("weapon_smg");
				
				case 3:
					return joaat("weapon_mg");
				
				case 4:
					return joaat("weapon_carbinerifle");
				
				default:
			}
			break;
		
		case joaat("a_m_m_hillbilly_02"):
		case joaat("a_m_m_hillbilly_01"):
			switch (gameplay::get_random_int_in_range(0, 5))
			{
				case 0:
					return joaat("weapon_combatpistol");
				
				case 1:
					return joaat("weapon_sawnoffshotgun");
				
				case 2:
					return joaat("weapon_microsmg");
				
				case 3:
					return joaat("weapon_mg");
				
				case 4:
					return joaat("weapon_combatmg");
				
				default:
			}
			break;
		
		case joaat("g_m_y_salvagoon_01"):
		case joaat("g_m_y_salvagoon_02"):
			switch (gameplay::get_random_int_in_range(0, 5))
			{
				case 0:
					return joaat("weapon_pistol");
				
				case 1:
					return joaat("weapon_pumpshotgun");
				
				case 2:
					return joaat("weapon_microsmg");
				
				case 3:
					return joaat("weapon_mg");
				
				case 4:
					return joaat("weapon_assaultrifle");
				
				default:
			}
			break;
		
		case joaat("g_m_y_strpunk_01"):
		case joaat("g_m_y_strpunk_02"):
			switch (gameplay::get_random_int_in_range(0, 5))
			{
				case 0:
					return joaat("weapon_pistol");
				
				case 1:
					return joaat("weapon_sawnoffshotgun");
				
				case 2:
					return joaat("weapon_microsmg");
				
				case 3:
					return joaat("weapon_mg");
				
				case 4:
					return joaat("weapon_assaultrifle");
				
				default:
			}
			break;
		
		default:
			switch (gameplay::get_random_int_in_range(0, 5))
			{
				case 0:
					return joaat("weapon_pistol");
				
				case 1:
					return joaat("weapon_pumpshotgun");
				
				case 2:
					return joaat("weapon_smg");
				
				case 3:
					return joaat("weapon_combatmg");
				
				case 4:
					return joaat("weapon_carbinerifle");
				
				default:
			}
			break;
	}
	return joaat("weapon_pistol");
}

bool func_16(var uParam0, int iParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7)//Position - 0xC77
{
	if (!network::can_register_mission_peds(1))
	{
		return false;
	}
	if (!network::network_does_network_id_exist(iParam1))
	{
		return false;
	}
	if (!vehicle::is_vehicle_driveable(network::net_to_veh(iParam1), 0))
	{
		return false;
	}
	*uParam0 = network::ped_to_net(ped::create_ped_inside_vehicle(network::net_to_veh(iParam1), iParam2, iParam3, iParam4, iParam6, iParam5));
	if (network::network_does_network_id_exist(*uParam0))
	{
		entity::_0x3910051CCECDB00C(network::net_to_ped(*uParam0), iParam7);
		if (network::_0xC7827959479DCC78(network::net_to_ped(*uParam0)))
		{
			if (iParam5)
			{
				network::set_network_id_exists_on_all_machines(*uParam0, 1);
			}
		}
		return true;
	}
	return false;
}

int func_17(int iParam0)//Position - 0xCFF
{
	if (network::network_does_network_id_exist(iParam0))
	{
		return !func_18(network::net_to_veh(iParam0));
	}
	return false;
}

bool func_18(int iParam0)//Position - 0xD1F
{
	if (entity::does_entity_exist(iParam0))
	{
		if (entity::is_entity_dead(iParam0))
		{
			return true;
		}
		else if (!vehicle::is_vehicle_driveable(iParam0, 0))
		{
			return true;
		}
	}
	else
	{
		return true;
	}
	return false;
}

bool func_19()//Position - 0xD57
{
	if ((!network::network_does_network_id_exist(Local_98.f_3) && func_37(Local_98.f_11)) && network::network_does_network_id_exist(Local_98.f_2))
	{
		if (func_17(Local_98.f_2))
		{
			if (Local_98.f_12 == 1)
			{
				if (func_12(&(Local_98.f_3), 22, Local_98.f_11, Local_98.f_24, Local_98.f_27, 1, 1, 1))
				{
					func_13(&(Local_98.f_3));
					func_20();
				}
			}
			else if (func_16(&(Local_98.f_3), Local_98.f_2, 22, Local_98.f_11, -1, 1, 1, 1))
			{
				func_13(&(Local_98.f_3));
				func_20();
			}
		}
	}
	if (!network::network_does_network_id_exist(Local_98.f_3))
	{
		return false;
	}
	return true;
}

void func_20()//Position - 0xDFB
{
	if (Local_98.f_12 == 0)
	{
		if (func_14())
		{
			ai::task_vehicle_drive_wander(network::net_to_ped(Local_98.f_3), network::net_to_veh(Local_98.f_2), gameplay::get_random_float_in_range(7f, 18f), 786468);
		}
		else
		{
			ai::task_vehicle_drive_wander(network::net_to_ped(Local_98.f_3), network::net_to_veh(Local_98.f_2), gameplay::get_random_float_in_range(7f, 18f), 786599);
		}
	}
	else if (Local_98.f_12 == 2)
	{
		func_174();
		ai::task_perform_sequence(network::net_to_ped(Local_98.f_3), iLocal_245);
	}
}

bool func_21()//Position - 0xE79
{
	int iVar0;
	
	if (!network::network_does_network_id_exist(Local_98.f_2))
	{
		if (func_37(Local_98.f_10))
		{
			if (func_23(&(Local_98.f_16), &(Local_98.f_19)))
			{
				if (func_22(&(Local_98.f_2), Local_98.f_10, Local_98.f_16, Local_98.f_19, 1, 1, 1, 1, 0, 1))
				{
					entity::freeze_entity_position(network::net_to_veh(Local_98.f_2), false);
					entity::set_entity_dynamic(network::net_to_veh(Local_98.f_2), 1);
					rope::activate_physics(network::net_to_veh(Local_98.f_2));
					vehicle::set_vehicle_engine_on(network::net_to_veh(Local_98.f_2), true, 1, 0);
					entity::_0x3910051CCECDB00C(network::net_to_veh(Local_98.f_2), false);
					if (decorator::decor_is_registered_as_type("Not_Allow_As_Saved_Veh", 3))
					{
						decorator::decor_set_int(network::net_to_veh(Local_98.f_2), "Not_Allow_As_Saved_Veh", 1);
					}
					if (decorator::decor_is_registered_as_type("MPBitset", 3))
					{
						if (decorator::decor_exist_on(network::net_to_veh(Local_98.f_2), "MPBitset"))
						{
							iVar0 = decorator::decor_get_int(network::net_to_veh(Local_98.f_2), "MPBitset");
						}
						gameplay::set_bit(&iVar0, 10);
						decorator::decor_set_int(network::net_to_veh(Local_98.f_2), "MPBitset", iVar0);
					}
					if (Local_98.f_12 == 0)
					{
						if (vehicle::get_vehicle_max_number_of_passengers(network::net_to_veh(Local_98.f_2)) < Local_98.f_14)
						{
							Local_98.f_14 = vehicle::get_vehicle_max_number_of_passengers(network::net_to_veh(Local_98.f_2));
						}
					}
				}
			}
		}
	}
	if (!network::network_does_network_id_exist(Local_98.f_2))
	{
		return false;
	}
	return true;
}

bool func_22(var uParam0, int iParam1, vector3 vParam2, float fParam5, int iParam6, int iParam7, int iParam8, int iParam9, int iParam10, int iParam11)//Position - 0xFA8
{
	int iVar0;
	
	if (!network::can_register_mission_vehicles(1))
	{
		return false;
	}
	if (iParam11)
	{
		gameplay::clear_area_of_vehicles(vParam2, 1f, 0, 0, 1, 1, true);
	}
	iVar0 = vehicle::create_vehicle(iParam1, vParam2, fParam5, iParam7, iParam6);
	*uParam0 = network::veh_to_net(iVar0);
	if (network::network_does_network_id_exist(*uParam0))
	{
		entity::_0x3910051CCECDB00C(iVar0, iParam10);
		if (network::_0xC7827959479DCC78(iVar0))
		{
			if (iParam8)
			{
				network::set_network_id_exists_on_all_machines(*uParam0, 1);
			}
			else
			{
				network::set_network_id_exists_on_all_machines(*uParam0, 0);
			}
		}
		vehicle::set_vehicle_is_stolen(iVar0, iParam9);
		return true;
	}
	return false;
}

int func_23(var uParam0, float fParam1)//Position - 0x102B
{
	int iVar0;
	int iVar1;
	var uVar2;
	vector3 vVar5;
	
	vVar5 = { func_36(player::player_id()) };
	if (Local_98.f_12 == 1)
	{
		return true;
	}
	if (!iVar0)
	{
		if (vehicle::_0xA4822F1CF23F4810(&vVar5, uParam0, &uVar2, 0f, 180f, 150f, false, 1, 1))
		{
			pathfind::get_nth_closest_vehicle_node_with_heading(*uParam0, 1, uParam0, fParam1, &iVar1, 4, 3f, 0f);
			if (iVar1 >= 1)
			{
				if (gameplay::get_distance_between_coords(-1367.557f, -3220.598f, 12.9448f, vVar5, 1) >= 600f && gameplay::get_distance_between_coords(750f, -3200f, 6f, vVar5, 1) >= 700f)
				{
					if (iLocal_250 <= 5)
					{
						if (func_24(*uParam0, 1086324736, 1065353216, 1065353216, 1084227584, 1, 1, 1, 1123024896, 0, -1, 1, 0, 0, 0, 0))
						{
							iVar0 = true;
						}
					}
					else
					{
						Local_98 = 4;
					}
				}
			}
		}
	}
	if (!iVar0)
	{
		iLocal_249 += 4;
		if (iLocal_249 >= 80)
		{
			iLocal_249 = 20;
			iLocal_250++;
		}
	}
	return iVar0;
}

bool func_24(vector3 vParam0, float fParam3, float fParam4, float fParam5, float fParam6, int iParam7, int iParam8, int iParam9, float fParam10, int iParam11, int iParam12, int iParam13, float fParam14, int iParam15, float fParam16, int iParam17)//Position - 0x112B
{
	Global_2404919 = 0;
	if (fParam3 > 0f)
	{
		if (vehicle::is_any_vehicle_near_point(vParam0, fParam3))
		{
			return false;
		}
	}
	if (fParam4 > 0f)
	{
		if (ped::is_any_ped_near_point(vParam0.x, vParam0.y, (vParam0.y + 1f), fParam4) || ped::is_any_ped_near_point(vParam0, fParam4))
		{
			return false;
		}
	}
	if (fParam5 > 0f)
	{
		if (object::is_any_object_near_point(vParam0, fParam5, 0))
		{
			return false;
		}
	}
	Global_2404919++;
	if (iParam13)
	{
		if (fire::get_number_of_fires_in_range(vParam0, 2.5f) > 0)
		{
			return false;
		}
	}
	Global_2404919++;
	if (fParam14 > 0f)
	{
		if (func_30(vParam0, fParam14, 1, 1, iParam15, iParam17, 0, iParam15))
		{
			return false;
		}
	}
	Global_2404919++;
	if (iParam8)
	{
		if (fParam6 > 0f)
		{
			if (func_25(vParam0, fParam6, iParam7, iParam9, fParam10, iParam11, iParam12, fParam16, iParam17))
			{
				return false;
			}
		}
	}
	Global_2404919++;
	return true;
}

bool func_25(vector3 vParam0, float fParam3, int iParam4, int iParam5, float fParam6, int iParam7, int iParam8, float fParam9, int iParam10)//Position - 0x1228
{
	int iVar0;
	int iVar1;
	float fVar2;
	
	if (iParam4 && !iParam7)
	{
		if (func_205(player::player_id(), 1, 1))
		{
			if (!cam::is_screen_faded_out())
			{
				fVar2 = fParam6;
				if (fParam9 > 0f)
				{
					fVar2 = fParam9;
				}
				if (gameplay::get_distance_between_coords(func_36(player::player_id()), vParam0, 1) <= (fVar2 + fParam3))
				{
					if (cam::is_sphere_visible(vParam0, fParam3))
					{
						return true;
					}
				}
			}
		}
	}
	iVar0 = 0;
	while (iVar0 < 32)
	{
		iVar1 = iVar0;
		if (func_205(iVar1, 1, 1))
		{
			if (!func_27(iVar1, 0) && network::_0x9DE986FC9A87C474(player::player_id(), iVar1))
			{
				if (iParam4 == 1 || (iParam4 == 0 && iVar1 != player::player_id()))
				{
					if ((func_26(iVar1) || !iParam10) && !Global_2417071[iVar1 /*306*/].f_255)
					{
						fVar2 = fParam6;
						if (fParam9 > 0f)
						{
							if (!player::get_player_team(iVar1) == -1)
							{
								if (player::get_player_team(iVar1) == player::get_player_team(player::player_id()))
								{
									fVar2 = fParam9;
								}
							}
						}
						if (!iParam7)
						{
							if ((iParam5 || (iParam5 == 0 && player::get_player_team(iVar1) != player::get_player_team(player::player_id()))) || player::get_player_team(iVar1) == -1)
							{
								if (gameplay::get_distance_between_coords(func_36(iVar1), vParam0, 1) <= (fVar2 + fParam3))
								{
									if (network::is_sphere_visible_to_player(iVar1, vParam0, fParam3))
									{
										return true;
									}
								}
							}
						}
						else if (player::get_player_team(iVar1) != iParam8 || player::get_player_team(iVar1) == -1)
						{
							if (gameplay::get_distance_between_coords(func_36(iVar1), vParam0, 1) <= (fVar2 + fParam3))
							{
								if (network::is_sphere_visible_to_player(iVar1, vParam0, fParam3))
								{
									return true;
								}
							}
						}
					}
				}
			}
		}
		iVar0++;
	}
	return false;
}

bool func_26(int iParam0)//Position - 0x13DF
{
	if (entity::is_entity_visible_to_script(player::get_player_ped(iParam0)) || Global_2417071[iParam0 /*306*/].f_241)
	{
		return true;
	}
	return false;
}

int func_27(int iParam0, int iParam1)//Position - 0x140A
{
	int iVar0;
	
	if (iParam0 == player::player_id())
	{
		iVar0 = func_28(-1, 0) == 8;
	}
	else
	{
		iVar0 = Global_1587175[iParam0 /*410*/].f_192 == 8;
	}
	if (iParam1 == 1)
	{
		if (network::network_is_player_active(iParam0))
		{
			iVar0 = player::get_player_team(iParam0) == 8;
		}
	}
	return iVar0;
}

int func_28(int iParam0, int iParam1)//Position - 0x1455
{
	int iVar0;
	int iVar1;
	
	iVar1 = iParam0;
	if (iVar1 == -1)
	{
		iVar1 = func_29();
	}
	if (Global_1315889[iVar1] == 1)
	{
		if (iParam1)
		{
		}
		iVar0 = 8;
	}
	else
	{
		iVar0 = Global_1312740[iVar1];
		if (iParam1)
		{
		}
	}
	return iVar0;
}

var func_29()//Position - 0x1496
{
	return Global_1312746;
}

bool func_30(vector3 vParam0, float fParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8, var uParam9)//Position - 0x14A2
{
	int iVar0;
	int iVar1;
	
	iVar0 = 0;
	while (iVar0 < 32)
	{
		iVar1 = iVar0;
		if ((iParam8 == 1 && player::player_id() != iVar1) || iParam8 == 0)
		{
			if (func_205(iVar1, iParam4, iParam5))
			{
				if (network::_0x9DE986FC9A87C474(player::player_id(), iVar1))
				{
					if (!iParam7 || (!ped::is_ped_injured(player::get_player_ped(iVar1)) && func_26(iVar1)))
					{
						if ((!iParam6 || (iParam6 == 1 && player::get_player_team(player::player_id()) != player::get_player_team(iVar1))) || player::get_player_team(player::player_id()) == -1)
						{
							if (((player::get_player_team(player::player_id()) == -1 && uParam9) && iParam6) && func_31(iVar1))
							{
							}
							else if (entity::does_entity_exist(player::get_player_ped(iVar1)))
							{
								if (gameplay::get_distance_between_coords(func_36(iVar1), vParam0, 1) < fParam3)
								{
									return true;
								}
							}
						}
					}
				}
			}
		}
		iVar0++;
	}
	return false;
}

bool func_31(int iParam0)//Position - 0x159E
{
	if (func_35(player::player_id(), iParam0))
	{
		return true;
	}
	Global_2457104 = { func_34(iParam0) };
	if (network::network_is_friend(&Global_2457104))
	{
		return true;
	}
	if (func_32(player::player_id(), iParam0))
	{
		return true;
	}
	return false;
}

bool func_32(int iParam0, int iParam1)//Position - 0x15E5
{
	int iVar0;
	
	iVar0 = func_33(iParam0);
	if (!iVar0 == func_5())
	{
		if (iVar0 == func_33(iParam1))
		{
			return true;
		}
	}
	return false;
}

int func_33(int iParam0)//Position - 0x1610
{
	if (iParam0 != func_5())
	{
		return Global_1608811[iParam0 /*109*/].f_9;
	}
	return func_5();
}

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

bool func_35(int iParam0, int iParam1)//Position - 0x1649
{
	if (network::_network_player_is_in_clan())
	{
		Global_2457104 = { func_34(iParam0) };
		Global_2457117 = { func_34(iParam1) };
		if (network::network_clan_player_is_active(&Global_2457104))
		{
			if (network::network_clan_player_is_active(&Global_2457117))
			{
				network::network_clan_player_get_desc(&Global_2457034, 35, &Global_2457104);
				network::network_clan_player_get_desc(&Global_2457069, 35, &Global_2457117);
				if (Global_2457034 == Global_2457069)
				{
					return true;
				}
			}
		}
	}
	return false;
}

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

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

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

void func_39(var uParam0)//Position - 0x1710
{
	if (!uParam0->f_1)
	{
		if (network::network_is_host_of_this_script())
		{
			func_9(uParam0, 0, 0);
		}
	}
}

void func_40()//Position - 0x172F
{
	switch (vLocal_147[network::participant_id_to_int() /*3*/].f_2)
	{
		case 0:
			func_173();
			func_46();
			func_41();
			if (Local_98.f_42 > 0)
			{
				vLocal_147[network::participant_id_to_int() /*3*/].f_2 = 1;
			}
			break;
		
		case 1:
			func_192();
			break;
	}
}

void func_41()//Position - 0x177B
{
	int iVar0;
	
	func_42(Local_98.f_3, &iLocal_251, -1082130432, 0, 0, 0, 0, -1);
	iVar0 = 0;
	while (iVar0 < Local_98.f_14)
	{
		func_42(Local_98.f_4[iVar0], &(Local_259[iVar0 /*8*/]), -1082130432, 0, 0, 0, 0, -1);
		iVar0++;
	}
	if (gameplay::is_bit_set(Local_98.f_1, 0))
	{
		if (!gameplay::is_bit_set(Local_98.f_1, 1) && !gameplay::is_bit_set(vLocal_147[network::participant_id_to_int() /*3*/].f_1, 3))
		{
			if (network::network_does_network_id_exist(Local_98.f_3))
			{
				if (network::network_has_control_of_network_id(Local_98.f_3) || (!network::_0xA1607996431332DF(Local_98.f_3) && network::network_is_host_of_this_script()))
				{
					ped::set_ped_relationship_group_hash(network::net_to_ped(Local_98.f_3), Global_1574229);
					gameplay::set_bit(&(vLocal_147[network::participant_id_to_int() /*3*/].f_1), 3);
				}
			}
		}
		iVar0 = 0;
		while (iVar0 < 3)
		{
			if (!gameplay::is_bit_set(Local_98.f_1, (2 + iVar0)) && !gameplay::is_bit_set(vLocal_147[network::participant_id_to_int() /*3*/].f_1, (4 + iVar0)))
			{
				if (network::network_does_network_id_exist(Local_98.f_4[iVar0]))
				{
					if (network::network_has_control_of_network_id(Local_98.f_4[iVar0]) || (!network::_0xA1607996431332DF(Local_98.f_4[iVar0]) && network::network_is_host_of_this_script()))
					{
						ped::set_ped_relationship_group_hash(network::net_to_ped(Local_98.f_4[iVar0]), Global_1574229);
						if (!ped::is_ped_injured(network::net_to_ped(Local_98.f_4[iVar0])))
						{
							ai::task_combat_hated_targets_around_ped(network::net_to_ped(Local_98.f_4[iVar0]), 100f, 0);
						}
						gameplay::set_bit(&(vLocal_147[network::participant_id_to_int() /*3*/].f_1), (4 + iVar0));
					}
				}
			}
			iVar0++;
		}
	}
}

void func_42(int iParam0, int iParam1, float fParam2, int iParam3, int iParam4, int iParam5, char* sParam6, int iParam7)//Position - 0x1908
{
	if (network::network_does_network_id_exist(iParam0))
	{
		if (func_45())
		{
			Global_2426867 = player::player_id();
		}
		if (iParam3)
		{
			func_44(network::net_to_ped(iParam0), iParam1, 1, Global_2426867, iParam4, iParam5, fParam2, sParam6, iParam7);
		}
		else
		{
			func_44(network::net_to_ped(iParam0), iParam1, -1, Global_2426867, iParam4, iParam5, fParam2, sParam6, iParam7);
		}
	}
	else if (ui::does_blip_exist(*iParam1))
	{
		func_43(iParam1);
	}
}

void func_43(int iParam0)//Position - 0x197B
{
	int iVar0;
	struct<8> Var1;
	
	if (ui::does_blip_exist(*iParam0))
	{
		ui::remove_blip(iParam0);
		iVar0 = true;
	}
	if (ui::does_blip_exist(iParam0->f_1))
	{
		ui::remove_blip(&(iParam0->f_1));
		iVar0 = true;
	}
	if (entity::does_entity_exist(iParam0->f_7))
	{
		if (!ped::is_ped_injured(iParam0->f_7))
		{
			if (ui::does_ped_have_ai_blip(iParam0->f_7))
			{
				ui::_0xD30C50DF888D58B5(iParam0->f_7, 0);
			}
		}
		iVar0 = true;
	}
	if (iVar0)
	{
		*iParam0 = { Var1 };
	}
}

bool func_44(int iParam0, var uParam1, int iParam2, int iParam3, int iParam4, int iParam5, float fParam6, char* sParam7, int iParam8)//Position - 0x19E9
{
	if (iParam3 == 0)
	{
		iParam3 = player::get_player_index();
	}
	if (fParam6 < 0f)
	{
		fParam6 = 100f;
	}
	if (!ped::is_ped_injured(iParam0))
	{
		if (!ui::does_ped_have_ai_blip(iParam0))
		{
			if (iParam8 == -1)
			{
				ui::_0xD30C50DF888D58B5(iParam0, 1);
			}
			else
			{
				unk_0xB13DCB4C6FAAD238(iParam0, 1, iParam8);
			}
			uParam1->f_7 = iParam0;
			ui::_0xE52B8E7F85D39A08(iParam0, iParam2);
			ui::_0x97C65887D4B37FA9(iParam0, fParam6);
			if (ui::does_blip_exist(*uParam1))
			{
				ui::set_blip_priority(*uParam1, 7);
			}
		}
		ui::_0x0C4BBF625CA98C4E(iParam0, iParam4);
		ui::hide_special_ability_lockon_operation(iParam0, iParam5);
		*uParam1 = ui::_0x7CD934010E115C2C(iParam0);
		if (!gameplay::is_bit_set(uParam1->f_6, 2))
		{
			if (ui::does_blip_exist(*uParam1))
			{
				if (!gameplay::is_string_null_or_empty(sParam7))
				{
					ui::begin_text_command_set_blip_name("MCUSTBLIP");
					ui::add_text_component_substring_player_name(sParam7);
					ui::end_text_command_set_blip_name(*uParam1);
				}
				gameplay::set_bit(&(uParam1->f_6), 2);
			}
		}
		if (ped::is_ped_in_any_vehicle(iParam0, 0))
		{
			uParam1->f_1 = ui::_0x56176892826A4FE8(iParam0);
			if (!gameplay::is_bit_set(uParam1->f_6, 3))
			{
				if (ui::does_blip_exist(uParam1->f_1))
				{
					ui::set_blip_priority(uParam1->f_1, 7);
					gameplay::set_bit(&(uParam1->f_6), 3);
				}
			}
		}
		else if (ui::does_blip_exist(uParam1->f_1))
		{
			uParam1->f_1 = 0;
			gameplay::clear_bit(&(uParam1->f_6), 3);
		}
	}
	else
	{
		return true;
	}
	return false;
}

var func_45()//Position - 0x1B19
{
	return Global_1315886;
}

void func_46()//Position - 0x1B25
{
	var uVar0;
	int iVar1;
	var uVar2;
	var uVar3;
	
	if (network::network_does_network_id_exist(Local_98.f_2))
	{
		if (!gameplay::is_bit_set(vLocal_147[network::participant_id_to_int() /*3*/].f_1, 0))
		{
			if (!vehicle::is_vehicle_driveable(network::net_to_veh(Local_98.f_2), 0))
			{
			}
			if (entity::is_entity_dead(network::net_to_veh(Local_98.f_2)))
			{
			}
			if (entity::is_entity_dead(network::net_to_veh(Local_98.f_2)))
			{
				if (player::player_id() == network::network_get_destroyer_of_network_id(Local_98.f_2, &uVar0))
				{
					func_166(2093, 1, -1);
					func_163(68, 1, -1);
					func_120(0, player::player_ped_id(), "XPT_KAIE", -875716015, 1504756458, Global_262145.f_6466, 1, -1, 0, 0);
					if (func_14())
					{
						func_107(86, "DSV_PASS0", 0, 0, -99);
					}
					else
					{
						func_107(86, "DSV_PASS1", 0, 0, -99);
					}
					iVar1 = Global_262145.f_6467;
					Global_2443261 = iVar1;
					func_68(&iVar1, 1);
					if (iVar1 > 0)
					{
						func_64(iVar1, 1, 1, 1092616192);
						if (func_63())
						{
							func_54(-1922554349, iVar1, &uVar2, 0, 0, 0);
						}
						else
						{
							networkcash::_0xFB6DB092FBAE29E6(iVar1, "AM_DESTROY_VEH", &uVar3);
						}
					}
					gameplay::set_bit(&(vLocal_147[network::participant_id_to_int() /*3*/].f_1), 0);
				}
			}
			else
			{
				if (!gameplay::is_bit_set(Local_98.f_1, 0))
				{
					if (!gameplay::is_bit_set(vLocal_147[network::participant_id_to_int() /*3*/].f_1, 1))
					{
						if (func_53(player::player_ped_id(), network::net_to_veh(Local_98.f_2), 1))
						{
							gameplay::set_bit(&(vLocal_147[network::participant_id_to_int() /*3*/].f_1), 1);
						}
					}
					if (!gameplay::is_bit_set(vLocal_147[network::participant_id_to_int() /*3*/].f_1, 2))
					{
						if (entity::has_entity_been_damaged_by_entity(network::net_to_veh(Local_98.f_2), player::player_ped_id(), 1))
						{
							gameplay::set_bit(&(vLocal_147[network::participant_id_to_int() /*3*/].f_1), 2);
						}
					}
				}
				if (func_205(player::player_id(), 1, 1) && func_53(player::player_ped_id(), network::net_to_veh(Local_98.f_2), 0))
				{
					if (!gameplay::is_bit_set(Global_2458121.f_4418, 1))
					{
						gameplay::set_bit(&(Global_2458121.f_4418), 1);
					}
				}
				else if (gameplay::is_bit_set(Global_2458121.f_4418, 1))
				{
					gameplay::clear_bit(&(Global_2458121.f_4418), 1);
				}
				func_47();
			}
		}
	}
}

void func_47()//Position - 0x1D1C
{
	if (!gameplay::is_bit_set(iLocal_244, 0))
	{
		if (func_52(27, -1) == 0)
		{
			if (func_205(player::player_id(), 1, 1))
			{
				if (func_53(player::player_ped_id(), network::net_to_veh(Local_98.f_2), 0))
				{
					if (func_6(&uLocal_284, 300000, 0))
					{
						func_50(27, 1, -1);
						gameplay::set_bit(&iLocal_244, 0);
					}
				}
				else if (func_49(&uLocal_284))
				{
					func_48(&uLocal_284);
				}
			}
			else if (func_49(&uLocal_284))
			{
				func_48(&uLocal_284);
			}
		}
		else
		{
			gameplay::set_bit(&iLocal_244, 0);
		}
	}
}

void func_48(var uParam0)//Position - 0x1DAB
{
	uParam0->f_1 = 0;
}

var func_49(var uParam0)//Position - 0x1DB8
{
	return uParam0->f_1;
}

void func_50(int iParam0, int iParam1, int iParam2)//Position - 0x1DC4
{
	int iVar0;
	
	iVar0 = Global_2489256[iParam0 /*5*/][func_51(iParam2)];
	stats::stat_set_bool(iVar0, iParam1, 1);
}

int func_51(int iParam0)//Position - 0x1DE8
{
	int iVar0;
	int iVar1;
	
	iVar0 = iParam0;
	if (iVar0 == -1)
	{
		iVar1 = func_29();
		if (iVar1 > -1)
		{
			Global_2466487 = 0;
			iVar0 = iVar1;
		}
		else
		{
			iVar0 = 0;
			Global_2466487 = 1;
		}
	}
	return iVar0;
}

int func_52(int iParam0, int iParam1)//Position - 0x1E1C
{
	int iVar0;
	var uVar1;
	
	iVar0 = Global_2489256[iParam0 /*5*/][func_51(iParam1)];
	if (stats::stat_get_bool(iVar0, &uVar1, -1))
	{
		return uVar1;
	}
	return 0;
}

bool func_53(int iParam0, int iParam1, int iParam2)//Position - 0x1E48
{
	if (entity::does_entity_exist(iParam0) && !entity::is_entity_dead(iParam0))
	{
		if (entity::does_entity_exist(iParam1) && !entity::is_entity_dead(iParam1))
		{
			if (ped::is_ped_in_vehicle(iParam0, iParam1, iParam2))
			{
				return true;
			}
		}
	}
	return false;
}

void func_54(int iParam0, int iParam1, var uParam2, int iParam3, int iParam4, int iParam5)//Position - 0x1E8C
{
	int iVar0;
	
	if (!func_63())
	{
		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:
			if (iParam1 > 0)
			{
				func_55(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:
			func_55(uParam2, -1135378931, 1445302971, 1474183246, iParam0, iParam1, iVar0, 7);
			break;
	}
}

bool func_55(var uParam0, int iParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7)//Position - 0x21AE
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	
	iVar0 = false;
	if (!func_63())
	{
		iVar0 = true;
	}
	if (!iVar0)
	{
		if (!unk3::_0xB24F0944DA203D9E(func_29()) || unk3::_0x810E8431C0614BF9())
		{
			Global_2555082 = 1;
			return false;
		}
		if (Global_2442114)
		{
			if (iParam3 == 1067618600 || iParam3 == -1303831698)
			{
				Global_2555083 = 1;
				return false;
			}
		}
	}
	iVar2 = false;
	iVar1 = 0;
	while (iVar1 < 5)
	{
		if (Global_2554598[iVar1 /*72*/].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_62(iVar3, iParam1, iParam4, iParam2, iParam3, iParam5, 0, iParam6, iParam7);
			if (iVar0)
			{
				if (*uParam0 != -1)
				{
					Global_2554598[*uParam0 /*72*/].f_65 = 1;
				}
			}
			Global_2555074 = 1;
			return true;
		}
	}
	else
	{
		if (iParam7 & 2 != 0)
		{
			Global_2555081 = 1;
			Global_2555084 = iParam4;
			Global_2555086 = iParam3;
			Global_2555087 = 1;
			Global_2555085 = iParam5;
		}
		if (iParam7 & 8 != 0)
		{
			Global_2555084 = iParam4;
			Global_2555086 = iParam3;
			Global_2555087 = 1;
			Global_2555085 = iParam5;
		}
		iVar4 = false;
		if (iVar4)
		{
			func_61(1, iParam4);
			Global_2555081 = 0;
		}
		if (iParam7 & 4 != 0)
		{
			func_56(-1, iParam4, iParam6, iParam5, -1);
		}
	}
	return false;
}

void func_56(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4)//Position - 0x2322
{
	switch (iParam1)
	{
		case 1704445500:
			gameplay::set_bit(&(Global_2417071[player::player_id() /*306*/].f_121.f_71), 0);
			break;
	}
	if (iParam0 != -1)
	{
		func_57(iParam0);
	}
}

void func_57(int iParam0)//Position - 0x235A
{
	int iVar0;
	
	iVar0 = false;
	if (!func_63())
	{
		iVar0 = true;
	}
	if (iParam0 != -1)
	{
		if (func_60(iParam0))
		{
			if (!iVar0)
			{
				unk_0xFA336E7F40C0A0D0();
			}
		}
		else if (!iVar0)
		{
			unk3::_network_shop_end_service(Global_2554598[iParam0 /*72*/]);
		}
		func_58(&(Global_2554598[iParam0 /*72*/]));
	}
}

void func_58(var uParam0)//Position - 0x23AC
{
	*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_59(&(uParam0->f_8.f_3));
	func_59(&(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_65 = 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;
}

void func_59(var uParam0)//Position - 0x2493
{
	*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_60(int iParam0)//Position - 0x24DB
{
	if (iParam0 >= 0 && iParam0 < 5)
	{
		return Global_2554598[iParam0 /*72*/].f_5 == 1;
	}
	return false;
}

void func_61(int iParam0, int iParam1)//Position - 0x2503
{
	Global_2443392 = iParam1;
	Global_2443391 = iParam0;
}

int func_62(int iParam0, var uParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, var uParam8)//Position - 0x2517
{
	int iVar0;
	
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < 5)
	{
		if (Global_2554598[iVar0 /*72*/].f_2 == 0)
		{
			if (!func_63())
			{
				iParam0 = iVar0 + 900;
			}
			Global_2554598[iVar0 /*72*/].f_2 = 1;
			Global_2554598[iVar0 /*72*/].f_1 = iParam5;
			Global_2554598[iVar0 /*72*/].f_3 = uParam1;
			Global_2554598[iVar0 /*72*/].f_4 = iParam2;
			Global_2554598[iVar0 /*72*/].f_7 = iParam3;
			Global_2554598[iVar0 /*72*/].f_5 = 0;
			Global_2554598[iVar0 /*72*/] = iParam0;
			Global_2554598[iVar0 /*72*/].f_6 = iParam4;
			Global_2554598[iVar0 /*72*/].f_68 = uParam8;
			Global_2554598[iVar0 /*72*/].f_67 = iParam7;
			Global_2554598[iVar0 /*72*/].f_71 = 0;
			Global_2555074 = 0;
			if (iParam6)
			{
				Global_2554598[iVar0 /*72*/].f_5 = 1;
			}
			return iVar0;
		}
		iVar0++;
	}
	return -1;
}

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

void func_64(int iParam0, int iParam1, int iParam2, float fParam3)//Position - 0x25FF
{
	func_65(iParam0, iParam1, iParam2, fParam3);
}

void func_65(int iParam0, int iParam1, int iParam2, float fParam3)//Position - 0x2613
{
	func_66(iParam0, iParam1, iParam2, fParam3);
}

void func_66(int iParam0, int iParam1, int iParam2, float fParam3)//Position - 0x2627
{
	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_1587175[player::player_id() /*410*/].f_192.f_4 = iVar1;
	Global_1587175[player::player_id() /*410*/].f_192.f_3 = (Global_1587175[player::player_id() /*410*/].f_192.f_3 + iVar1);
	if (iParam2 == 1)
	{
		func_67(iVar1, 0);
	}
}

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

void func_68(var uParam0, int iParam1)//Position - 0x26BB
{
	int iVar0;
	
	if (*uParam0 > 0)
	{
		if (!func_106())
		{
			if (func_105(0))
			{
				if (network::network_is_player_active(func_104()))
				{
					if (func_103() == 100)
					{
						iVar0 = *uParam0;
						*uParam0 = 0;
					}
					else
					{
						iVar0 = ((*uParam0 / 100) * func_103());
						*uParam0 = (*uParam0 - iVar0);
					}
					func_101(&iVar0);
					if (iParam1 == 1)
					{
						func_72("GB_BCUT_TICK1", func_104(), iVar0, 0, 0, 1, 1);
					}
					func_71(20);
					func_69(func_104(), iVar0, 1);
				}
			}
		}
	}
}

void func_69(int iParam0, int iParam1, int iParam2)//Position - 0x274E
{
	struct<4> Var0;
	
	if (func_205(iParam0, 0, 1))
	{
		Var0 = 433;
		Var0.f_1 = player::player_id();
		Var0.f_2 = iParam1;
		Var0.f_3 = iParam2;
		script::trigger_script_event(1, &Var0, 5, func_70(iParam0));
	}
}

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

void func_71(int iParam0)//Position - 0x279D
{
	gameplay::set_bit(&(Global_2458121.f_4648.f_7), iParam0);
}

int func_72(char* sParam0, int iParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6)//Position - 0x27B4
{
	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_79(iParam1, -2, 1, 0));
		ui::add_text_component_substring_player_name(func_77(&Var1));
		if (!iParam3 == 0)
		{
			ui::_0x39BBF623FC803EAC(iParam3);
		}
		ui::add_text_component_integer(iParam2);
		iVar0 = ui::_draw_notification(0, 1);
		func_73(27, sParam0, 1, &Var1, iParam2, 0, 0, 0, 1, 0, 0, 0);
	}
	return iVar0;
}

void func_73(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 - 0x2842
{
	int iVar0;
	
	if ((!func_76() || !network::network_is_activity_session()) || !func_27(player::player_id(), 0))
	{
		return;
	}
	iVar0 = func_74(iParam2);
	if (iVar0 >= 0 && iVar0 < 5)
	{
		Global_1718883.f_5[iVar0 /*53*/] = iParam0;
		Global_1718883.f_5[iVar0 /*53*/].f_1 = iParam2;
		StringCopy(&(Global_1718883.f_5[iVar0 /*53*/].f_8), sParam1, 16);
		Global_1718883.f_5[iVar0 /*53*/].f_2[0] = iParam4;
		Global_1718883.f_5[iVar0 /*53*/].f_2[1] = iParam5;
		Global_1718883.f_5[iVar0 /*53*/].f_2[2] = iParam6;
		Global_1718883.f_5[iVar0 /*53*/].f_7 = iParam7;
		Global_1718883.f_5[iVar0 /*53*/].f_6 = iParam8;
		StringCopy(&(Global_1718883.f_5[iVar0 /*53*/].f_12), sParam3, 64);
		StringCopy(&(Global_1718883.f_5[iVar0 /*53*/].f_28[0 /*6*/]), sParam9, 24);
		StringCopy(&(Global_1718883.f_5[iVar0 /*53*/].f_28[1 /*6*/]), sParam10, 24);
		StringCopy(&(Global_1718883.f_5[iVar0 /*53*/].f_28[2 /*6*/]), sParam11, 24);
	}
}

int func_74(int iParam0)//Position - 0x294A
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 <= (Global_1718883 - 1))
	{
		if (iParam0 > Global_1718883.f_5[iVar0 /*53*/].f_1)
		{
			func_75(iVar0);
			return iVar0;
		}
		iVar0++;
	}
	Global_1718883++;
	if (Global_1718883 > 5)
	{
		Global_1718883 = 5;
		return Global_1718883;
	}
	return (Global_1718883 - 1);
}

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

int func_76()//Position - 0x29E5
{
	return dlc2::is_dlc_present(-1762644250);
}

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

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

int func_79(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x2A22
{
	int iVar0;
	
	if (func_99(iParam0))
	{
		if (iParam2)
		{
			return 0;
		}
		else
		{
			return 1;
		}
	}
	if (func_99(player::player_id()) || (func_98() && func_97()))
	{
		iVar0 = func_96();
		if (entity::does_entity_exist(iVar0))
		{
			if (ped::is_ped_a_player(iVar0))
			{
				if (network::_network_get_ped_player(iVar0) != -1)
				{
					if (func_205(network::_network_get_ped_player(iVar0), 0, 1))
					{
						if ((iParam1 > -1 && network::network_is_activity_session()) && iParam1 < 4)
						{
							if (Global_1613622.f_65200[iParam1] != -1)
							{
								return func_95(iParam1, iParam0, 0);
							}
							else
							{
								return func_87(iParam0, network::_network_get_ped_player(iVar0), iParam1, iParam2, iParam3);
							}
						}
						else
						{
							return func_87(iParam0, network::_network_get_ped_player(iVar0), iParam1, iParam2, iParam3);
						}
					}
				}
			}
			else if ((iParam1 > -1 && network::network_is_activity_session()) && iParam1 < 4)
			{
				if (Global_1613622.f_65200[iParam1] != -1)
				{
					return func_95(iParam1, iParam0, 0);
				}
				else
				{
					return func_80(0, -1, 0);
				}
			}
			else
			{
				return func_80(0, -1, 0);
			}
		}
	}
	if ((iParam1 > -1 && network::network_is_activity_session()) && iParam1 < 4)
	{
		if (Global_1613622.f_65200[iParam1] != -1)
		{
			return func_95(iParam1, iParam0, 0);
		}
		else
		{
			return func_87(iParam0, player::player_id(), iParam1, iParam2, iParam3);
		}
	}
	return func_87(iParam0, player::player_id(), iParam1, iParam2, iParam3);
}

int func_80(int iParam0, int iParam1, int iParam2)//Position - 0x2BAA
{
	return func_81(player::player_id(), iParam0, iParam1, iParam2);
}

int func_81(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x2BC0
{
	int iVar0;
	
	iVar0 = player::get_player_team(iParam0);
	if (iParam1)
	{
		if (iParam2 > -1)
		{
			if (func_86(iVar0, iParam2, 0) && !gameplay::is_bit_set(Global_1613622.f_15, 18))
			{
				if (iVar0 == iParam2)
				{
					return func_85(1);
				}
				else
				{
					return func_85(0);
				}
			}
			else if (iParam3)
			{
				return 28;
			}
			else if (gameplay::is_bit_set(Global_1613622.f_4, 20))
			{
				return func_82(iVar0, iParam2, 1);
			}
			else
			{
				return func_82(iVar0, iParam2, 0);
			}
		}
		return 28;
	}
	if (iVar0 == iParam2 || iParam2 == -1)
	{
		return func_85(1);
	}
	return func_85(0);
}

int func_82(int iParam0, int iParam1, int iParam2)//Position - 0x2C74
{
	int iVar0;
	
	iVar0 = func_84(iParam0, iParam1);
	if (func_83(Global_1613622.f_68788))
	{
		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_83(int iParam0)//Position - 0x2D31
{
	int iVar0;
	
	if (iParam0 == 0)
	{
		return false;
	}
	iVar0 = 0;
	while (iVar0 <= 6)
	{
		if (iParam0 == Global_262145.f_7331[iVar0])
		{
			return true;
		}
		iVar0++;
	}
	return false;
}

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

int func_85(int iParam0)//Position - 0x2DB0
{
	if (iParam0)
	{
		return 118;
	}
	return 116;
}

int func_86(int iParam0, int iParam1, int iParam2)//Position - 0x2DC7
{
	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_1613622.f_38, 0);
				
				case 1:
					return gameplay::is_bit_set(Global_1613622.f_38, 1);
				
				case 2:
					return gameplay::is_bit_set(Global_1613622.f_38, 2);
				
				case 3:
					return gameplay::is_bit_set(Global_1613622.f_38, 3);
				
				default:
			}
			break;
		
		case 1:
			switch (iParam1)
			{
				case 0:
					return gameplay::is_bit_set(Global_1613622.f_38, 4);
				
				case 1:
					return gameplay::is_bit_set(Global_1613622.f_38, 5);
				
				case 2:
					return gameplay::is_bit_set(Global_1613622.f_38, 6);
				
				case 3:
					return gameplay::is_bit_set(Global_1613622.f_38, 7);
				
				default:
			}
			break;
		
		case 2:
			switch (iParam1)
			{
				case 0:
					return gameplay::is_bit_set(Global_1613622.f_38, 8);
				
				case 1:
					return gameplay::is_bit_set(Global_1613622.f_38, 9);
				
				case 2:
					return gameplay::is_bit_set(Global_1613622.f_38, 10);
				
				case 3:
					return gameplay::is_bit_set(Global_1613622.f_38, 11);
				
				default:
			}
			break;
		
		case 3:
			switch (iParam1)
			{
				case 0:
					return gameplay::is_bit_set(Global_1613622.f_38, 12);
				
				case 1:
					return gameplay::is_bit_set(Global_1613622.f_38, 13);
				
				case 2:
					return gameplay::is_bit_set(Global_1613622.f_38, 14);
				
				case 3:
					return gameplay::is_bit_set(Global_1613622.f_38, 15);
				
				default:
			}
			break;
	}
	return false;
}

int func_87(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4)//Position - 0x2F92
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	if (iParam2 == -2)
	{
		iVar0 = player::get_player_team(iParam0);
	}
	else
	{
		iVar0 = iParam2;
	}
	if (Global_1587175[player::player_id() /*410*/] == 148)
	{
		iVar1 = true;
	}
	iVar2 = iParam0;
	if (iVar2 > -1)
	{
		if (Global_1587175[iVar2 /*410*/] == 148)
		{
			iVar1 = true;
		}
	}
	if (!iVar1)
	{
		if (iVar0 != -1)
		{
			if ((func_94(iParam1, iParam0, iVar0, 0) && !gameplay::is_bit_set(Global_1613622.f_15, 18)) || ((func_86(player::get_player_team(iParam1), player::get_player_team(iParam0), 0) && gameplay::is_bit_set(Global_1613622.f_15, 23)) && !gameplay::is_bit_set(Global_1613622.f_15, 18)))
			{
				return func_85(1);
			}
			else if (gameplay::is_bit_set(Global_1613622.f_15, 26))
			{
				return func_93(1);
			}
			else
			{
				return func_81(iParam1, 1, iVar0, iParam4);
			}
		}
		else if ((Global_1573833 || Global_1573824) || Global_1587175[iParam0 /*410*/] == 0)
		{
			if (iParam0 == iParam1 || (Global_1573833 == 1 && Global_1573843 == 0))
			{
				return func_85(1);
			}
			else
			{
				return func_81(iParam1, 1, iVar0, iParam4);
			}
		}
		if (Global_1573828 && Global_1573408.f_14 == iParam0)
		{
			return 28;
		}
	}
	iVar3 = func_90(iParam0);
	if (!iVar3 == -1)
	{
		return func_88(iVar3);
	}
	if (iParam3)
	{
		return 0;
	}
	return 1;
}

int func_88(int iParam0)//Position - 0x3115
{
	int iVar0;
	
	iVar0 = func_89(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 12;
}

var func_89(var uParam0)//Position - 0x31D3
{
	return Global_2412494.f_1946.f_44[uParam0 /*2*/].f_1;
}

int func_90(int iParam0)//Position - 0x31EA
{
	if (!iParam0 == func_5())
	{
		if (func_91(iParam0, 1))
		{
			return Global_2412494.f_1946.f_11[func_33(iParam0)];
		}
	}
	return -1;
}

int func_91(int iParam0, int iParam1)//Position - 0x321C
{
	if (!iParam1)
	{
		if (func_92(iParam0))
		{
			return false;
		}
	}
	return Global_1608811[iParam0 /*109*/].f_9 != func_5();
}

int func_92(int iParam0)//Position - 0x3246
{
	if (iParam0 != func_5())
	{
		if (Global_1608811[iParam0 /*109*/].f_9 != func_5())
		{
			return Global_1608811[iParam0 /*109*/].f_9 == iParam0;
		}
	}
	return false;
}

int func_93(int iParam0)//Position - 0x3279
{
	if (iParam0)
	{
		return 119;
	}
	return 116;
}

int func_94(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x3290
{
	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_95(int iParam0, int iParam1, int iParam2)//Position - 0x3308
{
	int iVar0;
	
	if (Global_1613622.f_65200[iParam0] != -1 && Global_1613622.f_65200[iParam0] <= 4)
	{
		if (Global_1613622.f_65200[iParam0] == 0)
		{
			iVar0 = 15;
		}
		else if (Global_1613622.f_65200[iParam0] == 1)
		{
			iVar0 = 18;
		}
		else if (Global_1613622.f_65200[iParam0] == 2)
		{
			iVar0 = 24;
		}
		else if (Global_1613622.f_65200[iParam0] == 4)
		{
			if (gameplay::is_bit_set(Global_1613622.f_15, 29))
			{
				iVar0 = 21;
			}
			else
			{
				iVar0 = 6;
			}
		}
		else
		{
			iVar0 = Global_1613622.f_65200[iParam0];
		}
	}
	else
	{
		iVar0 = func_81(iParam1, !iParam2, iParam0, 0);
	}
	return iVar0;
}

var func_96()//Position - 0x33CD
{
	return Global_2359301.f_2;
}

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

int func_98()//Position - 0x33EC
{
	return gameplay::is_bit_set(Global_1587175[player::player_id() /*410*/].f_39.f_18, 14);
}

bool func_99(int iParam0)//Position - 0x3409
{
	if (func_27(iParam0, 0))
	{
		return true;
	}
	if (func_100())
	{
		if (iParam0 == player::player_id())
		{
			return true;
		}
	}
	if (gameplay::is_bit_set(Global_2417071[iParam0 /*306*/].f_194, 2))
	{
		return true;
	}
	return false;
}

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

void func_101(int iParam0)//Position - 0x345C
{
	int iVar0;
	int iVar1;
	
	iVar1 = func_102();
	iVar0 = ((*iParam0 / 100) * iVar1);
	*iParam0 = (*iParam0 - iVar0);
}

var func_102()//Position - 0x347E
{
	return Global_262145.f_10288;
}

var func_103()//Position - 0x348D
{
	return Global_262145.f_10287;
}

var func_104()//Position - 0x349C
{
	return Global_1608811[player::player_id() /*109*/].f_9;
}

int func_105(int iParam0)//Position - 0x34B0
{
	return func_91(player::player_id(), iParam0);
}

int func_106()//Position - 0x34C2
{
	return func_92(player::player_id());
}

void func_107(int iParam0, char* sParam1, char* sParam2, int iParam3, int iParam4)//Position - 0x34D2
{
	func_108(1, iParam0, sParam1, sParam2, iParam3, iParam4);
}

void func_108(int iParam0, var uParam1, char* sParam2, char* sParam3, int iParam4, int iParam5)//Position - 0x34E9
{
	var uVar0;
	int iVar1;
	
	uVar0 = uParam1;
	iVar1 = false;
	func_109(iParam0, sParam2, uVar0, iVar1, sParam3, iParam4, iParam5);
}

void func_109(var uParam0, char* sParam1, var uParam2, int iParam3, char* sParam4, int iParam5, int iParam6)//Position - 0x350A
{
	int iVar0;
	
	if (gameplay::is_string_null_or_empty(sParam1))
	{
		return;
	}
	if (ui::_0x43E4111189E54F0E(sParam1) > 15)
	{
		return;
	}
	if (!gameplay::is_string_null_or_empty(sParam4))
	{
		if (ui::_0x43E4111189E54F0E(sParam4) > 31)
		{
			return;
		}
	}
	iVar0 = func_118();
	if (iVar0 == -1)
	{
		return;
	}
	func_117(iVar0);
	func_116(iVar0, uParam0);
	func_115(iVar0, uParam2, iParam3);
	func_114(iVar0, sParam1);
	if (gameplay::is_string_null_or_empty(sParam4) && iParam6 == -99)
	{
		return;
	}
	func_113(iVar0);
	if (!gameplay::is_string_null_or_empty(sParam4))
	{
		func_111(iVar0, sParam4, iParam5);
	}
	if (!iParam6 == -99)
	{
		func_110(iVar0, iParam6);
	}
}

void func_110(int iParam0, int iParam1)//Position - 0x35B6
{
	Global_1332274.f_59[iParam0 /*16*/].f_15 = iParam1;
}

void func_111(int iParam0, char* sParam1, int iParam2)//Position - 0x35CC
{
	StringCopy(&(Global_1332274.f_59[iParam0 /*16*/].f_7), sParam1, 32);
	if (!iParam2)
	{
		return;
	}
	func_112(iParam0);
}

void func_112(var uParam0)//Position - 0x35F3
{
	gameplay::set_bit(&(Global_1332274.f_59[uParam0 /*16*/]), 5);
}

void func_113(int iParam0)//Position - 0x360A
{
	gameplay::set_bit(&(Global_1332274.f_59[iParam0 /*16*/]), 4);
}

void func_114(int iParam0, char* sParam1)//Position - 0x3621
{
	struct<4> Var0;
	
	StringCopy(&Var0, sParam1, 16);
	Global_1332274.f_59[iParam0 /*16*/].f_3 = { Var0 };
}

void func_115(int iParam0, var uParam1, int iParam2)//Position - 0x3641
{
	Global_1332274.f_59[iParam0 /*16*/].f_2 = uParam1;
	if (iParam2)
	{
		gameplay::set_bit(&(Global_1332274.f_59[iParam0 /*16*/]), 2);
		gameplay::clear_bit(&(Global_1332274.f_59[iParam0 /*16*/]), 3);
	}
	else
	{
		gameplay::set_bit(&(Global_1332274.f_59[iParam0 /*16*/]), 3);
		gameplay::clear_bit(&(Global_1332274.f_59[iParam0 /*16*/]), 2);
	}
}

void func_116(int iParam0, var uParam1)//Position - 0x369B
{
	Global_1332274.f_59[iParam0 /*16*/].f_1 = uParam1;
}

void func_117(int iParam0)//Position - 0x36B1
{
	gameplay::set_bit(&(Global_1332274.f_59[iParam0 /*16*/]), 0);
}

int func_118()//Position - 0x36C8
{
	int iVar0;
	
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < 8)
	{
		if (!func_119(iVar0))
		{
			return iVar0;
		}
		iVar0++;
	}
	return -1;
}

int func_119(int iParam0)//Position - 0x36F6
{
	return gameplay::is_bit_set(Global_1332274.f_59[iParam0 /*16*/], 0);
}

int func_120(int iParam0, int iParam1, char* sParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, char* sParam8, int iParam9)//Position - 0x370D
{
	return func_121(iParam0, iParam1, sParam2, iParam3, iParam4, iParam5, iParam6, iParam7, sParam8, iParam9);
}

int func_121(int iParam0, int iParam1, char* sParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, char* sParam8, int iParam9)//Position - 0x372D
{
	int iVar0;
	int iVar1;
	
	iVar0 = func_131(iParam0, sParam2, iParam3, iParam4, iParam5, iParam6, iParam7, iParam9);
	if (iParam4 == -592022605 || iParam4 == -1915191729)
	{
		if (entity::does_entity_exist(iParam1))
		{
			if (entity::is_entity_a_ped(iParam1))
			{
				iVar1 = entity::get_ped_index_from_entity_index(iParam1);
				func_127(ped::get_ped_bone_coords(iVar1, 31086, 0f, 0f, 0f), iVar0, 0, sParam8);
			}
		}
	}
	else
	{
		func_122(iParam1, iVar0, sParam8);
	}
	return iVar0;
}

void func_122(int iParam0, int iParam1, char* sParam2)//Position - 0x37A2
{
	vector3 vVar0;
	
	vVar0 = { func_125(iParam0, 1) };
	if (iParam0 == func_124(player::player_ped_id()))
	{
		func_123(1);
	}
	func_127(vVar0, iParam1, 0, sParam2);
}

void func_123(int iParam0)//Position - 0x37D4
{
	Global_2426867.f_1322 = iParam0;
}

int func_124(int iParam0)//Position - 0x37E5
{
	return iParam0;
}

Vector3 func_125(int iParam0, int iParam1)//Position - 0x37EF
{
	vector3 vVar0;
	float fVar3;
	vector3 vVar4;
	vector3 vVar7;
	float fVar10;
	
	if (iParam0 == func_126(player::player_ped_id()) && cam::_0xEE778F8C7E1142E2(cam::_0x19CAFA3C87F7C2FF()) == 4)
	{
		vVar0 = { entity::get_offset_from_entity_in_world_coords(iParam0, 0f, 2f, -0.2f) };
	}
	else
	{
		vVar0 = { entity::get_entity_coords(iParam0, 0) };
	}
	fVar3 = 0f;
	if (!entity::is_entity_dead(iParam0))
	{
		fVar3 = entity::get_entity_heading(iParam0);
	}
	gameplay::get_model_dimensions(entity::get_entity_model(iParam0), &vVar4, &vVar7);
	if (iParam1)
	{
		fVar10 = (vVar7.y + 0.18f);
	}
	else
	{
		fVar10 = (vVar4.y + 0.18f);
	}
	vVar0 = { object::_get_object_offset_from_coords(vVar0, fVar3, 0f, 0f, fVar10) };
	return vVar0;
}

int func_126(int iParam0)//Position - 0x388C
{
	return iParam0;
}

void func_127(vector3 vParam0, int iParam3, int iParam4, char* sParam5)//Position - 0x3896
{
	int iVar0;
	int iVar1;
	
	if (iParam3 != 0)
	{
		iVar1 = -1;
		iVar0 = 0;
		while (iVar0 < 20)
		{
			if (Global_2426867.f_741[iVar0 /*29*/].f_6 == 0 || Global_2426867.f_741[iVar0 /*29*/].f_6 == 6)
			{
				iVar1 = iVar0;
				iVar0 = 20;
			}
			iVar0++;
		}
		if (iVar1 != -1)
		{
			Global_2426867.f_741[iVar1 /*29*/] = { vParam0 };
			Global_2426867.f_741[iVar1 /*29*/].f_6 = 1;
			Global_2426867.f_741[iVar1 /*29*/].f_4 = func_130(Global_2426867.f_741[iVar1 /*29*/], &Global_1312317, &Global_1312318);
			Global_2426867.f_741[iVar1 /*29*/].f_7 = network::get_network_time();
			Global_2426867.f_741[iVar1 /*29*/].f_3 = iParam3;
			Global_2426867.f_741[iVar1 /*29*/].f_8 = iParam4;
			Global_2426867.f_741[iVar1 /*29*/].f_9 = func_129();
			Global_2426867.f_741[iVar1 /*29*/].f_10 = func_128();
			StringCopy(&(Global_2426867.f_741[iVar1 /*29*/].f_22), sParam5, 16);
		}
	}
}

bool func_128()//Position - 0x3996
{
	if (Global_2426867.f_1322)
	{
		Global_2426867.f_1322 = 0;
		return true;
	}
	Global_2426867.f_1322 = 0;
	return false;
}

var func_129()//Position - 0x39C0
{
	var uVar0;
	
	uVar0 = Global_2426867.f_1324;
	Global_2426867.f_1324 = 1;
	return uVar0;
}

float func_130(vector3 vParam0, var uParam3, var uParam4)//Position - 0x39DB
{
	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;
}

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

int func_132(int iParam0, int iParam1, char* sParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8, int iParam9, int iParam10)//Position - 0x3A97
{
	float fVar0;
	int iVar1;
	int iVar2;
	float fVar3;
	
	if (func_162(player::player_id()) || func_161(player::player_id()))
	{
		if (Global_262145.f_7555 > 8000)
		{
			iVar2 = 8000;
		}
		else
		{
			iVar2 = Global_262145.f_7555;
		}
	}
	else if (Global_262145.f_5033 > 5000)
	{
		iVar2 = 5000;
	}
	else
	{
		iVar2 = Global_262145.f_5033;
	}
	if (func_160(sParam2))
	{
	}
	if (func_159())
	{
		if (iParam4 < 1)
		{
			iParam4 = 1;
		}
		iVar1 = system::round((IntToFloat(iParam3) * (IntToFloat(iParam4) + fVar0)));
		iVar1 = func_157(iVar1);
		fVar3 = (system::to_float(iVar1) * Global_262145.f_1);
		iVar1 = system::round(fVar3);
		if (iParam10)
		{
			iVar1 = func_156(&iVar1);
		}
		if (iParam1 == 0)
		{
			switch (iParam0)
			{
				case 2:
					func_154(0, &iVar1);
					break;
				
				case 3:
					func_154(1, &iVar1);
					break;
				
				case 1:
					func_152(&iVar1);
					break;
				}
		}
		if (iParam1 == 0)
		{
			if (iVar1 > iVar2)
			{
				if (iParam0 == 1)
				{
					iVar1 = iVar2;
				}
				if (iParam0 == 2 || iParam0 == 3)
				{
					iVar1 = iVar2;
				}
			}
		}
		if (iParam7)
		{
			func_166(1154, iVar1, -1);
			if (iParam1 == 0)
			{
				func_142((func_151(player::player_id()) + iVar1), iParam9, 0);
				if (iParam8 == 0)
				{
				}
				if (iParam9 == 0)
				{
				}
				stats::playstats_award_xp(iVar1, iParam8, iParam9);
				if (Global_1587175[player::player_id() /*410*/].f_39.f_2 != -1)
				{
					func_166(1155, iVar1, -1);
				}
				if (iParam1 == 0)
				{
					func_137(iVar1);
				}
			}
		}
		if (iParam5)
		{
		}
		if (iParam7)
		{
			if (iParam6 == -1)
			{
				func_133((func_135(player::player_id()) + iVar1));
			}
			else
			{
				func_133((func_135(player::player_id()) + iParam6));
			}
		}
		if (iParam7)
		{
		}
	}
	return iVar1;
}

void func_133(int iParam0)//Position - 0x3C52
{
	if (func_159())
	{
		Global_1587175[player::player_id() /*410*/].f_192.f_5 = iParam0;
		func_134(joaat("mpply_globalxp"), iParam0);
	}
}

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

int func_135(int iParam0)//Position - 0x3C99
{
	if (iParam0 > -1)
	{
		if (func_205(iParam0, 0, 1))
		{
			if (iParam0 == player::player_id())
			{
				return func_136(joaat("mpply_globalxp"));
			}
			else
			{
				return Global_1587175[iParam0 /*410*/].f_192.f_5;
			}
		}
		else
		{
			return func_136(joaat("mpply_globalxp"));
		}
	}
	return 0;
}

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

void func_137(int iParam0)//Position - 0x3D08
{
	struct<13> Var0;
	int iVar13;
	
	Var0 = { func_34(player::player_id()) };
	if (network::_network_player_is_in_clan())
	{
		if (network::network_clan_player_is_active(&Var0))
		{
			iVar13 = func_140(func_141(&Var0));
			if (iVar13 == 0)
			{
				func_139(&Global_1347498, iParam0);
				func_138(joaat("mpply_crew_local_xp_0"), Global_1347498);
			}
			else if (iVar13 == 1)
			{
				func_139(&Global_1347499, iParam0);
				func_138(joaat("mpply_crew_local_xp_1"), Global_1347499);
			}
			else if (iVar13 == 2)
			{
				func_139(&Global_1347500, iParam0);
				func_138(joaat("mpply_crew_local_xp_2"), Global_1347500);
			}
			else if (iVar13 == 3)
			{
				func_139(&Global_1347501, iParam0);
				func_138(joaat("mpply_crew_local_xp_3"), Global_1347501);
			}
			else if (iVar13 == 4)
			{
				func_139(&Global_1347502, iParam0);
				func_138(joaat("mpply_crew_local_xp_4"), Global_1347502);
			}
		}
	}
}

void func_138(int iParam0, int iParam1)//Position - 0x3DDC
{
	int iVar0;
	
	iVar0 = iParam0;
	if (iVar0 != 0)
	{
		stats::stat_set_int(iVar0, iParam1, 1);
	}
	switch (iParam0)
	{
		case joaat("mpply_crew_0_id"):
			Global_1347493 = iParam1;
			break;
		
		case joaat("mpply_crew_1_id"):
			Global_1347495 = iParam1;
			break;
		
		case joaat("mpply_crew_2_id"):
			Global_1347495 = iParam1;
			break;
		
		case joaat("mpply_crew_3_id"):
			Global_1347496 = iParam1;
			break;
		
		case joaat("mpply_crew_4_id"):
			Global_1347497 = iParam1;
			break;
		
		case joaat("mpply_crew_local_xp_0"):
			Global_1347498 = iParam1;
			break;
		
		case joaat("mpply_crew_local_xp_1"):
			Global_1347499 = iParam1;
			break;
		
		case joaat("mpply_crew_local_xp_2"):
			Global_1347500 = iParam1;
			break;
		
		case joaat("mpply_crew_local_xp_3"):
			Global_1347501 = iParam1;
			break;
		
		case joaat("mpply_crew_local_xp_4"):
			Global_1347502 = iParam1;
			break;
		
		case joaat("mpply_became_cheater_num"):
			Global_1347503 = iParam1;
			break;
		
		case joaat("mpply_friendly"):
			Global_1347504 = iParam1;
			break;
		
		case joaat("mpply_offensive_language"):
			Global_1347505 = iParam1;
			break;
		
		case joaat("mpply_griefing"):
			Global_1347506 = iParam1;
			break;
		
		case joaat("mpply_helpful"):
			Global_1347507 = iParam1;
			break;
		
		case joaat("mpply_offensive_tagplate"):
			Global_1347508 = iParam1;
			break;
		
		case joaat("mpply_offensive_ugc"):
			Global_1347509 = iParam1;
			break;
		
		default:
			break;
	}
}

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

int func_140(int iParam0)//Position - 0x3F12
{
	if (iParam0 == Global_1347493)
	{
		return 0;
	}
	else if (iParam0 == Global_1347494)
	{
		return 1;
	}
	else if (iParam0 == Global_1347495)
	{
		return 2;
	}
	else if (iParam0 == Global_1347496)
	{
		return 3;
	}
	else if (iParam0 == Global_1347497)
	{
		return 4;
	}
	else
	{
		return -1;
	}
	return -1;
}

var func_141(var uParam0)//Position - 0x3F6F
{
	if (network::_network_player_is_in_clan())
	{
		if (network::network_clan_player_is_active(uParam0))
		{
			return Global_2441309;
		}
	}
	return Global_2441309;
}

void func_142(int iParam0, int iParam1, int iParam2)//Position - 0x3F92
{
	if (func_159())
	{
		if (iParam0 >= 1787576850)
		{
			iParam0 = 1787576850;
		}
		if (Global_262145.f_7530 == 0 && iParam1 != -1076930708)
		{
			if (iParam2 == 0)
			{
				if (iParam0 < Global_1347613[func_51(-1)])
				{
					stats::playstats_award_xp(iParam0, -523908350, iParam1);
					return;
				}
				else if (iParam0 == Global_1347613[func_51(-1)])
				{
					return;
				}
			}
		}
		if (Global_262145.f_7529 == 0)
		{
			if (iParam0 == 0)
			{
				stats::playstats_award_xp(iParam0, -1158693853, -1345423847);
				if (iParam2 == 0)
				{
					return;
				}
			}
		}
		if (Global_262145.f_7529 == 0)
		{
			if (iParam0 < 0)
			{
				stats::playstats_award_xp(iParam0, -1586921397, iParam1);
				return;
			}
		}
		if (func_150(player::player_id()))
		{
			Global_1587175[player::player_id() /*410*/].f_192.f_1 = iParam0;
			Global_1587175[player::player_id() /*410*/].f_192.f_6 = func_148(iParam0, 1);
		}
		func_147(629, iParam0, -1, 1);
		func_146(630, func_148(iParam0, 1), -1, 1);
		Global_1347613[func_51(-1)] = iParam0;
		func_143(7, 0);
	}
}

void func_143(int iParam0, int iParam1)//Position - 0x40B4
{
	var uVar0;
	
	if (func_145(iParam0, iParam1))
	{
		uVar0 = func_144();
		Global_2441286[uVar0] = iParam0;
	}
}

int func_144()//Position - 0x40D7
{
	int iVar0;
	int iVar1;
	
	iVar0 = 9;
	iVar1 = 0;
	while (iVar1 <= 9)
	{
		if (Global_2441286[iVar1] == 0)
		{
			iVar0 = iVar1;
			iVar1 = 10;
		}
		iVar1++;
	}
	return iVar0;
}

bool func_145(int iParam0, var uParam1)//Position - 0x410C
{
	if (Global_1315899)
	{
		return false;
	}
	if (iParam0 == 22)
	{
		return true;
	}
	if ((((((((uParam1 || !Global_1315911) || iParam0 == 3) || iParam0 == 10) || iParam0 == 11) || iParam0 == 27) || iParam0 == 28) || iParam0 == 29) || iParam0 == 30)
	{
		return true;
	}
	else
	{
		return false;
	}
	return true;
}

void func_146(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x4192
{
	int iVar0;
	
	iVar0 = Global_2466774[iParam0 /*5*/][func_51(iParam2)];
	if (iVar0 != 0)
	{
		stats::stat_set_int(iVar0, iParam1, iParam3);
	}
}

void func_147(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x41BD
{
	int iVar0;
	
	iVar0 = Global_2466774[iParam0 /*5*/][func_51(iParam2)];
	if (iVar0 != 0)
	{
		stats::stat_set_int(iVar0, iParam1, iParam3);
	}
	switch (iParam0)
	{
		case 777:
			Global_1347559[func_51(iParam2)] = iParam1;
			break;
		
		case 778:
			Global_1347565[func_51(iParam2)] = iParam1;
			break;
		
		case 779:
			Global_1347571[func_51(iParam2)] = iParam1;
			break;
		
		case 780:
			Global_1347577[func_51(iParam2)] = iParam1;
			break;
		
		case 767:
			Global_1347535[func_51(iParam2)] = iParam1;
			break;
		
		case 768:
			Global_1347541[func_51(iParam2)] = iParam1;
			break;
		
		case 769:
			Global_1347547[func_51(iParam2)] = iParam1;
			break;
		
		case 770:
			Global_1347553[func_51(iParam2)] = iParam1;
			break;
		
		case 757:
			Global_1347511[func_51(iParam2)] = iParam1;
			break;
		
		case 758:
			Global_1347517[func_51(iParam2)] = iParam1;
			break;
		
		case 759:
			Global_1347523[func_51(iParam2)] = iParam1;
			break;
		
		case 760:
			Global_1347529[func_51(iParam2)] = iParam1;
			break;
		
		case 747:
			Global_1347583[func_51(iParam2)] = iParam1;
			break;
		
		case 748:
			Global_1347589[func_51(iParam2)] = iParam1;
			break;
		
		case 749:
			Global_1347595[func_51(iParam2)] = iParam1;
			break;
		
		case 750:
			Global_1347601[func_51(iParam2)] = iParam1;
			break;
		
		case 1293:
			Global_1347607[func_51(iParam2)] = iParam1;
			break;
		
		case 629:
			Global_1347613[func_51(iParam2)] = iParam1;
			break;
		
		case 1268:
			Global_1347619[func_51(iParam2)] = iParam1;
			break;
		
		case 1865:
			Global_2489474[0 /*6*/][func_51(iParam2)] = iParam1;
			break;
		
		case 2256:
			Global_2489474[1 /*6*/][func_51(iParam2)] = iParam1;
			break;
		
		case 2902:
			Global_2489474[2 /*6*/][func_51(iParam2)] = iParam1;
			break;
		
		case 3030:
			Global_2489474[3 /*6*/][func_51(iParam2)] = iParam1;
			break;
		
		case 3732:
			Global_2489525[func_51(iParam2)] = iParam1;
			break;
		
		case 754:
			Global_1347625[func_51(iParam2)] = iParam1;
			break;
		
		case 755:
			Global_1347631[func_51(iParam2)] = iParam1;
			break;
		
		case 756:
			Global_1347637[func_51(iParam2)] = iParam1;
			break;
		
		case 1226:
			Global_1347643[func_51(iParam2)] = iParam1;
			break;
		
		case 3025:
			Global_2489499[0 /*5*/][func_51(iParam2)] = iParam1;
			break;
		
		case 3026:
			Global_2489499[1 /*5*/][func_51(iParam2)] = iParam1;
			break;
		
		case 3027:
			Global_2489499[2 /*5*/][func_51(iParam2)] = iParam1;
			break;
		
		case 3028:
			Global_2489499[3 /*5*/][func_51(iParam2)] = iParam1;
			break;
		
		case 3029:
			Global_2489499[4 /*5*/][func_51(iParam2)] = iParam1;
			break;
		
		default:
			break;
	}
}

int func_148(int iParam0, int iParam1)//Position - 0x4504
{
	if (iParam1)
	{
	}
	return func_149(iParam0, 0);
}

int func_149(int iParam0, int iParam1)//Position - 0x4518
{
	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_273943[iVar3] == iParam0)
		{
			iVar1 = iVar3;
			iVar2 = iVar3;
		}
		else if (Global_273943[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_150(int iParam0)//Position - 0x45D7
{
	if (iParam0 == -1)
	{
		return false;
	}
	else
	{
		return gameplay::is_bit_set(Global_2426867.f_1, iParam0);
	}
	return true;
}

int func_151(int iParam0)//Position - 0x45FC
{
	if (Global_1312466.f_9 == 0)
	{
		if (iParam0 > -1)
		{
			if (iParam0 == player::player_id())
			{
				return Global_1347613[func_51(-1)];
			}
			else if (func_150(iParam0))
			{
				return Global_1587175[iParam0 /*410*/].f_192.f_1;
			}
		}
	}
	else
	{
		return Global_1347613[func_51(-1)];
	}
	return 0;
}

void func_152(int iParam0)//Position - 0x4659
{
	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_86(player::get_player_team(iVar5), iVar1, 0))
				{
					iVar2++;
					if (iVar5 != player::player_id())
					{
						if (func_35(player::player_id(), iVar5))
						{
							iVar3 = true;
						}
					}
				}
			}
		}
		iVar0++;
	}
	if (iVar3)
	{
		iVar6 = system::round((func_153(*iParam0, 100) * (10f * Global_262145.f_4209)));
	}
	if (iVar2 > 4)
	{
		iVar2 = 4;
	}
	if (iVar2 >= 2)
	{
		iVar7 = system::round((func_153(*iParam0, 100) * (20f * Global_262145.f_4202)));
	}
	*iParam0 = (*iParam0 + iVar6);
	*iParam0 = (*iParam0 + iVar7);
}

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

void func_154(int iParam0, int iParam1)//Position - 0x4765
{
	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_205(iVar4, 0, 1))
				{
					if (iVar4 != player::player_id())
					{
						iVar1++;
						if (func_35(player::player_id(), iVar4))
						{
							iVar2 = true;
						}
					}
				}
			}
			iVar0++;
		}
	}
	else
	{
		iVar0 = 0;
		while (iVar0 < 32)
		{
			iVar4 = iVar0;
			if (func_205(iVar4, 1, 1))
			{
				if (iVar4 != player::player_id())
				{
					if (func_155(player::player_id(), iVar4) <= 20f)
					{
						iVar1++;
						if (func_35(player::player_id(), iVar4))
						{
							iVar2 = true;
						}
					}
				}
			}
			iVar0++;
		}
	}
	if (iVar2)
	{
		iVar5 = system::round((func_153(*iParam1, 100) * (10f * Global_262145.f_4209)));
	}
	if (iVar1 > 4)
	{
		iVar1 = 4;
	}
	if (iVar1 >= 1)
	{
		iVar6 = system::round((func_153(*iParam1, 100) * (20f * Global_262145.f_4202)));
	}
	*iParam1 = (*iParam1 + iVar5);
	*iParam1 = (*iParam1 + iVar6);
}

float func_155(int iParam0, int iParam1)//Position - 0x487D
{
	return system::vdist(func_36(iParam0), func_36(iParam1));
	return 0f;
}

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

int func_157(int iParam0)//Position - 0x48D0
{
	if (iParam0 < 0)
	{
		if (gameplay::absi(iParam0) > func_151(player::player_id()))
		{
			iParam0 = -func_151(player::player_id());
		}
	}
	if (func_158(8000, 0, 0) > 0)
	{
		if (func_158(8000, 0, 0) < (iParam0 + func_151(player::player_id())))
		{
			iParam0 = (func_158(8000, 0, 0) - func_151(player::player_id()));
		}
	}
	return iParam0;
}

var func_158(int iParam0, int iParam1, int iParam2)//Position - 0x4934
{
	if (iParam2 == 0)
	{
	}
	if (iParam1)
	{
	}
	if (iParam0 >= 8000)
	{
		iParam0 = 8000;
	}
	return Global_273943[iParam0];
}

bool func_159()//Position - 0x495C
{
	return true;
}

bool func_160(char* sParam0)//Position - 0x4965
{
	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_161(int iParam0)//Position - 0x499D
{
	return Global_2417071[iParam0 /*306*/].f_114 == 2;
}

int func_162(int iParam0)//Position - 0x49B2
{
	return Global_2417071[iParam0 /*306*/].f_114 == 7;
}

void func_163(int iParam0, int iParam1, int iParam2)//Position - 0x49C7
{
	int iVar0;
	
	iVar0 = func_165(iParam0, func_51(iParam2));
	iVar0 = (iVar0 + iParam1);
	func_164(iParam0, iVar0, iParam2);
}

void func_164(var uParam0, int iParam1, var uParam2)//Position - 0x49EE
{
	int iVar0;
	
	iVar0 = Global_2488810[uParam0 /*5*/][func_51(uParam2)];
	stats::stat_set_int(iVar0, iParam1, 1);
}

int func_165(var uParam0, var uParam1)//Position - 0x4A12
{
	int iVar0;
	var uVar1;
	
	iVar0 = Global_2488810[uParam0 /*5*/][func_51(uParam1)];
	if (stats::stat_get_int(iVar0, &uVar1, -1))
	{
		return uVar1;
	}
	return 0;
}

void func_166(int iParam0, int iParam1, int iParam2)//Position - 0x4A3E
{
	int iVar0;
	
	iVar0 = func_168(iParam0, func_51(iParam2), 0);
	iVar0 = (iVar0 + iParam1);
	if (!func_167(iParam0))
	{
		func_146(iParam0, iVar0, iParam2, 1);
	}
	else
	{
		func_147(iParam0, iVar0, iParam2, 1);
	}
}

bool func_167(int iParam0)//Position - 0x4A7F
{
	if (Global_1347492)
	{
		switch (iParam0)
		{
			case 777:
			case 778:
			case 779:
			case 780:
			case 767:
			case 768:
			case 769:
			case 770:
			case 757:
			case 758:
			case 759:
			case 760:
			case 747:
			case 748:
			case 749:
			case 750:
			case 1293:
			case 629:
			case 1268:
			case 754:
			case 755:
			case 756:
			case 1226:
			case 1865:
			case 2256:
			case 2902:
			case 3030:
			case 3732:
			case 3025:
			case 3026:
			case 3027:
			case 3028:
			case 3029:
				return true;
				break;
			}
	}
	return false;
}

int func_168(int iParam0, int iParam1, int iParam2)//Position - 0x4B63
{
	int iVar0;
	var uVar1;
	
	if (iParam2 == 0)
	{
	}
	iVar0 = Global_2466774[iParam0 /*5*/][func_51(iParam1)];
	if (stats::stat_get_int(iVar0, &uVar1, -1))
	{
		return uVar1;
	}
	return 0;
}

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

bool func_170()//Position - 0x4BAC
{
	if (func_171(17))
	{
		return true;
	}
	if (func_171(0))
	{
		return true;
	}
	return false;
}

int func_171(int iParam0)//Position - 0x4BCE
{
	int iVar0;
	
	iVar0 = func_168(2453, -1, 0);
	return gameplay::is_bit_set(iVar0, iParam0);
}

int func_172(int iParam0)//Position - 0x4BE9
{
	return gameplay::absi(network::get_time_difference(Global_2409442, network::get_network_time())) > iParam0;
}

void func_173()//Position - 0x4C04
{
	if (ui::does_blip_exist(iLocal_247))
	{
		if (func_170())
		{
			ui::set_blip_display(iLocal_247, 0);
		}
		else
		{
			ui::set_blip_display(iLocal_247, 4);
		}
	}
	else if (network::network_does_entity_exist_with_network_id(Local_98.f_2))
	{
		if (!entity::is_entity_dead(network::net_to_veh(Local_98.f_2)))
		{
			iLocal_247 = ui::add_blip_for_entity(network::net_to_veh(Local_98.f_2));
			if (!vehicle::is_this_model_a_bike(Local_98.f_10))
			{
				ui::set_blip_sprite(iLocal_247, 225);
			}
			else
			{
				ui::set_blip_sprite(iLocal_247, 348);
			}
			ui::set_blip_colour(iLocal_247, 1);
			ui::set_blip_flash_timer(iLocal_247, 7000);
			ui::set_blip_priority(iLocal_247, 6);
			ui::set_blip_name_from_text_file(iLocal_247, "DSV_BLIP");
			if (func_170())
			{
				ui::set_blip_display(iLocal_247, 0);
			}
		}
	}
}

void func_174()//Position - 0x4CA7
{
	if (Local_98.f_12 == 2)
	{
		if (network::network_does_entity_exist_with_network_id(Local_98.f_2))
		{
			if (vehicle::is_vehicle_driveable(network::net_to_veh(Local_98.f_2), 0))
			{
				ai::open_sequence_task(&iLocal_245);
				ai::task_vehicle_drive_to_coord_longrange(0, network::net_to_veh(Local_98.f_2), Local_98.f_20, 7f, iLocal_248, 3f);
				ai::task_leave_any_vehicle(0, 0, 0);
				ai::task_follow_nav_mesh_to_coord(0, Local_98.f_24, 1f, -1, 1048576000, 0, Local_98.f_27);
				ai::close_sequence_task(iLocal_245);
			}
		}
	}
}

int func_175()//Position - 0x4D13
{
	return Local_98;
}

var func_176(int iParam0)//Position - 0x4D1D
{
	return vLocal_147[iParam0 /*3*/];
}

int func_177(int iParam0)//Position - 0x4D2B
{
	return !func_178(iParam0);
}

bool func_178(int iParam0)//Position - 0x4D3A
{
	switch (iParam0)
	{
		case 0:
			break;
		
		case 1:
			break;
		
		case 2:
			break;
		
		case 3:
			break;
		
		case 4:
			if (Global_262145.f_5057)
			{
				return false;
			}
			if (func_180(player::player_id(), 7))
			{
				return false;
			}
			if (gameplay::is_bit_set(Global_1587175[player::player_id() /*410*/].f_247.f_6, 0) || gameplay::is_bit_set(Global_1587175[player::player_id() /*410*/].f_247.f_6, 1))
			{
				return false;
			}
			break;
		
		case 5:
			if (Global_262145.f_5058)
			{
				return false;
			}
			if (func_180(player::player_id(), 7))
			{
				return false;
			}
			if (gameplay::is_bit_set(Global_1587175[player::player_id() /*410*/].f_247.f_6, 0) || gameplay::is_bit_set(Global_1587175[player::player_id() /*410*/].f_247.f_6, 1))
			{
				return false;
			}
			break;
		
		case 6:
			if (Global_262145.f_5059)
			{
				return false;
			}
			break;
		
		case 7:
			break;
		
		case 8:
			break;
		
		case 9:
			if (Global_262145.f_5060)
			{
				return false;
			}
			if (func_180(player::player_id(), 7))
			{
				return false;
			}
			if (gameplay::is_bit_set(Global_1587175[player::player_id() /*410*/].f_247.f_6, 0) || gameplay::is_bit_set(Global_1587175[player::player_id() /*410*/].f_247.f_6, 1))
			{
				return false;
			}
			break;
		
		case 15:
			if (func_179(4))
			{
				return false;
			}
			if (func_180(player::player_id(), 7))
			{
				return false;
			}
			if (gameplay::is_bit_set(Global_1587175[player::player_id() /*410*/].f_247.f_6, 0) || gameplay::is_bit_set(Global_1587175[player::player_id() /*410*/].f_247.f_6, 1))
			{
				return false;
			}
			break;
		
		case 17:
			if (func_179(4))
			{
				return false;
			}
			if (func_180(player::player_id(), 7))
			{
				return false;
			}
			if (gameplay::is_bit_set(Global_1587175[player::player_id() /*410*/].f_247.f_6, 0) || gameplay::is_bit_set(Global_1587175[player::player_id() /*410*/].f_247.f_6, 1))
			{
				return false;
			}
			break;
		
		case 16:
			if (func_179(4))
			{
				return false;
			}
			if (func_180(player::player_id(), 7))
			{
				return false;
			}
			if (gameplay::is_bit_set(Global_1587175[player::player_id() /*410*/].f_247.f_6, 0) || gameplay::is_bit_set(Global_1587175[player::player_id() /*410*/].f_247.f_6, 1))
			{
				return false;
			}
			break;
		
		case 18:
		case 21:
		case 22:
		case 23:
			if (func_179(4))
			{
				return false;
			}
			if (func_180(player::player_id(), 7))
			{
				return false;
			}
			if (gameplay::is_bit_set(Global_1587175[player::player_id() /*410*/].f_247.f_6, 0) || gameplay::is_bit_set(Global_1587175[player::player_id() /*410*/].f_247.f_6, 1))
			{
				return false;
			}
			break;
		
		case 19:
			if (func_179(4))
			{
				return false;
			}
			if (func_180(player::player_id(), 7))
			{
				return false;
			}
			break;
		
		case 20:
			if (func_179(4))
			{
				return false;
			}
			if (func_180(player::player_id(), 7))
			{
				return false;
			}
			break;
		
		case 10:
			break;
		
		case 11:
			break;
		
		case 12:
			break;
	}
	return true;
}

bool func_179(int iParam0)//Position - 0x508A
{
	int iVar0;
	
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < 32)
	{
		if (func_205(player::int_to_playerindex(iVar0), 0, 1))
		{
			if (gameplay::is_bit_set(Global_2417071[iVar0 /*306*/].f_206, iParam0))
			{
				return true;
			}
		}
		iVar0++;
	}
	return false;
}

int func_180(int iParam0, int iParam1)//Position - 0x50D0
{
	return gameplay::is_bit_set(Global_2417071[iParam0 /*306*/].f_206, iParam1);
}

bool func_181()//Position - 0x50E9
{
	int iVar0;
	
	func_188(&iVar0);
	if (iVar0)
	{
		return true;
	}
	if (Global_1315886 == 0)
	{
		if (!network::network_is_game_in_progress())
		{
			return true;
		}
	}
	if (func_187())
	{
		return true;
	}
	if (Global_2443300)
	{
		return true;
	}
	if (func_186())
	{
		return true;
	}
	if (func_185(157))
	{
		if (!func_184())
		{
			return true;
		}
	}
	if (func_185(155))
	{
		return true;
	}
	if (!network::network_is_signed_online())
	{
		return true;
	}
	if (func_182() != 0)
	{
		if (script::_get_number_of_instances_of_streamed_script(func_182()) == 0)
		{
			return true;
		}
	}
	return false;
}

int func_182()//Position - 0x517C
{
	switch (func_183())
	{
		case 0:
			return joaat("freemode");
			break;
		
		case 2:
			return joaat("creator");
			break;
	}
	return 0;
}

var func_183()//Position - 0x51B0
{
	return Global_25115;
}

var func_184()//Position - 0x51BB
{
	return Global_2433098.f_574;
}

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

var func_186()//Position - 0x51E1
{
	return Global_2441381;
}

var func_187()//Position - 0x51ED
{
	return Global_2433098.f_569;
}

void func_188(var uParam0)//Position - 0x51FC
{
	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 325:
					func_189(iVar0);
					break;
				
				case 2:
					script::get_event_data(1, iVar0, &vVar4, 3);
					if (vVar4.y == 55)
					{
						*uParam0 = 1;
					}
					break;
				}
		}
		iVar0++;
	}
}

void func_189(int iParam0)//Position - 0x526C
{
	vector3 vVar0;
	int iVar3;
	int iVar4;
	int iVar5;
	
	if (script::get_event_data(1, iParam0, &vVar0, 3))
	{
		if (func_205(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_190(iVar4, &iVar5))
						{
							vehicle::remove_vehicle_window(iVar4, vVar0.y);
						}
						if (iVar5)
						{
							entity::set_vehicle_as_no_longer_needed(&iVar4);
						}
					}
				}
			}
		}
	}
}

bool func_190(int iParam0, var uParam1)//Position - 0x52ED
{
	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_191()//Position - 0x533B
{
	system::wait(0);
}

void func_192()//Position - 0x5348
{
	if (ui::does_blip_exist(iLocal_247))
	{
		ui::remove_blip(&iLocal_247);
	}
	func_195();
	if (func_175() == 4 && Local_98.f_10 != 0)
	{
		vehicle::set_vehicle_model_is_suppressed(Local_98.f_10, false);
	}
	gameplay::clear_bit(&(Global_2458121.f_4418), 1);
	func_194(17, 0);
	func_193();
}

void func_193()//Position - 0x5397
{
	script::terminate_this_thread();
}

void func_194(int iParam0, int iParam1)//Position - 0x53A3
{
	if (iParam1)
	{
		if (!gameplay::is_bit_set(Global_2417071[player::player_id() /*306*/].f_206, iParam0))
		{
			gameplay::set_bit(&(Global_2417071[player::player_id() /*306*/].f_206), iParam0);
		}
	}
	else if (gameplay::is_bit_set(Global_2417071[player::player_id() /*306*/].f_206, iParam0))
	{
		gameplay::clear_bit(&(Global_2417071[player::player_id() /*306*/].f_206), iParam0);
	}
}

void func_195()//Position - 0x5406
{
	if (Local_98.f_12 == 2)
	{
		ai::clear_sequence_task(&iLocal_245);
	}
}

void func_196(struct<20> Param0)//Position - 0x541C
{
	func_203(func_204(Param0), Param0);
	network::reserve_network_mission_peds(4);
	network::reserve_network_mission_vehicles(1);
	func_202(0, -1, 0);
	network::network_register_host_broadcast_variables(&Local_98, 49);
	network::network_register_player_broadcast_variables(&vLocal_147, 97);
	if (!func_201())
	{
		func_192();
	}
	if (network::network_is_game_in_progress())
	{
		gameplay::set_this_script_can_be_paused(0);
		if (network::network_is_host_of_this_script())
		{
			func_197();
			Local_98.f_8 = func_5();
		}
		func_194(17, 1);
		vLocal_147[network::participant_id_to_int() /*3*/] = 0;
	}
	else
	{
		func_192();
	}
}

void func_197()//Position - 0x5497
{
	func_200();
	Local_98.f_12 = gameplay::get_random_int_in_range(0, 3);
	if (Local_98.f_12 == 1 || Local_98.f_12 == 2)
	{
		Local_98.f_15 = gameplay::get_random_int_in_range(0, 5);
		if (Local_98.f_12 == 1)
		{
			func_199(&(Local_98.f_16), &(Local_98.f_19));
		}
		else
		{
			func_199(&(Local_98.f_20), &(Local_98.f_23));
		}
		func_198();
	}
	Local_98.f_14 = gameplay::get_random_int_in_range(0, 3);
	if (Global_262145.f_6470 >= 0 && Global_262145.f_6470 < 5)
	{
		Local_98.f_13 = Global_262145.f_6470;
	}
	else
	{
		Local_98.f_13 = gameplay::get_random_int_in_range(0, 5);
	}
}

void func_198()//Position - 0x552F
{
	switch (Local_98.f_15)
	{
		case 0:
			Local_98.f_24 = { -2195.782f, -420.2502f, 12.0819f };
			Local_98.f_27 = 117.3927f;
			Local_98.f_28[0 /*3*/] = { -2189.975f, -422.8502f, 12.0709f };
			Local_98.f_38[0] = 152.6699f;
			Local_98.f_28[1 /*3*/] = { -2184.031f, -400.948f, 12.2027f };
			Local_98.f_38[1] = 337.9892f;
			Local_98.f_28[2 /*3*/] = { -2175.282f, -426.3756f, 12.128f };
			Local_98.f_38[2] = 12.2947f;
			break;
		
		case 1:
			Local_98.f_24 = { -981.5774f, -1487.319f, 4.5867f };
			Local_98.f_27 = 300.0815f;
			Local_98.f_28[0 /*3*/] = { -977.8269f, -1494.568f, 4.5867f };
			Local_98.f_38[0] = 0.731f;
			Local_98.f_28[1 /*3*/] = { -977.7324f, -1491.717f, 4.5867f };
			Local_98.f_38[1] = 173.7717f;
			Local_98.f_28[2 /*3*/] = { -954.6693f, -1486.713f, 4.16f };
			Local_98.f_38[2] = 304.8721f;
			break;
		
		case 2:
			Local_98.f_24 = { 697.3923f, -1375.27f, 25.196f };
			Local_98.f_27 = 111.1953f;
			Local_98.f_28[0 /*3*/] = { 717.8624f, -1360.491f, 25.0461f };
			Local_98.f_38[0] = 55.1674f;
			Local_98.f_28[1 /*3*/] = { 703.9843f, -1361.094f, 24.6728f };
			Local_98.f_38[1] = 306.7133f;
			Local_98.f_28[2 /*3*/] = { 707.1707f, -1388.706f, 25.2759f };
			Local_98.f_38[2] = 204.5666f;
			break;
		
		case 3:
			Local_98.f_24 = { -258.5791f, 302.4799f, 91.0086f };
			Local_98.f_27 = 180.4109f;
			Local_98.f_28[0 /*3*/] = { -244.9193f, 299.3712f, 91.0424f };
			Local_98.f_38[0] = 43.0354f;
			Local_98.f_28[1 /*3*/] = { -248.7361f, 305.6155f, 91.1444f };
			Local_98.f_38[1] = 191.8736f;
			Local_98.f_28[2 /*3*/] = { -232.4524f, 299.4706f, 91.2088f };
			Local_98.f_38[2] = 199.8353f;
			break;
		
		case 4:
			Local_98.f_24 = { 862.7026f, 2875.148f, 56.9868f };
			Local_98.f_27 = 206.7217f;
			Local_98.f_28[0 /*3*/] = { 880.2893f, 2862.074f, 55.6697f };
			Local_98.f_38[0] = 191.0122f;
			Local_98.f_28[1 /*3*/] = { 865.2399f, 2853.536f, 56.2583f };
			Local_98.f_38[1] = 305.8056f;
			Local_98.f_28[2 /*3*/] = { 867.6559f, 2841.155f, 56.944f };
			Local_98.f_38[2] = 235.4465f;
			break;
	}
}

void func_199(var uParam0, var uParam1)//Position - 0x581F
{
	switch (Local_98.f_15)
	{
		case 0:
			*uParam0 = { -2192.39f, -419.3334f, 12.0959f };
			*uParam1 = 71.2404f;
			break;
		
		case 1:
			*uParam0 = { -977.0366f, -1482.866f, 4.0099f };
			*uParam1 = 124.7807f;
			break;
		
		case 2:
			*uParam0 = { 702.5064f, -1370.477f, 25.0573f };
			*uParam1 = 279.9129f;
			break;
		
		case 3:
			*uParam0 = { -253.3582f, 299.4982f, 90.9592f };
			*uParam1 = 184.8169f;
			break;
		
		case 4:
			*uParam0 = { 868.8133f, 2868.439f, 55.9186f };
			*uParam1 = 200.5778f;
			break;
	}
}

void func_200()//Position - 0x58E4
{
	int iVar0;
	
	iVar0 = gameplay::get_random_int_in_range(0, 8);
	if (Global_262145.f_6469 >= 0 && Global_262145.f_6469 < 8)
	{
		iVar0 = Global_262145.f_6469;
	}
	switch (iVar0)
	{
		case 0:
			if (func_14())
			{
				Local_98.f_10 = joaat("baller");
			}
			else
			{
				Local_98.f_10 = joaat("zion");
			}
			if (func_14())
			{
				Local_98.f_11 = joaat("g_m_y_ballaorig_01");
			}
			else
			{
				Local_98.f_11 = joaat("g_m_y_ballaeast_01");
			}
			break;
		
		case 1:
			if (func_14())
			{
				Local_98.f_10 = joaat("emperor");
			}
			else
			{
				Local_98.f_10 = joaat("cavalcade2");
			}
			if (func_14())
			{
				Local_98.f_11 = joaat("g_m_y_mexgoon_02");
			}
			else
			{
				Local_98.f_11 = joaat("g_f_y_vagos_01");
			}
			break;
		
		case 2:
			if (func_14())
			{
				Local_98.f_10 = joaat("daemon");
			}
			else
			{
				Local_98.f_10 = joaat("gburrito");
			}
			if (func_14())
			{
				Local_98.f_11 = joaat("g_m_y_lost_01");
			}
			else
			{
				Local_98.f_11 = joaat("g_f_y_lost_01");
			}
			break;
		
		case 3:
			if (func_14())
			{
				Local_98.f_10 = joaat("pcj");
			}
			else
			{
				Local_98.f_10 = joaat("bjxl");
			}
			if (func_14())
			{
				Local_98.f_11 = joaat("g_m_m_chigoon_02");
			}
			else
			{
				Local_98.f_11 = joaat("g_m_m_chigoon_01");
			}
			break;
		
		case 4:
			if (func_14())
			{
				Local_98.f_10 = joaat("rocoto");
			}
			else
			{
				Local_98.f_10 = joaat("emperor");
			}
			if (func_14())
			{
				Local_98.f_11 = joaat("g_m_m_armgoon_01");
			}
			else
			{
				Local_98.f_11 = joaat("g_m_y_armgoon_02");
			}
			break;
		
		case 5:
			if (func_14())
			{
				Local_98.f_10 = joaat("journey");
			}
			else
			{
				Local_98.f_10 = joaat("sandking");
			}
			if (func_14())
			{
				Local_98.f_11 = joaat("a_m_m_hillbilly_02");
			}
			else
			{
				Local_98.f_11 = joaat("a_m_m_hillbilly_01");
			}
			break;
		
		case 6:
			if (func_14())
			{
				Local_98.f_10 = joaat("habanero");
			}
			else
			{
				Local_98.f_10 = joaat("sanchez2");
			}
			if (func_14())
			{
				Local_98.f_11 = joaat("g_m_y_salvagoon_01");
			}
			else
			{
				Local_98.f_11 = joaat("g_m_y_salvagoon_02");
			}
			break;
		
		case 7:
			if (func_14())
			{
				Local_98.f_10 = joaat("buffalo2");
			}
			else
			{
				Local_98.f_10 = joaat("dubsta");
			}
			if (func_14())
			{
				Local_98.f_11 = joaat("g_m_y_strpunk_01");
			}
			else
			{
				Local_98.f_11 = joaat("g_m_y_strpunk_02");
			}
			break;
	}
}

bool func_201()//Position - 0x5B28
{
	int iVar0;
	
	iVar0 = 0;
	while (true)
	{
		iVar0++;
		if (!network::network_is_game_in_progress())
		{
			return false;
		}
		if (network::_0x5D10B3795F3FC886())
		{
			return true;
		}
		if (func_187())
		{
			return false;
		}
		if (func_185(155))
		{
			return false;
		}
		if (iVar0 >= 3600)
		{
			return false;
		}
		system::wait(0);
	}
	return false;
}

bool func_202(int iParam0, int iParam1, int iParam2)//Position - 0x5B81
{
	int iVar0;
	
	iVar0 = network::network_get_script_status();
	while (iVar0 != 2)
	{
		if (((iVar0 == 3 || iVar0 == 4) || iVar0 == 5) || iVar0 == 6)
		{
			if (!iParam2)
			{
				func_193();
			}
			else
			{
				return false;
			}
		}
		if (!func_45())
		{
			if (iParam0 == 0)
			{
				if (!network::network_is_game_in_progress())
				{
					if (!iParam2)
					{
						func_193();
					}
					else
					{
						return false;
					}
				}
				if (func_187())
				{
					if (!iParam2)
					{
						func_193();
					}
					else
					{
						return false;
					}
				}
				if (func_185(155))
				{
					if (!iParam2)
					{
						func_193();
					}
					else
					{
						return false;
					}
				}
			}
			else if (!network::network_is_in_session())
			{
				if (!iParam2)
				{
					func_193();
				}
				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_193();
			}
			else
			{
				return false;
			}
		}
	}
	else if (!network::network_is_in_session())
	{
		if (!iParam2)
		{
			func_193();
		}
		else
		{
			return false;
		}
	}
	return true;
}

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

int func_204(int iParam0)//Position - 0x5CB5
{
	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 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 65:
			return 32;
		
		case 66:
			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 77:
			return 32;
		
		case 78:
			return 32;
		
		case 67:
			return 32;
		
		case 68:
			return 32;
		
		case 72:
			return 32;
		
		case 70:
			return 32;
		
		case 71:
			return 32;
		
		case 75:
			return 32;
		
		case 76:
			return 32;
		
		case 73:
			return 32;
		
		case 74:
			return 32;
		
		case 79:
			return 32;
		
		case 80:
			return 32;
		
		case 81:
			return 32;
		
		case 82:
			return 32;
		
		case 83:
			return 2;
		
		case 88:
			return 1;
		
		case 84:
			return 2;
		
		case 85:
			return 4;
		
		case 86:
			return 2;
		
		case 87:
			return 2;
		
		case 69:
			return 1;
		
		case 89:
			return 2;
		
		case 90:
		case 91:
		case 92:
		case 93:
		case 94:
		case 95:
			return 0;
		
		case 96:
			return 1;
		
		default:
	}
	return 0;
}

bool func_205(int iParam0, int iParam1, int iParam2)//Position - 0x60B6
{
	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_2426867.f_3[uVar0])
			{
				return false;
			}
		}
		return true;
	}
	return false;
}

