#region Local Var
	var uLocal_0 = 0;
	var uLocal_1 = 0;
	int iLocal_2 = 0;
	int iLocal_3 = 0;
	int iLocal_4 = 0;
	int iLocal_5 = 0;
	int iLocal_6 = 0;
	int iLocal_7 = 0;
	int iLocal_8 = 0;
	int iLocal_9 = 0;
	int iLocal_10 = 0;
	int iLocal_11 = 0;
	var uLocal_12 = 0;
	var uLocal_13 = 0;
	float fLocal_14 = 0f;
	var uLocal_15 = 0;
	var uLocal_16 = 0;
	int iLocal_17 = 0;
	var uLocal_18 = 0;
	var uLocal_19 = 0;
	char* sLocal_20 = NULL;
	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 = 10;
	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 = 0;
	var uLocal_67 = 0;
	var uLocal_68 = 2;
	var uLocal_69 = 0;
	var uLocal_70 = 0;
	var uLocal_71 = 8;
	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 = 0;
	var uLocal_79 = 0;
	var uLocal_80 = 8;
	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;
	var uLocal_89 = 0;
	float fLocal_90 = 0f;
	struct<53> Local_91 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } ;
	var uLocal_144 = 0;
	struct<5> Local_145[32];
	int iLocal_306 = 0;
	int iLocal_307[3] = { 0, 0, 0 };
	int iLocal_311 = 0;
	int iLocal_312 = 0;
	int iLocal_313 = 0;
	int iLocal_314 = 0;
	int iLocal_315 = 0;
	vector3 vLocal_316 = { 0f, 0f, 0f };
	int iLocal_319 = 0;
	int iLocal_320 = 0;
	int iLocal_321 = 0;
	int iLocal_322 = 0;
	int iLocal_323 = 0;
	var uLocal_324 = 0;
	var uLocal_325 = 0;
	var uLocal_326 = 0;
	var uLocal_327 = 0;
	var uLocal_328 = 0;
	var uLocal_329 = 0;
	var uLocal_330 = 0;
	var uLocal_331 = 16;
	var uLocal_332 = 0;
	var uLocal_333 = 0;
	var uLocal_334 = 0;
	var uLocal_335 = 0;
	var uLocal_336 = 0;
	var uLocal_337 = 0;
	var uLocal_338 = 0;
	var uLocal_339 = 0;
	var uLocal_340 = 0;
	var uLocal_341 = 0;
	var uLocal_342 = 0;
	var uLocal_343 = 0;
	var uLocal_344 = 0;
	var uLocal_345 = 0;
	var uLocal_346 = 0;
	var uLocal_347 = 0;
	var uLocal_348 = 0;
	var uLocal_349 = 0;
	var uLocal_350 = 0;
	var uLocal_351 = 0;
	var uLocal_352 = 0;
	var uLocal_353 = 0;
	var uLocal_354 = 0;
	var uLocal_355 = 0;
	var uLocal_356 = 0;
	var uLocal_357 = 0;
	var uLocal_358 = 0;
	var uLocal_359 = 0;
	var uLocal_360 = 0;
	var uLocal_361 = 0;
	var uLocal_362 = 0;
	var uLocal_363 = 0;
	var uLocal_364 = 0;
	var uLocal_365 = 0;
	var uLocal_366 = 0;
	var uLocal_367 = 0;
	var uLocal_368 = 0;
	var uLocal_369 = 0;
	var uLocal_370 = 0;
	var uLocal_371 = 0;
	var uLocal_372 = 0;
	var uLocal_373 = 0;
	var uLocal_374 = 0;
	var uLocal_375 = 0;
	var uLocal_376 = 0;
	var uLocal_377 = 0;
	var uLocal_378 = 0;
	var uLocal_379 = 0;
	var uLocal_380 = 0;
	var uLocal_381 = 0;
	var uLocal_382 = 0;
	var uLocal_383 = 0;
	var uLocal_384 = 0;
	var uLocal_385 = 0;
	var uLocal_386 = 0;
	var uLocal_387 = 0;
	var uLocal_388 = 0;
	var uLocal_389 = 0;
	var uLocal_390 = 0;
	var uLocal_391 = 0;
	var uLocal_392 = 0;
	var uLocal_393 = 0;
	var uLocal_394 = 0;
	var uLocal_395 = 0;
	var uLocal_396 = 0;
	var uLocal_397 = 0;
	var uLocal_398 = 0;
	var uLocal_399 = 0;
	var uLocal_400 = 0;
	var uLocal_401 = 0;
	var uLocal_402 = 0;
	var uLocal_403 = 0;
	var uLocal_404 = 0;
	var uLocal_405 = 0;
	var uLocal_406 = 0;
	var uLocal_407 = 0;
	var uLocal_408 = 0;
	var uLocal_409 = 0;
	var uLocal_410 = 0;
	var uLocal_411 = 0;
	var uLocal_412 = 0;
	var uLocal_413 = 0;
	var uLocal_414 = 0;
	var uLocal_415 = 0;
	var uLocal_416 = 0;
	var uLocal_417 = 0;
	var uLocal_418 = 0;
	var uLocal_419 = 0;
	var uLocal_420 = 0;
	var uLocal_421 = 0;
	var uLocal_422 = 0;
	var uLocal_423 = 0;
	var uLocal_424 = 0;
	var uLocal_425 = 0;
	var uLocal_426 = 0;
	var uLocal_427 = 0;
	var uLocal_428 = 0;
	var uLocal_429 = 0;
	var uLocal_430 = 0;
	var uLocal_431 = 0;
	var uLocal_432 = 0;
	var uLocal_433 = 0;
	var uLocal_434 = 0;
	var uLocal_435 = 0;
	var uLocal_436 = 0;
	var uLocal_437 = 0;
	var uLocal_438 = 0;
	var uLocal_439 = 0;
	var uLocal_440 = 0;
	var uLocal_441 = 0;
	var uLocal_442 = 0;
	var uLocal_443 = 0;
	var uLocal_444 = 0;
	var uLocal_445 = 0;
	var uLocal_446 = 0;
	var uLocal_447 = 0;
	var uLocal_448 = 0;
	var uLocal_449 = 0;
	var uLocal_450 = 0;
	var uLocal_451 = 0;
	var uLocal_452 = 0;
	var uLocal_453 = 0;
	var uLocal_454 = 0;
	var uLocal_455 = 0;
	var uLocal_456 = 0;
	var uLocal_457 = 0;
	var uLocal_458 = 0;
	var uLocal_459 = 0;
	var uLocal_460 = 0;
	var uLocal_461 = 0;
	var uLocal_462 = 0;
	var uLocal_463 = 0;
	var uLocal_464 = 0;
	var uLocal_465 = 0;
	var uLocal_466 = 0;
	var uLocal_467 = 0;
	var uLocal_468 = 0;
	var uLocal_469 = 0;
	var uLocal_470 = 0;
	var uLocal_471 = 0;
	var uLocal_472 = 0;
	var uLocal_473 = 0;
	var uLocal_474 = 0;
	var uLocal_475 = 0;
	var uLocal_476 = 0;
	var uLocal_477 = 0;
	var uLocal_478 = 0;
	var uLocal_479 = 0;
	var uLocal_480 = 0;
	var uLocal_481 = 0;
	var uLocal_482 = 0;
	var uLocal_483 = 0;
	var uLocal_484 = 0;
	var uLocal_485 = 0;
	var uLocal_486 = 0;
	var uLocal_487 = 0;
	var uLocal_488 = 0;
	var uLocal_489 = 0;
	var uLocal_490 = 0;
	var uLocal_491 = 0;
	var uLocal_492 = 0;
	var uLocal_493 = 0;
	var uLocal_494 = 0;
	var uLocal_495 = 0;
	var uLocal_496 = 0;
	var uLocal_497[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
	int iLocal_514 = 0;
	int iLocal_515 = 0;
	var uLocal_516 = 0;
	var uLocal_517 = 0;
	struct<20> Local_518 = { 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
{
	int iVar0;
	
	iLocal_2 = 1;
	iLocal_3 = 134;
	iLocal_4 = 134;
	iLocal_5 = 1;
	iLocal_6 = 1;
	iLocal_7 = 1;
	iLocal_8 = 134;
	iLocal_9 = 1;
	iLocal_10 = 12;
	iLocal_11 = 12;
	fLocal_14 = 0.001f;
	iLocal_17 = -1;
	sLocal_20 = "NULL";
	fLocal_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_90 = ((0.05f + 0.275f) - 0.01f);
	iLocal_312 = -1;
	iLocal_315 = -1;
	if (network::network_is_game_in_progress())
	{
		func_496(Local_518);
	}
	while (true)
	{
		func_495();
		if (func_485())
		{
			func_482();
		}
		iLocal_319 = network::get_network_time();
		func_473();
		func_470();
		func_465();
		func_464();
		switch (func_463(player::network_player_id_to_int()))
		{
			case 0:
				if (func_462() == 1)
				{
					Local_145[player::network_player_id_to_int() /*5*/] = 1;
				}
				else if (func_462() == 4)
				{
					Local_145[player::network_player_id_to_int() /*5*/] = 3;
				}
				break;
			
			case 1:
				if (func_462() == 1)
				{
					func_456();
				}
				else if (func_462() == 0)
				{
					func_450();
					Local_145[player::network_player_id_to_int() /*5*/] = 0;
				}
				else if (func_462() == 4)
				{
					Local_145[player::network_player_id_to_int() /*5*/] = 3;
				}
				break;
			
			case 3:
				func_425();
				func_423(&(Local_91.f_52));
				if (func_422(&(Local_91.f_52)))
				{
					iVar0 = 0;
					while (iVar0 < func_421(iLocal_312))
					{
						func_425();
						iVar0++;
					}
					Local_145[player::network_player_id_to_int() /*5*/] = 4;
				}
				break;
			
			case 2:
				Local_145[player::network_player_id_to_int() /*5*/] = 4;
			
			case 4:
				func_228();
				break;
		}
		if (network::network_is_host_of_this_script())
		{
			func_226();
			func_225();
			func_224();
			switch (func_462())
			{
				case 0:
					func_223();
					if (func_219())
					{
						if (!entity::is_entity_dead(player::get_player_ped(iLocal_314), 0))
						{
							func_217(player::get_player_ped(iLocal_314));
						}
						else
						{
							Local_91.f_36 = { vLocal_316 };
						}
						gameplay::clear_bit(&(Local_91.f_2), 6);
						Local_91 = 1;
					}
					break;
				
				case 1:
					if (func_59())
					{
						func_58();
						func_57();
					}
					func_39();
					break;
				
				case 4:
					break;
			}
			func_1();
		}
	}
}

void func_1()//Position - 0x235
{
	int iVar0;
	
	if (func_462() < 4)
	{
		if (func_22())
		{
			iLocal_320 = 0;
			iVar0 = 0;
			while (iVar0 <= (func_421(iLocal_312) - 1))
			{
				func_2();
				iVar0++;
			}
			Local_91 = 4;
		}
	}
}

void func_2()//Position - 0x271
{
	var uVar0;
	struct<14> Var1;
	
	if (gameplay::is_bit_set(Local_91.f_10[iLocal_320 /*7*/].f_2, 1) || gameplay::is_bit_set(Local_91.f_10[iLocal_320 /*7*/].f_2, 6))
	{
		if (network::network_does_network_id_exist(Local_91.f_10[iLocal_320 /*7*/]))
		{
			if (entity::does_entity_exist(network::net_to_ped(Local_91.f_10[iLocal_320 /*7*/])))
			{
				if (entity::is_entity_dead(network::net_to_ped(Local_91.f_10[iLocal_320 /*7*/]), 0))
				{
					if (!gameplay::is_bit_set(Local_91.f_10[iLocal_320 /*7*/].f_2, 6))
					{
						if (iLocal_312 == 0)
						{
							Local_91.f_48++;
							if (!gameplay::is_bit_set(Local_91.f_2, 12))
							{
								if (network::network_get_destroyer_of_network_id(Local_91.f_10[iLocal_320 /*7*/], &uVar0) == iLocal_314)
								{
									gameplay::set_bit(&(Local_91.f_2), 12);
								}
							}
							if ((Local_91.f_42 == iLocal_320 && !gameplay::is_bit_set(Local_91.f_2, 5)) || Local_91.f_48 == func_421(iLocal_312))
							{
								Var1.f_2 = 155;
								Var1.f_10 = iLocal_314;
								Var1.f_11 = iLocal_313;
								if (func_421(iLocal_312) > 1)
								{
									Var1.f_12 = player::int_to_playerindex(1);
								}
								else
								{
									Var1.f_12 = player::int_to_playerindex(0);
								}
								Var1.f_3 = Local_91.f_43;
								func_20(Var1, func_21(1));
								if (Local_91.f_42 == iLocal_320)
								{
									gameplay::set_bit(&(Local_91.f_2), 5);
								}
							}
							else if (!gameplay::is_bit_set(Local_91.f_2, 5))
							{
								Var1.f_2 = 154;
								Var1.f_11 = iLocal_313;
								func_20(Var1, func_21(1));
							}
						}
						gameplay::set_bit(&(Local_91.f_10[iLocal_320 /*7*/].f_2), 6);
					}
				}
				else
				{
					if (!gameplay::is_bit_set(Local_91.f_10[iLocal_320 /*7*/].f_2, 5))
					{
						gameplay::set_bit(&iLocal_306, 2);
					}
					gameplay::set_bit(&iLocal_306, 1);
				}
			}
		}
	}
	else
	{
		gameplay::set_bit(&iLocal_306, 1);
		gameplay::set_bit(&iLocal_306, 2);
	}
	func_3(iLocal_320);
	iLocal_320++;
	if (iLocal_320 >= func_421(iLocal_312))
	{
		iLocal_320 = 0;
		if (gameplay::is_bit_set(Local_91.f_1, 0))
		{
			if (!gameplay::is_bit_set(iLocal_306, 1))
			{
				if (!gameplay::is_bit_set(Local_91.f_1, 1))
				{
					gameplay::set_bit(&(Local_91.f_1), 1);
				}
			}
			if (!gameplay::is_bit_set(iLocal_306, 2))
			{
				if (!gameplay::is_bit_set(Local_91.f_1, 9))
				{
					gameplay::set_bit(&(Local_91.f_1), 9);
				}
			}
		}
		gameplay::clear_bit(&iLocal_306, 1);
		gameplay::clear_bit(&iLocal_306, 2);
	}
}

void func_3(int iParam0)//Position - 0x4AD
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	if (network::network_is_host_of_this_script())
	{
		if (network::network_does_network_id_exist(Local_91.f_10[iParam0 /*7*/]))
		{
			iVar0 = network::net_to_ped(Local_91.f_10[iParam0 /*7*/]);
			if (!entity::is_entity_dead(iVar0, 0))
			{
				if (!gameplay::is_bit_set(Local_91.f_10[iParam0 /*7*/].f_2, 9))
				{
					iVar2 = false;
					switch (Local_91.f_10[iParam0 /*7*/].f_1)
					{
						case 0:
							if (func_19(iVar0, 3))
							{
								iVar2 = true;
							}
							break;
					}
					if (iVar2)
					{
						gameplay::set_bit(&(Local_91.f_10[iParam0 /*7*/].f_2), 9);
					}
				}
				switch (Local_91.f_10[iParam0 /*7*/].f_5)
				{
					case 0:
						break;
					
					case 1:
						if (Local_91.f_10[iParam0 /*7*/].f_4 == 0)
						{
							if (!gameplay::is_bit_set(Local_91.f_10[iParam0 /*7*/].f_2, 7))
							{
								if ((((ai::get_navmesh_route_result(iVar0) == 2 || (Global_2421327[iLocal_314 /*353*/].f_235 != -1 && func_18(Global_2421327[iLocal_314 /*353*/].f_235) == 4)) || Global_1588660[iLocal_314 /*532*/].f_441) || func_16(iLocal_314, 0)) || func_9(iLocal_314))
								{
									Local_91.f_10[iParam0 /*7*/].f_3 = iLocal_319;
									gameplay::set_bit(&(Local_91.f_10[iParam0 /*7*/].f_2), 7);
								}
							}
							else if ((((ai::get_navmesh_route_result(iVar0) != 2 && Global_2421327[iLocal_314 /*353*/].f_235 == -1) && !Global_1588660[iLocal_314 /*532*/].f_441) && !func_16(iLocal_314, 0)) && !func_9(iLocal_314))
							{
								gameplay::clear_bit(&(Local_91.f_10[iParam0 /*7*/].f_2), 7);
							}
							else if (network::get_time_difference(iLocal_319, Local_91.f_10[iParam0 /*7*/].f_3) > 10000 || ai::get_navmesh_route_result(iVar0) != 2)
							{
								if (!gameplay::is_bit_set(Local_91.f_2, 10))
								{
									gameplay::set_bit(&(Local_91.f_2), 10);
									Local_91.f_39 = { func_8(iLocal_314) };
									iVar1 = 0;
									iVar1 = 0;
									while (iVar1 < func_421(iLocal_312))
									{
										func_7(iVar1, 3);
										iVar1++;
									}
								}
							}
							if (gameplay::is_bit_set(Local_91.f_10[iParam0 /*7*/].f_2, 2))
							{
								if (!gameplay::is_bit_set(Local_91.f_10[iParam0 /*7*/].f_2, 3))
								{
									if (ai::get_ped_desired_move_blend_ratio(iVar0) == 3f && !ped::get_ped_config_flag(iVar0, 118, 1))
									{
										gameplay::set_bit(&(Local_91.f_10[iParam0 /*7*/].f_2), 3);
									}
								}
							}
						}
						if (gameplay::is_bit_set(Local_91.f_2, 1))
						{
							gameplay::set_bit(&(Local_91.f_10[iParam0 /*7*/].f_2), 2);
							func_7(iParam0, 3);
						}
						else if (func_6(iLocal_314, 1, 1))
						{
							if (!gameplay::is_bit_set(Local_91.f_10[iParam0 /*7*/].f_2, 2))
							{
								if (func_5(entity::get_entity_coords(iVar0, 1), entity::get_entity_coords(player::get_player_ped(iLocal_314), 1), 25f) || !func_5(entity::get_entity_coords(iVar0, 1), entity::get_entity_coords(player::get_player_ped(iLocal_314), 1), 625f))
								{
									gameplay::set_bit(&(Local_91.f_10[iParam0 /*7*/].f_2), 2);
								}
							}
							if (func_4(entity::get_entity_coords(iVar0, 1), entity::get_entity_coords(player::get_player_ped(iLocal_314), 1)) || (ped::is_ped_jacking(iVar0) && ped::get_jack_target(iVar0) == player::get_player_ped(iLocal_314)))
							{
								func_7(iParam0, 2);
							}
						}
						break;
					
					case 2:
						if (gameplay::is_bit_set(Local_91.f_2, 1))
						{
							gameplay::set_bit(&(Local_91.f_10[iParam0 /*7*/].f_2), 2);
							func_7(iParam0, 3);
						}
						else if (func_6(iLocal_314, 1, 1))
						{
							if (!func_4(entity::get_entity_coords(iVar0, 1), entity::get_entity_coords(player::get_player_ped(iLocal_314), 1)) && !(ped::is_ped_jacking(iVar0) && ped::get_jack_target(iVar0) == player::get_player_ped(iLocal_314)))
							{
								func_7(iParam0, 1);
							}
						}
						break;
					
					case 3:
						if (Local_91.f_10[iParam0 /*7*/].f_4 == 0)
						{
							if (!gameplay::is_bit_set(Local_91.f_10[iParam0 /*7*/].f_2, 4))
							{
								if (ped::get_ped_config_flag(iVar0, 118, 1))
								{
									gameplay::set_bit(&(Local_91.f_10[iParam0 /*7*/].f_2), 4);
								}
							}
						}
						break;
					
					case 4:
						break;
					}
				}
			}
	}
}

bool func_4(vector3 vParam0, vector3 vParam3)//Position - 0x8B1
{
	vector3 vVar0;
	vector3 vVar3;
	
	if (gameplay::absf((vParam3.y - vParam0.y)) < 2f)
	{
		vVar0.x = vParam0.x;
		vVar0.y = vParam0.y;
		vVar3.x = vParam3.x;
		vVar3.y = vParam3.y;
		if (func_5(vVar0, vVar3, 2f))
		{
			return true;
		}
	}
	return false;
}

bool func_5(vector3 vParam0, vector3 vParam3, float fParam6)//Position - 0x8F8
{
	if (system::vdist2(vParam0, vParam3) < fParam6)
	{
		return true;
	}
	return false;
}

bool func_6(int iParam0, int iParam1, int iParam2)//Position - 0x917
{
	int iVar0;
	
	iVar0 = iParam0;
	if (iVar0 != -1)
	{
		if (network::network_is_player_active(iParam0))
		{
			if (iParam1)
			{
				if (!player::is_player_playing(iParam0))
				{
					return false;
				}
			}
			if (iParam2)
			{
				if (!Global_2432628.f_3[iVar0])
				{
					return false;
				}
			}
			return true;
		}
	}
	return false;
}

void func_7(int iParam0, int iParam1)//Position - 0x961
{
	Local_91.f_10[iParam0 /*7*/].f_5 = iParam1;
}

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

int func_9(int iParam0)//Position - 0x988
{
	int iVar0;
	int iVar1;
	
	if (network::network_is_player_active(iParam0))
	{
		if (func_14(iParam0, 1))
		{
			iVar0 = player::get_player_ped(iParam0);
			iVar1 = func_11(iParam0);
			if (entity::does_entity_exist(iVar1))
			{
				if (vehicle::is_vehicle_driveable(iVar1, 0))
				{
					if (ped::is_ped_in_vehicle(iVar0, iVar1, 0))
					{
						return func_10(iVar1);
					}
				}
			}
		}
	}
	return 0;
}

bool func_10(int iParam0)//Position - 0x9DC
{
	int iVar0;
	
	if (vehicle::is_vehicle_driveable(iParam0, 0))
	{
		if (decorator::decor_is_registered_as_type("MPBitset", 3) && decorator::decor_exist_on(iParam0, "MPBitset"))
		{
			iVar0 = decorator::decor_get_int(iParam0, "MPBitset");
			if (gameplay::is_bit_set(iVar0, 17))
			{
				return true;
			}
		}
	}
	return false;
}

int func_11(int iParam0)//Position - 0xA1F
{
	if (func_14(iParam0, 1))
	{
		return Global_2482149.f_4698.f_32[func_12(iParam0)];
	}
	return 0;
}

int func_12(int iParam0)//Position - 0xA46
{
	if (iParam0 != func_13())
	{
		return Global_1614576[iParam0 /*324*/].f_10;
	}
	return func_13();
}

int func_13()//Position - 0xA69
{
	return -1;
}

int func_14(int iParam0, int iParam1)//Position - 0xA72
{
	if (!iParam1)
	{
		if (func_15(iParam0))
		{
			return false;
		}
	}
	return Global_1614576[iParam0 /*324*/].f_10 != func_13();
}

int func_15(int iParam0)//Position - 0xA9D
{
	if (iParam0 != func_13())
	{
		if (Global_1614576[iParam0 /*324*/].f_10 != func_13())
		{
			return Global_1614576[iParam0 /*324*/].f_10 == iParam0;
		}
	}
	return false;
}

bool func_16(int iParam0, int iParam1)//Position - 0xAD2
{
	int iVar0;
	
	if (func_6(iParam0, 1, 1))
	{
		iVar0 = player::get_player_ped(iParam0);
		if (ped::is_ped_in_any_vehicle(iVar0, iParam1))
		{
			if (func_17(ped::get_vehicle_ped_is_in(iVar0, iParam1)))
			{
				return true;
			}
		}
	}
	return false;
}

bool func_17(int iParam0)//Position - 0xB0C
{
	if (Global_69617)
	{
		if (decorator::decor_exist_on(iParam0, "Player_Vehicle"))
		{
			return true;
		}
	}
	return false;
}

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

bool func_19(int iParam0, int iParam1)//Position - 0xD9F
{
	if (decorator::decor_is_registered_as_type("AttributeDamage", 3))
	{
		if (decorator::decor_exist_on(iParam0, "AttributeDamage"))
		{
			if (gameplay::is_bit_set(decorator::decor_get_int(iParam0, "AttributeDamage"), iParam1))
			{
				return true;
			}
		}
	}
	return false;
}

void func_20(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 - 0xDD5
{
	Param0 = 0;
	Param0.f_1 = player::player_id();
	if (!iParam14 == 0)
	{
		script::trigger_script_event(1, &Param0, 14, iParam14);
	}
}

var func_21(int iParam0)//Position - 0xDFE
{
	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_6(iVar2, 0, 0))
			{
				if (iVar2 != player::player_id() || iParam0)
				{
					gameplay::set_bit(&uVar0, iVar2);
				}
			}
		}
		iVar1++;
	}
	return uVar0;
}

bool func_22()//Position - 0xE5B
{
	if (gameplay::is_bit_set(Local_91.f_1, 0))
	{
		if (iLocal_312 == 1)
		{
			if (gameplay::is_bit_set(Local_91.f_1, 4))
			{
				gameplay::set_bit(&(Local_91.f_3), 11);
				return true;
			}
		}
		else if (gameplay::is_bit_set(Local_91.f_1, 1))
		{
			gameplay::set_bit(&(Local_91.f_3), 0);
			return true;
		}
	}
	else if (gameplay::is_bit_set(Local_91.f_1, 2))
	{
		gameplay::set_bit(&(Local_91.f_3), 1);
		gameplay::set_bit(&Global_1729860, iLocal_312);
		return true;
	}
	if (gameplay::is_bit_set(Local_91.f_3, 12))
	{
		return true;
	}
	if (iLocal_312 == 0)
	{
		if (gameplay::is_bit_set(Local_91.f_2, 2))
		{
			gameplay::set_bit(&(Local_91.f_3), 2);
			return true;
		}
		if (gameplay::is_bit_set(Local_91.f_2, 8))
		{
			gameplay::set_bit(&(Local_91.f_3), 8);
			return true;
		}
		if (gameplay::is_bit_set(Local_91.f_2, 5))
		{
			gameplay::set_bit(&(Local_91.f_3), 3);
			return true;
		}
		if (gameplay::is_bit_set(Local_91.f_2, 9))
		{
			gameplay::set_bit(&(Local_91.f_3), 9);
			return true;
		}
		if (gameplay::is_bit_set(Local_91.f_1, 15))
		{
			gameplay::set_bit(&(Local_91.f_3), 10);
			return true;
		}
	}
	if (!func_6(iLocal_314, 0, 1))
	{
		if (iLocal_312 != 0 || !gameplay::is_bit_set(Local_91.f_2, 1))
		{
			gameplay::set_bit(&(Local_91.f_3), 4);
			return true;
		}
	}
	else
	{
		if (func_37(iLocal_314, 129))
		{
			gameplay::set_bit(&(Local_91.f_2), 13);
			gameplay::set_bit(&(Local_91.f_3), 8);
			return true;
		}
		if (func_37(iLocal_314, 131) || gameplay::is_bit_set(Global_1614576[iLocal_314 /*324*/].f_1, 11))
		{
			gameplay::set_bit(&(Local_91.f_2), 13);
			gameplay::set_bit(&(Local_91.f_2), 8);
			return true;
		}
		if (func_37(iLocal_314, 136) || (func_36(player::player_id(), 24) && func_35(iLocal_314)))
		{
			gameplay::set_bit(&(Local_91.f_2), 8);
			return true;
		}
		if (func_37(iLocal_314, 146))
		{
			gameplay::set_bit(&(Local_91.f_2), 8);
			return true;
		}
		if (func_34(player::player_id()) && ((func_32(player::player_id()) == 148 || func_32(player::player_id()) == 142) || func_32(player::player_id()) == 164))
		{
			gameplay::set_bit(&(Local_91.f_2), 8);
			return true;
		}
		if (func_32(player::player_id()) == 153)
		{
			gameplay::set_bit(&(Local_91.f_2), 8);
			return true;
		}
		if (func_30(player::player_id()) && func_32(player::player_id()) == 170)
		{
			gameplay::set_bit(&(Local_91.f_2), 8);
			return true;
		}
		if (func_32(player::player_id()) == 167)
		{
			gameplay::set_bit(&(Local_91.f_2), 8);
			return true;
		}
		if (func_32(player::player_id()) == 168)
		{
			gameplay::set_bit(&(Local_91.f_2), 8);
			return true;
		}
		if (entity::is_entity_dead(player::get_player_ped(iLocal_314), 0))
		{
			if (iLocal_312 == 1)
			{
				if (gameplay::is_bit_set(Local_91.f_1, 0))
				{
					gameplay::set_bit(&(Local_91.f_3), 6);
					return true;
				}
			}
		}
		else
		{
			if (iLocal_312 == 1)
			{
				if (func_37(iLocal_314, 146))
				{
					gameplay::set_bit(&(Local_91.f_3), 7);
					return true;
				}
				if (!gameplay::is_bit_set(Local_91.f_1, 16))
				{
					if (network::get_time_difference(iLocal_319, Local_91.f_9) > 120000)
					{
						gameplay::set_bit(&(Local_91.f_3), 7);
						return true;
					}
				}
				if (func_27())
				{
					gameplay::set_bit(&(Local_91.f_3), 7);
					return true;
				}
				if (func_23(iLocal_314, func_12(iLocal_313), 1))
				{
					gameplay::set_bit(&(Local_91.f_3), 7);
					return true;
				}
			}
			if (iLocal_315 != gameplay::get_hash_key(player::get_player_name(iLocal_314)))
			{
				gameplay::set_bit(&(Local_91.f_3), 5);
				return true;
			}
		}
	}
	return false;
}

int func_23(int iParam0, int iParam1, int iParam2)//Position - 0x11E9
{
	return func_24(iParam0, iParam1, iParam2, 1);
}

int func_24(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x11FC
{
	if (iParam1 != func_13() && iParam0 != func_13())
	{
		if (!iParam2)
		{
			if (func_26(iParam0, iParam1, iParam3))
			{
				return 0;
			}
		}
		if (Global_1614576[iParam0 /*324*/].f_10 != func_13())
		{
			if (iParam1 == Global_1614576[iParam0 /*324*/].f_10)
			{
				return func_25(iParam1, iParam3);
			}
		}
	}
	return 0;
}

int func_25(int iParam0, int iParam1)//Position - 0x125F
{
	if (func_15(iParam0))
	{
		return Global_1614576[iParam0 /*324*/].f_10.f_234 == iParam1;
	}
	return false;
}

int func_26(int iParam0, int iParam1, int iParam2)//Position - 0x1284
{
	if (iParam1 != func_13())
	{
		if (iParam0 != func_13())
		{
			if (Global_1614576[iParam0 /*324*/].f_10 != func_13())
			{
				if (Global_1614576[iParam0 /*324*/].f_10 == iParam0)
				{
					if (Global_1614576[iParam0 /*324*/].f_10.f_234 == iParam2)
					{
						return iParam1 == iParam0;
					}
				}
			}
		}
	}
	return false;
}

bool func_27()//Position - 0x12DB
{
	if (((func_29(iLocal_314, 1, 0) || func_36(iLocal_314, 0)) || func_36(iLocal_314, 7)) || func_28(iLocal_314))
	{
		return true;
	}
	return false;
}

int func_28(int iParam0)//Position - 0x131D
{
	return Global_1588660[iParam0 /*532*/].f_186 != 0;
}

bool func_29(int iParam0, int iParam1, int iParam2)//Position - 0x1332
{
	if (iParam0 == func_13())
	{
		return false;
	}
	if (gameplay::is_bit_set(Global_1588660[iParam0 /*532*/].f_256.f_9, 0))
	{
		return true;
	}
	if (iParam1)
	{
		if (gameplay::is_bit_set(Global_1588660[iParam0 /*532*/].f_256.f_9, 1))
		{
			return true;
		}
	}
	if (iParam2)
	{
		if (Global_2421327[iParam0 /*353*/].f_308.f_1 != -1)
		{
			return true;
		}
	}
	return false;
}

int func_30(int iParam0)//Position - 0x139C
{
	int iVar0;
	
	iVar0 = iParam0;
	if (iVar0 != -1)
	{
		return func_31(iParam0, 9);
	}
	return false;
}

int func_31(var uParam0, int iParam1)//Position - 0x13BA
{
	return gameplay::is_bit_set(Global_1614576[uParam0 /*324*/].f_10.f_4, iParam1);
}

int func_32(int iParam0)//Position - 0x13D5
{
	if (func_33(iParam0, 0))
	{
		return Global_1614576[iParam0 /*324*/].f_10.f_32;
	}
	return -1;
}

bool func_33(int iParam0, int iParam1)//Position - 0x13F8
{
	if (Global_1614576[iParam0 /*324*/].f_10.f_32 != -1 || (iParam1 && Global_1614576[iParam0 /*324*/].f_10.f_31 != -1))
	{
		return true;
	}
	return false;
}

bool func_34(int iParam0)//Position - 0x1433
{
	if (func_15(iParam0))
	{
		if (func_30(iParam0))
		{
			return true;
		}
	}
	return false;
}

int func_35(int iParam0)//Position - 0x1452
{
	return gameplay::is_bit_set(Global_1614576[iParam0 /*324*/].f_1, 4);
}

int func_36(int iParam0, int iParam1)//Position - 0x146A
{
	return gameplay::is_bit_set(Global_2421327[iParam0 /*353*/].f_208, iParam1);
}

int func_37(int iParam0, int iParam1)//Position - 0x1483
{
	if (Global_1614576[iParam0 /*324*/] == iParam1)
	{
		return func_38(iParam0);
	}
	return false;
}

int func_38(var uParam0)//Position - 0x14A3
{
	int iVar0;
	
	iVar0 = uParam0;
	if (iVar0 != -1)
	{
		return gameplay::is_bit_set(Global_1614576[iVar0 /*324*/].f_1, 0);
	}
	return false;
}

void func_39()//Position - 0x14C9
{
	func_50();
	if (iLocal_312 != 1)
	{
		func_2();
	}
	func_40();
}

void func_40()//Position - 0x14E4
{
	int iVar0;
	
	if (func_6(player::int_to_playerindex(iLocal_321), 0, 1))
	{
		if (iLocal_312 == 1)
		{
			if (player::int_to_playerindex(iLocal_321) == iLocal_314)
			{
				if (!gameplay::is_bit_set(Local_91.f_1, 16))
				{
					if (gameplay::is_bit_set(Local_145[iLocal_321 /*5*/].f_1, 3))
					{
						gameplay::set_bit(&(Local_91.f_1), 16);
					}
				}
			}
		}
		else
		{
			if (!gameplay::is_bit_set(Local_91.f_1, 11))
			{
				if (func_46(player::int_to_playerindex(iLocal_321)))
				{
					if (!gameplay::is_bit_set(Local_91.f_4, iLocal_321))
					{
						gameplay::set_bit(&(Local_91.f_1), 11);
						gameplay::set_bit(&(Local_91.f_4), iLocal_321);
					}
				}
				else if (gameplay::is_bit_set(Local_91.f_4, iLocal_321))
				{
					gameplay::set_bit(&(Local_91.f_1), 11);
					gameplay::clear_bit(&(Local_91.f_4), iLocal_321);
				}
			}
			else if (gameplay::is_bit_set(Local_145[iLocal_321 /*5*/].f_1, 2))
			{
				gameplay::clear_bit(&(Local_91.f_1), 11);
			}
			if (iLocal_312 == 0)
			{
				if (gameplay::is_bit_set(Local_145[iLocal_321 /*5*/].f_1, 0))
				{
					if (Local_145[iLocal_321 /*5*/].f_2 != -1)
					{
						if (!gameplay::is_bit_set(Local_91.f_2, 1))
						{
							gameplay::set_bit(&(Local_91.f_2), 1);
							Local_91.f_42 = Local_145[iLocal_321 /*5*/].f_2;
							Local_91.f_43 = Local_145[iLocal_321 /*5*/].f_3;
							if (!func_45())
							{
								func_44();
							}
						}
					}
					else if (!gameplay::is_bit_set(Local_91.f_2, 9))
					{
						if (!func_45())
						{
							func_43();
						}
						iVar0 = 0;
						while (iVar0 < func_421(iLocal_312))
						{
							func_7(iVar0, 3);
							iVar0++;
						}
						gameplay::set_bit(&(Local_91.f_2), 9);
						gameplay::set_bit(&(Local_91.f_2), 1);
					}
				}
				if (func_45())
				{
					if (!gameplay::is_bit_set(iLocal_306, 17))
					{
						if (gameplay::is_bit_set(Local_145[iLocal_321 /*5*/].f_1, 5))
						{
							func_44();
							gameplay::set_bit(&iLocal_306, 17);
						}
						else if (gameplay::is_bit_set(Local_145[iLocal_321 /*5*/].f_1, 6))
						{
							func_43();
							gameplay::set_bit(&iLocal_306, 17);
						}
					}
				}
				if (!gameplay::is_bit_set(Local_145[iLocal_321 /*5*/].f_1, 1))
				{
					if (!gameplay::is_bit_set(iLocal_306, 3))
					{
						gameplay::set_bit(&iLocal_306, 3);
					}
				}
				else if (player::int_to_playerindex(iLocal_321) == iLocal_314)
				{
					if (iLocal_312 == 0)
					{
						if (!gameplay::is_bit_set(Local_91.f_2, 1))
						{
							if (!gameplay::is_bit_set(Local_91.f_2, 6))
							{
								gameplay::set_bit(&(Local_91.f_2), 6);
							}
						}
					}
				}
			}
		}
	}
	iLocal_321++;
	if (iLocal_321 >= 32)
	{
		iLocal_321 = 0;
		if (iLocal_312 == 0)
		{
			if (!gameplay::is_bit_set(iLocal_306, 3))
			{
				func_42();
			}
			else
			{
				func_41();
			}
			gameplay::clear_bit(&iLocal_306, 3);
		}
	}
}

void func_41()//Position - 0x175D
{
	if (gameplay::is_bit_set(Local_91.f_2, 3))
	{
		gameplay::clear_bit(&(Local_91.f_2), 3);
	}
}

void func_42()//Position - 0x177A
{
	if (!gameplay::is_bit_set(Local_91.f_2, 3))
	{
		Local_91.f_6 = iLocal_319;
		gameplay::set_bit(&(Local_91.f_2), 3);
	}
}

void func_43()//Position - 0x179F
{
	struct<14> Var0;
	
	Var0.f_2 = 156;
	Var0.f_10 = iLocal_314;
	Var0.f_11 = iLocal_313;
	func_20(Var0, func_21(1));
}

void func_44()//Position - 0x17C9
{
	struct<14> Var0;
	
	Var0.f_2 = 153;
	Var0.f_10 = iLocal_314;
	Var0.f_11 = iLocal_313;
	if (func_421(iLocal_312) > 1)
	{
		Var0.f_12 = player::int_to_playerindex(1);
	}
	else
	{
		Var0.f_12 = player::int_to_playerindex(0);
	}
	Var0.f_3 = Local_91.f_43;
	func_20(Var0, func_21(1));
}

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

int func_46(int iParam0)//Position - 0x182F
{
	if (iParam0 == player::player_id())
	{
		return func_49();
	}
	return gameplay::is_bit_set(Global_1342783.f_241.f_136[func_48(10) /*33*/][iParam0], func_47(10));
}

int func_47(int iParam0)//Position - 0x1865
{
	return (iParam0 % 32);
}

int func_48(int iParam0)//Position - 0x1872
{
	return (iParam0 / 32);
}

var func_49()//Position - 0x187F
{
	return Global_1312412;
}

void func_50()//Position - 0x188B
{
	int iVar0;
	
	if (iLocal_312 == 0)
	{
		if (gameplay::is_bit_set(Local_91.f_2, 3))
		{
			if (network::get_time_difference(iLocal_319, Local_91.f_6) > 10000)
			{
				if (gameplay::is_bit_set(Local_91.f_2, 1))
				{
					gameplay::set_bit(&(Local_91.f_2), 2);
				}
			}
		}
		if (gameplay::is_bit_set(Local_91.f_1, 8))
		{
			if (!gameplay::is_bit_set(Local_91.f_2, 1))
			{
				if (func_54())
				{
					gameplay::set_bit(&(Local_91.f_2), 6);
					func_53();
				}
			}
		}
		if (!gameplay::is_bit_set(Local_91.f_1, 0))
		{
			if (func_6(iLocal_314, 1, 1))
			{
				iVar0 = player::get_player_ped(iLocal_314);
				if (func_52(iVar0))
				{
					func_217(iVar0);
				}
			}
		}
		if (!gameplay::is_bit_set(Local_91.f_2, 1))
		{
			if (!func_6(iLocal_314, 1, 1) || func_28(iLocal_314))
			{
				gameplay::set_bit(&(Local_91.f_1), 15);
			}
		}
	}
	if (gameplay::is_bit_set(Local_91.f_1, 0))
	{
		if (gameplay::is_bit_set(Local_91.f_1, 5))
		{
			if (!gameplay::is_bit_set(Local_91.f_1, 4))
			{
				if (network::get_time_difference(iLocal_319, Local_91.f_5) > 600000)
				{
					gameplay::set_bit(&(Local_91.f_1), 4);
				}
			}
		}
		if (!gameplay::is_bit_set(Local_91.f_3, 12))
		{
			if (func_51())
			{
				gameplay::set_bit(&(Local_91.f_3), 12);
			}
		}
	}
}

bool func_51()//Position - 0x19BB
{
	switch (Local_91.f_10[0 /*7*/].f_1)
	{
		case 0:
			if (Global_1588660[player::player_id() /*532*/].f_432 == 0)
			{
				return true;
			}
			break;
		
		case 1:
			if (Global_1588660[player::player_id() /*532*/].f_432 == 1)
			{
				return true;
			}
			break;
	}
	return false;
}

bool func_52(int iParam0)//Position - 0x1A10
{
	if (ped::is_ped_injured(iParam0))
	{
	}
	if (gameplay::is_bit_set(Local_91.f_1, 17))
	{
		if (!entity::is_entity_in_water(iParam0))
		{
			return true;
		}
	}
	if (!func_5(Local_91.f_36, entity::get_entity_coords(iParam0, 1), 625f))
	{
		return true;
	}
	return false;
}

void func_53()//Position - 0x1A5B
{
	func_450();
	Local_91 = 0;
}

bool func_54()//Position - 0x1A6A
{
	if ((((((((gameplay::is_bit_set(Local_91.f_2, 6) || player::is_player_dead(iLocal_314)) || func_29(iLocal_314, 1, 0)) || func_56(iLocal_314)) || func_36(iLocal_314, 0)) || func_36(iLocal_314, 7)) || func_28(iLocal_314)) || Global_2421327[iLocal_314 /*353*/].f_237) || func_55(player::get_player_ped(iLocal_314), joaat("titan")))
	{
		return true;
	}
	if (iLocal_314 != -1)
	{
		if (gameplay::is_bit_set(Local_145[iLocal_314 /*5*/].f_1, 4))
		{
			return true;
		}
	}
	return false;
}

bool func_55(int iParam0, int iParam1)//Position - 0x1B19
{
	int iVar0;
	
	if (entity::does_entity_exist(iParam0))
	{
		if (!ped::is_ped_injured(iParam0))
		{
			if (ped::is_ped_sitting_in_any_vehicle(iParam0))
			{
				iVar0 = ped::get_vehicle_ped_is_in(iParam0, 0);
				if (entity::does_entity_exist(iVar0))
				{
					if (entity::get_entity_model(iVar0) == iParam1)
					{
						return true;
					}
				}
			}
		}
	}
	return false;
}

bool func_56(int iParam0)//Position - 0x1B5F
{
	if (gameplay::is_bit_set(Global_1588660[iParam0 /*532*/].f_256.f_9, 14))
	{
		return true;
	}
	if (gameplay::is_bit_set(Global_1588660[iParam0 /*532*/].f_256.f_9, 11))
	{
		return true;
	}
	return false;
}

void func_57()//Position - 0x1B9E
{
	if (!gameplay::is_bit_set(Local_91.f_1, 5))
	{
		Local_91.f_5 = iLocal_319;
		gameplay::set_bit(&(Local_91.f_1), 5);
	}
}

void func_58()//Position - 0x1BC3
{
	if (gameplay::is_bit_set(Local_91.f_1, 5))
	{
		gameplay::clear_bit(&(Local_91.f_1), 5);
	}
}

bool func_59()//Position - 0x1BE0
{
	int iVar0;
	
	if (gameplay::is_bit_set(Local_91.f_1, 0))
	{
		return false;
	}
	else
	{
		iVar0 = false;
		if (func_219())
		{
			if (iLocal_312 == 1)
			{
				iVar0 = true;
			}
			else if (func_214())
			{
				if (func_211())
				{
					if (func_210())
					{
						iVar0 = true;
					}
					else if (func_208(func_209(iLocal_312)))
					{
						if (func_65())
						{
							iVar0 = true;
						}
					}
				}
			}
		}
		if (iVar0)
		{
			func_57();
			if (func_60())
			{
				return true;
			}
		}
	}
	return false;
}

bool func_60()//Position - 0x1C5A
{
	int iVar0;
	
	iVar0 = 0;
	if (network::network_is_host_of_this_script())
	{
		if (gameplay::is_bit_set(Local_91.f_1, 0))
		{
			return true;
		}
		else
		{
			switch (iLocal_312)
			{
				case 0:
					iVar0 = 0;
					while (iVar0 < func_421(iLocal_312))
					{
						if ((!network::network_does_network_id_exist(Local_91.f_10[iVar0 /*7*/]) && !gameplay::is_bit_set(Local_91.f_10[iVar0 /*7*/].f_2, 1)) && !gameplay::is_bit_set(Local_91.f_10[iVar0 /*7*/].f_2, 6))
						{
							func_61(iVar0, func_64(iLocal_312), Local_91.f_32, Local_91.f_35);
						}
						iVar0++;
					}
					break;
			}
			if (iLocal_312 != 1)
			{
				iVar0 = 0;
				while (iVar0 < func_421(iLocal_312))
				{
					if (!network::network_does_network_id_exist(Local_91.f_10[iVar0 /*7*/]))
					{
						if (!gameplay::is_bit_set(Local_91.f_10[iVar0 /*7*/].f_2, 6))
						{
							return false;
						}
					}
					iVar0++;
				}
			}
			gameplay::set_bit(&iLocal_306, 1);
			gameplay::set_bit(&iLocal_306, 2);
			gameplay::set_bit(&iLocal_306, 3);
			gameplay::set_bit(&iLocal_306, 4);
			gameplay::set_bit(&(Local_91.f_1), 0);
			gameplay::set_bit(&Global_1729861, iLocal_312);
			return true;
		}
	}
	return false;
}

void func_61(int iParam0, var uParam1, vector3 vParam2, float fParam5)//Position - 0x1D78
{
	if (network::network_is_host_of_this_script())
	{
		if (!network::network_does_network_id_exist(Local_91.f_10[iParam0 /*7*/]))
		{
			if (network::_0xCB215C4B56A7FAE7(0) < network::get_num_reserved_mission_peds(false))
			{
				if (network::can_register_mission_peds(1))
				{
					if (func_208(func_209(iLocal_312)))
					{
						if (func_63(&(Local_91.f_10[iParam0 /*7*/]), 7, func_209(iLocal_312), vParam2, fParam5, 1, 1, 1))
						{
							Local_91.f_10[iParam0 /*7*/].f_1 = iLocal_312;
							Local_91.f_10[iParam0 /*7*/].f_4 = uParam1;
							func_62(iParam0);
						}
					}
				}
			}
		}
	}
}

void func_62(int iParam0)//Position - 0x1DF9
{
	char cVar0[16];
	
	if (!gameplay::is_bit_set(Local_91.f_10[iParam0 /*7*/].f_2, 1))
	{
		if (!entity::is_entity_dead(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 0))
		{
			if (Local_91.f_10[iParam0 /*7*/].f_4 == 0)
			{
				ped::set_ped_relationship_group_hash(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), Global_1574275);
				ai::set_ped_paths_width_plant(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 1);
				ai::set_ped_path_prefer_to_avoid_water(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 0);
			}
			entity::set_entity_proofs(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), false, false, false, false, false, false, 1, false);
			ped::set_ped_combat_ability(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 2);
			ped::set_ped_combat_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 13, true);
			ped::set_ped_combat_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 41, true);
			ped::set_ped_combat_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 20, true);
			ped::set_ped_config_flag(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 132, true);
			ped::set_ped_config_flag(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 118, false);
			ped::set_ped_config_flag(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 311, true);
			ped::set_ped_to_inform_respected_friends(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 300f, 10);
			ped::set_ped_keep_task(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), true);
			StringCopy(&cVar0, "gang ", 16);
			StringIntConCat(&cVar0, iParam0, 16);
			ped::set_ped_name_debug(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), &cVar0);
			switch (Local_91.f_10[iParam0 /*7*/].f_4)
			{
				case 0:
					func_7(iParam0, 1);
					ped::set_ped_combat_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 0, false);
					ped::set_ped_combat_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 2, false);
					ped::set_ped_combat_movement(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 2);
					ped::set_ped_combat_range(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 0);
					ped::set_ped_using_action_mode(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), false, -1, 0);
					ped::set_ped_config_flag(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 32, true);
					ped::set_ped_flee_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 4, false);
					ped::set_ped_flee_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 1024, true);
					ped::set_ped_flee_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 128, true);
					ped::set_ped_flee_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 32, false);
					ped::set_ped_flee_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 8, false);
					ped::set_ped_flee_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 64, false);
					ped::set_ped_flee_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 256, true);
					ped::set_ped_flee_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 1, false);
					ped::set_ped_flee_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 2, true);
					ped::set_ped_flee_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 16, true);
					if (!gameplay::is_bit_set(Local_91.f_10[iParam0 /*7*/].f_2, 0))
					{
						gameplay::set_bit(&(Local_91.f_10[iParam0 /*7*/].f_2), 2);
					}
					ped::set_ped_flee_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 512, true);
					ped::set_ped_combat_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 17, false);
					weapon::give_weapon_to_ped(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), joaat("weapon_knife"), 1, true, true);
					ped::set_ped_money(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 0);
					ai::task_look_at_entity(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), player::get_player_ped(iLocal_314), -1, 0, 2);
					network::_0x3FA36981311FA4FF(Local_91.f_10[iParam0 /*7*/], 1);
					break;
			}
			entity::set_entity_health(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), system::round((Global_262145.f_151 * IntToFloat(entity::get_entity_health(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]))))));
			if (!gameplay::is_bit_set(Local_91.f_1, 8))
			{
				gameplay::set_bit(&(Local_91.f_1), 8);
			}
			gameplay::set_bit(&(Local_91.f_10[iParam0 /*7*/].f_2), 1);
		}
	}
}

bool func_63(var uParam0, int iParam1, int iParam2, vector3 vParam3, float fParam6, int iParam7, int iParam8, int iParam9)//Position - 0x2184
{
	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;
}

bool func_64(int iParam0)//Position - 0x21E3
{
	switch (iParam0)
	{
		case 0:
			return false;
			break;
	}
	return false;
}

bool func_65()//Position - 0x2200
{
	struct<26> Var0;
	
	if (gameplay::is_bit_set(Local_91.f_1, 3))
	{
		return true;
	}
	else
	{
		switch (iLocal_312)
		{
			case 0:
				if (network::network_is_player_active(iLocal_314) && func_6(iLocal_314, 1, 1))
				{
					Var0.f_5 = 1115815936;
					Var0.f_13 = 2;
					Var0.f_20 = 2;
					Var0.f_25 = -1082130432;
					Var0 = { entity::get_entity_coords(player::get_player_ped(iLocal_314), 1) };
					Var0.f_5 = 20f;
					if (func_66(Local_91.f_36, 40f, &(Local_91.f_32), &(Local_91.f_35), Var0))
					{
						gameplay::set_bit(&(Local_91.f_1), 3);
						return true;
					}
				}
				else
				{
					network::_0xFB8F2A6F3DF08CBE();
					ped::_0xFEE4A5459472A9F8();
					if (Global_2404993.f_2023)
					{
						pathfind::remove_navmesh_required_regions();
						Global_2404993.f_2023 = 0;
					}
				}
				break;
			}
	}
	return false;
}

bool func_66(vector3 vParam0, float fParam3, var uParam4, var uParam5, struct<13> Param6, var uParam19, var uParam20, var uParam21, var uParam22, var uParam23, var uParam24, var uParam25, var uParam26, var uParam27, var uParam28, var uParam29, var uParam30, var uParam31)//Position - 0x22CE
{
	struct<11> Var0;
	struct<18> Var18;
	vector3 vVar44;
	
	if (Param6.f_5 > (fParam3 - 20f))
	{
		Param6.f_5 = (fParam3 - 20f);
	}
	Var0 = 3;
	Var0.f_10 = 3;
	Var0.f_14 = 3;
	Var18.f_16 = 1;
	Var18.f_22 = 1;
	Var18.f_23 = 1;
	Var18.f_24 = 1;
	Var18 = { vParam0 };
	Var18.f_3 = Param6.f_11;
	Var18.f_4 = fParam3;
	Var18.f_5 = 0;
	Var18.f_6 = 1;
	Var18.f_7 = 0;
	Var18.f_15 = 0;
	Var18.f_16 = 1;
	Var18.f_17 = 0;
	if (func_67(&Var18, &Param6, &Var0))
	{
		if ((Param6.f_12 > 0f && Param6.f_7) && Param6.f_8)
		{
			vVar44 = { vParam0 - Var0[0 /*3*/] };
			if (vVar44.y > Param6.f_12)
			{
				Var0[0 /*3*/] = { vParam0 };
				Var0.f_10[0] = Param6.f_11;
			}
		}
		*uParam4 = { Var0[0 /*3*/] };
		*uParam5 = Var0.f_10[0];
		return true;
	}
	return false;
}

bool func_67(var uParam0, var uParam1, var uParam2)//Position - 0x23C8
{
	int iVar0;
	vector3 vVar1;
	float fVar4;
	float fVar5;
	float fVar6;
	float fVar7;
	vector3 vVar8;
	vector3 vVar11;
	vector3 vVar14;
	int iVar17;
	vector3 vVar18;
	vector3 vVar21;
	var uVar24;
	int iVar25;
	struct<56> Var26;
	int iVar83;
	
	iVar25 = false;
	switch (uParam0->f_7)
	{
		case 0:
			if (((!Global_2404993.f_2017 == *uParam0 || !Global_2404993.f_2017.f_1 == uParam0->f_1) || !Global_2404993.f_2017.f_2 == uParam0->f_2) || !Global_2404993.f_2020 == uParam0->f_4)
			{
				iVar25 = true;
			}
			break;
		
		case 1:
			if (((((!Global_2404993.f_2031 == uParam0->f_8 || !Global_2404993.f_2031.f_1 == uParam0->f_8.f_1) || !Global_2404993.f_2031.f_2 == uParam0->f_8.f_2) || !Global_2404993.f_2034 == uParam0->f_11) || !Global_2404993.f_2034.f_1 == uParam0->f_11.f_1) || !Global_2404993.f_2034.f_2 == uParam0->f_11.f_2)
			{
				iVar25 = true;
			}
			break;
		
		case 2:
			if ((((((!Global_2404993.f_2031 == uParam0->f_8 || !Global_2404993.f_2031.f_1 == uParam0->f_8.f_1) || !Global_2404993.f_2031.f_2 == uParam0->f_8.f_2) || !Global_2404993.f_2034 == uParam0->f_11) || !Global_2404993.f_2034.f_1 == uParam0->f_11.f_1) || !Global_2404993.f_2034.f_2 == uParam0->f_11.f_2) || !Global_2404993.f_2037 == uParam0->f_14)
			{
				iVar25 = true;
			}
			break;
	}
	if (iVar25)
	{
		if (Global_2404993.f_2015 == 1)
		{
			if (script::is_thread_active(Global_2404993.f_2024))
			{
				if (Global_2404993.f_2024 == script::get_id_of_this_thread())
				{
					if (network::get_time_difference(network::get_network_time(), Global_2404993.f_2021) < func_207(0))
					{
						return false;
					}
				}
				else if (network::get_time_difference(network::get_network_time(), Global_2404993.f_2021) < func_207(0))
				{
					return false;
				}
			}
			network::_0xFB8F2A6F3DF08CBE();
			ped::_0xFEE4A5459472A9F8();
			func_206();
		}
		Global_2404993.f_2015 = 0;
	}
	else if (network::get_time_difference(network::get_network_time(), Global_2404993.f_2021) > func_207(0))
	{
		Global_2404993.f_2022 = network::get_network_time();
	}
	switch (uParam0->f_7)
	{
		case 0:
			fVar4 = (*uParam0 - uParam0->f_4);
			fVar5 = (uParam0->f_1 - uParam0->f_4);
			fVar6 = (*uParam0 + uParam0->f_4);
			fVar7 = (uParam0->f_1 + uParam0->f_4);
			break;
		
		case 1:
			if (uParam0->f_8 < uParam0->f_11)
			{
				fVar4 = uParam0->f_8;
				fVar6 = uParam0->f_11;
			}
			else
			{
				fVar4 = uParam0->f_11;
				fVar6 = uParam0->f_8;
			}
			if (uParam0->f_8.f_1 < uParam0->f_11.f_1)
			{
				fVar5 = uParam0->f_8.f_1;
				fVar7 = uParam0->f_11.f_1;
			}
			else
			{
				fVar5 = uParam0->f_11.f_1;
				fVar7 = uParam0->f_8.f_1;
			}
			break;
		
		case 2:
			if (uParam0->f_8 < uParam0->f_11)
			{
				fVar4 = (uParam0->f_8 - (0.5f * uParam0->f_14));
				fVar6 = (uParam0->f_11 + (0.5f * uParam0->f_14));
			}
			else
			{
				fVar4 = (uParam0->f_11 - (0.5f * uParam0->f_14));
				fVar6 = (uParam0->f_8 + (0.5f * uParam0->f_14));
			}
			if (uParam0->f_8.f_1 < uParam0->f_11.f_1)
			{
				fVar5 = (uParam0->f_8.f_1 - (0.5f * uParam0->f_14));
				fVar7 = (uParam0->f_11.f_1 + (0.5f * uParam0->f_14));
			}
			else
			{
				fVar5 = (uParam0->f_11.f_1 - (0.5f * uParam0->f_14));
				fVar7 = (uParam0->f_8.f_1 + (0.5f * uParam0->f_14));
			}
			break;
	}
	pathfind::_0x07FB139B592FA687(fVar4, fVar5, fVar6, fVar7);
	if (uParam0->f_7 == 0)
	{
		vVar8 = { *uParam0 };
	}
	else
	{
		vVar8 = { uParam0->f_8 + uParam0->f_11 * Vector(0.5f, 0.5f, 0.5f) };
	}
	vVar11 = { vVar8 + Vector(-0.1f, -0.1f, -0.1f) };
	vVar14 = { vVar8 + Vector(0.1f, 0.1f, 0.1f) };
	if (!Global_2404993.f_2015)
	{
		network::_0xFB8F2A6F3DF08CBE();
		ped::_0xFEE4A5459472A9F8();
		func_206();
		if (uParam1->f_7 && uParam0->f_7 == 0)
		{
			if (system::vmag(*uParam0) > 0f)
			{
				if (func_205(*uParam0, 6f, 1f, 1f, 5f, 1, 1, 1, 120f, 0, -1, 1, uParam1->f_5, uParam0->f_17, 0, 0, 0))
				{
					*(uParam2[0 /*3*/]) = { *uParam0 };
					uParam2->f_10[0] = uParam0->f_3;
					return true;
				}
			}
		}
		if (!ped::_0x3C67506996001F5E())
		{
			Global_2404993.f_2038 = uParam0->f_7;
			switch (uParam0->f_7)
			{
				case 0:
					Global_2404993.f_2017 = { *uParam0 };
					Global_2404993.f_2020 = uParam0->f_4;
					break;
				
				case 1:
					Global_2404993.f_2031 = { uParam0->f_8 };
					Global_2404993.f_2034 = { uParam0->f_11 };
					Global_2404993.f_2037 = 0f;
					Global_2404993.f_2017 = { uParam0->f_8 + uParam0->f_11 / Vector(2f, 2f, 2f) };
					break;
				
				case 2:
					Global_2404993.f_2031 = { uParam0->f_8 };
					Global_2404993.f_2034 = { uParam0->f_11 };
					Global_2404993.f_2037 = uParam0->f_14;
					Global_2404993.f_2017 = { uParam0->f_8 + uParam0->f_11 / Vector(2f, 2f, 2f) };
					break;
			}
			if (!uParam1->f_8 && !uParam1->f_9)
			{
				func_204(vVar8.x, vVar8.y);
			}
			Global_2404993.f_2016 = 1;
			Global_2404993.f_2015 = 1;
			Global_2404993.f_2022 = network::get_network_time();
			Global_2404993.f_2021 = network::get_network_time();
			Global_2404993.f_2024 = script::get_id_of_this_thread();
		}
		else
		{
			return false;
		}
	}
	if (Global_2404993.f_2015)
	{
		if (Global_2404993.f_2016 == 1)
		{
			if (pathfind::_0xF7B79A50B905A30D(fVar4, fVar5, fVar6, fVar7) || network::get_time_difference(network::get_network_time(), Global_2404993.f_2022) > 5000)
			{
				Global_2404993.f_2022 = network::get_network_time();
				if (uParam1->f_8 || uParam1->f_9)
				{
					if (uParam0->f_21)
					{
						*(uParam2[0 /*3*/]) = { uParam0->f_18 };
					}
					else
					{
						*(uParam2[0 /*3*/]) = { vVar8 };
					}
					Var26.f_6 = 1082130432;
					Var26.f_7 = 1176255488;
					Var26.f_8 = 1;
					Var26.f_10 = 1;
					Var26.f_13 = 1;
					Var26.f_15 = 1;
					Var26.f_16 = 1;
					Var26.f_31 = 1;
					Var26.f_34 = joaat("tailgater");
					Var26.f_38 = 2;
					Var26.f_45 = 2;
					Var26.f_49 = 1123024896;
					Var26.f_53 = 999;
					Var26.f_54 = 1176256410;
					Var26.f_55 = 1;
					Var26.f_56 = 1;
					Var26 = { *uParam1 };
					Var26.f_3 = uParam1->f_5;
					Var26.f_11 = uParam1->f_9;
					Var26.f_18 = 1;
					if (uParam1->f_25 > 0f)
					{
						Var26.f_6 = uParam1->f_25;
					}
					switch (uParam0->f_7)
					{
						case 0:
							Var26.f_19 = { *uParam0 };
							Var26.f_25 = uParam0->f_4;
							break;
						
						case 1:
							Var26.f_19 = { uParam0->f_8 };
							Var26.f_22 = { uParam0->f_11 };
							Var26.f_25 = 0f;
							break;
						
						case 2:
							Var26.f_19 = { uParam0->f_8 };
							Var26.f_22 = { uParam0->f_11 };
							Var26.f_25 = uParam0->f_14;
							break;
					}
					Var26.f_26 = uParam0->f_7;
					Var26.f_12 = uParam0->f_15;
					if (uParam0->f_21)
					{
						Var26.f_30 = 1;
						Var26.f_32 = 1;
					}
					iVar17 = 0;
					while (iVar17 < 2)
					{
						Var26.f_38[iVar17 /*3*/] = { uParam1->f_13[iVar17 /*3*/] };
						Var26.f_45[iVar17] = uParam1->f_20[iVar17];
						iVar17++;
					}
					Var26.f_51 = uParam1->f_23;
					Var26.f_55 = uParam0->f_16;
					func_185(uParam2[0 /*3*/], &(uParam2->f_10[0]), &Var26);
					if ((uParam1->f_7 && uParam1->f_9) && uParam0->f_7 == 0)
					{
						if (!func_184(*(uParam2[0 /*3*/]), *uParam0, uParam0->f_4, 1, 1))
						{
							*(uParam2[0 /*3*/]) = { *uParam0 };
							uParam2->f_10[0] = uParam0->f_3;
						}
					}
					Global_2404993.f_2016 = 9;
				}
				else
				{
					Global_2404993.f_2016 = 2;
				}
			}
		}
		if (Global_2404993.f_2016 == 2)
		{
			if ((pathfind::is_navmesh_loaded_in_area(vVar11, vVar14) || network::get_time_difference(network::get_network_time(), Global_2404993.f_2022) > 15000) || pathfind::_0x01708E8DD3FF8C65(vVar11, vVar14) == 0)
			{
				Global_2404993.f_2022 = network::get_network_time();
				if (uParam0->f_5 && !func_181(player::player_id(), 0))
				{
					Global_2404993.f_2016 = 3;
				}
				else
				{
					Global_2404993.f_2016 = 4;
				}
			}
			else if (network::get_time_difference(network::get_network_time(), Global_2404993.f_2026) > 7000)
			{
				func_180(vVar8.x, vVar8.y);
			}
		}
		if (Global_2404993.f_2016 == 3)
		{
			if (func_179() || network::get_time_difference(network::get_network_time(), Global_2404993.f_2022) > 10000)
			{
				Global_2404993.f_2022 = network::get_network_time();
				Global_2404993.f_2016 = 4;
			}
		}
		if (Global_2404993.f_2016 == 4)
		{
			if (ped::_0x3C67506996001F5E())
			{
				network::_0xFB8F2A6F3DF08CBE();
				ped::_0xFEE4A5459472A9F8();
			}
			else
			{
				iVar0 = 0;
				func_173();
				if (uParam0->f_5)
				{
					if (system::vmag(*uParam1) == 0f)
					{
						iVar0 += 2;
					}
					if (uParam1->f_3)
					{
						iVar0 += 8;
					}
					iVar0 += 16;
					iVar0 += 32;
					if (!player::get_player_team(player::player_id()) == -1)
					{
						iVar0 += 64;
						iVar0 += 128;
						iVar0 += 256;
					}
					iVar0 += 2048;
					iVar0 += 512;
					iVar0 += 1024;
					switch (uParam0->f_7)
					{
						case 0:
							if (network::_0x5A6FFA2433E2F14C(player::player_id(), *uParam0, uParam0->f_4, *uParam1, iVar0))
							{
								Global_2404993.f_2022 = network::get_network_time();
								Global_2404993.f_2016 = 5;
							}
							break;
						
						case 1:
							func_172(uParam0->f_8, uParam0->f_11, &vVar18, &vVar21, &uVar24);
							if (network::_0x4BA92A18502BCA61(player::player_id(), vVar18, vVar21, uVar24, *uParam1, iVar0))
							{
								Global_2404993.f_2022 = network::get_network_time();
								Global_2404993.f_2016 = 5;
							}
							break;
						
						case 2:
							if (network::_0x4BA92A18502BCA61(player::player_id(), uParam0->f_8, uParam0->f_11, uParam0->f_14, *uParam1, iVar0))
							{
								Global_2404993.f_2022 = network::get_network_time();
								Global_2404993.f_2016 = 5;
							}
							break;
					}
				}
				else
				{
					if (uParam1->f_3)
					{
						iVar0++;
					}
					iVar0 += 2;
					if (uParam1->f_10)
					{
						iVar0 += 32;
					}
					Global_2404993.f_2022 = network::get_network_time();
					Global_2404993.f_2016 = 5;
					switch (uParam0->f_7)
					{
						case 0:
							ped::_0x2DF9038C90AD5264(*uParam0, uParam0->f_4, 5f, iVar0, 2f, 5000);
							break;
						
						case 1:
							func_172(uParam0->f_8, uParam0->f_11, &vVar18, &vVar21, &uVar24);
							ped::_0xB2AFF10216DEFA2F(vVar18, vVar21, uVar24, iVar0, 2f, 5000);
							break;
						
						case 2:
							ped::_0xB2AFF10216DEFA2F(uParam0->f_8, uParam0->f_11, uParam0->f_14, iVar0, 2f, 5000);
							break;
						}
					}
				}
		}
		if (Global_2404993.f_2016 == 5)
		{
			if (func_111(uParam2, uParam0, uParam1, 0))
			{
				if (Global_2404993.f_2042.f_5)
				{
					Global_2404993.f_2022 = network::get_network_time();
					Global_2404993.f_2016 = 6;
				}
				else
				{
					Global_2404993.f_2022 = network::get_network_time();
					if (!uParam0->f_5)
					{
						if (!system::vmag(*uParam1) == 0f)
						{
							vVar1 = { *uParam1 - *(uParam2[0 /*3*/]) };
							uParam2->f_10[0] = gameplay::get_heading_from_vector_2d(vVar1.x, vVar1.y);
						}
					}
					Global_2404993.f_2016 = 9;
				}
			}
			else if (network::get_time_difference(network::get_network_time(), Global_2404993.f_2022) > 20000)
			{
				network::_0xFB8F2A6F3DF08CBE();
				ped::_0xFEE4A5459472A9F8();
				Global_2404993.f_2022 = network::get_network_time();
				Global_2404993.f_2016 = 8;
			}
		}
		if (Global_2404993.f_2016 == 6)
		{
			iVar0 = 0;
			Global_2404993.f_2042.f_1 = 0;
			if (uParam1->f_3)
			{
				iVar0++;
			}
			else if (uParam0->f_7 == 0)
			{
				if (!func_110(uParam0->f_4))
				{
					if (interior::is_valid_interior(interior::get_interior_at_coords(vVar8)))
					{
						iVar0++;
					}
				}
			}
			else if (!func_109(uParam0->f_8, uParam0->f_11, uParam0->f_14))
			{
				if (interior::is_valid_interior(interior::get_interior_at_coords(vVar8)))
				{
					iVar0++;
				}
			}
			iVar0 += 2;
			if (uParam1->f_10)
			{
				iVar0 += 32;
			}
			if (uParam0->f_15)
			{
				iVar0 += 16;
			}
			Global_2404993.f_2022 = network::get_network_time();
			Global_2404993.f_2016 = 7;
			switch (uParam0->f_7)
			{
				case 0:
					ped::_0x2DF9038C90AD5264(*uParam0, uParam0->f_4, 5f, iVar0, 2f, 5000);
					break;
				
				case 1:
					func_172(uParam0->f_8, uParam0->f_11, &vVar18, &vVar21, &uVar24);
					ped::_0xB2AFF10216DEFA2F(vVar18, vVar21, uVar24, iVar0, 2f, 5000);
					break;
				
				case 2:
					ped::_0xB2AFF10216DEFA2F(uParam0->f_8, uParam0->f_11, uParam0->f_14, iVar0, 2f, 5000);
					break;
				}
		}
		if (Global_2404993.f_2016 == 7)
		{
			if (func_111(uParam2, uParam0, uParam1, 1))
			{
				if (system::vmag(*(uParam2[0 /*3*/])) == 0f)
				{
					iVar17 = 0;
					while (iVar17 < 3)
					{
						if (system::vmag(*(uParam2[0 /*3*/])) == 0f)
						{
							if (!system::vmag(Global_2404993.f_2153[iVar17 /*3*/]) == 0f)
							{
								switch (uParam0->f_7)
								{
									case 0:
										if (func_184(Global_2404993.f_2153[iVar17 /*3*/], *uParam0, uParam0->f_4, 0, 0))
										{
											*(uParam2[0 /*3*/]) = { Global_2404993.f_2153[iVar17 /*3*/] };
										}
										break;
									
									case 1:
										if (func_107(Global_2404993.f_2153[iVar17 /*3*/], uParam0->f_8, uParam0->f_11, 0, 0))
										{
											*(uParam2[0 /*3*/]) = { Global_2404993.f_2153[iVar17 /*3*/] };
										}
										break;
									
									case 2:
										if (object::is_point_in_angled_area(Global_2404993.f_2153[iVar17 /*3*/], uParam0->f_8, uParam0->f_11, uParam0->f_14, 0, true))
										{
											*(uParam2[0 /*3*/]) = { Global_2404993.f_2153[iVar17 /*3*/] };
										}
										break;
									}
								}
						}
						iVar17++;
					}
					if (system::vmag(*(uParam2[0 /*3*/])) == 0f)
					{
						switch (uParam0->f_7)
						{
							case 0:
								vVar1 = { *uParam0 };
								break;
							
							case 1:
							case 2:
								vVar1 = { uParam0->f_8 + uParam0->f_11 / Vector(2f, 2f, 2f) };
								break;
						}
						func_70(&vVar1, 0, 1, 1, 0, uParam0, uParam1);
						*(uParam2[0 /*3*/]) = { vVar1 };
					}
				}
				Global_2404993.f_2022 = network::get_network_time();
				if (!system::vmag(*uParam1) == 0f)
				{
					iVar17 = 0;
					while (iVar17 < 3)
					{
						vVar1 = { *uParam1 - *(uParam2[iVar17 /*3*/]) };
						uParam2->f_10[iVar17] = gameplay::get_heading_from_vector_2d(vVar1.x, vVar1.y);
						iVar17++;
					}
				}
				Global_2404993.f_2016 = 9;
			}
			else if (network::get_time_difference(network::get_network_time(), Global_2404993.f_2022) > 20000)
			{
				Global_2404993.f_2022 = network::get_network_time();
				Global_2404993.f_2016 = 8;
			}
		}
		if (Global_2404993.f_2016 == 8)
		{
			if (uParam0->f_5)
			{
				if (func_69(Global_2404993.f_474))
				{
				}
			}
			else if (Global_2404993.f_2042.f_2)
			{
				func_68(uParam2, &(Global_2404993.f_2042.f_6));
			}
			else
			{
				if (uParam0->f_15)
				{
					iVar83 = false;
				}
				else
				{
					iVar83 = true;
				}
				*(uParam2[0 /*3*/]) = { Global_2404993.f_2017 };
				func_70(uParam2[0 /*3*/], 0, iVar83, 0, 0, uParam0, uParam1);
			}
			Global_2404993.f_2022 = network::get_network_time();
			Global_2404993.f_2016 = 9;
		}
		if (Global_2404993.f_2016 == 9)
		{
			Global_2404993.f_2015 = 0;
			network::_0xFB8F2A6F3DF08CBE();
			ped::_0xFEE4A5459472A9F8();
			func_206();
			return true;
		}
		Global_2404993.f_2021 = network::get_network_time();
	}
	return false;
}

void func_68(var uParam0, var uParam1)//Position - 0x3355
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < 3)
	{
		*(uParam0[iVar0 /*3*/]) = { (uParam1[iVar0 /*9*/])->f_4 };
		uParam0->f_10[iVar0] = (uParam1[iVar0 /*9*/])->f_7;
		uParam0->f_14[iVar0] = (*uParam1)[iVar0 /*9*/];
		iVar0++;
	}
}

bool func_69(int iParam0)//Position - 0x339F
{
	if (iParam0 == 3 || iParam0 == 26)
	{
		return true;
	}
	return false;
}

void func_70(var uParam0, int iParam1, int iParam2, int iParam3, int iParam4, var uParam5, var uParam6)//Position - 0x33BE
{
	vector3 vVar0;
	var uVar3;
	struct<56> Var4;
	var uVar61;
	int iVar62;
	int iVar63;
	int iVar64;
	vector3 vVar65;
	vector3 vVar68;
	vector3 vVar71;
	float fVar74;
	
	Var4.f_6 = 1082130432;
	Var4.f_7 = 1176255488;
	Var4.f_8 = 1;
	Var4.f_10 = 1;
	Var4.f_13 = 1;
	Var4.f_15 = 1;
	Var4.f_16 = 1;
	Var4.f_31 = 1;
	Var4.f_34 = joaat("tailgater");
	Var4.f_38 = 2;
	Var4.f_45 = 2;
	Var4.f_49 = 1123024896;
	Var4.f_53 = 999;
	Var4.f_54 = 1176256410;
	Var4.f_55 = 1;
	Var4.f_56 = 1;
	if (iParam1)
	{
		iVar64 = 0;
	}
	else
	{
		iVar64 = 16;
	}
	if (!uParam6->f_3)
	{
		if (uParam5->f_5)
		{
			if (!uParam5->f_22)
			{
				iVar64 += 4;
			}
			else
			{
				switch (uParam5->f_7)
				{
					case 0:
						vVar65 = { *uParam5 };
						if (func_110(uParam5->f_4) || !interior::is_valid_interior(interior::get_interior_at_coords(vVar65)))
						{
							iVar64 += 4;
						}
						break;
					
					case 1:
						vVar65 = { uParam5->f_8 + uParam5->f_11 * Vector(0.5f, 0.5f, 0.5f) };
						if (func_109(uParam5->f_8, uParam5->f_11, 0f) || !interior::is_valid_interior(interior::get_interior_at_coords(vVar65)))
						{
							iVar64 += 4;
						}
						break;
					
					case 2:
						vVar65 = { uParam5->f_8 + uParam5->f_11 * Vector(0.5f, 0.5f, 0.5f) };
						if (func_109(uParam5->f_8, uParam5->f_11, uParam5->f_14) || !interior::is_valid_interior(interior::get_interior_at_coords(vVar65)))
						{
							iVar64 += 4;
						}
						break;
					}
			}
		}
		else
		{
			iVar64 += 4;
		}
	}
	if (func_72(*uParam0, &vVar0, iVar64, iParam3, 1))
	{
	}
	else
	{
		iVar63 = true;
	}
	if (iVar63)
	{
		vVar0 = { *uParam0 };
		Var4 = { *uParam6 };
		Var4.f_8 = 1;
		Var4.f_3 = uParam6->f_5;
		if (iParam2)
		{
			Var4.f_10 = 0;
		}
		else
		{
			Var4.f_10 = 1;
		}
		Var4.f_13 = uParam5->f_15;
		Var4.f_15 = iParam3;
		if (uParam6->f_25 > 0f)
		{
			Var4.f_6 = uParam6->f_25;
		}
		if (iParam4)
		{
			Var4.f_18 = 1;
			Var4.f_26 = uParam5->f_7;
			switch (uParam5->f_7)
			{
				case 0:
					Var4.f_19 = { *uParam5 };
					Var4.f_25 = uParam5->f_4;
					break;
				
				case 1:
					Var4.f_19 = { uParam5->f_8 };
					Var4.f_22 = { uParam5->f_11 };
					Var4.f_25 = 0f;
					break;
				
				case 2:
					Var4.f_19 = { uParam5->f_8 };
					Var4.f_22 = { uParam5->f_11 };
					Var4.f_25 = uParam5->f_14;
					break;
				}
		}
		iVar62 = 0;
		while (iVar62 < 2)
		{
			Var4.f_38[iVar62 /*3*/] = { uParam6->f_13[iVar62 /*3*/] };
			Var4.f_45[iVar62] = uParam6->f_20[iVar62];
			iVar62++;
		}
		Var4.f_51 = uParam6->f_23;
		Var4.f_55 = uParam5->f_16;
		func_185(&vVar0, &uVar3, &Var4);
	}
	if (iParam4)
	{
		switch (uParam5->f_7)
		{
			case 0:
				vVar68 = { *uParam5 };
				fVar74 = uParam5->f_4;
				break;
			
			case 1:
				vVar68 = { uParam5->f_8 };
				vVar71 = { uParam5->f_11 };
				break;
			
			case 2:
				vVar68 = { uParam5->f_8 };
				vVar71 = { uParam5->f_11 };
				fVar74 = uParam5->f_14;
				break;
		}
		if (!func_71(vVar0, uParam5->f_7, vVar68, vVar71, fVar74))
		{
			if (func_72(*uParam0, &vVar0, iVar64, iParam3, 0))
			{
				if (!func_71(vVar0, uParam5->f_7, vVar68, vVar71, fVar74))
				{
					if (uParam5->f_7 == 2 || uParam5->f_7 == 1)
					{
						vVar0 = { vVar68 + vVar71 * Vector(0.5f, 0.5f, 0.5f) };
					}
					else
					{
						vVar0 = { vVar68 };
					}
					if (gameplay::get_ground_z_for_3d_coord(vVar0, &uVar61, 0))
					{
						vVar0.z = uVar61;
					}
				}
			}
			else
			{
				if (uParam5->f_7 == 2 || uParam5->f_7 == 1)
				{
					vVar0 = { vVar68 + vVar71 * Vector(0.5f, 0.5f, 0.5f) };
				}
				else
				{
					vVar0 = { vVar68 };
				}
				if (gameplay::get_ground_z_for_3d_coord(vVar0, &uVar61, 0))
				{
					vVar0.z = uVar61;
				}
			}
		}
	}
	*uParam0 = { vVar0 };
	Global_2404993.f_614 = 1;
}

int func_71(vector3 vParam0, int iParam3, vector3 vParam4, vector3 vParam7, float fParam10)//Position - 0x37EE
{
	switch (iParam3)
	{
		case 0:
			if (system::vdist(vParam0, vParam4) <= fParam10)
			{
				return true;
			}
			break;
		
		case 1:
			return func_107(vParam0, vParam4, vParam7, 0, 0);
			break;
		
		case 2:
			return object::is_point_in_angled_area(vParam0, vParam4, vParam7, fParam10, 0, true);
			break;
	}
	return false;
}

bool func_72(vector3 vParam0, var uParam3, int iParam4, int iParam5, int iParam6)//Position - 0x385B
{
	if (func_106(vParam0, uParam3))
	{
		if (func_73(vParam0, uParam3, iParam5, iParam6))
		{
			return true;
		}
	}
	if (pathfind::get_safe_coord_for_ped(vParam0, 0, uParam3, iParam4))
	{
		if (func_73(vParam0, uParam3, iParam5, iParam6))
		{
			return true;
		}
	}
	return false;
}

bool func_73(vector3 vParam0, var uParam3, int iParam4, int iParam5)//Position - 0x38B7
{
	float fVar0;
	var uVar1;
	var uVar8;
	
	fVar0 = system::vdist(vParam0, *uParam3);
	if (fVar0 < 40f)
	{
		uVar1 = 2;
		uVar8 = 2;
		if ((iParam4 == 1 && !func_88(Global_2404993.f_491, uParam3, &uVar1, &uVar8, iParam5, 1)) || iParam4 == 0)
		{
			if (!func_80(*uParam3, 1056964608))
			{
				if (!func_74(uParam3, 0))
				{
					return true;
				}
			}
		}
	}
	return false;
}

bool func_74(var uParam0, int iParam1)//Position - 0x393C
{
	int iVar0;
	vector3 vVar1;
	var uVar4;
	
	vVar1 = { *uParam0 };
	uVar4 = func_79(vVar1);
	iVar0 = 0;
	while (iVar0 < Global_2410131[uVar4])
	{
		if (func_78(vVar1, &(Global_2409302[uVar4 /*92*/][iVar0 /*7*/])))
		{
			if (iParam1)
			{
				func_75(&vVar1, Global_2409302[uVar4 /*92*/][iVar0 /*7*/], Global_2409302[uVar4 /*92*/][iVar0 /*7*/].f_3, Global_2409302[uVar4 /*92*/][iVar0 /*7*/].f_6, 1036831949, 0);
				*uParam0 = { vVar1 };
			}
			return true;
		}
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 < Global_2410131[8])
	{
		if (func_78(vVar1, &(Global_2409302[8 /*92*/][iVar0 /*7*/])))
		{
			if (iParam1)
			{
				func_75(&vVar1, Global_2409302[uVar4 /*92*/][iVar0 /*7*/], Global_2409302[uVar4 /*92*/][iVar0 /*7*/].f_3, Global_2409302[uVar4 /*92*/][iVar0 /*7*/].f_6, 1036831949, 0);
				*uParam0 = { vVar1 };
			}
			return true;
		}
		iVar0++;
	}
	return false;
}

void func_75(var uParam0, vector3 vParam1, vector3 vParam4, float fParam7, float fParam8, int iParam9)//Position - 0x3A49
{
	vector3 vVar0;
	vector3 vVar3;
	vector3 vVar6;
	float fVar9;
	vector3 vVar10;
	vector3 vVar13;
	float fVar16;
	vector3 vVar17;
	vector3 vVar20;
	vector3 vVar23;
	vector3 vVar26;
	vector3 vVar29;
	
	vVar0 = { vParam4 - vParam1 };
	vVar0.z = 0f;
	vVar3 = { *uParam0 - vParam1 };
	vVar3.z = 0f;
	vVar6 = { func_77(0f, 0f, 1f, vVar0) };
	vVar6 = { vVar6 / FtoV(system::vmag(vVar6)) };
	fVar9 = (system::vmag(vVar3) * system::sin(gameplay::get_angle_between_2d_vectors(vVar0.x, vVar0.y, vVar3.x, vVar3.y)));
	if (fVar9 < (fParam7 * 0.5f))
	{
		if (!iParam9)
		{
			if (func_76(vVar6, vVar3) >= 0f)
			{
				vVar6 = { vVar6 * FtoV((((fParam7 * 0.5f) - fVar9) + fParam8)) };
			}
			else
			{
				vVar6 = { vVar6 * FtoV(((((fParam7 * 0.5f) - fVar9) + fParam8) * -1f)) };
			}
		}
		else if (func_76(vVar6, vVar3) >= 0f)
		{
			vVar6 = { vVar6 * FtoV(((((fParam7 * 0.5f) + fVar9) + fParam8) * -1f)) };
		}
		else
		{
			vVar6 = { vVar6 * FtoV((((fParam7 * 0.5f) + fVar9) + fParam8)) };
		}
		vVar10 = { *uParam0 + vVar6 };
		fVar16 = system::vdist(vParam1.x, vParam1.y, 0f, vParam4.x, vParam4.y, 0f);
		vVar17 = { vParam1 + vParam4 / Vector(2f, 2f, 2f) };
		vVar17.z = 0f;
		vVar6 = { func_77(0f, 0f, 1f, vVar0) };
		vVar6 = { vVar6 / FtoV(system::vmag(vVar6)) };
		vVar6 = { vVar6 * FtoV((fParam7 * 0.5f)) };
		vVar20 = { vVar17 - vVar6 };
		vVar23 = { vVar17 + vVar6 };
		vVar26 = { vVar23 - vVar20 };
		vVar26.z = 0f;
		vVar29 = { *uParam0 - vVar20 };
		vVar29.z = 0f;
		vVar6 = { func_77(0f, 0f, 1f, vVar26) };
		vVar6 = { vVar6 / FtoV(system::vmag(vVar6)) };
		fVar9 = (system::vmag(vVar29) * system::sin(gameplay::get_angle_between_2d_vectors(vVar26.x, vVar26.y, vVar29.x, vVar29.y)));
		if (!iParam9)
		{
			if (func_76(vVar6, vVar29) >= 0f)
			{
				vVar6 = { vVar6 * FtoV((((fVar16 * 0.5f) - fVar9) + fParam8)) };
			}
			else
			{
				vVar6 = { vVar6 * FtoV(((((fVar16 * 0.5f) - fVar9) + fParam8) * -1f)) };
			}
		}
		else if (func_76(vVar6, vVar29) >= 0f)
		{
			vVar6 = { vVar6 * FtoV(((((fVar16 * 0.5f) + fVar9) + fParam8) * -1f)) };
		}
		else
		{
			vVar6 = { vVar6 * FtoV((((fVar16 * 0.5f) + fVar9) + fParam8)) };
		}
		vVar13 = { *uParam0 + vVar6 };
		if (system::vdist(vVar10, *uParam0, uParam0->f_1, 0f) < system::vdist(vVar13, *uParam0, uParam0->f_1, 0f))
		{
			*uParam0 = { vVar10 };
		}
		else
		{
			*uParam0 = { vVar13 };
		}
	}
}

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

Vector3 func_77(vector3 vParam0, vector3 vParam3)//Position - 0x3D39
{
	return ((vParam0.y * vParam3.y) - (vParam0.y * vParam3.y)), ((vParam0.y * vParam3.x) - (vParam0.x * vParam3.y)), ((vParam0.x * vParam3.y) - (vParam0.y * vParam3.x));
}

int func_78(vector3 vParam0, var uParam3)//Position - 0x3D72
{
	return object::is_point_in_angled_area(vParam0, *uParam3, uParam3->f_3, uParam3->f_6, 0, true);
}

int func_79(struct<2> Param0, var uParam2)//Position - 0x3D92
{
	if (Param0.f_1 > Global_2410141[0])
	{
		return 0;
	}
	if (Param0.f_1 > Global_2410141[1])
	{
		if (Param0 < Global_2410145[0])
		{
			return 1;
		}
		else
		{
			return 2;
		}
	}
	if (Param0.f_1 > Global_2410141[2])
	{
		if (Param0 < Global_2410145[1])
		{
			return 3;
		}
		else if (Param0 < Global_2410145[2])
		{
			return 4;
		}
		else if (Param0 < Global_2410145[3])
		{
			return 5;
		}
		else
		{
			return 6;
		}
	}
	return 7;
}

bool func_80(vector3 vParam0, float fParam3)//Position - 0x3E2D
{
	int iVar0;
	
	if (func_85(player::player_id(), 1))
	{
		if (Global_1626500.f_41581 > 0)
		{
			iVar0 = 0;
			while (iVar0 < Global_1626500.f_41581)
			{
				if (Global_1626500.f_41582[iVar0 /*59*/].f_7 != 0)
				{
					if (func_81(vParam0, Global_1626500.f_41582[iVar0 /*59*/], Global_1626500.f_41582[iVar0 /*59*/].f_6, Global_1626500.f_41582[iVar0 /*59*/].f_7, fParam3))
					{
						return true;
					}
				}
				iVar0++;
			}
		}
		if (Global_1626500.f_39362 > 0)
		{
			iVar0 = 0;
			while (iVar0 < Global_1626500.f_39362)
			{
				if (Global_1626500.f_39365[iVar0 /*90*/].f_16 != 0)
				{
					if (func_81(vParam0, Global_1626500.f_39365[iVar0 /*90*/], Global_1626500.f_39365[iVar0 /*90*/].f_3, Global_1626500.f_39365[iVar0 /*90*/].f_16, 0.5f))
					{
						return true;
					}
				}
				iVar0++;
			}
		}
		if (Global_1626500.f_53608 > 0)
		{
			iVar0 = 0;
			while (iVar0 < Global_1626500.f_53608)
			{
				if (Global_1626500.f_53612[iVar0 /*128*/].f_12 != 0)
				{
					if (func_81(vParam0, Global_1626500.f_53612[iVar0 /*128*/], Global_1626500.f_53612[iVar0 /*128*/].f_3, Global_1626500.f_53612[iVar0 /*128*/].f_12, 0.5f))
					{
						return true;
					}
				}
				iVar0++;
			}
		}
	}
	return false;
}

bool func_81(vector3 vParam0, vector3 vParam3, float fParam6, int iParam7, float fParam8)//Position - 0x3FB6
{
	vector3 vVar0;
	vector3 vVar3;
	vector3 vVar6;
	float fVar9;
	float fVar10;
	float fVar11;
	vector3 vVar12;
	vector3 vVar15;
	
	if (system::vdist(vParam0, vParam3) < func_84(iParam7, 1008981770))
	{
		vVar0 = { 0f, 1f, 0f };
		func_83(&vVar0, 0f, 0f, fParam6);
		vVar0 = { vVar0 / FtoV(system::vmag(vVar0)) };
		func_82(iParam7, &vVar3, &vVar6, 1086324736, 1080033280, 1077936128);
		fVar9 = gameplay::absf((vVar6.y - vVar3.y));
		fVar10 = gameplay::absf((vVar6.x - vVar3.x));
		fVar11 = gameplay::absf((vVar6.y - vVar3.y));
		vVar12 = { vParam3 + vVar0 * FtoV(((0.5f * fVar9) + fParam8)) };
		vVar12.z = (vVar12.y - ((0.5f * fVar11) + fParam8));
		vVar15 = { vParam3 - vVar0 * FtoV(((0.5f * fVar9) + fParam8)) };
		vVar15.z = (vVar15.y + ((0.5f * fVar11) + fParam8));
		if (object::is_point_in_angled_area(vParam0, vVar12, vVar15, fVar10, 0, true))
		{
			return true;
		}
	}
	return false;
}

void func_82(int iParam0, float fParam1, float fParam2, float fParam3, float fParam4, float fParam5)//Position - 0x40B7
{
	if (streaming::is_model_valid(iParam0))
	{
		gameplay::get_model_dimensions(iParam0, fParam1, fParam2);
	}
	if (system::vmag(*fParam1) <= 0.01f || system::vmag(*fParam2) <= 0.01f)
	{
		*fParam1 = (0f - (fParam4 * 0.5f));
		*fParam2 = (0f + (fParam4 * 0.5f));
		fParam1->f_1 = (0f - (fParam3 * 0.5f));
		fParam2->f_1 = (0f + (fParam3 * 0.5f));
		fParam1->f_2 = (0f - (fParam5 * 0.5f));
		fParam2->f_2 = (0f + (fParam5 * 0.5f));
	}
}

void func_83(var uParam0, vector3 vParam1)//Position - 0x4149
{
	float fVar0;
	float fVar1;
	vector3 vVar2;
	
	fVar0 = system::cos(vParam1.x);
	fVar1 = system::sin(vParam1.x);
	vVar2.x = *uParam0;
	vVar2.y = ((fVar0 * uParam0->f_1) - (fVar1 * uParam0->f_2));
	vVar2.z = ((fVar1 * uParam0->f_1) + (fVar0 * uParam0->f_2));
	*uParam0 = { vVar2 };
	fVar0 = system::cos(vParam1.y);
	fVar1 = system::sin(vParam1.y);
	vVar2.x = ((fVar0 * *uParam0) + (fVar1 * uParam0->f_2));
	vVar2.y = uParam0->f_1;
	vVar2.z = ((fVar0 * uParam0->f_2) - (fVar1 * *uParam0));
	*uParam0 = { vVar2 };
	fVar0 = system::cos(vParam1.y);
	fVar1 = system::sin(vParam1.y);
	vVar2.x = ((fVar0 * *uParam0) - (fVar1 * uParam0->f_1));
	vVar2.y = ((fVar1 * *uParam0) + (fVar0 * uParam0->f_1));
	vVar2.z = uParam0->f_2;
	*uParam0 = { vVar2 };
}

float func_84(int iParam0, float fParam1)//Position - 0x4220
{
	vector3 vVar0;
	vector3 vVar3;
	vector3 vVar6;
	float fVar9;
	
	if (iParam0 == 0)
	{
		return 5f;
	}
	func_82(iParam0, &vVar0, &vVar3, 1086324736, 1080033280, 1077936128);
	vVar6 = { vVar3 - vVar0 };
	fVar9 = (system::sqrt(((((vVar6.x * 0.5f) * (vVar6.x * 0.5f)) + ((vVar6.y * 0.5f) * (vVar6.y * 0.5f))) + ((vVar6.y * 0.5f) * (vVar6.y * 0.5f)))) + fParam1);
	return fVar9;
}

bool func_85(int iParam0, int iParam1)//Position - 0x42A0
{
	if (iParam1)
	{
		if (func_86(iParam0))
		{
			return true;
		}
	}
	if (Global_1588660[iParam0 /*532*/] == -1)
	{
		return false;
	}
	return true;
}

int func_86(var uParam0)//Position - 0x42CC
{
	return func_87(uParam0);
}

int func_87(var uParam0)//Position - 0x42DA
{
	return gameplay::is_bit_set(Global_1588660[uParam0 /*532*/].f_13.f_1, 0);
}

bool func_88(vector3 vParam0, var uParam3, var uParam4, var uParam5, int iParam6, int iParam7)//Position - 0x42F4
{
	int iVar0;
	int iVar1;
	
	if (func_100(vParam0))
	{
		if (func_99(uParam3, iParam6, 0, 1))
		{
			if (iParam6)
			{
			}
			return true;
		}
	}
	if (func_91(uParam3, iParam6, 1))
	{
		if (iParam6)
		{
		}
		return true;
	}
	if (iParam7)
	{
		if (func_90(*uParam3, 1056964608))
		{
			return true;
		}
	}
	iVar1 = false;
	iVar0 = 0;
	while (iVar0 < *uParam4)
	{
		if (system::vdist(*uParam3, *(uParam4[iVar0 /*3*/])) < (*uParam5)[iVar0])
		{
			if (iParam6)
			{
				func_89(uParam3, *(uParam4[iVar0 /*3*/]), (*uParam5)[iVar0], 1036831949, 0, 0);
			}
			iVar1 = true;
		}
		iVar0++;
	}
	if (iVar1)
	{
		return true;
	}
	return false;
}

void func_89(var uParam0, vector3 vParam1, float fParam4, float fParam5, int iParam6, float fParam7)//Position - 0x43AF
{
	vector3 vVar0;
	vector3 vVar3;
	
	vVar0 = { *uParam0 - vParam1 };
	vVar0.z = 0f;
	if (system::vmag(vVar0) > 0f)
	{
		vVar0 = { vVar0 / FtoV(system::vmag(vVar0)) };
	}
	else
	{
		vVar0 = { 0f, 1f, 0f };
		if (fParam7 == 0f)
		{
			func_83(&vVar0, 0f, 0f, gameplay::get_random_float_in_range(0f, 360f));
		}
		else
		{
			func_83(&vVar0, 0f, 0f, fParam7);
		}
	}
	vVar0 = { vVar0 * FtoV((fParam4 + fParam5)) };
	if (!iParam6)
	{
		vVar3 = { vParam1 + vVar0 };
	}
	else
	{
		vVar3 = { vParam1 - vVar0 };
	}
	*uParam0 = vVar3.x;
	uParam0->f_1 = vVar3.y;
}

bool func_90(vector3 vParam0, float fParam3)//Position - 0x4457
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < 10)
	{
		if (system::vdist(vParam0, Global_2404993.f_2255[iVar0 /*3*/]) < fParam3)
		{
			return true;
		}
		iVar0++;
	}
	return false;
}

bool func_91(var uParam0, int iParam1, int iParam2)//Position - 0x4492
{
	var uVar0;
	var uVar1;
	vector3 vVar2;
	
	if (func_96(*uParam0, &uVar0))
	{
		if (iParam1)
		{
			vVar2 = { *uParam0 };
			func_93(&vVar2, &(Global_2404993.f_353[uVar0 /*12*/]), 1036831949, 0, iParam2);
			if (func_96(vVar2, &uVar1) || func_92(vVar2))
			{
				vVar2 = { *uParam0 };
				func_93(&vVar2, &(Global_2404993.f_353[uVar0 /*12*/]), 1036831949, 1, iParam2);
			}
			*uParam0 = { vVar2 };
		}
		return true;
	}
	return false;
}

bool func_92(vector3 vParam0)//Position - 0x4516
{
	float fVar0;
	
	if (Global_2404993.f_559 > 0f)
	{
		fVar0 = system::vdist(vParam0, Global_2404993.f_556);
		if (fVar0 < Global_2404993.f_559)
		{
			return true;
		}
	}
	return false;
}

void func_93(var uParam0, var uParam1, float fParam2, int iParam3, int iParam4)//Position - 0x454F
{
	if (iParam4)
	{
		switch (uParam1->f_10)
		{
			case 0:
				*uParam0 = { func_95(*uParam0, *uParam1, 0f, 0f, 0f, (uParam1->f_6 + (IntToFloat(Global_2404993.f_2253) * uParam1->f_8)), 0, fParam2, iParam3) };
				break;
			
			case 1:
				*uParam0 = { func_95(*uParam0, *uParam1, uParam1->f_3, 0f, 1, fParam2, iParam3) };
				break;
			
			case 2:
				*uParam0 = { func_95(*uParam0, *uParam1, uParam1->f_3, uParam1->f_6, 2, fParam2, iParam3) };
				break;
		}
	}
	else
	{
		switch (uParam1->f_10)
		{
			case 0:
				func_89(uParam0, *uParam1, (uParam1->f_6 + (IntToFloat(Global_2404993.f_2253) * uParam1->f_8)), fParam2, iParam3, 0);
				break;
			
			case 1:
				func_94(uParam0, *uParam1, uParam1->f_3, fParam2, iParam3);
				break;
			
			case 2:
				func_75(uParam0, *uParam1, uParam1->f_3, uParam1->f_6, fParam2, iParam3);
				break;
			}
	}
}

void func_94(var uParam0, struct<2> Param1, var uParam3, struct<2> Param4, var uParam6, float fParam7, int iParam8)//Position - 0x4659
{
	vector3 vVar0;
	float fVar3;
	float fVar4;
	float fVar5;
	float fVar6;
	float fVar7;
	float fVar8;
	
	vVar0 = { *uParam0 };
	fVar3 = (*uParam0 - Param1);
	fVar4 = (*uParam0 - Param4);
	if (fVar3 < fVar4)
	{
		fVar5 = fVar3;
	}
	else
	{
		fVar5 = fVar4;
	}
	fVar6 = (uParam0->f_1 - Param1.f_1);
	fVar7 = (uParam0->f_1 - Param4.f_1);
	if (fVar6 < fVar7)
	{
		fVar8 = fVar6;
	}
	else
	{
		fVar8 = fVar7;
	}
	vVar0 = { *uParam0 };
	if (!iParam8)
	{
		if (fVar5 < fVar8)
		{
			if (fVar3 < fVar4)
			{
				vVar0.x = (Param1 - fParam7);
			}
			else
			{
				vVar0.x = (Param4 + fParam7);
			}
		}
		else if (fVar6 < fVar7)
		{
			vVar0.y = (Param1.f_1 - fParam7);
		}
		else
		{
			vVar0.y = (Param4.f_1 + fParam7);
		}
	}
	else if (fVar5 < fVar8)
	{
		if (fVar3 < fVar4)
		{
			vVar0.x = (Param4 + fParam7);
		}
		else
		{
			vVar0.x = (Param1 - fParam7);
		}
	}
	else if (fVar6 < fVar7)
	{
		vVar0.y = (Param4.f_1 + fParam7);
	}
	else
	{
		vVar0.y = (Param1.f_1 - fParam7);
	}
	*uParam0 = { vVar0 };
}

Vector3 func_95(vector3 vParam0, vector3 vParam3, vector3 vParam6, float fParam9, int iParam10, float fParam11, int iParam12)//Position - 0x4758
{
	int iVar0;
	vector3 vVar1;
	
	switch (iParam10)
	{
		case 0:
			func_89(&vParam0, vParam3, fParam9, fParam11, iParam12, 0);
			break;
		
		case 1:
			func_94(&vParam0, vParam3, vParam6, fParam11, iParam12);
			break;
		
		case 2:
			func_75(&vParam0, vParam3, vParam6, fParam9, fParam11, iParam12);
			break;
	}
	iVar0 = 0;
	while (iVar0 < 40)
	{
		pathfind::get_nth_closest_vehicle_node(vParam0, iVar0 * 5, &vVar1, 1, 0f, 0f);
		switch (iParam10)
		{
			case 0:
				if (!func_184(vVar1, vParam3, fParam9, 0, 0))
				{
					return vVar1;
				}
				break;
			
			case 1:
				if (!func_107(vVar1, vParam3, vParam6, 0, 0))
				{
					return vVar1;
				}
				break;
			
			case 2:
				if (!object::is_point_in_angled_area(vVar1, vParam3, vParam6, fParam9, 0, true))
				{
					return vVar1;
				}
				break;
		}
		iVar0++;
	}
	return vParam0;
}

bool func_96(vector3 vParam0, var uParam3)//Position - 0x485B
{
	int iVar0;
	int iVar1;
	
	iVar1 = func_98();
	iVar0 = 0;
	while (iVar0 < iVar1)
	{
		if (Global_2404993.f_353[iVar0 /*12*/].f_9 == 1)
		{
			if (func_97(vParam0, &(Global_2404993.f_353[iVar0 /*12*/]), 1008981770, 0, 0))
			{
				*uParam3 = iVar0;
				return true;
			}
		}
		iVar0++;
	}
	return false;
}

int func_97(vector3 vParam0, var uParam3, float fParam4, int iParam5, int iParam6)//Position - 0x48B4
{
	switch (uParam3->f_10)
	{
		case 0:
			return func_184(vParam0, *uParam3, ((uParam3->f_6 + fParam4) + (IntToFloat(Global_2404993.f_2253) * uParam3->f_8)), iParam5, iParam6);
			break;
		
		case 1:
			return func_107(vParam0, *uParam3 + Vector((fParam4 * -1f), (fParam4 * -1f), (fParam4 * -1f)), uParam3->f_3 + Vector(fParam4, fParam4, fParam4), iParam5, iParam6);
			break;
		
		case 2:
			if (iParam5 && iParam6)
			{
				return object::is_point_in_angled_area(vParam0, *uParam3, uParam3->f_3, uParam3->f_6, 0, false);
			}
			else if (iParam5)
			{
				if (object::is_point_in_angled_area(vParam0, *uParam3, uParam3->f_3, uParam3->f_6, 0, false) && !(vParam0.y < uParam3->f_2 && vParam0.y < uParam3->f_3.f_2))
				{
					return true;
				}
				else
				{
					return false;
				}
			}
			else if (iParam6)
			{
				if (object::is_point_in_angled_area(vParam0, *uParam3, uParam3->f_3, uParam3->f_6, 0, false) && !(vParam0.y > uParam3->f_2 && vParam0.y > uParam3->f_3.f_2))
				{
					return true;
				}
				else
				{
					return false;
				}
			}
			else
			{
				return object::is_point_in_angled_area(vParam0, *uParam3, uParam3->f_3, uParam3->f_6, 0, true);
			}
			break;
	}
	return false;
}

int func_98()//Position - 0x4A15
{
	int iVar0;
	int iVar1;
	
	iVar0 = 0;
	while (iVar0 < 10)
	{
		if (Global_2404993.f_353[iVar0 /*12*/].f_9)
		{
			iVar1++;
		}
		iVar0++;
	}
	return iVar1;
}

bool func_99(var uParam0, int iParam1, int iParam2, int iParam3)//Position - 0x4A48
{
	int iVar0;
	vector3 vVar1;
	
	iVar0 = 0;
	while (iVar0 < 8)
	{
		if (Global_2409165[iVar0 /*17*/].f_9 == 1)
		{
			if (!iParam2 || (iParam2 && Global_2409165[iVar0 /*17*/].f_16))
			{
				if (func_97(*uParam0, &(Global_2409165[iVar0 /*17*/]), 1008981770, 1, 0))
				{
					if (iParam1)
					{
						if (Global_2409165[iVar0 /*17*/].f_12)
						{
							*uParam0 = { Global_2409165[iVar0 /*17*/].f_13 };
						}
						else
						{
							vVar1 = { *uParam0 };
							func_93(&vVar1, &(Global_2409165[iVar0 /*17*/]), 1036831949, 0, iParam3);
							if (func_99(&vVar1, 0, 0, 0))
							{
								vVar1 = { *uParam0 };
								func_93(&vVar1, &(Global_2409165[iVar0 /*17*/]), 1036831949, 1, 0);
							}
							*uParam0 = { vVar1 };
						}
					}
					return true;
				}
			}
		}
		iVar0++;
	}
	return false;
}

bool func_100(vector3 vParam0)//Position - 0x4B21
{
	int iVar0;
	vector3 vVar1;
	
	if (!Global_2404993.f_494)
	{
		if (!Global_2404993.f_43.f_309)
		{
			if (!func_104(player::player_id(), 1))
			{
				return true;
			}
			if (!func_103(vParam0, 1008981770))
			{
				if (!func_99(&vParam0, 0, 0, 0))
				{
					return true;
				}
				else if (func_99(&vParam0, 0, 1, 0))
				{
					return true;
				}
			}
			else
			{
				iVar0 = func_102(vParam0, 1008981770);
				if (iVar0 > -1)
				{
					vVar1 = { func_101(&(Global_2404993.f_43[iVar0 /*12*/])) };
					if (!func_99(&vVar1, 0, 0, 0))
					{
						if (!func_99(&vParam0, 0, 0, 0))
						{
							return true;
						}
					}
				}
			}
		}
	}
	return false;
}

Vector3 func_101(var uParam0)//Position - 0x4BD0
{
	switch (uParam0->f_10)
	{
		case 0:
			return *uParam0;
			break;
		
		case 1:
		case 2:
			return *uParam0 + uParam0->f_3 * Vector(0.5f, 0.5f, 0.5f);
			break;
	}
	return *uParam0;
}

int func_102(vector3 vParam0, float fParam3)//Position - 0x4C19
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < 4)
	{
		if (Global_2404993.f_43[iVar0 /*12*/].f_9)
		{
			if (func_97(vParam0, &(Global_2404993.f_43[iVar0 /*12*/]), fParam3, 0, 0))
			{
				return iVar0;
			}
		}
		iVar0++;
	}
	return -1;
}

bool func_103(vector3 vParam0, float fParam3)//Position - 0x4C61
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < 4)
	{
		if (Global_2404993.f_43[iVar0 /*12*/].f_9)
		{
			if (func_97(vParam0, &(Global_2404993.f_43[iVar0 /*12*/]), fParam3, 0, 0))
			{
				return true;
			}
		}
		iVar0++;
	}
	return false;
}

int func_104(int iParam0, int iParam1)//Position - 0x4CA8
{
	if (Global_1312443 != 0)
	{
		return func_105(iParam0) != 0;
	}
	return func_85(iParam0, iParam1);
}

int func_105(int iParam0)//Position - 0x4CCE
{
	if (func_6(iParam0, 0, 1))
	{
		return Global_2421327[iParam0 /*353*/].f_1;
	}
	return 0;
}

bool func_106(vector3 vParam0, var uParam3)//Position - 0x4CF0
{
	int iVar0;
	int iVar1;
	float fVar2;
	float fVar3;
	
	iVar1 = -1;
	fVar2 = 999999.9f;
	if (Global_2404993.f_1813 > 0)
	{
		iVar0 = 0;
		while (iVar0 < Global_2404993.f_1813)
		{
			fVar3 = system::vdist(Global_2404993.f_1814[iVar0 /*4*/], vParam0);
			if (fVar3 < fVar2)
			{
				iVar1 = iVar0;
				fVar2 = fVar3;
			}
			iVar0++;
		}
		if (!iVar1 == -1)
		{
			*uParam3 = { Global_2404993.f_1814[iVar1 /*4*/] };
			return true;
		}
	}
	return false;
}

bool func_107(vector3 vParam0, vector3 vParam3, vector3 vParam6, int iParam9, int iParam10)//Position - 0x4D6A
{
	func_108(&vParam3, &vParam6);
	if (((!vParam0.x >= vParam3.x || !vParam0.y >= vParam3.y) || !vParam0.x <= vParam6.x) || !vParam0.y <= vParam6.y)
	{
		return false;
	}
	if (iParam9 && iParam10)
	{
		return true;
	}
	else if (iParam9)
	{
		if (vParam0.y >= vParam3.y)
		{
			return true;
		}
	}
	else if (iParam10)
	{
		if (vParam0.y <= vParam6.y)
		{
			return true;
		}
	}
	else if (vParam0.y >= vParam3.y && vParam0.y <= vParam6.y)
	{
		return true;
	}
	return false;
}

void func_108(var uParam0, var uParam1)//Position - 0x4E15
{
	var uVar0;
	
	if (*uParam0 > *uParam1)
	{
		uVar0 = *uParam1;
		*uParam1 = *uParam0;
		*uParam0 = uVar0;
	}
	if (uParam0->f_1 > uParam1->f_1)
	{
		uVar0 = uParam1->f_1;
		uParam1->f_1 = uParam0->f_1;
		uParam0->f_1 = uVar0;
	}
	if (uParam0->f_2 > uParam1->f_2)
	{
		uVar0 = uParam1->f_2;
		uParam1->f_2 = uParam0->f_2;
		uParam0->f_2 = uVar0;
	}
}

bool func_109(vector3 vParam0, vector3 vParam3, float fParam6)//Position - 0x4E77
{
	vector3 vVar0;
	vector3 vVar3;
	
	if (vParam0.x > vParam3.x)
	{
		vVar3.x = vParam0.x;
		vVar0.x = vParam3.x;
	}
	else
	{
		vVar3.x = vParam3.x;
		vVar0.x = vParam0.x;
	}
	if (vParam0.y > vParam3.y)
	{
		vVar3.y = vParam0.y;
		vVar0.y = vParam3.y;
	}
	else
	{
		vVar3.y = vParam3.y;
		vVar0.y = vParam0.y;
	}
	if (vParam0.y > vParam3.y)
	{
		vVar3.z = vParam0.y;
		vVar0.z = vParam3.y;
	}
	else
	{
		vVar3.z = vParam3.y;
		vVar0.z = vParam0.y;
	}
	if (system::vmag(vVar3 - vVar0) > 100f)
	{
		return true;
	}
	if (fParam6 > 50f)
	{
		return true;
	}
	return false;
}

bool func_110(float fParam0)//Position - 0x4F22
{
	if (fParam0 > 50f)
	{
		return true;
	}
	return false;
}

bool func_111(var uParam0, var uParam1, var uParam2, int iParam3)//Position - 0x4F3A
{
	vector3 vVar0;
	float fVar3;
	int iVar4;
	int iVar5;
	int iVar6;
	int iVar7;
	int iVar8;
	
	if (Global_2404993.f_2042.f_1 == 0 && Global_2404993.f_2042 == 0)
	{
		if (uParam1->f_5 && !iParam3)
		{
			switch (network::_0x3C891A251567DFCE(&(Global_2404993.f_2042.f_1)))
			{
				case 0:
					func_170(uParam1, uParam2);
					if (!Global_2404993.f_2042.f_2)
					{
						if (uParam2->f_7 && Global_2404993.f_523.f_7 == 0)
						{
							*(uParam0[0 /*3*/]) = { *uParam1 };
							uParam0->f_10[0] = uParam1->f_3;
							return true;
						}
						else
						{
							if (uParam1->f_21)
							{
								*(uParam0[0 /*3*/]) = { uParam1->f_18 };
							}
							else
							{
								*(uParam0[0 /*3*/]) = { Global_2404993.f_2017 };
							}
							if (uParam1->f_5 && func_69(Global_2404993.f_474))
							{
								if (!Global_2404993.f_2042.f_5)
								{
									Global_2404993.f_2042.f_5 = 1;
								}
								else
								{
									func_70(uParam0[0 /*3*/], 1, 0, 1, 1, uParam1, uParam2);
								}
							}
							else
							{
								func_70(uParam0[0 /*3*/], 0, 0, 1, 0, uParam1, uParam2);
							}
							uParam0->f_10[0] = gameplay::get_random_float_in_range(0f, 360f);
							return true;
						}
					}
					break;
				
				case 1:
					func_170(uParam1, uParam2);
					break;
				
				case 2:
					return false;
					break;
				
				case 3:
					return false;
					break;
			}
		}
		else if (ped::_0x3C67506996001F5E())
		{
			if (!ped::_0xF445DE8DA80A1792())
			{
				if (ped::_0xA586FBEB32A53DBB())
				{
					func_170(uParam1, uParam2);
					Global_2404993.f_2042.f_1 = ped::_0xA635C11B8C44AFC2();
				}
				else
				{
					return false;
				}
			}
			else
			{
				ped::_0xFEE4A5459472A9F8();
				func_170(uParam1, uParam2);
				if (!Global_2404993.f_2042.f_2)
				{
					Global_2404993.f_2042.f_5 = 1;
					return true;
				}
			}
		}
		else
		{
			return false;
		}
	}
	if (uParam1->f_5)
	{
		func_167(Global_2404993.f_523, &(Global_2404993.f_2042.f_34), &(Global_2404993.f_2042.f_67));
	}
	if (uParam2->f_7 && !Global_2404993.f_2042.f_4)
	{
		Global_2404993.f_2042.f_4 = 1;
		func_119(*uParam1, uParam1->f_3, uParam1, uParam2, 1, -1);
	}
	iVar6 = 0;
	if (uParam1->f_5)
	{
		iVar7 = 64;
	}
	else
	{
		iVar7 = 32;
	}
	if (Global_2404993.f_2042.f_1 > 0 || Global_2404993.f_2042 > 0)
	{
		if (uParam1->f_5 || ped::_0x3C67506996001F5E())
		{
			iVar4 = 0;
			while (iVar4 < Global_2404993.f_2042.f_1)
			{
				if (iVar6 < iVar7)
				{
					if (iVar4 <= Global_2404993.f_2042.f_3)
					{
						iVar4 = Global_2404993.f_2042.f_3 + 1;
					}
					if (iVar4 > (Global_2404993.f_2042.f_1 - 1))
					{
						iVar4 = (Global_2404993.f_2042.f_1 - 1);
					}
					if (iVar4 < 0)
					{
						iVar4 = 0;
					}
					if (uParam1->f_5 && !iParam3)
					{
						network::network_get_respawn_result(iVar4, &vVar0, &fVar3);
						fVar3 = (fVar3 * 57.29578f);
					}
					else
					{
						ped::_0x280C7E3AC7F56E90(iVar4, &vVar0, &(vVar0.f_1), &(vVar0.f_2));
					}
					if (uParam1->f_5 && !iParam3)
					{
						iVar5 = network::_0x6C34F1208B8923FD(iVar4);
					}
					else
					{
						ped::_0xB782F8238512BAD5(iVar4, &iVar5);
					}
					func_119(vVar0, fVar3, uParam1, uParam2, 0, iVar5);
					iVar6++;
					Global_2404993.f_2042.f_3 = iVar4;
				}
				else
				{
					return false;
				}
				iVar4++;
			}
		}
		else
		{
			iVar4 = Global_2404993.f_2042.f_1;
		}
		if (Global_2404993.f_2042.f_1 == iVar4)
		{
			if (uParam1->f_5 && Global_2404993.f_2345)
			{
				func_113(&(Global_2404993.f_2042.f_6[0 /*9*/]), &(Global_2404993.f_2042.f_6[1 /*9*/]), &(Global_2404993.f_2042.f_6[2 /*9*/]));
			}
			if (uParam1->f_5 && func_69(Global_2404993.f_474))
			{
				if (Global_2404993.f_2042.f_2)
				{
					func_68(uParam0, &(Global_2404993.f_2042.f_6));
					func_112(*(uParam0[0 /*3*/]));
					return true;
				}
				else
				{
					*(uParam0[0 /*3*/]) = { Global_2404993.f_2017 };
					func_70(uParam0[0 /*3*/], 0, 0, 0, 0, uParam1, uParam2);
					uParam0->f_10[0] = gameplay::get_random_float_in_range(0f, 360f);
					func_112(*(uParam0[0 /*3*/]));
					return true;
				}
			}
			else if (Global_2404993.f_2042.f_2)
			{
				func_68(uParam0, &(Global_2404993.f_2042.f_6));
				func_112(*(uParam0[0 /*3*/]));
				return true;
			}
			else if (uParam1->f_5)
			{
				iVar4 = gameplay::get_random_int_in_range(0, Global_2404993.f_2042.f_1);
				network::network_get_respawn_result(iVar4, uParam0[0 /*3*/], &(uParam0->f_10[0]));
				if (!func_74(uParam0[0 /*3*/], 0))
				{
					uParam0->f_10[0] = (uParam0->f_10[0] * 57.29578f);
					func_112(*(uParam0[0 /*3*/]));
					return true;
				}
				else
				{
					*(uParam0[0 /*3*/]) = { Global_2404993.f_2017 };
					func_70(uParam0[0 /*3*/], 1, 0, 1, 1, uParam1, uParam2);
					uParam0->f_10[0] = gameplay::get_random_float_in_range(0f, 360f);
					func_112(*(uParam0[0 /*3*/]));
					return true;
				}
			}
			else
			{
				*(uParam0[0 /*3*/]) = { Global_2404993.f_2017 };
				func_70(uParam0[0 /*3*/], 0, 0, 0, 0, uParam1, uParam2);
				uParam0->f_10[0] = gameplay::get_random_float_in_range(0f, 360f);
				func_112(*(uParam0[0 /*3*/]));
				return true;
			}
		}
	}
	else
	{
		*(uParam0[0 /*3*/]) = { Global_2404993.f_2017 };
		if (uParam1->f_5 && func_69(Global_2404993.f_474))
		{
			if (!Global_2404993.f_2042.f_5)
			{
				Global_2404993.f_2042.f_5 = 1;
			}
			else
			{
				func_70(uParam0[0 /*3*/], 1, 0, 1, 1, uParam1, uParam2);
			}
		}
		else
		{
			if (uParam1->f_15)
			{
				iVar8 = false;
			}
			else
			{
				iVar8 = true;
			}
			func_70(uParam0[0 /*3*/], 0, iVar8, 0, 0, uParam1, uParam2);
		}
		uParam0->f_10[0] = gameplay::get_random_float_in_range(0f, 360f);
		func_112(*(uParam0[0 /*3*/]));
		return true;
	}
	return false;
}

void func_112(vector3 vParam0)//Position - 0x5501
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < 2)
	{
		if (iVar0 > 0)
		{
			Global_2404993.f_2153[(3 - iVar0) /*3*/] = { Global_2404993.f_2153[(3 - iVar0 + 1) /*3*/] };
		}
		iVar0++;
	}
	Global_2404993.f_2153[0 /*3*/] = { vParam0 };
}

void func_113(var uParam0, var uParam1, var uParam2)//Position - 0x5551
{
	if (func_69(Global_2404993.f_474) && func_118() < 4096)
	{
		func_117(uParam0, 0f);
		func_117(uParam1, uParam0->f_2);
		func_117(uParam2, uParam1->f_2);
	}
	else
	{
		func_116(uParam0);
		func_115(uParam2, uParam0->f_4);
		func_114(uParam1, uParam0->f_4, uParam2->f_4);
	}
}

void func_114(var uParam0, vector3 vParam1, vector3 vParam4)//Position - 0x55B6
{
	int iVar0;
	float fVar1;
	float fVar2;
	float fVar3;
	float fVar4;
	struct<9> Var5;
	
	fVar1 = -1f;
	Var5.f_2 = 1176256410;
	iVar0 = 0;
	while (iVar0 < 128)
	{
		if (Global_2407339[iVar0 /*9*/] > 0)
		{
			fVar2 = system::vdist(Global_2407339[iVar0 /*9*/].f_4, vParam1);
			fVar3 = system::vdist(Global_2407339[iVar0 /*9*/].f_4, vParam4);
			fVar4 = (fVar2 + fVar3);
			fVar4 = (fVar4 * Global_2407339[iVar0 /*9*/].f_1);
			if (fVar4 > fVar1)
			{
				fVar1 = fVar4;
				Var5 = { Global_2407339[iVar0 /*9*/] };
			}
		}
		iVar0++;
	}
	*uParam0 = { Var5 };
}

void func_115(var uParam0, vector3 vParam1)//Position - 0x5655
{
	int iVar0;
	float fVar1;
	float fVar2;
	struct<9> Var3;
	
	fVar1 = -1f;
	Var3.f_2 = 1176256410;
	iVar0 = 0;
	while (iVar0 < 128)
	{
		if (Global_2407339[iVar0 /*9*/] > 0)
		{
			fVar2 = system::vdist(Global_2407339[iVar0 /*9*/].f_4, vParam1);
			fVar2 = (fVar2 * Global_2407339[iVar0 /*9*/].f_1);
			if (fVar2 > fVar1)
			{
				fVar1 = fVar2;
				Var3 = { Global_2407339[iVar0 /*9*/] };
			}
		}
		iVar0++;
	}
	*uParam0 = { Var3 };
}

void func_116(var uParam0)//Position - 0x56D7
{
	int iVar0;
	float fVar1;
	struct<9> Var2;
	
	fVar1 = -1f;
	Var2.f_2 = 1176256410;
	iVar0 = 0;
	while (iVar0 < 128)
	{
		if (Global_2407339[iVar0 /*9*/] > 0)
		{
			if (Global_2407339[iVar0 /*9*/].f_1 > fVar1)
			{
				fVar1 = Global_2407339[iVar0 /*9*/].f_1;
				Var2 = { Global_2407339[iVar0 /*9*/] };
			}
		}
		iVar0++;
	}
	*uParam0 = { Var2 };
}

void func_117(var uParam0, float fParam1)//Position - 0x5744
{
	int iVar0;
	float fVar1;
	struct<9> Var2;
	
	fVar1 = 999999.9f;
	Var2.f_2 = 1176256410;
	iVar0 = 0;
	while (iVar0 < 128)
	{
		if (Global_2407339[iVar0 /*9*/] > 0)
		{
			if (Global_2407339[iVar0 /*9*/].f_2 < fVar1 && Global_2407339[iVar0 /*9*/].f_2 > fParam1)
			{
				fVar1 = Global_2407339[iVar0 /*9*/].f_2;
				Var2 = { Global_2407339[iVar0 /*9*/] };
			}
		}
		iVar0++;
	}
	*uParam0 = { Var2 };
}

int func_118()//Position - 0x57C7
{
	int iVar0;
	int iVar1;
	
	iVar1 = 0;
	iVar0 = 0;
	while (iVar0 < 128)
	{
		if (Global_2407339[iVar0 /*9*/] > iVar1)
		{
			iVar1 = Global_2407339[iVar0 /*9*/];
		}
		iVar0++;
	}
	return iVar1;
}

void func_119(vector3 vParam0, float fParam3, var uParam4, var uParam5, int iParam6, int iParam7)//Position - 0x57FE
{
	float fVar0;
	float fVar1;
	float fVar2;
	float fVar3;
	int iVar4;
	float fVar5;
	float fVar6;
	int iVar7;
	int iVar8;
	int iVar9;
	int iVar10;
	vector3 vVar11;
	int iVar14;
	int iVar15;
	struct<9> Var16;
	int iVar25;
	int iVar26;
	
	iVar9 = 0;
	iVar7 = 0;
	iVar8 = false;
	if (uParam4->f_5)
	{
		if (Global_2404993.f_474 == 1)
		{
			if (gameplay::absf((Global_2404993.f_491.f_2 - vParam0.y)) < 25f)
			{
				iVar7++;
			}
		}
		else
		{
			iVar7++;
		}
	}
	else
	{
		iVar7++;
	}
	if (uParam4->f_5)
	{
		if (func_165(player::player_id()))
		{
			if (iParam7 == -1)
			{
				iVar8 = true;
			}
			else if (!iParam7 & 1 == 0)
			{
				iVar8 = true;
			}
		}
		else if (iParam7 == -1)
		{
			iVar7 += 2;
		}
		else if (!iParam7 & 1 == 0)
		{
			iVar7 += 2;
		}
	}
	else
	{
		iVar7 += 2;
	}
	if (uParam4->f_5 && uParam4->f_6)
	{
		if (!func_164(vParam0, 1084227584, 1123024896, 0))
		{
			iVar7 += 4;
		}
	}
	else
	{
		iVar7 += 4;
	}
	if (uParam4->f_5)
	{
		if (!ped::_0x68772DB2B2526F9F(player::player_ped_id(), vParam0, 65f))
		{
			iVar7 += 8;
			iVar7 += 16;
		}
		else if (!ped::_0x68772DB2B2526F9F(player::player_ped_id(), vParam0, 20f))
		{
			iVar7 += 8;
		}
	}
	else
	{
		iVar7 += 8;
		iVar7 += 16;
	}
	if (uParam4->f_5)
	{
		if (!func_163(vParam0, uParam5->f_5, 1, 1, 1, 1, 1, 1))
		{
			iVar7 += 32;
		}
	}
	else
	{
		iVar7 += 32;
	}
	iVar14 = true;
	iVar10 = 0;
	while (iVar10 < 2)
	{
		if (system::vmag(uParam5->f_13[iVar10 /*3*/]) > 0f)
		{
			if (!system::vdist(vParam0, uParam5->f_13[iVar10 /*3*/]) > uParam5->f_20[iVar10])
			{
				iVar14 = false;
			}
		}
		iVar10++;
	}
	if (iVar14)
	{
		iVar7 += 256;
	}
	if (uParam4->f_5)
	{
		if (func_157(vParam0, fParam3, uParam4->f_15, func_162(1), uParam4->f_16, 0, 1123024896, 1101004800, 1101004800, 1084227584, 1092616192, 0, 0))
		{
			iVar7 += 64;
			iVar7 += 128;
		}
		else
		{
			iVar9 = Global_2404993.f_3;
		}
	}
	else if (!func_154(vParam0, 25f, player::player_id(), 1, 1))
	{
		if (uParam4->f_15)
		{
			fVar1 = 3.5f;
		}
		else
		{
			fVar1 = 1f;
		}
		if (!func_153(vParam0, fVar1, 1, 1, 120f, 0, -1, 0f, 1))
		{
			iVar7 += 128;
			iVar7 += 64;
		}
		else if (!func_153(vParam0, fVar1, 1, 1, 60f, 0, -1, 0f, 1))
		{
			iVar7 += 64;
		}
	}
	if (uParam4->f_5)
	{
		if (!Global_2404993.f_636)
		{
			vVar11 = { Global_2404993.f_491 };
			if (Global_2404993.f_474 == 26)
			{
				vVar11 = { Global_2404993.f_523.f_18 };
			}
			if (func_100(vVar11))
			{
				if (!func_99(&vParam0, 0, 0, 0) && !func_152(&vParam0, 0))
				{
					iVar7 += 512;
				}
			}
			else if (!func_152(&vParam0, 0) && !func_90(vParam0, 0.5f))
			{
				iVar7 += 512;
			}
		}
		else
		{
			iVar7 += 512;
		}
	}
	else if (!func_151(vParam0, 2.5f, 3))
	{
		iVar7 += 512;
	}
	if (uParam4->f_5)
	{
		if (!(func_150(player::player_id()) && func_149(player::player_id())))
		{
			if (!func_148(&vParam0, &(Global_2404993.f_2042.f_67), 0, 1065353216))
			{
				iVar7 += 1024;
			}
		}
		else
		{
			iVar7 += 1024;
		}
	}
	else
	{
		iVar7 += 1024;
	}
	if (uParam4->f_5)
	{
		if (!func_149(player::player_id()))
		{
			if (!func_147(vParam0, &(Global_2404993.f_2042.f_34), &(Global_2404993.f_2042.f_67), 1073741824))
			{
				iVar7 += 2048;
			}
		}
		else
		{
			iVar7 += 2048;
		}
	}
	else
	{
		iVar7 += 2048;
	}
	if (func_146(vParam0))
	{
		if (uParam4->f_5)
		{
			if (func_146(vParam0))
			{
				if (func_69(Global_2404993.f_474))
				{
					if (func_103(vParam0, 1f))
					{
						iVar7 += 4096;
					}
				}
				else
				{
					iVar7 += 4096;
				}
			}
		}
		else
		{
			iVar7 += 4096;
		}
	}
	if (uParam4->f_5)
	{
		if (func_145(vParam0))
		{
			iVar7 += 8192;
		}
	}
	else
	{
		iVar7 += 8192;
	}
	if (!Global_2404993.f_43.f_55)
	{
		iVar7 += 16384;
	}
	else if (uParam4->f_5)
	{
		if (!iParam7 & 1 == 0)
		{
			if (interior::is_valid_interior(interior::get_interior_at_coords(vParam0)))
			{
				iVar7 += 16384;
			}
		}
	}
	else if (!iParam7 & 2 == 0)
	{
		if (interior::is_valid_interior(interior::get_interior_at_coords(vParam0)))
		{
			iVar7 += 16384;
		}
	}
	if (uParam4->f_5)
	{
		if (!Global_2404993.f_636)
		{
			if (!func_91(&vParam0, 0, 0))
			{
				iVar7 = (iVar7 + 32768);
			}
		}
		else
		{
			iVar7 = (iVar7 + 32768);
		}
	}
	else
	{
		iVar7 = (iVar7 + 32768);
	}
	if (!func_74(&vParam0, 0))
	{
		iVar7 = (iVar7 + 65536);
	}
	else
	{
		iVar7 = -1;
	}
	if (func_80(vParam0, 1056964608))
	{
		iVar7 = -1;
	}
	if (uParam4->f_5)
	{
	}
	else if (func_144(vParam0, 1, 0, uParam4->f_15, 1060320051, 1086324736, 1065353216, 1088421888))
	{
		iVar7 = 0;
	}
	Var16.f_2 = 1176256410;
	iVar25 = false;
	iVar26 = false;
	if (Global_2404993.f_2345 && uParam4->f_5)
	{
		if (iVar7 > 0)
		{
			if (iParam6)
			{
				uParam5->f_4 = 0;
				iVar4 = false;
			}
			else
			{
				iVar4 = true;
			}
			if (uParam4->f_21)
			{
				fVar0 = func_136(vParam0, uParam4->f_18, uParam5->f_6, uParam5->f_4, iVar4, iVar9, &(Var16.f_8));
			}
			else
			{
				fVar0 = func_136(vParam0, Global_2404993.f_2017, uParam5->f_6, uParam5->f_4, iVar4, iVar9, &(Var16.f_8));
			}
			if (iVar8)
			{
				fVar0 = (fVar0 * 3f);
			}
			if (func_69(Global_2404993.f_474) && iVar7 < 4096)
			{
				Var16.f_2 = func_134(vParam0);
			}
			Var16.f_4 = { vParam0 };
			Var16.f_7 = fParam3;
			Var16 = iVar7;
			Var16.f_1 = fVar0;
			func_133(Var16);
			Global_2404993.f_2042.f_2 = 1;
		}
	}
	else
	{
		iVar15 = 0;
		while (iVar15 < 3)
		{
			if (iVar7 >= Global_2404993.f_2042.f_6[iVar15 /*9*/])
			{
				if (uParam4->f_5)
				{
					if (!iVar25)
					{
						if (iParam6)
						{
							uParam5->f_4 = 0;
							iVar4 = false;
						}
						else
						{
							iVar4 = true;
						}
						if (uParam4->f_21)
						{
							fVar0 = func_136(vParam0, uParam4->f_18, uParam5->f_6, uParam5->f_4, iVar4, iVar9, &(Var16.f_8));
						}
						else
						{
							fVar0 = func_136(vParam0, Global_2404993.f_2017, uParam5->f_6, uParam5->f_4, iVar4, iVar9, &(Var16.f_8));
						}
						if (iVar8)
						{
							fVar0 = (fVar0 * 3f);
						}
						iVar25 = true;
					}
					if ((func_69(Global_2404993.f_474) && iVar7 == Global_2404993.f_2042.f_6[iVar15 /*9*/]) && iVar7 < 4096)
					{
						if (!iVar26)
						{
							fVar2 = func_134(vParam0);
							iVar26 = true;
						}
						if (fVar2 < Global_2404993.f_2042.f_6[iVar15 /*9*/].f_2)
						{
							Var16.f_4 = { vParam0 };
							Var16.f_7 = fParam3;
							Var16 = iVar7;
							Var16.f_1 = fVar0;
							Var16.f_2 = fVar2;
							func_132(Var16, iVar15);
							Global_2404993.f_2042.f_2 = 1;
							return;
						}
					}
					else if (iVar7 > Global_2404993.f_2042.f_6[iVar15 /*9*/] || (iVar7 == Global_2404993.f_2042.f_6[iVar15 /*9*/] && fVar0 > Global_2404993.f_2042.f_6[iVar15 /*9*/].f_1))
					{
						Var16.f_4 = { vParam0 };
						Var16.f_7 = fParam3;
						Var16 = iVar7;
						Var16.f_1 = fVar0;
						func_132(Var16, iVar15);
						Global_2404993.f_2042.f_2 = 1;
						return;
					}
				}
				else
				{
					if (!iVar25)
					{
						if (uParam4->f_15)
						{
							fVar1 = 3.5f;
						}
						else
						{
							fVar1 = 1f;
						}
						fVar5 = func_131(vParam0, fVar1, 1, 1, 0, -1, 1);
						fVar6 = func_121(vParam0, 1, 1, 1, 1);
						if (fVar5 > 15f && fVar6 > 5f)
						{
							fVar3 = func_120(fVar5, 0f, 80f, 160f, 1f, 1.2f);
						}
						else
						{
							fVar3 = func_120(fVar6, 0f, 80f, 160f, 0f, 0.2f);
						}
						iVar25 = true;
					}
					if (iVar7 > Global_2404993.f_2042.f_6[iVar15 /*9*/] || (iVar7 == Global_2404993.f_2042.f_6[iVar15 /*9*/] && fVar3 > Global_2404993.f_2042.f_6[iVar15 /*9*/].f_3))
					{
						Var16.f_4 = { vParam0 };
						Var16.f_7 = fParam3;
						Var16 = iVar7;
						Var16.f_3 = fVar3;
						func_132(Var16, iVar15);
						Global_2404993.f_2042.f_2 = 1;
						return;
					}
				}
			}
			iVar15++;
		}
	}
}

float func_120(float fParam0, float fParam1, float fParam2, float fParam3, float fParam4, float fParam5)//Position - 0x60D4
{
	float fVar0;
	
	if (fParam1 >= fParam3)
	{
		fParam1 = (fParam3 * 0.5f);
	}
	if (fParam0 < fParam1)
	{
		fParam0 = fParam1;
	}
	if (fParam0 > fParam3)
	{
		fParam0 = fParam3;
	}
	if (fParam2 < fParam3 && fParam2 > fParam1)
	{
		if (fParam0 < fParam2)
		{
			fVar0 = (fParam4 + ((1f - fParam4) - ((1f - fParam4) * ((fParam2 - fParam0) / (fParam2 - fParam1)))));
		}
		else
		{
			fVar0 = (fParam5 + ((1f - fParam5) - ((1f - fParam5) * ((fParam0 - fParam2) / (fParam3 - fParam2)))));
		}
	}
	else
	{
		fVar0 = (fParam4 + (((fParam0 - fParam1) / (fParam3 - fParam1)) * (fParam5 - fParam4)));
	}
	return fVar0;
}

float func_121(vector3 vParam0, int iParam3, int iParam4, int iParam5, int iParam6)//Position - 0x6172
{
	int iVar0;
	float fVar1;
	float fVar2;
	float fVar3;
	int iVar4;
	vector3 vVar5;
	vector3 vVar8;
	int iVar11;
	
	fVar3 = 999999.9f;
	iVar4 = false;
	iVar0 = 0;
	while (iVar0 < 32)
	{
		iVar11 = iVar0;
		if (func_6(iVar11, 1, 1))
		{
			if (!iVar11 == player::player_id() || iParam5 == 1)
			{
				iVar4 = false;
				if (iParam3)
				{
					if (func_123(iVar11))
					{
						iVar4 = true;
					}
				}
				if (iParam4)
				{
					if (player::get_player_team(iVar11) == player::get_player_team(player::player_id()))
					{
						if (!player::get_player_team(iVar11) == -1 || !func_104(player::player_id(), 1))
						{
							iVar4 = true;
						}
					}
				}
				if (iVar4)
				{
					if (network::_0x9DE986FC9A87C474(player::player_id(), iVar11) || !iParam6)
					{
						if (func_122(iVar11))
						{
							vVar5 = { func_8(iVar11) };
							if (!iVar11 == player::player_id())
							{
								vVar8 = { unk_0x64D779659BC37B19(player::get_player_ped(iVar11)) };
							}
							else
							{
								vVar8 = { vVar5 };
							}
							if (!iParam6)
							{
								if (vVar5.y < -100f)
								{
									vVar5.z = vParam0.y;
								}
								if (vVar8.y < -100f)
								{
									vVar8.z = vParam0.y;
								}
							}
							fVar1 = gameplay::get_distance_between_coords(vParam0, vVar5, 1);
							fVar2 = gameplay::get_distance_between_coords(vParam0, vVar8, 1);
							if (fVar1 < fVar3)
							{
								fVar3 = fVar1;
							}
							if (fVar2 < fVar3)
							{
								fVar3 = fVar2;
							}
						}
					}
				}
			}
		}
		iVar0++;
	}
	return fVar3;
}

bool func_122(int iParam0)//Position - 0x62BE
{
	if (entity::is_entity_visible_to_script(player::get_player_ped(iParam0)) || Global_2421327[iParam0 /*353*/].f_244)
	{
		return true;
	}
	return false;
}

bool func_123(int iParam0)//Position - 0x62E9
{
	if (func_6(iParam0, 0, 1))
	{
		if (!func_129(iParam0))
		{
			if (network::_0x9DE986FC9A87C474(player::player_id(), iParam0))
			{
				if (!player::get_player_team(iParam0) == player::get_player_team(player::player_id()))
				{
					if (func_85(player::player_id(), 1))
					{
						if (!func_128(player::get_player_team(iParam0), player::get_player_team(player::player_id()), 0))
						{
							return true;
						}
					}
					else
					{
						return true;
					}
				}
				else if (player::get_player_team(iParam0) == -1 && player::get_player_team(player::player_id()) == -1)
				{
					if (!func_85(player::player_id(), 1))
					{
						if (!func_124(iParam0))
						{
							return true;
						}
					}
					else
					{
						return true;
					}
				}
			}
		}
	}
	return false;
}

bool func_124(int iParam0)//Position - 0x6394
{
	if (func_127(player::player_id(), iParam0))
	{
		return true;
	}
	Global_2471194 = { func_126(iParam0) };
	if (network::network_is_friend(&Global_2471194))
	{
		return true;
	}
	if (func_125(player::player_id(), iParam0))
	{
		return true;
	}
	return false;
}

bool func_125(int iParam0, int iParam1)//Position - 0x63DB
{
	int iVar0;
	
	iVar0 = func_12(iParam0);
	if (!iVar0 == func_13())
	{
		if (iVar0 == func_12(iParam1))
		{
			return true;
		}
	}
	return false;
}

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

bool func_127(int iParam0, int iParam1)//Position - 0x641D
{
	if (network::_network_player_is_in_clan())
	{
		Global_2471194 = { func_126(iParam0) };
		Global_2471207 = { func_126(iParam1) };
		if (network::network_clan_player_is_active(&Global_2471194))
		{
			if (network::network_clan_player_is_active(&Global_2471207))
			{
				network::network_clan_player_get_desc(&Global_2471124, 35, &Global_2471194);
				network::network_clan_player_get_desc(&Global_2471159, 35, &Global_2471207);
				if (Global_2471124 == Global_2471159)
				{
					return true;
				}
			}
		}
	}
	return false;
}

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

bool func_129(int iParam0)//Position - 0x6655
{
	if (func_181(iParam0, 0))
	{
		return true;
	}
	if (func_130())
	{
		if (iParam0 == player::player_id())
		{
			return true;
		}
	}
	if (gameplay::is_bit_set(Global_2421327[iParam0 /*353*/].f_196, 2))
	{
		return true;
	}
	return false;
}

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

float func_131(vector3 vParam0, float fParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8)//Position - 0x66A8
{
	int iVar0;
	int iVar1;
	int iVar2;
	float fVar3;
	float fVar4;
	
	iVar2 = false;
	fVar3 = 1E+13f;
	if (iParam4 && !iParam6)
	{
		if (func_6(player::player_id(), 1, 1))
		{
			if (!cam::is_screen_faded_out())
			{
				if (cam::is_sphere_visible(vParam0, fParam3))
				{
					fVar4 = system::vdist2(vParam0, entity::get_entity_coords(player::player_ped_id(), 0));
					if (fVar4 < fVar3)
					{
						fVar3 = fVar4;
						iVar2 = true;
					}
				}
			}
		}
	}
	iVar0 = 0;
	while (iVar0 < 32)
	{
		iVar1 = iVar0;
		if (func_6(iVar1, 1, 1))
		{
			if (!func_181(iVar1, 0) && network::_0x9DE986FC9A87C474(player::player_id(), iVar1))
			{
				if (iParam4 == 1 || (iParam4 == 0 && iVar1 != player::player_id()))
				{
					if (func_122(iVar1) || !iParam8)
					{
						if (!iParam6)
						{
							if ((iParam5 || (iParam5 == 0 && player::get_player_team(iVar1) != player::get_player_team(player::player_id()))) || player::get_player_team(iVar1) == -1)
							{
								if (network::is_sphere_visible_to_player(iVar1, vParam0, fParam3))
								{
									fVar4 = system::vdist2(vParam0, entity::get_entity_coords(player::get_player_ped(iVar1), 0));
									if (fVar4 < fVar3)
									{
										fVar3 = fVar4;
										iVar2 = true;
									}
								}
							}
						}
						else if (player::get_player_team(iVar1) != iParam7 || player::get_player_team(iVar1) == -1)
						{
							if (network::is_sphere_visible_to_player(iVar1, vParam0, fParam3))
							{
								fVar4 = system::vdist2(vParam0, entity::get_entity_coords(player::get_player_ped(iVar1), 0));
								if (fVar4 < fVar3)
								{
									fVar3 = fVar4;
									iVar2 = true;
								}
							}
						}
					}
				}
			}
		}
		iVar0++;
	}
	if (iVar2)
	{
		return system::sqrt(fVar3);
	}
	return -1f;
}

void func_132(struct<9> Param0, int iParam9)//Position - 0x683F
{
	struct<9> Var0;
	
	Var0.f_2 = 1176256410;
	Var0 = { Global_2404993.f_2042.f_6[iParam9 /*9*/] };
	Global_2404993.f_2042.f_6[iParam9 /*9*/] = { Param0 };
	if (iParam9 < 2)
	{
		func_132(Var0, iParam9 + 1);
	}
}

void func_133(struct<9> Param0)//Position - 0x6891
{
	int iVar0;
	struct<9> Var1;
	int iVar10;
	float fVar11;
	int iVar12;
	
	Var1.f_2 = 1176256410;
	iVar10 = func_118();
	if (Param0 > iVar10)
	{
		iVar10 = Param0;
	}
	iVar0 = 0;
	while (iVar0 < 128)
	{
		if (Global_2407339[iVar0 /*9*/] < iVar10)
		{
			Global_2407339[iVar0 /*9*/] = { Var1 };
		}
		iVar0++;
	}
	if (Param0 < iVar10)
	{
		return;
	}
	iVar0 = 0;
	while (iVar0 < 128)
	{
		if (Global_2407339[iVar0 /*9*/] == 0)
		{
			Global_2407339[iVar0 /*9*/] = { Param0 };
			return;
		}
		iVar0++;
	}
	fVar11 = 9999.9f;
	iVar12 = -1;
	iVar0 = 0;
	while (iVar0 < 128)
	{
		if (Global_2407339[iVar0 /*9*/] > 0)
		{
			if (Global_2407339[iVar0 /*9*/].f_1 < fVar11)
			{
				fVar11 = Global_2407339[iVar0 /*9*/].f_1;
				iVar12 = iVar0;
			}
		}
		iVar0++;
	}
	if (iVar12 > -1)
	{
		Global_2407339[iVar12 /*9*/] = { Param0 };
	}
}

float func_134(vector3 vParam0)//Position - 0x6985
{
	var uVar0;
	
	return func_135(vParam0, &(Global_2404993.f_43), &uVar0);
}

float func_135(vector3 vParam0, var uParam3, var uParam4)//Position - 0x699D
{
	int iVar0;
	float fVar1;
	float fVar2;
	int iVar3;
	
	iVar3 = -1;
	fVar2 = 1E+07f;
	iVar0 = 0;
	while (iVar0 < *uParam3)
	{
		if ((uParam3[iVar0 /*12*/])->f_9)
		{
			fVar1 = 0f;
			switch ((uParam3[iVar0 /*12*/])->f_10)
			{
				case 0:
					fVar1 = system::vdist(*(uParam3[iVar0 /*12*/]), vParam0);
					fVar1 = (fVar1 - ((uParam3[iVar0 /*12*/])->f_6 + (IntToFloat(Global_2404993.f_2253) * (uParam3[iVar0 /*12*/])->f_8)));
					break;
				
				case 1:
				case 2:
					if (vParam0.x < (*uParam3)[iVar0 /*12*/])
					{
						fVar1 = (fVar1 + ((*uParam3)[iVar0 /*12*/] - vParam0.x));
					}
					else if (vParam0.x > (uParam3[iVar0 /*12*/])->f_3)
					{
						fVar1 = (fVar1 + (vParam0.x - (uParam3[iVar0 /*12*/])->f_3));
					}
					if (vParam0.y < (uParam3[iVar0 /*12*/])->f_1)
					{
						fVar1 = (fVar1 + ((uParam3[iVar0 /*12*/])->f_1 - vParam0.y));
					}
					else if (vParam0.y > (uParam3[iVar0 /*12*/])->f_3.f_1)
					{
						fVar1 = (fVar1 + (vParam0.y - (uParam3[iVar0 /*12*/])->f_3.f_1));
					}
					if (vParam0.y < (uParam3[iVar0 /*12*/])->f_2)
					{
						fVar1 = (fVar1 + ((uParam3[iVar0 /*12*/])->f_2 - vParam0.y));
					}
					else if (vParam0.y > (uParam3[iVar0 /*12*/])->f_3.f_2)
					{
						fVar1 = (fVar1 + (vParam0.y - (uParam3[iVar0 /*12*/])->f_3.f_2));
					}
					break;
			}
			if (fVar1 < fVar2)
			{
				fVar2 = fVar1;
				iVar3 = iVar0;
			}
		}
		iVar0++;
	}
	if (fVar2 < 0f)
	{
		fVar2 = 0f;
	}
	*uParam4 = iVar3;
	return fVar2;
}

float func_136(vector3 vParam0, vector3 vParam3, int iParam6, int iParam7, int iParam8, int iParam9, var uParam10)//Position - 0x6B19
{
	float fVar0;
	float fVar1;
	float fVar2;
	float fVar3;
	float fVar4;
	float fVar5;
	
	fVar1 = 1f;
	if (iParam9 > 0)
	{
		fVar1 = (system::to_float(iParam9) / system::to_float(8));
	}
	if (iParam6)
	{
		fVar0 = func_120(system::vdist(vParam0, vParam3), 0f, 0f, 200f, 1f, 0.1f);
		fVar1 = (fVar1 * (fVar0 * 0.95f));
	}
	*uParam10 = 1E+07f;
	fVar4 = func_121(vParam0, 1, 0, 0, 1);
	fVar0 = func_120(fVar4, 0f, func_143(), func_141(), 0f, 0.3f);
	fVar1 = (fVar1 * (fVar0 * 0.95f));
	if (fVar4 < *uParam10)
	{
		fVar4 = fVar4;
	}
	fVar4 = func_139(vParam0);
	fVar0 = func_120(fVar4, 0f, 0f, 60f, 0.5f, 1f);
	fVar1 = (fVar1 * (fVar0 * 0.95f));
	if (fVar4 < *uParam10)
	{
		fVar4 = fVar4;
	}
	fVar5 = 100f;
	if (player::get_player_team(player::player_id()) == -1 && !func_104(player::player_id(), 1))
	{
		fVar5 = 1f;
	}
	fVar4 = func_138(vParam0, player::player_id(), 0);
	fVar0 = func_120(fVar4, 0f, 0f, fVar5, 0f, 1f);
	fVar1 = (fVar1 * (fVar0 * 0.95f));
	if (fVar4 < *uParam10)
	{
		fVar4 = fVar4;
	}
	if (iParam7)
	{
		if (func_137(vParam0, &fVar2, &fVar3))
		{
			if (fVar2 < 10f)
			{
				fVar2 = 10f;
			}
			if (fVar3 < 0.5f)
			{
				fVar3 = 0.5f;
			}
			fVar0 = func_120(fVar2, 0f, 0f, 200f, 1f, 0.1f);
			fVar0 = (fVar0 + func_120(fVar3, 0f, 0f, 6f, 1f, 0.5f));
			fVar0 = (fVar0 * 0.5f);
			fVar1 = (fVar1 * (fVar0 * 0.85f));
		}
	}
	if (iParam8)
	{
		fVar0 = func_120(system::vdist(Global_2404993.f_491, vParam0), 0f, 100f, 200f, 0.1f, 0.1f);
		fVar1 = (fVar1 * (fVar0 * 0.9f));
	}
	return fVar1;
}

bool func_137(vector3 vParam0, var uParam3, var uParam4)//Position - 0x6CFF
{
	vector3 vVar0;
	int iVar3;
	var uVar4;
	var uVar5;
	
	iVar3 = pathfind::get_nth_closest_vehicle_node_id_with_heading(vParam0, 1, &uVar5, &uVar4, 1, 3f, 0f);
	if (pathfind::is_vehicle_node_id_valid(iVar3))
	{
		pathfind::get_vehicle_node_position(iVar3, &vVar0);
		*uParam3 = system::vdist(vParam0.x, vParam0.y, 0f, vVar0.x, vVar0.y, 0f);
		*uParam4 = gameplay::absf((vParam0.y - vVar0.y));
		return true;
	}
	return false;
}

float func_138(vector3 vParam0, int iParam3, int iParam4)//Position - 0x6D58
{
	float fVar0;
	float fVar1;
	int iVar2;
	int iVar3;
	
	fVar0 = 999999.9f;
	iVar2 = 0;
	while (iVar2 < 32)
	{
		if (!iParam3 == iVar2 || iParam4 == 1)
		{
			iVar3 = iVar2;
			if (func_6(iVar3, 0, 1))
			{
				if (player::get_player_team(iVar3) != player::get_player_team(iParam3) || (player::get_player_team(iVar3) == -1 && player::get_player_team(iParam3) == -1))
				{
					if (Global_2415586.f_260[iVar2])
					{
						fVar1 = system::vdist(Global_2415586.f_130[iVar2 /*3*/], vParam0);
						if (fVar1 < fVar0)
						{
							fVar0 = fVar1;
						}
					}
				}
			}
		}
		iVar2++;
	}
	return fVar0;
}

float func_139(vector3 vParam0)//Position - 0x6DF9
{
	float fVar0;
	float fVar1;
	int iVar2;
	vector3 vVar3;
	var uVar6[32];
	int iVar39;
	
	iVar39 = ped::get_ped_nearby_peds(player::player_ped_id(), &uVar6, -1);
	fVar0 = 1E+07f;
	iVar2 = 0;
	while (iVar2 < iVar39)
	{
		if (entity::does_entity_exist(uVar6[iVar2]))
		{
			if (!entity::is_entity_dead(uVar6[iVar2], 0))
			{
				if (func_140(uVar6[iVar2]))
				{
					vVar3 = { entity::get_entity_coords(uVar6[iVar2], 1) };
					fVar1 = gameplay::get_distance_between_coords(vParam0, vVar3, 1);
					if (fVar1 < fVar0)
					{
						fVar0 = fVar1;
					}
				}
			}
		}
		iVar2++;
	}
	return fVar0;
}

bool func_140(int iParam0)//Position - 0x6E86
{
	int iVar0;
	int iVar1;
	
	iVar0 = ped::get_ped_relationship_group_hash(iParam0);
	switch (ped::get_relationship_between_groups(iVar0, 1862763509))
	{
		case 3:
		case 5:
			return true;
			break;
	}
	switch (ped::get_relationship_between_groups(iVar0, Global_1574240[player::player_id()]))
	{
		case 3:
		case 5:
			return true;
			break;
	}
	if (Global_1588660[player::player_id() /*532*/] == 0)
	{
		iVar1 = player::get_player_team(player::player_id());
		if (iVar1 > -1 && iVar1 < 4)
		{
			switch (ped::get_relationship_between_groups(iVar0, Global_1573951[iVar1]))
			{
				case 3:
				case 5:
					return true;
					break;
				}
			}
	}
	return false;
}

float func_141()//Position - 0x6F31
{
	if (func_142())
	{
		if ((vehicle::is_this_model_a_plane(Global_2404993.f_43.f_67) || vehicle::is_this_model_a_heli(Global_2404993.f_43.f_67)) || Global_2404993.f_43.f_67 == joaat("rhino"))
		{
			return 640f;
		}
		else
		{
			return 320f;
		}
	}
	return 160f;
}

bool func_142()//Position - 0x6F8D
{
	if (Global_2404993.f_43.f_65 && !Global_2404993.f_43.f_296)
	{
		if (!func_129(player::player_id()))
		{
			return true;
		}
	}
	return false;
}

float func_143()//Position - 0x6FC3
{
	if (func_142())
	{
		if ((vehicle::is_this_model_a_plane(Global_2404993.f_43.f_67) || vehicle::is_this_model_a_heli(Global_2404993.f_43.f_67)) || Global_2404993.f_43.f_67 == joaat("rhino"))
		{
			return 320f;
		}
		else
		{
			return 160f;
		}
	}
	return 80f;
}

bool func_144(vector3 vParam0, int iParam3, int iParam4, int iParam5, int iParam6, float fParam7, float fParam8, float fParam9)//Position - 0x701F
{
	float fVar0;
	
	fVar0 = iParam6;
	if (iParam5)
	{
		fVar0 = fParam7;
	}
	if ((((fParam7 > 0f && vehicle::is_any_vehicle_near_point(vParam0, fParam7)) || (fVar0 > 0f && ped::is_any_ped_near_point(vParam0, fVar0))) || ((iParam4 == 1 && fParam8 > 0f) && object::is_any_object_near_point(vParam0, fParam8, 0))) || ((iParam3 == 1 && fParam9 > 0f) && object::is_any_object_near_point(vParam0, fParam9, 1)))
	{
		return true;
	}
	return false;
}

bool func_145(vector3 vParam0)//Position - 0x70AE
{
	int iVar0;
	int iVar1;
	
	if (Global_2404993.f_43.f_55)
	{
		if (interior::is_valid_interior(Global_2404993.f_43.f_56))
		{
			if (!interior::_are_coords_colliding_with_exterior(vParam0))
			{
				iVar0 = interior::get_interior_at_coords(vParam0);
				if (interior::is_valid_interior(iVar0))
				{
					iVar1 = interior::get_interior_group_id(iVar0);
					if (!iVar1 == Global_2404993.f_43.f_57)
					{
						return false;
					}
				}
				else
				{
					return false;
				}
			}
			else
			{
				return false;
			}
		}
	}
	return true;
}

int func_146(vector3 vParam0)//Position - 0x7119
{
	switch (Global_2404993.f_2038)
	{
		case 0:
			return func_184(vParam0, Global_2404993.f_2017, Global_2404993.f_2020, 0, 0);
			break;
		
		case 1:
			return func_107(vParam0, Global_2404993.f_2031, Global_2404993.f_2034, 0, 0);
			break;
		
		case 2:
			return object::is_point_in_angled_area(vParam0, Global_2404993.f_2031, Global_2404993.f_2034, Global_2404993.f_2037, 0, true);
			break;
	}
	return false;
}

bool func_147(vector3 vParam0, var uParam3, var uParam4, float fParam5)//Position - 0x71AB
{
	float fVar0;
	int iVar1;
	vector3 vVar2;
	vector3 vVar5;
	float fVar8;
	
	fVar0 = 0f;
	iVar1 = 0;
	iVar1 = 0;
	while (iVar1 < *uParam3)
	{
		fVar0 = ((uParam3[iVar1 /*4*/])->f_3 + fParam5);
		if (system::vdist(*(uParam3[iVar1 /*4*/]), vParam0) < fVar0)
		{
			return true;
		}
		iVar1++;
	}
	vVar2 = { 0f, 0f, 0f };
	vVar5 = { 0f, 0f, 0f };
	fVar8 = 0f;
	iVar1 = 0;
	while (iVar1 < *uParam4)
	{
		vVar2 = { *(uParam4[iVar1 /*10*/]) };
		vVar5 = { (uParam4[iVar1 /*10*/])->f_3 };
		fVar8 = (uParam4[iVar1 /*10*/])->f_6;
		if (object::is_point_in_angled_area(vParam0, vVar2, vVar5, fVar8, 0, true))
		{
			return true;
		}
		iVar1++;
	}
	return false;
}

bool func_148(var uParam0, var uParam1, int iParam2, float fParam3)//Position - 0x7259
{
	int iVar0;
	vector3 vVar1;
	
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < *uParam1)
	{
		if (system::vdist((uParam1[iVar0 /*10*/])->f_7, *uParam0) < (80f * fParam3))
		{
			if (iParam2)
			{
				vVar1 = { *uParam0 };
				func_89(&vVar1, (uParam1[iVar0 /*10*/])->f_7, 80f, 1036831949, 0, 0);
				*uParam0 = { vVar1 };
			}
			return true;
		}
		iVar0++;
	}
	return false;
}

bool func_149(int iParam0)//Position - 0x72CC
{
	switch (Global_1312443)
	{
		case 0:
			if (!func_28(iParam0))
			{
				if (Global_1588660[iParam0 /*532*/] == 0)
				{
					return true;
				}
			}
			break;
	}
	return false;
}

bool func_150(int iParam0)//Position - 0x7302
{
	if (func_85(iParam0, 1))
	{
		if (Global_1588660[iParam0 /*532*/] != 6)
		{
			return true;
		}
	}
	return false;
}

bool func_151(vector3 vParam0, float fParam3, int iParam4)//Position - 0x7326
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < iParam4)
	{
		if (system::vdist2(Global_2404993.f_2153[iVar0 /*3*/], vParam0) < (fParam3 * fParam3))
		{
			return true;
		}
		iVar0++;
	}
	return false;
}

bool func_152(var uParam0, int iParam1)//Position - 0x7364
{
	var uVar0;
	vector3 vVar1;
	float fVar4;
	
	if (func_92(*uParam0))
	{
		if (iParam1)
		{
			vVar1 = { *uParam0 };
			fVar4 = gameplay::get_random_float_in_range(0.01f, 360f);
			func_89(&vVar1, Global_2404993.f_556, Global_2404993.f_559, 1036831949, 0, fVar4);
			if (func_96(vVar1, &uVar0) || func_92(vVar1))
			{
				vVar1 = { *uParam0 };
				func_89(&vVar1, Global_2404993.f_556, Global_2404993.f_559, 1036831949, 1, fVar4);
			}
			*uParam0 = { vVar1 };
		}
	}
	return false;
}

bool func_153(vector3 vParam0, float fParam3, int iParam4, int iParam5, float fParam6, int iParam7, int iParam8, float fParam9, int iParam10)//Position - 0x73FC
{
	int iVar0;
	int iVar1;
	float fVar2;
	
	if (iParam4 && !iParam7)
	{
		if (func_6(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_8(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_6(iVar1, 1, 1))
		{
			if (!func_181(iVar1, 0) && network::_0x9DE986FC9A87C474(player::player_id(), iVar1))
			{
				if (iParam4 == 1 || (iParam4 == 0 && iVar1 != player::player_id()))
				{
					if ((func_122(iVar1) || !iParam10) && !Global_2421327[iVar1 /*353*/].f_258)
					{
						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_8(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_8(iVar1), vParam0, 1) <= (fVar2 + fParam3))
							{
								if (network::is_sphere_visible_to_player(iVar1, vParam0, fParam3))
								{
									return true;
								}
							}
						}
					}
				}
			}
		}
		iVar0++;
	}
	return false;
}

bool func_154(vector3 vParam0, float fParam3, int iParam4, int iParam5, int iParam6)//Position - 0x75B4
{
	if (func_156(vParam0, fParam3, iParam4, iParam5, 0) || func_155(vParam0, iParam4, iParam6))
	{
		return true;
	}
	return false;
}

bool func_155(vector3 vParam0, int iParam3, int iParam4)//Position - 0x75E5
{
	int iVar0;
	int iVar1;
	
	iVar0 = 0;
	while (iVar0 < 32)
	{
		if (!iParam3 == iVar0 || iParam4 == 1)
		{
			iVar1 = iVar0;
			if (!Global_2415586.f_556[iVar0] == 0)
			{
				if (func_81(vParam0, Global_2415586.f_426[iVar0 /*3*/], Global_2415586.f_523[iVar0], Global_2415586.f_556[iVar0], 1036831949))
				{
					if (func_6(iVar1, 0, 1) && func_6(iParam3, 0, 1))
					{
						return true;
					}
					else
					{
						return true;
					}
				}
			}
		}
		iVar0++;
	}
	return false;
}

bool func_156(vector3 vParam0, float fParam3, int iParam4, int iParam5, int iParam6)//Position - 0x767F
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	iVar0 = 0;
	while (iVar0 < 32)
	{
		if (!iParam4 == iVar0 || iParam5 == 1)
		{
			iVar1 = iVar0;
			iVar2 = false;
			if (iParam6)
			{
				if (func_6(iVar1, 0, 1) && func_6(iParam4, 0, 1))
				{
					if (player::get_player_team(iVar1) == player::get_player_team(iParam4))
					{
						iVar2 = true;
					}
				}
			}
			if (!iVar2)
			{
				if (func_6(iVar1, 0, 1) && func_6(iParam4, 0, 1))
				{
					if (Global_2415586.f_260[iVar0])
					{
						if (system::vdist(Global_2415586.f_130[iVar0 /*3*/], vParam0) < fParam3)
						{
							return true;
						}
					}
					else if (system::vdist(func_8(iVar1), vParam0) < 1f)
					{
						return true;
					}
				}
				else if (Global_2415586.f_260[iVar0])
				{
					if (system::vdist(Global_2415586.f_130[iVar0 /*3*/], vParam0) < fParam3)
					{
						return true;
					}
				}
				else if (func_6(iVar1, 0, 1))
				{
					if (system::vdist(func_8(iVar1), vParam0) < 1f)
					{
						return true;
					}
				}
			}
		}
		iVar0++;
	}
	return false;
}

bool func_157(vector3 vParam0, float fParam3, int iParam4, int iParam5, int iParam6, int iParam7, float fParam8, float fParam9, float fParam10, float fParam11, float fParam12, float fParam13, int iParam14)//Position - 0x779C
{
	Global_2404993.f_3 = 0;
	if (!func_154(vParam0, 0.5f, player::player_id(), 0, 0))
	{
		Global_2404993.f_3++;
		if (iParam5)
		{
			if (func_205(vParam0, 3.65f, 0.5f, 1.5f, 1f, 0, iParam6, iParam7, fParam8, 0, -1, 1, 0, 0, fParam13, iParam14, 0))
			{
				Global_2404993.f_3 = (Global_2404993.f_3 + Global_2404993.f_2);
				if (!func_161(vParam0, fParam12))
				{
					Global_2404993.f_3++;
					if (!func_80(vParam0, 1056964608))
					{
						Global_2404993.f_3++;
						return true;
					}
				}
			}
			else
			{
				Global_2404993.f_3 = (Global_2404993.f_3 + Global_2404993.f_2);
			}
		}
		else if (!iParam4)
		{
			if (func_205(vParam0, 3.65f, 0.5f, 1.5f, 1f, 0, iParam6, iParam7, fParam8, 0, -1, 1, 0, 0, fParam13, iParam14, 0))
			{
				Global_2404993.f_3 = (Global_2404993.f_3 + Global_2404993.f_2);
				if (!func_161(vParam0, fParam12))
				{
					Global_2404993.f_3++;
					if (!func_158(vParam0, fParam3, fParam9, fParam10, 1084227584))
					{
						Global_2404993.f_3++;
						if (!func_80(vParam0, 1056964608))
						{
							Global_2404993.f_3++;
							return true;
						}
					}
				}
			}
			else
			{
				Global_2404993.f_3 = (Global_2404993.f_3 + Global_2404993.f_2);
			}
		}
		else if (func_205(vParam0, 6f, 5f, 5f, 5f, 0, iParam6, iParam7, fParam8, 0, -1, 1, 0, 0, fParam13, iParam14, 0))
		{
			Global_2404993.f_3 = (Global_2404993.f_3 + Global_2404993.f_2);
			if (!func_161(vParam0, fParam12))
			{
				Global_2404993.f_3++;
				if (!func_158(vParam0, fParam3, fParam9, fParam10, fParam11))
				{
					Global_2404993.f_3++;
					if (!func_80(vParam0, 1056964608))
					{
						Global_2404993.f_3++;
						return true;
					}
				}
			}
		}
		else
		{
			Global_2404993.f_3 = (Global_2404993.f_3 + Global_2404993.f_2);
		}
	}
	return false;
}

bool func_158(vector3 vParam0, float fParam3, float fParam4, float fParam5, float fParam6)//Position - 0x79D9
{
	int iVar0;
	int iVar1;
	
	iVar0 = 0;
	while (iVar0 < 32)
	{
		iVar1 = iVar0;
		if (!player::player_id() == iVar1)
		{
			if ((func_6(iVar1, 1, 1) && func_122(iVar1)) && network::_0x9DE986FC9A87C474(player::player_id(), iVar1))
			{
				if (!func_160(player::player_id(), iVar1, -2, 0))
				{
					if (func_159(func_8(iVar1), vParam0, fParam3, fParam4, fParam5, fParam6))
					{
						return true;
					}
				}
			}
		}
		iVar0++;
	}
	return false;
}

int func_159(vector3 vParam0, vector3 vParam3, float fParam6, float fParam7, float fParam8, float fParam9)//Position - 0x7A58
{
	vector3 vVar0;
	vector3 vVar3;
	
	fParam6 = (fParam6 * -1f);
	fParam6 = (fParam6 + 360f);
	vVar0.x = system::sin(fParam6);
	vVar0.y = system::cos(fParam6);
	vVar0.z = 0f;
	vVar0 = { vVar0 / FtoV(system::vmag(vVar0)) };
	vVar0 = { vVar0 * Vector(fParam7, fParam7, fParam7) };
	vVar3 = { vParam3 + vVar0 };
	vVar3.z = vParam3.y;
	vVar3.z = (vVar3.y + fParam9);
	vParam3.z = (vParam3.y + fParam9);
	return object::is_point_in_angled_area(vParam0, vParam3, vVar3, fParam8, 0, true);
}

int func_160(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x7AE4
{
	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;
}

bool func_161(vector3 vParam0, float fParam3)//Position - 0x7B5C
{
	int iVar0;
	int iVar1;
	
	iVar0 = 0;
	while (iVar0 < 32)
	{
		iVar1 = iVar0;
		if ((func_6(iVar1, 1, 1) && func_122(iVar1)) && network::_0x9DE986FC9A87C474(player::player_id(), iVar1))
		{
			if ((player::get_player_team(player::player_id()) == -1 && player::get_player_team(iVar1) == -1) && !func_104(player::player_id(), 1))
			{
				return false;
			}
			else if ((player::get_player_team(player::player_id()) == -1 && !player::player_id() == iVar1) || !func_160(player::player_id(), iVar1, -2, 0))
			{
				if (system::vdist(vParam0, func_8(iVar1)) < fParam3)
				{
					return true;
				}
			}
		}
		iVar0++;
	}
	return false;
}

bool func_162(int iParam0)//Position - 0x7C18
{
	if ((Global_2404993.f_474 == 9 || Global_2404993.f_474 == 9) || (Global_2404993.f_474 == 15 && iParam0 == 1))
	{
		return true;
	}
	return false;
}

bool func_163(vector3 vParam0, float fParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8, int iParam9)//Position - 0x7C5B
{
	int iVar0;
	int iVar1;
	
	iVar0 = 0;
	while (iVar0 < 32)
	{
		iVar1 = iVar0;
		if ((iParam8 == 1 && player::player_id() != iVar1) || iParam8 == 0)
		{
			if (func_6(iVar1, iParam4, iParam5))
			{
				if (network::_0x9DE986FC9A87C474(player::player_id(), iVar1))
				{
					if (!iParam7 || (!ped::is_ped_injured(player::get_player_ped(iVar1)) && func_122(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 && iParam9) && iParam6) && func_124(iVar1))
							{
							}
							else if (entity::does_entity_exist(player::get_player_ped(iVar1)))
							{
								if (gameplay::get_distance_between_coords(func_8(iVar1), vParam0, 1) < fParam3)
								{
									return true;
								}
							}
						}
					}
				}
			}
		}
		iVar0++;
	}
	return false;
}

bool func_164(vector3 vParam0, float fParam3, int iParam4, float fParam5)//Position - 0x7D57
{
	int iVar0;
	int iVar1;
	float fVar2;
	int iVar3;
	
	iVar3 = player::get_player_team(player::player_id());
	if (!iVar3 == -1)
	{
		iVar0 = 0;
		while (iVar0 < 32)
		{
			iVar1 = iVar0;
			if (func_6(iVar1, 1, 1))
			{
				if ((!func_181(iVar1, 0) && network::_0x9DE986FC9A87C474(player::player_id(), iVar1)) && iVar1 != player::player_id())
				{
					fVar2 = iParam4;
					if (fParam5 > 0f)
					{
						if (!player::get_player_team(iVar1) == -1)
						{
							if (player::get_player_team(iVar1) == player::get_player_team(player::player_id()))
							{
								fVar2 = fParam5;
							}
						}
					}
					if (player::get_player_team(iVar1) == iVar3)
					{
						if (gameplay::get_distance_between_coords(func_8(iVar1), vParam0, 1) <= (fVar2 + fParam3))
						{
							if (network::is_sphere_visible_to_player(iVar1, vParam0, fParam3))
							{
								return true;
							}
						}
					}
				}
			}
			iVar0++;
		}
	}
	return false;
}

bool func_165(int iParam0)//Position - 0x7E1C
{
	if ((func_104(iParam0, 1) || func_166(iParam0)) || func_33(iParam0, 0))
	{
		return true;
	}
	return false;
}

int func_166(int iParam0)//Position - 0x7E4C
{
	int iVar0;
	
	iVar0 = iParam0;
	if (iVar0 != -1)
	{
		return Global_1614576[iVar0 /*324*/] != -1;
	}
	return false;
}

void func_167(vector3 vParam0, var uParam3, var uParam4)//Position - 0x7E6D
{
	int iVar0;
	int iVar1;
	struct<4> Var2;
	struct<8> Var6;
	vector3 vVar16;
	vector3 vVar19;
	
	iVar0 = 0;
	while (iVar0 < *uParam3)
	{
		*(uParam3[iVar0 /*4*/]) = { Var2 };
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 < *uParam4)
	{
		*(uParam4[iVar0 /*10*/]) = { Var6 };
		iVar0++;
	}
	iVar0 = 0;
	iVar1 = 0;
	iVar1 = 0;
	while (iVar1 < Global_1311741)
	{
		iVar0 = 0;
		while (iVar0 < *uParam3)
		{
			if (!gameplay::is_bit_set(Global_2359719[iVar1 /*26*/].f_12, 11))
			{
				if (system::vmag(*(uParam3[iVar0 /*4*/])) == 0f || system::vdist(Global_2359719[iVar1 /*26*/].f_3, vParam0) < system::vdist(*(uParam3[iVar0 /*4*/]), vParam0))
				{
					Var2 = { Global_2359719[iVar1 /*26*/].f_3 };
					Var2.f_3 = Global_2359719[iVar1 /*26*/].f_6.f_2;
					func_169(&Var2, uParam3, iVar0);
					iVar0 = *uParam3;
				}
			}
			iVar0++;
		}
		iVar1++;
	}
	iVar0 = 0;
	iVar1 = 0;
	iVar1 = 0;
	while (iVar1 < Global_1311706)
	{
		iVar0 = 0;
		while (iVar0 < *uParam4)
		{
			vVar16 = { Global_1311025[iVar1 /*8*/].f_1 + Global_1311025[iVar1 /*8*/].f_4 * Vector(0.5f, 0.5f, 0.5f) };
			vVar19 = { *(uParam4[iVar0 /*10*/]) + (uParam4[iVar0 /*10*/])->f_3 * Vector(0.5f, 0.5f, 0.5f) };
			if (system::vmag(*(uParam4[iVar0 /*10*/])) == 0f || system::vdist(vVar16, vParam0) < system::vdist(vVar19, vParam0))
			{
				Var6 = { Global_1311025[iVar1 /*8*/].f_1 };
				Var6.f_3 = { Global_1311025[iVar1 /*8*/].f_4 };
				Var6.f_6 = Global_1311025[iVar1 /*8*/].f_7;
				Var6.f_7 = { Global_2359395[iVar1 /*3*/] };
				func_168(&Var6, uParam4, iVar0);
				iVar0 = *uParam4;
			}
			iVar0++;
		}
		iVar1++;
	}
}

void func_168(var uParam0, var uParam1, int iParam2)//Position - 0x8057
{
	Global_2411129 = { *(uParam1[iParam2 /*10*/]) };
	*(uParam1[iParam2 /*10*/]) = { *uParam0 };
	if (iParam2 + 1 < *uParam1)
	{
		func_168(&Global_2411129, uParam1, iParam2 + 1);
	}
}

void func_169(var uParam0, var uParam1, int iParam2)//Position - 0x8095
{
	Global_2411125 = { *(uParam1[iParam2 /*4*/]) };
	*(uParam1[iParam2 /*4*/]) = { *uParam0 };
	if (iParam2 + 1 < *uParam1)
	{
		func_169(&Global_2411125, uParam1, iParam2 + 1);
	}
}

void func_170(var uParam0, var uParam1)//Position - 0x80CF
{
	int iVar0;
	vector3 vVar1;
	float fVar4;
	
	if (Global_2404993.f_1813 > 0)
	{
		iVar0 = 0;
		while (iVar0 < Global_2404993.f_1813)
		{
			if (func_171(Global_2404993.f_1814[iVar0 /*4*/], uParam0))
			{
				fVar4 = Global_2404993.f_1814[iVar0 /*4*/].f_3;
				if (system::vmag(*uParam1) > 0.01f)
				{
					vVar1 = { *uParam1 - Global_2404993.f_1814[iVar0 /*4*/] };
					fVar4 = gameplay::get_heading_from_vector_2d(vVar1.x, vVar1.y);
				}
				func_119(Global_2404993.f_1814[iVar0 /*4*/], fVar4, uParam0, uParam1, 0, -1);
				Global_2404993.f_2042++;
			}
			iVar0++;
		}
	}
	if (uParam0->f_5 && Global_2404993.f_2345)
	{
		func_113(&(Global_2404993.f_2042.f_6[0 /*9*/]), &(Global_2404993.f_2042.f_6[1 /*9*/]), &(Global_2404993.f_2042.f_6[2 /*9*/]));
	}
}

int func_171(vector3 vParam0, var uParam3)//Position - 0x81BC
{
	switch (uParam3->f_7)
	{
		case 0:
			return func_71(vParam0, uParam3->f_7, *uParam3, 0f, 0f, 0f, uParam3->f_4);
		
		case 1:
		case 2:
			return func_71(vParam0, uParam3->f_7, uParam3->f_8, uParam3->f_11, uParam3->f_14);
		
		default:
	}
	return false;
}

void func_172(vector3 vParam0, vector3 vParam3, var uParam6, var uParam7, var uParam8)//Position - 0x8219
{
	float fVar0;
	
	func_108(&vParam0, &vParam3);
	fVar0 = (vParam3.x - vParam0.x);
	*uParam6 = (vParam0.x + (fVar0 * 0.5f));
	uParam6->f_1 = vParam0.y;
	uParam6->f_2 = vParam0.y;
	*uParam7 = *uParam6;
	uParam7->f_1 = vParam3.y;
	uParam7->f_2 = vParam3.y;
	*uParam8 = (fVar0 * 0.5f);
}

void func_173()//Position - 0x826F
{
	func_178();
	func_177();
	func_176();
	func_175();
	func_174();
}

void func_174()//Position - 0x828B
{
	struct<9> Var0;
	int iVar9;
	
	Var0.f_2 = 1176256410;
	iVar9 = 0;
	while (iVar9 < 128)
	{
		Global_2407339[iVar9 /*9*/] = { Var0 };
		iVar9++;
	}
}

void func_175()//Position - 0x82C3
{
	struct<10> Var0;
	int iVar10;
	
	iVar10 = 0;
	while (iVar10 < 4)
	{
		Global_2404993.f_2042.f_67[iVar10 /*10*/] = { Var0 };
		iVar10++;
	}
}

void func_176()//Position - 0x82F2
{
	struct<4> Var0;
	int iVar4;
	
	iVar4 = 0;
	while (iVar4 < 8)
	{
		Global_2404993.f_2042.f_34[iVar4 /*4*/] = { Var0 };
		iVar4++;
	}
}

void func_177()//Position - 0x8320
{
	struct<9> Var0;
	int iVar9;
	
	Var0.f_2 = 1176256410;
	iVar9 = 0;
	while (iVar9 < 3)
	{
		Global_2404993.f_2042.f_6[iVar9 /*9*/] = { Var0 };
		iVar9++;
	}
}

void func_178()//Position - 0x835C
{
	struct<6> Var0;
	
	Var0.f_3 = -1;
	Global_2404993.f_2042 = { Var0 };
}

var func_179()//Position - 0x837A
{
	return Global_1310987.f_4;
}

void func_180(float fParam0, float fParam1)//Position - 0x8388
{
	func_206();
	func_204(fParam0, fParam1);
}

int func_181(int iParam0, int iParam1)//Position - 0x839C
{
	int iVar0;
	
	if (iParam0 == player::player_id())
	{
		iVar0 = func_182(-1, 0) == 8;
	}
	else
	{
		iVar0 = Global_1588660[iParam0 /*532*/].f_201 == 8;
	}
	if (iParam1 == 1)
	{
		if (network::network_is_player_active(iParam0))
		{
			iVar0 = player::get_player_team(iParam0) == 8;
		}
	}
	return iVar0;
}

int func_182(int iParam0, int iParam1)//Position - 0x83E7
{
	int iVar0;
	int iVar1;
	
	iVar1 = iParam0;
	if (iVar1 == -1)
	{
		iVar1 = func_183();
	}
	if (Global_1315209[iVar1] == 1)
	{
		if (iParam1)
		{
		}
		iVar0 = 8;
	}
	else
	{
		iVar0 = Global_1312725[iVar1];
		if (iParam1)
		{
		}
	}
	return iVar0;
}

var func_183()//Position - 0x8428
{
	return Global_1312731;
}

int func_184(vector3 vParam0, vector3 vParam3, float fParam6, int iParam7, int iParam8)//Position - 0x8434
{
	if (iParam7 && iParam8)
	{
		vParam0.z = 0f;
		vParam3.z = 0f;
		return system::vdist(vParam0, vParam3) < (fParam6 + 0.01f);
	}
	else if (iParam7)
	{
		if (vParam0.y > vParam3.y)
		{
			vParam0.z = vParam3.y;
		}
		return system::vdist(vParam0, vParam3) < (fParam6 + 0.01f);
	}
	else if (iParam8)
	{
		if (vParam0.y < vParam3.y)
		{
			vParam0.z = vParam3.y;
		}
		return system::vdist(vParam0, vParam3) < (fParam6 + 0.01f);
	}
	return system::vdist(vParam0, vParam3) < (fParam6 + 0.01f);
}

void func_185(var uParam0, var uParam1, var uParam2)//Position - 0x84E7
{
	if (Global_2404993.f_1683 > 0 && func_203(uParam0, uParam1, uParam2))
	{
	}
	else
	{
		func_186(uParam0, uParam1, uParam2);
	}
}

void func_186(var uParam0, var uParam1, var uParam2)//Position - 0x8517
{
	int iVar0;
	vector3 vVar1;
	float fVar4;
	int iVar5;
	var uVar6;
	var uVar7;
	int iVar8;
	int iVar9;
	int iVar10;
	int iVar11;
	int iVar12;
	float fVar13;
	float fVar14;
	int iVar15;
	int iVar16;
	int iVar17;
	int iVar18;
	int iVar19;
	float fVar20;
	int iVar21;
	int iVar22;
	float fVar23;
	int iVar24;
	vector3 vVar25;
	var uVar28;
	vector3 vVar29;
	float fVar32;
	int iVar33;
	
	iVar0 = 0;
	if (!system::vmag(uParam2->f_35) > 0f)
	{
		uParam2->f_35 = { *uParam0 };
	}
	if (uParam2->f_15)
	{
		if (func_88(uParam2->f_35, uParam0, &(uParam2->f_38), &(uParam2->f_45), 1, 1))
		{
			uParam2->f_6 = 9999.9f;
			uParam2->f_7 = 9999.9f;
		}
	}
	if (uParam2->f_51)
	{
		uParam2->f_6 = 9999.9f;
	}
	if (uParam2->f_48)
	{
		if (func_202(uParam0, 1))
		{
		}
	}
	iVar5 = 0;
	iVar10 = 1;
	if (uParam2->f_11)
	{
		iVar5 += 2;
		iVar5++;
		iVar10 = 0;
	}
	else if (uParam2->f_10 == 0 || (uParam2->f_33 > 0 && uParam2->f_16))
	{
		iVar5++;
		iVar10 = 0;
	}
	iVar5 += 4;
	fVar13 = 3f;
	fVar14 = 5f;
	switch (uParam2->f_33)
	{
		case 0:
			fVar13 = 3f;
			fVar14 = 5f;
			break;
		
		case 1:
			fVar13 = 2.75f;
			fVar14 = 7.5f;
			break;
		
		default:
			fVar13 = 2.5f;
			fVar14 = 10f;
			break;
	}
	iVar15 = 0;
	Global_2411139.f_162 = 0;
	Global_2411139.f_163 = 0;
	Global_2411139.f_164 = -99;
	Global_2411139.f_165 = { 0f, 0f, 0f };
	iVar16 = 0;
	while (iVar16 < 40)
	{
		Global_2411139[iVar16 /*3*/] = { 0f, 0f, 0f };
		Global_2411139.f_121[iVar16] = 0f;
		iVar16++;
	}
	while (true)
	{
		iVar8 = pathfind::get_nth_closest_vehicle_node_id_with_heading(*uParam0, iVar0, &fVar4, &iVar9, iVar5, fVar13, fVar14);
		if (pathfind::is_vehicle_node_id_valid(iVar8))
		{
			pathfind::get_vehicle_node_position(iVar8, &vVar1);
			iVar12 = false;
			if (Global_2411139.f_164 == iVar8)
			{
				iVar12 = true;
			}
			Global_2411139.f_165 = { vVar1 };
			if (((uParam2->f_10 || uParam2->f_33 > 0) || !pathfind::_get_is_slow_road_flag(iVar8)) || pathfind::_get_supports_gps_route_flag(iVar8))
			{
				pathfind::get_vehicle_node_properties(vVar1, &uVar6, &uVar7);
				if (system::vdist(vVar1, uParam2->f_35) > uParam2->f_4)
				{
					if (!func_152(&vVar1, 0))
					{
						if ((uParam2->f_13 || uVar7 & 64 == 0) || uParam2->f_33 == 1)
						{
							if (uParam2->f_14 || uVar7 & 16 == 0)
							{
								if ((uVar7 & 128 == 0 && uVar7 & 256 == 0) && uVar7 & 512 == 0)
								{
									if (!func_201(vVar1))
									{
										vVar1 = { func_199(vVar1, &fVar4, iVar9, uParam2->f_9, *uParam2, iVar10, uParam2->f_11, uParam2->f_34, &iVar11, iVar12, 1, uParam2->f_51) };
										if (!func_80(vVar1, 5f))
										{
											if (vVar1.y >= (uParam2->f_35.f_2 - uParam2->f_7) || uParam2->f_33 >= 2)
											{
												if (vVar1.y <= (uParam2->f_35.f_2 + uParam2->f_6) || uParam2->f_33 >= 2)
												{
													if (func_198(vVar1, uParam2))
													{
														if ((uParam2->f_48 && !func_202(&vVar1, 0)) || uParam2->f_48 == 0)
														{
															if (!iVar12)
															{
																if (iVar11)
																{
																	iVar0 = (iVar0 + -1);
																}
															}
															if (system::vmag(vVar1) > 0f)
															{
																if (((uParam2->f_5 > 0f && system::vdist(vVar1.x, vVar1.y, 0f, uParam2->f_35, uParam2->f_35.f_1, 0f) < uParam2->f_5) || uParam2->f_5 <= 0f) || uParam2->f_33 >= 2)
																{
																	if ((uParam2->f_12 && !func_193(vVar1, fVar4, uParam2->f_34, player::player_id(), 0, uParam2->f_56)) || !uParam2->f_12)
																	{
																		if (!uParam2->f_15 || !func_88(uParam2->f_35, &vVar1, &(uParam2->f_38), &(uParam2->f_45), 0, 1))
																		{
																			if (uParam2->f_8)
																			{
																				iVar17 = uParam2->f_31;
																				iVar18 = true;
																				iVar19 = 1;
																				fVar20 = uParam2->f_49;
																				if (!uParam2->f_55)
																				{
																					iVar17 = 0;
																					iVar18 = false;
																					iVar19 = 0;
																					fVar20 = 1f;
																				}
																				else if (uParam2->f_17)
																				{
																					iVar17 = 0;
																					iVar18 = false;
																					iVar19 = 0;
																					if (uParam2->f_33 == 1)
																					{
																						fVar20 = (fVar20 * 0.375f);
																					}
																				}
																				else
																				{
																					iVar18 = true;
																					iVar19 = 1;
																					if (uParam2->f_28)
																					{
																						if (uParam2->f_33 == 1)
																						{
																							fVar20 = (fVar20 * 0.375f);
																						}
																					}
																				}
																				iVar21 = 0;
																				if (uParam2->f_3 > 7f)
																				{
																					if (func_205(vVar1, 6f, 1f, 1f, 5f, iVar17, iVar18, iVar19, fVar20, 0, -1, 1, uParam2->f_3, 0, 0, 0, 0))
																					{
																						iVar21 = 1;
																					}
																				}
																				else if (func_205(vVar1, 6f, 1f, 1f, 5f, iVar17, iVar18, iVar19, fVar20, 0, -1, 1, 0f, 0, 0, 0, 0) && !func_192(vVar1, fVar4, uParam2->f_34, 1, 1, 0, 0, 0, 0))
																				{
																					iVar21 = 1;
																				}
																				if (iVar21 || uParam2->f_33 >= 2)
																				{
																					if (((uParam2->f_29 || uParam2->f_30) || uParam2->f_52) || uParam2->f_33 >= 2)
																					{
																						fVar23 = 0f;
																						if (uParam2->f_52)
																						{
																							iVar22 = func_191(vVar1, uParam2->f_54, &fVar23);
																						}
																						if (!uParam2->f_52 || (uParam2->f_52 && iVar22 <= uParam2->f_53))
																						{
																							if (uParam2->f_52)
																							{
																								if (iVar22 < uParam2->f_53)
																								{
																									iVar16 = 0;
																									while (iVar16 < Global_2411139.f_162)
																									{
																										Global_2411139[iVar16 /*3*/] = { 0f, 0f, 0f };
																										Global_2411139.f_121[iVar16] = 0f;
																										iVar16++;
																									}
																									Global_2411139.f_162 = 0;
																									uParam2->f_53 = iVar22;
																								}
																							}
																							if (uParam2->f_30)
																							{
																								if (Global_2411139.f_162 == 0)
																								{
																									Global_2411139[0 /*3*/] = { vVar1 };
																									Global_2411139.f_121[0] = fVar4;
																								}
																								else
																								{
																									iVar16 = 0;
																									while (iVar16 < Global_2411139.f_162 + 1)
																									{
																										if (iVar16 < 40)
																										{
																											if (system::vdist2(vVar1, uParam2->f_35) < system::vdist2(Global_2411139[iVar16 /*3*/], uParam2->f_35))
																											{
																												func_190(vVar1, fVar4, iVar16);
																												iVar16 = Global_2411139.f_162 + 1;
																											}
																										}
																										iVar16++;
																									}
																								}
																								Global_2411139.f_162++;
																								if (Global_2411139.f_162 >= 5)
																								{
																									if ((uParam2->f_52 && uParam2->f_53 == 0) || uParam2->f_52 == 0)
																									{
																										iVar0 = 100;
																									}
																									else if (Global_2411139.f_162 == 40)
																									{
																										iVar0 = 100;
																									}
																								}
																							}
																							else
																							{
																								Global_2411139[Global_2411139.f_162 /*3*/] = { vVar1 };
																								Global_2411139.f_121[Global_2411139.f_162] = fVar4;
																								Global_2411139.f_162++;
																								if (func_198(vVar1, uParam2))
																								{
																									Global_2411139.f_163++;
																								}
																								if (Global_2411139.f_162 >= 10)
																								{
																									if ((uParam2->f_52 && uParam2->f_53 == 0) || uParam2->f_52 == 0)
																									{
																										iVar0 = 100;
																									}
																									else if (Global_2411139.f_162 == 40)
																									{
																										iVar0 = 100;
																									}
																								}
																							}
																						}
																					}
																					else
																					{
																						*uParam0 = { vVar1 };
																						*uParam1 = fVar4;
																						return;
																					}
																				}
																				else
																				{
																					iVar0++;
																				}
																			}
																			else
																			{
																				*uParam0 = { vVar1 };
																				*uParam1 = fVar4;
																				return;
																			}
																		}
																	}
																	else
																	{
																		iVar15++;
																	}
																}
																else
																{
																	iVar0 = 100;
																}
															}
														}
														else
														{
															iVar0++;
														}
													}
													else if (!uParam2->f_32)
													{
														iVar0 = 100;
													}
												}
												else
												{
													iVar0++;
												}
											}
											else
											{
												iVar0++;
											}
										}
									}
									else
									{
										iVar0++;
									}
								}
							}
							else
							{
								iVar0++;
							}
						}
						else
						{
							iVar0++;
						}
					}
					else
					{
						iVar15++;
					}
				}
				else
				{
					iVar15++;
				}
			}
			iVar0++;
			if (iVar0 >= (40 + iVar15) || iVar0 >= 100)
			{
				if (Global_2411139.f_162 > 0 && ((uParam2->f_29 || uParam2->f_30) || uParam2->f_33 >= 2))
				{
					if (uParam2->f_30)
					{
						*uParam0 = { Global_2411139[0 /*3*/] };
						*uParam1 = Global_2411139.f_121[0];
						return;
					}
					else
					{
						if (Global_2411139.f_163 > 0 && !Global_2411139.f_163 == Global_2411139.f_162)
						{
							func_188(0, uParam2);
						}
						iVar24 = gameplay::get_random_int_in_range(0, Global_2411139.f_162);
						vVar25 = { Global_2411139[0 /*3*/] };
						uVar28 = Global_2411139.f_121[0];
						Global_2411139[0 /*3*/] = { Global_2411139[iVar24 /*3*/] };
						Global_2411139.f_121[0] = Global_2411139.f_121[iVar24];
						Global_2411139[iVar24 /*3*/] = { vVar25 };
						Global_2411139.f_121[iVar24] = uVar28;
						*uParam0 = { Global_2411139[0 /*3*/] };
						*uParam1 = Global_2411139.f_121[0];
						return;
					}
				}
				else
				{
					uParam2->f_33++;
					if (uParam2->f_33 < 3)
					{
						func_186(uParam0, uParam1, uParam2);
						return;
					}
					else
					{
						iVar0 = gameplay::get_random_int_in_range((1 + iVar15), (40 + iVar15));
						pathfind::get_nth_closest_vehicle_node_with_heading(*uParam0, iVar0, &vVar1, &fVar4, &iVar9, iVar5, fVar13, fVar14);
						vVar1 = { func_199(vVar1, &fVar4, iVar9, uParam2->f_9, *uParam2, iVar10, uParam2->f_11, uParam2->f_34, &iVar11, 0, 0, uParam2->f_51) };
						vVar29 = { vVar1 };
						fVar32 = fVar4;
						if (!uParam2->f_50)
						{
							iVar33 = true;
						}
						else
						{
							iVar33 = false;
						}
						if (func_88(uParam2->f_35, &vVar29, &(uParam2->f_38), &(uParam2->f_45), iVar33, 1) || func_202(&vVar29, iVar33))
						{
							if (!uParam2->f_50)
							{
								uParam2->f_33 = 0;
								uParam2->f_50 = 1;
								*uParam0 = { vVar29 };
								*uParam1 = fVar32;
								uParam2->f_6 = 9999.9f;
								uParam2->f_7 = 9999.9f;
								func_186(uParam0, uParam1, uParam2);
								return;
							}
							else
							{
								*uParam0 = { vVar29 };
								*uParam1 = fVar32;
								return;
							}
						}
						else
						{
							*uParam0 = { vVar29 };
							*uParam1 = fVar32;
							return;
						}
					}
				}
			}
		}
		else
		{
			uParam2->f_33++;
			if (uParam2->f_33 < 3)
			{
				func_186(uParam0, uParam1, uParam2);
				return;
			}
			else
			{
				func_187(&Global_1312061, uParam0, uParam1, *uParam0);
				if (uParam2->f_11)
				{
					uParam2->f_27 = 1;
				}
				return;
			}
		}
		Global_2411139.f_164 = iVar8;
	}
}

void func_187(var uParam0, var uParam1, var uParam2, vector3 vParam3)//Position - 0x8EF2
{
	float fVar0;
	float fVar1;
	int iVar2;
	int iVar3;
	
	fVar0 = 1E+09f;
	iVar3 = -1;
	iVar2 = 0;
	while (iVar2 < *uParam0)
	{
		fVar1 = system::vdist(*(uParam0[iVar2 /*4*/]), vParam3);
		if (fVar1 < fVar0)
		{
			if (!func_154(*(uParam0[iVar2 /*4*/]), 5f, player::player_id(), 0, 0))
			{
				fVar0 = fVar1;
				iVar3 = iVar2;
			}
		}
		iVar2++;
	}
	if (!iVar3 == -1)
	{
		*uParam1 = { *(uParam0[iVar3 /*4*/]) };
		*uParam2 = (uParam0[iVar3 /*4*/])->f_3;
	}
}

void func_188(int iParam0, var uParam1)//Position - 0x8F76
{
	if (!func_198(Global_2411139[iParam0 /*3*/], uParam1))
	{
		Global_2411139.f_162 = (Global_2411139.f_162 - 1);
		func_189(iParam0);
		if (Global_2411139.f_162 > Global_2411139.f_163)
		{
			func_188(iParam0, uParam1);
		}
	}
	else if (iParam0 < 39)
	{
		func_188(iParam0 + 1, uParam1);
	}
}

void func_189(int iParam0)//Position - 0x8FD1
{
	while (iParam0 < 39)
	{
		if (iParam0 < 39)
		{
			Global_2411139[iParam0 /*3*/] = { Global_2411139[iParam0 + 1 /*3*/] };
			Global_2411139.f_121[iParam0] = Global_2411139.f_121[iParam0 + 1];
		}
		iParam0++;
	}
}

void func_190(vector3 vParam0, float fParam3, int iParam4)//Position - 0x901C
{
	vector3 vVar0;
	var uVar3;
	
	vVar0 = { Global_2411139[iParam4 /*3*/] };
	uVar3 = Global_2411139.f_121[iParam4];
	Global_2411139[iParam4 /*3*/] = { vParam0 };
	Global_2411139.f_121[iParam4] = fParam3;
	if (iParam4 <= Global_2411139.f_162 && iParam4 < 39)
	{
		if (system::vmag(vVar0) > 0f)
		{
			func_190(vVar0, uVar3, iParam4 + 1);
		}
	}
}

int func_191(vector3 vParam0, float fParam3, float fParam4)//Position - 0x9089
{
	int iVar0;
	vector3 vVar1;
	int iVar4;
	int iVar5;
	float fVar6;
	float fVar7;
	
	fVar6 = 99999.9f;
	iVar0 = 0;
	while (iVar0 < 32)
	{
		iVar5 = iVar0;
		if (func_123(iVar5))
		{
			vVar1 = { func_8(iVar5) };
			fVar7 = system::vdist(vParam0, vVar1);
			if (fVar7 < fParam3)
			{
				if (fVar7 < fVar6)
				{
					fVar6 = fVar7;
				}
				iVar4++;
			}
		}
		iVar0++;
	}
	*fParam4 = fVar6;
	return iVar4;
}

bool func_192(vector3 vParam0, float fParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8, int iParam9, int iParam10)//Position - 0x90F1
{
	int iVar0;
	int iVar1;
	
	iVar0 = 0;
	while (iVar0 < 32)
	{
		iVar1 = iVar0;
		if ((iParam9 == 1 && player::player_id() != iVar1) || iParam9 == 0)
		{
			if (func_6(iVar1, iParam5, iParam6))
			{
				if (network::_0x9DE986FC9A87C474(player::player_id(), iVar1))
				{
					if (!iParam8 || (!ped::is_ped_injured(player::get_player_ped(iVar1)) && func_122(iVar1)))
					{
						if ((!iParam7 || (iParam7 == 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 && iParam10) && iParam7) && func_124(iVar1))
							{
							}
							else if (entity::does_entity_exist(player::get_player_ped(iVar1)))
							{
								if (func_81(func_8(iVar1), vParam0, fParam3, iParam4, 1036831949))
								{
									return true;
								}
							}
						}
					}
				}
			}
		}
		iVar0++;
	}
	return false;
}

bool func_193(vector3 vParam0, float fParam3, int iParam4, int iParam5, int iParam6, int iParam7)//Position - 0x91F2
{
	if (func_197(vParam0, fParam3, iParam4, iParam5, iParam6) || func_194(vParam0, fParam3, iParam4, iParam5, iParam7))
	{
		return true;
	}
	return false;
}

bool func_194(vector3 vParam0, float fParam3, int iParam4, int iParam5, int iParam6)//Position - 0x9228
{
	int iVar0;
	int iVar1;
	
	iVar0 = 0;
	while (iVar0 < 32)
	{
		if (!iParam5 == iVar0 || iParam6 == 1)
		{
			iVar1 = iVar0;
			if (func_196(vParam0, iParam4, Global_2415586.f_426[iVar0 /*3*/], Global_2415586.f_556[iVar0]))
			{
				if (func_195(vParam0, fParam3, iParam4, Global_2415586.f_426[iVar0 /*3*/], Global_2415586.f_523[iVar0], Global_2415586.f_556[iVar0], 0))
				{
					if (func_6(iVar1, 0, 1) && func_6(iParam5, 0, 1))
					{
						return true;
					}
					else
					{
						return true;
					}
				}
			}
		}
		iVar0++;
	}
	return false;
}

bool func_195(vector3 vParam0, float fParam3, int iParam4, vector3 vParam5, float fParam8, int iParam9, int iParam10)//Position - 0x92D6
{
	int iVar0;
	vector3 vVar1[4];
	vector3 vVar14;
	vector3 vVar17;
	float fVar20;
	float fVar21;
	float fVar22;
	vector3 vVar23;
	vector3 vVar26;
	
	if (func_81(vParam0, vParam5, fParam8, iParam9, 1036831949))
	{
		return true;
	}
	func_82(iParam4, &vVar14, &vVar17, 1086324736, 1080033280, 1077936128);
	fVar20 = gameplay::absf((vVar17.y - vVar14.y));
	fVar21 = gameplay::absf((vVar17.x - vVar14.x));
	fVar22 = gameplay::absf((vVar17.y - vVar14.y));
	vVar23 = { 0f, (fVar20 * 0.5f), 0f };
	func_83(&vVar23, 0f, 0f, fParam3);
	vVar26 = { (fVar21 * 0.5f), 0f, 0f };
	func_83(&vVar26, 0f, 0f, fParam3);
	vVar1[0 /*3*/] = { vParam0 + vVar23 + vVar26 };
	vVar1[0 /*3*/].f_2 = (vVar1[0 /*3*/].f_2 + (0.5f * fVar22));
	vVar1[1 /*3*/] = { vParam0 + vVar23 - vVar26 };
	vVar1[1 /*3*/].f_2 = (vVar1[1 /*3*/].f_2 + (0.5f * fVar22));
	vVar1[2 /*3*/] = { vParam0 - vVar23 + vVar26 };
	vVar1[2 /*3*/].f_2 = (vVar1[2 /*3*/].f_2 + (0.5f * fVar22));
	vVar1[3 /*3*/] = { vParam0 - vVar23 - vVar26 };
	vVar1[3 /*3*/].f_2 = (vVar1[3 /*3*/].f_2 + (0.5f * fVar22));
	iVar0 = 0;
	while (iVar0 < 4)
	{
		if (func_81(vVar1[iVar0 /*3*/], vParam5, fParam8, iParam9, 1036831949))
		{
			return true;
		}
		iVar0++;
	}
	if (!iParam10)
	{
		if (func_195(vParam5, fParam8, iParam9, vParam0, fParam3, iParam4, 1))
		{
			return true;
		}
	}
	return false;
}

bool func_196(vector3 vParam0, int iParam3, vector3 vParam4, int iParam7)//Position - 0x9476
{
	float fVar0;
	float fVar1;
	float fVar2;
	
	fVar0 = func_84(iParam3, 1008981770);
	fVar1 = func_84(iParam7, 1008981770);
	fVar2 = system::vdist(vParam0, vParam4);
	if (fVar2 < (fVar0 + fVar1))
	{
		return true;
	}
	return false;
}

bool func_197(vector3 vParam0, float fParam3, int iParam4, int iParam5, int iParam6)//Position - 0x94B6
{
	int iVar0;
	int iVar1;
	
	iVar0 = 0;
	while (iVar0 < 32)
	{
		if (!iParam5 == iVar0 || iParam6 == 1)
		{
			iVar1 = iVar0;
			if (func_6(iVar1, 0, 1) && func_6(iParam5, 0, 1))
			{
				if (Global_2415586.f_260[iVar0])
				{
					if (func_81(Global_2415586.f_130[iVar0 /*3*/], vParam0, fParam3, iParam4, 1036831949))
					{
						return true;
					}
				}
				else if (func_81(func_8(iVar1), vParam0, fParam3, iParam4, 1036831949))
				{
					return true;
				}
			}
			else if (Global_2415586.f_260[iVar0])
			{
				if (func_81(Global_2415586.f_130[iVar0 /*3*/], vParam0, fParam3, iParam4, 1036831949))
				{
					return true;
				}
			}
			else if (func_6(iVar1, 0, 0))
			{
				if (entity::does_entity_exist(player::get_player_ped(iVar1)))
				{
					if (func_81(func_8(iVar1), vParam0, fParam3, iParam4, 1036831949))
					{
						return true;
					}
				}
			}
		}
		iVar0++;
	}
	return false;
}

bool func_198(vector3 vParam0, var uParam3)//Position - 0x95C5
{
	if (uParam3->f_18)
	{
		switch (uParam3->f_26)
		{
			case 0:
				if (func_184(vParam0, uParam3->f_19, uParam3->f_25, 0, 0))
				{
					return true;
				}
				break;
			
			case 1:
				if (func_107(vParam0, uParam3->f_19, uParam3->f_22, 0, 0))
				{
					return true;
				}
				break;
			
			case 2:
				if (object::is_point_in_angled_area(vParam0, uParam3->f_19, uParam3->f_22, uParam3->f_25, 0, true))
				{
					return true;
				}
				break;
		}
		return false;
	}
	return true;
}

Vector3 func_199(vector3 vParam0, float fParam3, int iParam4, int iParam5, vector3 vParam6, int iParam9, int iParam10, int iParam11, int iParam12, int iParam13, int iParam14, int iParam15)//Position - 0x9656
{
	vector3 vVar0;
	var uVar3;
	var uVar4;
	var uVar5;
	var uVar8;
	int iVar11;
	int iVar12;
	float fVar13;
	float fVar14;
	int iVar15;
	int iVar16;
	float fVar17;
	float fVar20;
	float fVar23;
	vector3 vVar24;
	vector3 vVar27;
	vector3 vVar30;
	
	if (iParam15)
	{
		if (system::vmag(vParam6) > 0f)
		{
			if (!func_200(vParam0, *fParam3, vParam6))
			{
				*fParam3 = (*fParam3 + 180f);
			}
		}
		return vParam0;
	}
	pathfind::get_vehicle_node_properties(vParam0, &uVar3, &uVar4);
	if (uVar4 & 1024 == 0 && !iParam10)
	{
		pathfind::get_closest_road(vParam0, 1f, 1, &uVar5, &uVar8, &iVar11, &iVar12, &fVar13, iParam9);
		if (iVar11 == iVar12)
		{
			*iParam12 = 1;
		}
		if (iParam14)
		{
			if (!uVar4 & 128 == 0)
			{
				return 0f, 0f, 0f;
			}
			if (!uVar4 & 256 == 0)
			{
				return 0f, 0f, 0f;
			}
			if (!uVar4 & 512 == 0)
			{
				return 0f, 0f, 0f;
			}
			if ((iVar11 + iVar12) != iParam4)
			{
				return 0f, 0f, 0f;
			}
		}
		if (iParam13 && *iParam12)
		{
			*fParam3 = (*fParam3 + 180f);
			if (*fParam3 > 360f)
			{
				*fParam3 = (*fParam3 + -360f);
			}
		}
		if (*fParam3 <= 90f || *fParam3 > 270f)
		{
			iVar15 = true;
		}
		else
		{
			iVar15 = false;
		}
		iVar16 = false;
		if (iVar15)
		{
			if (iVar11 == 0)
			{
				if (iParam14)
				{
					return 0f, 0f, 0f;
				}
			}
			else if (iParam4 == iVar11)
			{
				iVar16 = true;
			}
		}
		else if (iVar12 == 0)
		{
			if (iParam14)
			{
				return 0f, 0f, 0f;
			}
		}
		else if (iParam4 == iVar12)
		{
			iVar16 = true;
		}
		if (fVar13 < 0f)
		{
			fVar14 = 0f;
		}
		else
		{
			if (iVar15)
			{
				if (iVar16)
				{
					fVar14 = (4.2f * (system::to_float(iVar11) * 0.5f));
				}
				else
				{
					fVar14 = (4.2f * system::to_float(iVar11));
				}
				if (iVar16)
				{
					if (iVar11 > 2)
					{
						fVar14 = (fVar14 + (IntToFloat((iVar11 - 2)) * 1f));
					}
				}
				else if (iVar11 > 1)
				{
					fVar14 = (fVar14 + (IntToFloat((iVar11 - 1)) * 1f));
				}
			}
			else
			{
				if (iVar16)
				{
					fVar14 = (4.2f * (system::to_float(iVar12) * 0.5f));
				}
				else
				{
					fVar14 = (4.2f * system::to_float(iVar12));
				}
				if (iVar16)
				{
					if (iVar12 > 2)
					{
						fVar14 = (fVar14 + (IntToFloat((iVar12 - 2)) * 1f));
					}
				}
				else if (iVar12 > 1)
				{
					fVar14 = (fVar14 + (IntToFloat((iVar12 - 1)) * 1f));
				}
			}
			if (!uVar4 & 64 == 0)
			{
				fVar14 = (fVar14 + (0.95f * fVar13));
			}
			if (!uVar4 & 4 == 0 || !uVar4 & 8 == 0)
			{
				fVar14 = (fVar14 + -0.5f);
			}
			if ((!uVar4 & 32 == 0 && uVar4 & 4 == 0) && uVar4 & 8 == 0)
			{
				fVar14 = (fVar14 + -1f);
			}
			if (!iParam5 || !uVar4 & 8 == 0)
			{
				fVar14 = (fVar14 + (4.2f * -0.5f));
			}
			if (!iParam11 == 0)
			{
				func_82(iParam11, &fVar17, &fVar20, 1086324736, 1080033280, 1077936128);
				fVar23 = (fVar20 - fVar17);
				if (fVar23 > 1.8f)
				{
					fVar14 = (fVar14 + ((fVar23 - 1.8f) * -0.5f));
				}
			}
		}
	}
	if (system::vmag(vParam6) > 0f)
	{
		if (!func_200(vParam0, *fParam3, vParam6))
		{
			if (iParam5)
			{
				*fParam3 = (*fParam3 + 180f);
			}
			else if (iParam14)
			{
				return 0f, 0f, 0f;
			}
		}
	}
	if (fVar14 < 0f)
	{
		fVar14 = 0f;
	}
	vVar0 = { object::_get_object_offset_from_coords(vParam0, *fParam3, fVar14, 0f, 0f) };
	if (iParam5)
	{
		if (unk_0xA0F8A7517A273C05(vParam0, *fParam3, &vVar24))
		{
			vVar27 = { vVar24 - vParam0 };
			if (!iParam11 == 0)
			{
				vVar30 = { vVar27 / FtoV(system::vmag(vVar27)) };
				func_82(iParam11, &fVar17, &fVar20, 1086324736, 1080033280, 1077936128);
				fVar23 = (fVar20 - fVar17);
				vVar30 = { vVar30 * FtoV((fVar23 * 0.5f)) };
				vVar27 = { vVar27 - vVar30 };
				vVar24 = { vParam0 + vVar27 };
			}
			vVar30 = { vVar0 - vVar24 };
			vVar0 = { vVar24 };
		}
	}
	return vVar0;
}

bool func_200(vector3 vParam0, float fParam3, vector3 vParam4)//Position - 0x9A54
{
	vector3 vVar0;
	vector3 vVar3;
	
	vVar0 = { 0f, 1f, 0f };
	func_83(&vVar0, 0f, 0f, fParam3);
	vVar3 = { vParam4 - vParam0 };
	if (func_76(vVar3, vVar0) >= 0f)
	{
		return true;
	}
	return false;
}

bool func_201(vector3 vParam0)//Position - 0x9A90
{
	int iVar0;
	var uVar1;
	
	uVar1 = func_79(vParam0);
	iVar0 = 0;
	while (iVar0 < Global_2410853[uVar1])
	{
		if (func_78(vParam0, &(Global_2410150[uVar1 /*78*/][iVar0 /*7*/])))
		{
			return true;
		}
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 < Global_2410853[8])
	{
		if (func_78(vParam0, &(Global_2410150[8 /*78*/][iVar0 /*7*/])))
		{
			return true;
		}
		iVar0++;
	}
	return false;
}

int func_202(var uParam0, int iParam1)//Position - 0x9B0B
{
	int iVar0;
	
	iVar0 = false;
	if (Global_2404993.f_26.f_16)
	{
		switch (Global_2404993.f_26.f_15)
		{
			case 0:
				if (func_184(*uParam0, Global_2404993.f_26.f_8, Global_2404993.f_26.f_14, 0, 0))
				{
					iVar0 = true;
				}
				break;
			
			case 1:
				if (func_107(*uParam0, Global_2404993.f_26.f_8, Global_2404993.f_26.f_11, 0, 0))
				{
					iVar0 = true;
				}
				break;
			
			case 2:
				if (object::is_point_in_angled_area(*uParam0, Global_2404993.f_26.f_8, Global_2404993.f_26.f_11, Global_2404993.f_26.f_14, 0, true))
				{
					iVar0 = true;
				}
				break;
		}
		if (iVar0)
		{
			if (iParam1)
			{
				*uParam0 = { func_95(*uParam0, Global_2404993.f_26.f_8, Global_2404993.f_26.f_11, Global_2404993.f_26.f_14, Global_2404993.f_26.f_15, 1036831949, 0) };
			}
		}
	}
	return iVar0;
}

int func_203(var uParam0, var uParam1, var uParam2)//Position - 0x9BFD
{
	int iVar0;
	vector3 vVar1;
	float fVar4;
	int iVar5;
	int iVar6;
	int iVar7;
	int iVar8;
	float fVar9;
	int iVar10;
	int iVar11;
	float fVar12;
	int iVar13;
	vector3 vVar14;
	var uVar17;
	
	if (Global_2404993.f_1683 > 0)
	{
		iVar0 = 0;
		if (!system::vmag(uParam2->f_35) > 0f)
		{
			uParam2->f_35 = { *uParam0 };
		}
		if (uParam2->f_15)
		{
			if (func_88(uParam2->f_35, uParam0, &(uParam2->f_38), &(uParam2->f_45), 1, 1))
			{
				uParam2->f_6 = 9999.9f;
				uParam2->f_7 = 9999.9f;
			}
		}
		if (uParam2->f_48)
		{
			if (func_202(uParam0, 1))
			{
				uParam2->f_6 = 9999.9f;
				uParam2->f_7 = 9999.9f;
			}
		}
		Global_2411139.f_162 = 0;
		Global_2411139.f_163 = 0;
		iVar5 = 0;
		while (iVar5 < 40)
		{
			Global_2411139[iVar5 /*3*/] = { 0f, 0f, 0f };
			Global_2411139.f_121[iVar5] = 0f;
			iVar5++;
		}
		iVar0 = 0;
		while (iVar0 < Global_2404993.f_1683)
		{
			vVar1 = { Global_2404993.f_1684[iVar0 /*4*/] };
			fVar4 = Global_2404993.f_1684[iVar0 /*4*/].f_3;
			if (system::vmag(vVar1) > 0f)
			{
				if ((uParam2->f_5 > 0f && system::vdist(vVar1.x, vVar1.y, 0f, uParam2->f_35, uParam2->f_35.f_1, 0f) < uParam2->f_5) || uParam2->f_5 <= 0f)
				{
					if ((uParam2->f_12 && !func_193(vVar1, fVar4, uParam2->f_34, player::player_id(), 0, uParam2->f_56)) || !uParam2->f_12)
					{
						if (!uParam2->f_15 || !func_88(uParam2->f_35, &vVar1, &(uParam2->f_38), &(uParam2->f_45), 0, 1))
						{
							if (uParam2->f_8)
							{
								iVar6 = uParam2->f_31;
								iVar7 = true;
								iVar8 = 1;
								fVar9 = uParam2->f_49;
								if (!uParam2->f_55)
								{
									iVar6 = 0;
									iVar7 = false;
									iVar8 = 0;
									fVar9 = 1f;
								}
								else if (uParam2->f_17)
								{
									iVar6 = 0;
									iVar7 = false;
									iVar8 = 0;
									if (uParam2->f_33 == 1)
									{
										fVar9 = (fVar9 * 0.375f);
									}
								}
								else
								{
									iVar7 = true;
									iVar8 = 1;
									if (uParam2->f_28)
									{
										if (uParam2->f_33 == 1)
										{
											fVar9 = (fVar9 * 0.375f);
										}
									}
								}
								iVar10 = false;
								if (uParam2->f_3 > 7f)
								{
									if (func_205(vVar1, 6f, 1f, 1f, 5f, iVar6, iVar7, iVar8, fVar9, 0, -1, 1, uParam2->f_3, 0, 0, 0, 0))
									{
										iVar10 = true;
									}
								}
								else if (func_205(vVar1, 6f, 1f, 1f, 5f, iVar6, iVar7, iVar8, fVar9, 0, -1, 1, 0f, 0, 0, 0, 0) && !func_192(vVar1, fVar4, uParam2->f_34, 1, 1, 0, 0, 0, 0))
								{
									iVar10 = true;
								}
								if (iVar10)
								{
									if ((uParam2->f_29 || uParam2->f_30) || uParam2->f_52)
									{
										fVar12 = 0f;
										if (uParam2->f_52)
										{
											iVar11 = func_191(vVar1, uParam2->f_54, &fVar12);
										}
										if (!uParam2->f_52 || (uParam2->f_52 && iVar11 <= uParam2->f_53))
										{
											if (uParam2->f_52)
											{
												if (iVar11 < uParam2->f_53)
												{
													iVar5 = 0;
													while (iVar5 < Global_2411139.f_162)
													{
														Global_2411139[iVar5 /*3*/] = { 0f, 0f, 0f };
														Global_2411139.f_121[iVar5] = 0f;
														iVar5++;
													}
													Global_2411139.f_162 = 0;
													uParam2->f_53 = iVar11;
												}
											}
											if (uParam2->f_30)
											{
												if (Global_2411139.f_162 == 0)
												{
													Global_2411139[0 /*3*/] = { vVar1 };
													Global_2411139.f_121[0] = fVar4;
												}
												else
												{
													iVar5 = 0;
													while (iVar5 < Global_2411139.f_162 + 1)
													{
														if (iVar5 < 40)
														{
															if (system::vdist2(vVar1, uParam2->f_35) < system::vdist2(Global_2411139[iVar5 /*3*/], uParam2->f_35))
															{
																func_190(vVar1, fVar4, iVar5);
																iVar5 = Global_2411139.f_162 + 1;
															}
														}
														iVar5++;
													}
												}
												Global_2411139.f_162++;
												if (Global_2411139.f_162 >= 5)
												{
													if ((uParam2->f_52 && uParam2->f_53 == 0) || uParam2->f_52 == 0)
													{
														iVar0 = Global_2404993.f_1683;
													}
													else if (Global_2411139.f_162 == 40)
													{
														iVar0 = Global_2404993.f_1683;
													}
												}
											}
											else
											{
												Global_2411139[Global_2411139.f_162 /*3*/] = { vVar1 };
												Global_2411139.f_121[Global_2411139.f_162] = fVar4;
												Global_2411139.f_162++;
												if (Global_2411139.f_162 >= 10)
												{
													if ((uParam2->f_52 && uParam2->f_53 == 0) || uParam2->f_52 == 0)
													{
														iVar0 = Global_2404993.f_1683;
													}
													else if (Global_2411139.f_162 == 40)
													{
														iVar0 = Global_2404993.f_1683;
													}
												}
											}
										}
									}
									else
									{
										*uParam0 = { vVar1 };
										*uParam1 = fVar4;
										return 1;
									}
								}
							}
							else
							{
								*uParam0 = { vVar1 };
								*uParam1 = fVar4;
								return 1;
							}
						}
					}
				}
			}
			iVar0++;
		}
		if (Global_2411139.f_162 > 0)
		{
			if (uParam2->f_30)
			{
				*uParam0 = { Global_2411139[0 /*3*/] };
				*uParam1 = Global_2411139.f_121[0];
				return 1;
			}
			else
			{
				if (Global_2411139.f_163 > 0 && !Global_2411139.f_163 == Global_2411139.f_162)
				{
					func_188(0, uParam2);
				}
				iVar13 = gameplay::get_random_int_in_range(0, Global_2411139.f_162);
				vVar14 = { Global_2411139[0 /*3*/] };
				uVar17 = Global_2411139.f_121[0];
				Global_2411139[0 /*3*/] = { Global_2411139[iVar13 /*3*/] };
				Global_2411139.f_121[0] = Global_2411139.f_121[iVar13];
				Global_2411139[iVar13 /*3*/] = { vVar14 };
				Global_2411139.f_121[iVar13] = uVar17;
				*uParam0 = { Global_2411139[0 /*3*/] };
				*uParam1 = Global_2411139.f_121[0];
				return 1;
			}
		}
		else
		{
			uParam2->f_33++;
			if (uParam2->f_33 < 2)
			{
				return func_203(uParam0, uParam1, uParam2);
			}
			else
			{
				uParam2->f_33 = 0;
				func_186(uParam0, uParam1, uParam2);
				return 1;
			}
		}
	}
	return 0;
}

void func_204(float fParam0, float fParam1)//Position - 0xA1B3
{
	pathfind::add_navmesh_required_region(fParam0, fParam1, 0.1f);
	Global_2404993.f_2025 = script::get_id_of_this_thread();
	Global_2404993.f_2023 = 1;
	Global_2404993.f_2026 = network::get_network_time();
}

bool func_205(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, int iParam18)//Position - 0xA1E6
{
	Global_2404993.f_2 = 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, iParam18))
		{
			return false;
		}
	}
	Global_2404993.f_2++;
	if (iParam13)
	{
		if (fire::get_number_of_fires_in_range(vParam0, 2.5f) > 0)
		{
			return false;
		}
	}
	Global_2404993.f_2++;
	if (fParam14 > 0f)
	{
		if (func_163(vParam0, fParam14, 1, 1, iParam15, iParam17, 0, iParam15))
		{
			return false;
		}
	}
	Global_2404993.f_2++;
	if (iParam8)
	{
		if (fParam6 > 0f)
		{
			if (func_153(vParam0, fParam6, iParam7, iParam9, fParam10, iParam11, iParam12, fParam16, iParam17))
			{
				return false;
			}
		}
	}
	Global_2404993.f_2++;
	return true;
}

void func_206()//Position - 0xA2F6
{
	if (Global_2404993.f_2023)
	{
		if (script::get_id_of_this_thread() == Global_2404993.f_2025)
		{
			pathfind::remove_navmesh_required_regions();
		}
		else
		{
			pathfind::remove_navmesh_required_regions();
		}
		Global_2404993.f_2023 = 0;
	}
}

int func_207(int iParam0)//Position - 0xA329
{
	if (cam::is_screen_faded_out())
	{
		return 10000;
	}
	if (iParam0)
	{
		return 5000;
	}
	return 1000;
}

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

int func_209(int iParam0)//Position - 0xA36A
{
	switch (iParam0)
	{
		case 0:
			return Local_91.f_49;
			break;
	}
	return 0;
}

bool func_210()//Position - 0xA38A
{
	if (iLocal_312 == 0)
	{
		if (gameplay::is_bit_set(Local_91.f_2, 4))
		{
			return true;
		}
	}
	return false;
}

bool func_211()//Position - 0xA3AA
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	int iVar6;
	int iVar7;
	int iVar8;
	var uVar9;
	
	if (!gameplay::is_bit_set(Local_91.f_2, 0))
	{
		gameplay::set_bit(&(Local_91.f_2), 0);
		if (iLocal_312 != 0)
		{
			return true;
		}
		else if (func_6(iLocal_314, 1, 1))
		{
			if (network::get_num_reserved_mission_peds(false) - network::_0xCB215C4B56A7FAE7(0)) >= func_421(iLocal_312)
			{
				if (network::can_register_mission_peds(func_421(iLocal_312)))
				{
					iVar0 = 0;
					iVar1 = 0;
					iVar2 = player::get_player_ped(iLocal_314);
					iVar3 = ped::get_ped_nearby_peds(iVar2, &uLocal_497, -1);
					iVar4 = true;
					iVar0 = 0;
					while (iVar0 < iVar3)
					{
						if (iVar4)
						{
							iVar5 = -1;
							iVar4 = false;
							iVar1 = 0;
							while (iVar1 < func_421(iLocal_312))
							{
								if (iVar5 == -1)
								{
									if (((!network::network_does_network_id_exist(Local_91.f_10[iVar1 /*7*/]) && !gameplay::is_bit_set(Local_91.f_10[iVar1 /*7*/].f_2, 1)) && !gameplay::is_bit_set(Local_91.f_10[iVar1 /*7*/].f_2, 6)) && !gameplay::is_bit_set(Local_91.f_10[iVar1 /*7*/].f_2, 8))
									{
										iVar5 = iVar1;
										iVar4 = true;
									}
								}
								iVar1++;
							}
							if (iVar5 != -1)
							{
								if (entity::does_entity_exist(uLocal_497[iVar0]))
								{
									if (!entity::is_entity_dead(uLocal_497[iVar0], 0))
									{
										if (!ped::is_ped_a_player(uLocal_497[iVar0]))
										{
											if (func_213(entity::get_entity_model(uLocal_497[iVar0])))
											{
												if (!entity::is_entity_a_mission_entity(uLocal_497[iVar0]))
												{
													if (!ped::is_ped_in_any_vehicle(uLocal_497[iVar0], 0))
													{
														if (func_5(entity::get_entity_coords(uLocal_497[iVar0], 1), entity::get_entity_coords(iVar2, 1), 625f))
														{
															entity::set_entity_as_mission_entity(uLocal_497[iVar0], true, 0);
															Local_91.f_10[iVar5 /*7*/].f_6 = iVar0;
															gameplay::set_bit(&(Local_91.f_10[iVar5 /*7*/].f_2), 8);
															if (!gameplay::is_bit_set(Local_91.f_1, 12))
															{
																Local_91.f_8 = iLocal_319;
																gameplay::set_bit(&(Local_91.f_1), 12);
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
						iVar0++;
					}
				}
			}
		}
	}
	else if (gameplay::is_bit_set(Local_91.f_1, 12))
	{
		iVar6 = 0;
		iVar7 = 0;
		iVar8 = false;
		iVar6 = 0;
		while (iVar6 < func_421(iLocal_312))
		{
			if (gameplay::is_bit_set(Local_91.f_10[iVar6 /*7*/].f_2, 1) || gameplay::is_bit_set(Local_91.f_10[iVar6 /*7*/].f_2, 6))
			{
				iVar7++;
			}
			else if (gameplay::is_bit_set(Local_91.f_10[iVar6 /*7*/].f_2, 8))
			{
				if (!entity::is_entity_dead(uLocal_497[Local_91.f_10[iVar6 /*7*/].f_6], 0))
				{
					if (entity::is_entity_a_mission_entity(uLocal_497[Local_91.f_10[iVar6 /*7*/].f_6]))
					{
						if (!network::network_has_control_of_entity(uLocal_497[Local_91.f_10[iVar6 /*7*/].f_6]))
						{
							network::network_request_control_of_entity(uLocal_497[Local_91.f_10[iVar6 /*7*/].f_6]);
							iVar8 = true;
						}
						else
						{
							weapon::remove_all_ped_weapons(uLocal_497[Local_91.f_10[iVar6 /*7*/].f_6], 1);
							Local_91.f_10[iVar6 /*7*/] = network::ped_to_net(uLocal_497[Local_91.f_10[iVar6 /*7*/].f_6]);
							network::set_network_id_exists_on_all_machines(Local_91.f_10[iVar6 /*7*/], 1);
							gameplay::set_bit(&(Local_91.f_10[iVar6 /*7*/].f_2), 0);
							Local_91.f_10[iVar6 /*7*/].f_1 = iLocal_312;
							Local_91.f_10[iVar6 /*7*/].f_4 = func_64(iLocal_312);
							func_62(iVar6);
							gameplay::clear_bit(&(Local_91.f_10[iVar6 /*7*/].f_2), 8);
							iVar7++;
						}
					}
					else
					{
						iVar8 = true;
					}
				}
			}
			iVar6++;
		}
		if (!iVar8 || network::get_time_difference(iLocal_319, Local_91.f_8) > 5000)
		{
			if (iVar7 >= func_421(iLocal_312))
			{
				gameplay::set_bit(&(Local_91.f_2), 4);
			}
			iVar6 = 0;
			while (iVar6 < 16)
			{
				uLocal_497[iVar6] = uVar9;
				iVar6++;
			}
			iVar6 = 0;
			while (iVar6 < func_421(iLocal_312))
			{
				if (gameplay::is_bit_set(Local_91.f_10[iVar6 /*7*/].f_2, 8))
				{
					func_212(&(Local_91.f_10[iVar6 /*7*/]));
					gameplay::clear_bit(&(Local_91.f_10[iVar6 /*7*/].f_2), 8);
				}
				iVar6++;
			}
			gameplay::clear_bit(&(Local_91.f_1), 12);
			return true;
		}
	}
	else
	{
		return true;
	}
	return false;
}

void func_212(int iParam0)//Position - 0xA788
{
	int iVar0;
	
	if (network::network_does_entity_exist_with_network_id(*iParam0))
	{
		iVar0 = network::net_to_ent(*iParam0);
		entity::set_entity_as_no_longer_needed(&iVar0);
	}
}

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

bool func_214()//Position - 0xAAAA
{
	if (gameplay::is_bit_set(Local_91.f_1, 6))
	{
		return true;
	}
	else if (iLocal_312 == 0)
	{
		Local_91.f_49 = func_215(Local_91.f_36, 1);
		gameplay::set_bit(&(Local_91.f_1), 6);
		return true;
	}
	else
	{
		gameplay::set_bit(&(Local_91.f_1), 6);
		return true;
	}
	return false;
}

int func_215(vector3 vParam0, int iParam3)//Position - 0xAAF9
{
	int iVar0;
	
	if (func_216(vParam0, 1301f, -1696f, 300f, 350f, 0))
	{
		return joaat("g_m_y_mexgoon_01");
	}
	else if (func_216(vParam0, 1100f, -196f, 300f, 350f, 0) || func_216(vParam0, 77f, 3657f, 100f, 150f, 0))
	{
		return joaat("g_m_y_lost_01");
	}
	else if (func_216(vParam0, 208f, -1835f, 200f, 250f, 0))
	{
		return joaat("g_m_y_ballaorig_01");
	}
	else if (func_216(vParam0, -26f, -1450f, 200f, 250f, 0))
	{
		return joaat("g_m_y_famca_01");
	}
	else if (func_216(vParam0, -654f, -922f, 300f, 350f, 0))
	{
		return joaat("g_m_y_korean_02");
	}
	else if (func_216(vParam0, 1840f, 3657f, 450f, 500f, 0))
	{
		return joaat("a_m_m_hillbilly_02");
	}
	else if (func_216(vParam0, 550f, -1885f, 200f, 250f, 0))
	{
		return joaat("g_m_y_salvagoon_01");
	}
	else if (iParam3 == 1)
	{
		iVar0 = gameplay::get_random_int_in_range(0, 100);
		if (iVar0 < 33)
		{
			return joaat("mp_g_m_pros_01");
		}
		else if (iVar0 >= 66)
		{
			return joaat("g_m_m_armgoon_01");
		}
		else
		{
			return joaat("g_m_m_chigoon_01");
		}
		if (vParam0.y > 800f)
		{
			iVar0 = gameplay::get_random_int_in_range(0, 100);
			if (iVar0 < 33)
			{
				return joaat("a_m_m_hillbilly_02");
			}
		}
	}
	return joaat("mp_g_m_pros_01");
}

int func_216(vector3 vParam0, vector3 vParam3, float fParam6, int iParam7)//Position - 0xACB6
{
	return gameplay::get_distance_between_coords(vParam0, vParam3, iParam7) <= fParam6;
}

void func_217(int iParam0)//Position - 0xACCF
{
	if (ped::is_ped_injured(iParam0))
	{
	}
	Local_91.f_36 = { entity::get_entity_coords(iParam0, 1) };
	if (func_218(iParam0, 0))
	{
		gameplay::set_bit(&(Local_91.f_1), 17);
	}
	else
	{
		gameplay::clear_bit(&(Local_91.f_1), 17);
	}
}

bool func_218(int iParam0, int iParam1)//Position - 0xAD0E
{
	if (entity::does_entity_exist(iParam0))
	{
		if (!entity::is_entity_dead(iParam0, 0) || iParam1)
		{
			if (entity::is_entity_in_water(iParam0))
			{
				if (entity::get_entity_submerged_level(iParam0) >= 0.7f)
				{
					return true;
				}
			}
		}
	}
	return false;
}

bool func_219()//Position - 0xAD4F
{
	int iVar0;
	
	if (network::network_is_host_of_this_script())
	{
		if (gameplay::is_bit_set(Local_91.f_1, 7))
		{
			return true;
		}
		else
		{
			iVar0 = false;
			switch (iLocal_312)
			{
				case 0:
					if (gameplay::is_bit_set(Local_91.f_2, 11))
					{
						if (func_6(iLocal_314, 1, 1))
						{
							if (system::vdist2(func_8(iLocal_314), Local_91.f_39) > 625f)
							{
								gameplay::clear_bit(&(Local_91.f_2), 11);
								gameplay::clear_bit(&iLocal_306, 8);
							}
						}
					}
					else
					{
						if (func_6(iLocal_314, 1, 1))
						{
							iVar0 = true;
							if (func_222())
							{
								iVar0 = false;
							}
						}
						if (iVar0)
						{
							func_57();
						}
						else
						{
							func_58();
						}
						if (gameplay::is_bit_set(Local_91.f_1, 5))
						{
							if (func_221())
							{
								func_58();
								gameplay::set_bit(&(Local_91.f_1), 7);
							}
						}
					}
					break;
				
				case 1:
					if (func_6(iLocal_314, 1, 1))
					{
						iVar0 = true;
						if (func_220())
						{
							iVar0 = false;
						}
					}
					if (iVar0)
					{
						func_57();
					}
					else
					{
						func_58();
					}
					if (gameplay::is_bit_set(Local_91.f_1, 5))
					{
						if (network::get_time_difference(iLocal_319, Local_91.f_5) > 30000)
						{
							func_58();
							gameplay::set_bit(&(Local_91.f_1), 7);
						}
					}
					break;
				}
			}
	}
	return false;
}

bool func_220()//Position - 0xAE74
{
	int iVar0;
	
	iVar0 = player::get_player_ped(iLocal_314);
	if (((((entity::is_entity_in_air(iVar0) || entity::is_entity_in_water(iVar0)) || func_29(iLocal_314, 1, 0)) || func_36(iLocal_314, 0)) || func_36(iLocal_314, 7)) || func_28(iLocal_314))
	{
		return true;
	}
	if (func_104(iLocal_314, 1))
	{
		if (iLocal_314 > -1)
		{
			if (Global_1588660[iLocal_314 /*532*/] != 1)
			{
				return true;
			}
		}
	}
	return false;
}

bool func_221()//Position - 0xAEFB
{
	if (!gameplay::is_bit_set(Local_91.f_1, 18))
	{
		if (network::get_time_difference(iLocal_319, Local_91.f_5) > 5000)
		{
			gameplay::set_bit(&(Local_91.f_1), 18);
			return true;
		}
	}
	else if (network::get_time_difference(iLocal_319, Local_91.f_5) > 60000)
	{
		return true;
	}
	return false;
}

bool func_222()//Position - 0xAF4A
{
	int iVar0;
	
	iVar0 = player::get_player_ped(iLocal_314);
	if (((((((((entity::get_entity_speed(iVar0) > 10f || entity::is_entity_in_air(iVar0)) || entity::is_entity_in_water(iVar0)) || func_29(iLocal_314, 1, 0)) || func_56(iLocal_314)) || func_36(iLocal_314, 0)) || func_36(iLocal_314, 7)) || func_28(iLocal_314)) || Global_2421327[iLocal_314 /*353*/].f_237) || func_55(player::get_player_ped(iLocal_314), joaat("titan")))
	{
		return true;
	}
	if (func_104(iLocal_314, 1))
	{
		if (iLocal_314 > -1)
		{
			if (Global_1588660[iLocal_314 /*532*/] != 1)
			{
				return true;
			}
		}
	}
	if (iLocal_314 != -1)
	{
		if (gameplay::is_bit_set(Local_145[iLocal_314 /*5*/].f_1, 4))
		{
			return true;
		}
	}
	return false;
}

void func_223()//Position - 0xB034
{
	if (!gameplay::is_bit_set(Local_91.f_1, 14))
	{
		Local_91.f_9 = iLocal_319;
		gameplay::set_bit(&(Local_91.f_1), 14);
	}
}

void func_224()//Position - 0xB05B
{
	if (Local_91.f_44 != Local_145[iLocal_313 /*5*/].f_4)
	{
		Local_91.f_44 = Local_145[iLocal_313 /*5*/].f_4;
	}
}

void func_225()//Position - 0xB080
{
	if (!gameplay::is_bit_set(Local_91.f_1, 10))
	{
		Local_91.f_45 = func_421(iLocal_312);
		Local_91.f_46 = 0;
		Local_91.f_47 = 0;
		gameplay::set_bit(&(Local_91.f_1), 10);
	}
}

void func_226()//Position - 0xB0B5
{
	func_227();
	if (!gameplay::is_bit_set(Local_91.f_1, 8))
	{
		if (gameplay::is_bit_set(Local_91.f_2, 7))
		{
			if (network::get_time_difference(iLocal_319, Local_91.f_7) > 300000)
			{
				gameplay::set_bit(&(Local_91.f_2), 8);
			}
		}
	}
}

void func_227()//Position - 0xB0F7
{
	if (!gameplay::is_bit_set(Local_91.f_2, 7))
	{
		Local_91.f_7 = iLocal_319;
		gameplay::set_bit(&(Local_91.f_2), 7);
	}
}

void func_228()//Position - 0xB11C
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	gameplay::set_bit(&iLocal_306, 7);
	if (gameplay::is_bit_set(Local_91.f_3, 1))
	{
	}
	if (gameplay::is_bit_set(Local_91.f_3, 2))
	{
	}
	if (gameplay::is_bit_set(Local_91.f_3, 3))
	{
	}
	if (gameplay::is_bit_set(Local_91.f_3, 9))
	{
	}
	if (gameplay::is_bit_set(Local_91.f_3, 4))
	{
	}
	if (gameplay::is_bit_set(Local_91.f_3, 5))
	{
	}
	if (gameplay::is_bit_set(Local_91.f_3, 11))
	{
		if (player::player_id() == iLocal_313)
		{
			gameplay::clear_bit(&iLocal_306, 7);
			if (Local_91.f_50)
			{
				gameplay::set_bit(&iLocal_306, 7);
			}
			else if (func_323("MPCT_MERts", "FM_MERRYWEATHER", 85))
			{
				gameplay::set_bit(&iLocal_306, 7);
			}
		}
	}
	if (gameplay::is_bit_set(Local_91.f_3, 6))
	{
		if (player::player_id() == iLocal_313)
		{
			gameplay::clear_bit(&iLocal_306, 7);
			if (Local_91.f_50)
			{
				gameplay::set_bit(&iLocal_306, 7);
			}
			else if (func_323("MPCT_MERtd", "FM_MERRYWEATHER", 85))
			{
				gameplay::set_bit(&iLocal_306, 7);
			}
		}
	}
	if (gameplay::is_bit_set(Local_91.f_3, 7))
	{
		if (player::player_id() == iLocal_313)
		{
			gameplay::clear_bit(&iLocal_306, 7);
			if (func_298())
			{
				if (!Local_91.f_50)
				{
					iLocal_514 = func_295(12);
					func_293(iLocal_514, 1, 0, 0f);
					func_281(iLocal_514, 4, 1, 1);
					gameplay::set_bit(&iLocal_306, 7);
				}
				else
				{
					gameplay::set_bit(&iLocal_306, 7);
				}
			}
		}
	}
	if (gameplay::is_bit_set(Local_91.f_3, 0))
	{
		if (player::player_id() == iLocal_313)
		{
			if (!gameplay::is_bit_set(Local_91.f_2, 1))
			{
				gameplay::clear_bit(&iLocal_306, 7);
				if (func_323("MPCT_mugfail", "LAMAR", 19))
				{
					gameplay::set_bit(&iLocal_306, 7);
				}
			}
		}
		else if (player::player_id() == iLocal_314)
		{
			if (gameplay::is_bit_set(Local_91.f_2, 1))
			{
				if (gameplay::is_bit_set(Local_91.f_2, 12))
				{
					iVar0 = system::round((IntToFloat(Global_262145.f_5458) * Global_262145.f_4291));
					func_244(0, "XPT_MEDIUMT", -1859646258, 757237446, iVar0, 1, -1, 0);
					func_230(47, 1);
				}
			}
		}
	}
	if (gameplay::is_bit_set(Local_91.f_3, 8))
	{
		if (player::player_id() == iLocal_313)
		{
			gameplay::clear_bit(&iLocal_306, 7);
			if (func_298())
			{
				if (iLocal_312 == 0)
				{
					iLocal_514 = (func_295(2) * func_421(iLocal_312));
					iVar1 = 3;
				}
				else
				{
					iLocal_514 = func_295(12);
					iVar1 = 4;
				}
				if (!Local_91.f_50)
				{
					func_293(iLocal_514, 1, 0, 0f);
					func_281(iLocal_514, iVar1, 1, 0);
					gameplay::set_bit(&iLocal_306, 7);
				}
				else
				{
					gameplay::set_bit(&iLocal_306, 7);
				}
			}
		}
	}
	if (gameplay::is_bit_set(Local_91.f_3, 10))
	{
		if (player::player_id() == iLocal_313)
		{
			gameplay::clear_bit(&iLocal_306, 7);
			if (func_298())
			{
				if (iLocal_312 == 0)
				{
					iLocal_514 = (func_295(2) * func_421(iLocal_312));
					iVar2 = 3;
				}
				else
				{
					iLocal_514 = func_295(12);
					iVar2 = 4;
				}
				if (!Local_91.f_50)
				{
					func_293(iLocal_514, 1, 0, 0f);
					func_281(iLocal_514, iVar2, 1, 0);
					gameplay::set_bit(&iLocal_306, 7);
				}
				else
				{
					gameplay::set_bit(&iLocal_306, 7);
				}
			}
		}
	}
	if (gameplay::is_bit_set(iLocal_306, 7))
	{
		func_229();
	}
}

void func_229()//Position - 0xB40C
{
	gameplay::clear_bit(&(Global_1588660[player::network_player_id_to_int() /*532*/].f_138), iLocal_312);
	Global_1588660[player::network_player_id_to_int() /*532*/].f_139 = -1;
	if (iLocal_312 == 1)
	{
		if (gameplay::is_incident_valid(uLocal_496))
		{
			gameplay::delete_incident(uLocal_496);
		}
	}
	func_450();
	func_482();
}

int func_230(int iParam0, int iParam1)//Position - 0xB456
{
	if (iParam0 >= 70)
	{
		return 0;
	}
	return func_231(iParam0, iParam1);
}

bool func_231(int iParam0, int iParam1)//Position - 0xB471
{
	if (func_243(14) && !func_242(iParam0))
	{
		return false;
	}
	if (player::has_achievement_been_passed(iParam0) && iParam1 == 1)
	{
		return false;
	}
	if (Global_25431 != 0 && !Global_69617)
	{
		return false;
	}
	if (func_241(&Global_2578151))
	{
		if (func_239(&Global_2578151, iParam0))
		{
			return false;
		}
		if (func_232(&Global_2578151, iParam0))
		{
			return true;
		}
	}
	else
	{
		if (!player::give_achievement_to_player(iParam0))
		{
			return false;
		}
		if (player::has_achievement_been_passed(iParam0))
		{
			return true;
		}
		return false;
	}
	return false;
}

bool func_232(var uParam0, int iParam1)//Position - 0xB50E
{
	int iVar0;
	var uVar1[70];
	
	if (player::has_achievement_been_passed(iParam1))
	{
		return false;
	}
	if (func_243(14) && !func_242(iParam1))
	{
		return false;
	}
	if (func_239(uParam0, iParam1))
	{
		return false;
	}
	if (func_238(uParam0) < 0f)
	{
		func_237(uParam0, 0);
	}
	func_235(&uVar1);
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < (*uParam0 - 1))
	{
		uVar1[iVar0 + 1] = (*uParam0)[iVar0];
		iVar0++;
	}
	func_233(&uVar1, iParam1);
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < *uParam0)
	{
		(*uParam0)[iVar0] = uVar1[iVar0];
		iVar0++;
	}
	return true;
}

bool func_233(var uParam0, int iParam1)//Position - 0xB5BF
{
	int iVar0;
	
	if (player::has_achievement_been_passed(iParam1))
	{
		return false;
	}
	if (func_243(14) && !func_242(iParam1))
	{
		return false;
	}
	if (func_239(uParam0, iParam1))
	{
		return false;
	}
	if (func_238(uParam0) < 0f)
	{
		func_237(uParam0, 0);
	}
	iVar0 = 0;
	while (iVar0 < *uParam0)
	{
		if (func_234(uParam0, iVar0))
		{
			(*uParam0)[iVar0] = iParam1;
			return true;
		}
		iVar0++;
	}
	return false;
}

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

void func_235(var uParam0)//Position - 0xB64B
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < *uParam0)
	{
		func_236(uParam0, iVar0);
		iVar0++;
	}
	func_237(uParam0, (Global_2578150 - 0.5f));
}

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

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

var func_238(var uParam0)//Position - 0xB6AC
{
	return uParam0->f_72;
}

int func_239(var uParam0, int iParam1)//Position - 0xB6B8
{
	return func_240(uParam0, iParam1) != -1;
}

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

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

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

int func_243(int iParam0)//Position - 0xB755
{
	return Global_35775 == iParam0;
}

var func_244(int iParam0, char* sParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7)//Position - 0xB763
{
	return func_245(iParam0, sParam1, iParam2, iParam3, iParam4, iParam5, iParam6, iParam7);
}

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

int func_246(int iParam0, int iParam1, char* sParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8, int iParam9, int iParam10)//Position - 0xB7A2
{
	float fVar0;
	int iVar1;
	int iVar2;
	float fVar3;
	
	if (func_280(player::player_id()) || func_279(player::player_id()))
	{
		if (Global_262145.f_8088 > 8000)
		{
			iVar2 = 8000;
		}
		else
		{
			iVar2 = Global_262145.f_8088;
		}
	}
	else if (Global_262145.f_5451 > 5000)
	{
		iVar2 = 5000;
	}
	else
	{
		iVar2 = Global_262145.f_5451;
	}
	if (func_278(sParam2))
	{
	}
	if (func_277())
	{
		if (iParam4 < 1)
		{
			iParam4 = 1;
		}
		iVar1 = system::round((IntToFloat(iParam3) * (IntToFloat(iParam4) + fVar0)));
		iVar1 = func_275(iVar1);
		fVar3 = (system::to_float(iVar1) * Global_262145.f_1);
		iVar1 = system::round(fVar3);
		if (iParam10)
		{
			iVar1 = func_274(&iVar1);
		}
		if (iParam1 == 0)
		{
			switch (iParam0)
			{
				case 2:
					func_272(0, &iVar1);
					break;
				
				case 3:
					func_272(1, &iVar1);
					break;
				
				case 1:
					func_270(&iVar1);
					break;
				}
		}
		if (iParam1 == 0)
		{
			if (iVar1 > iVar2)
			{
				if (iParam0 == 1)
				{
					iVar1 = iVar2;
				}
				if (iParam0 == 2 || iParam0 == 3)
				{
					iVar1 = iVar2;
				}
			}
		}
		if (iParam7)
		{
			func_267(1157, iVar1, -1);
			if (iParam1 == 0)
			{
				func_256((func_266(player::player_id()) + iVar1), iParam9, 0);
				if (iParam8 == 0)
				{
				}
				if (iParam9 == 0)
				{
				}
				stats::playstats_award_xp(iVar1, iParam8, iParam9);
				if (Global_1588660[player::player_id() /*532*/].f_39.f_2 != -1)
				{
					func_267(1158, iVar1, -1);
				}
				if (iParam1 == 0)
				{
					func_251(iVar1);
				}
			}
		}
		if (iParam5)
		{
		}
		if (iParam7)
		{
			if (iParam6 == -1)
			{
				func_247((func_249(player::player_id()) + iVar1));
			}
			else
			{
				func_247((func_249(player::player_id()) + iParam6));
			}
		}
		if (iParam7)
		{
		}
	}
	return iVar1;
}

void func_247(int iParam0)//Position - 0xB95D
{
	if (func_277())
	{
		Global_1588660[player::player_id() /*532*/].f_201.f_5 = iParam0;
		func_248(joaat("mpply_globalxp"), iParam0);
	}
}

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

int func_249(int iParam0)//Position - 0xB9A4
{
	if (iParam0 > -1)
	{
		if (func_6(iParam0, 0, 1))
		{
			if (iParam0 == player::player_id())
			{
				return func_250(joaat("mpply_globalxp"));
			}
			else
			{
				return Global_1588660[iParam0 /*532*/].f_201.f_5;
			}
		}
		else
		{
			return func_250(joaat("mpply_globalxp"));
		}
	}
	return 0;
}

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

void func_251(int iParam0)//Position - 0xBA13
{
	struct<13> Var0;
	int iVar13;
	
	Var0 = { func_126(player::player_id()) };
	if (network::_network_player_is_in_clan())
	{
		if (network::network_clan_player_is_active(&Var0))
		{
			iVar13 = func_254(func_255(&Var0));
			if (iVar13 == 0)
			{
				func_253(&Global_1352222, iParam0);
				func_252(joaat("mpply_crew_local_xp_0"), Global_1352222);
			}
			else if (iVar13 == 1)
			{
				func_253(&Global_1352223, iParam0);
				func_252(joaat("mpply_crew_local_xp_1"), Global_1352223);
			}
			else if (iVar13 == 2)
			{
				func_253(&Global_1352224, iParam0);
				func_252(joaat("mpply_crew_local_xp_2"), Global_1352224);
			}
			else if (iVar13 == 3)
			{
				func_253(&Global_1352225, iParam0);
				func_252(joaat("mpply_crew_local_xp_3"), Global_1352225);
			}
			else if (iVar13 == 4)
			{
				func_253(&Global_1352226, iParam0);
				func_252(joaat("mpply_crew_local_xp_4"), Global_1352226);
			}
		}
	}
}

void func_252(int iParam0, int iParam1)//Position - 0xBAE7
{
	int iVar0;
	
	iVar0 = iParam0;
	if (iVar0 != 0)
	{
		stats::stat_set_int(iVar0, iParam1, 1);
	}
	switch (iParam0)
	{
		case joaat("mpply_crew_0_id"):
			Global_1352217 = iParam1;
			break;
		
		case joaat("mpply_crew_1_id"):
			Global_1352219 = iParam1;
			break;
		
		case joaat("mpply_crew_2_id"):
			Global_1352219 = iParam1;
			break;
		
		case joaat("mpply_crew_3_id"):
			Global_1352220 = iParam1;
			break;
		
		case joaat("mpply_crew_4_id"):
			Global_1352221 = iParam1;
			break;
		
		case joaat("mpply_crew_local_xp_0"):
			Global_1352222 = iParam1;
			break;
		
		case joaat("mpply_crew_local_xp_1"):
			Global_1352223 = iParam1;
			break;
		
		case joaat("mpply_crew_local_xp_2"):
			Global_1352224 = iParam1;
			break;
		
		case joaat("mpply_crew_local_xp_3"):
			Global_1352225 = iParam1;
			break;
		
		case joaat("mpply_crew_local_xp_4"):
			Global_1352226 = iParam1;
			break;
		
		case joaat("mpply_became_cheater_num"):
			Global_1352227 = iParam1;
			break;
		
		case joaat("mpply_friendly"):
			Global_1352228 = iParam1;
			break;
		
		case joaat("mpply_offensive_language"):
			Global_1352229 = iParam1;
			break;
		
		case joaat("mpply_griefing"):
			Global_1352230 = iParam1;
			break;
		
		case joaat("mpply_helpful"):
			Global_1352231 = iParam1;
			break;
		
		case joaat("mpply_offensive_tagplate"):
			Global_1352232 = iParam1;
			break;
		
		case joaat("mpply_offensive_ugc"):
			Global_1352233 = iParam1;
			break;
		
		default:
			break;
	}
}

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

int func_254(int iParam0)//Position - 0xBC1D
{
	if (iParam0 == Global_1352217)
	{
		return 0;
	}
	else if (iParam0 == Global_1352218)
	{
		return 1;
	}
	else if (iParam0 == Global_1352219)
	{
		return 2;
	}
	else if (iParam0 == Global_1352220)
	{
		return 3;
	}
	else if (iParam0 == Global_1352221)
	{
		return 4;
	}
	else
	{
		return -1;
	}
	return -1;
}

var func_255(var uParam0)//Position - 0xBC7A
{
	if (network::_network_player_is_in_clan())
	{
		if (network::network_clan_player_is_active(uParam0))
		{
			return Global_2451705;
		}
	}
	return Global_2451705;
}

void func_256(int iParam0, int iParam1, int iParam2)//Position - 0xBC9D
{
	if (func_277())
	{
		if (iParam0 >= 1787576850)
		{
			iParam0 = 1787576850;
		}
		if (Global_262145.f_8058 == 0 && iParam1 != -1076930708)
		{
			if (iParam2 == 0)
			{
				if (iParam0 < Global_1352337[func_265(-1)])
				{
					stats::playstats_award_xp(iParam0, -523908350, iParam1);
					return;
				}
				else if (iParam0 == Global_1352337[func_265(-1)])
				{
					return;
				}
			}
		}
		if (Global_262145.f_8057 == 0)
		{
			if (iParam0 == 0)
			{
				stats::playstats_award_xp(iParam0, -1158693853, -1345423847);
				if (iParam2 == 0)
				{
					return;
				}
			}
		}
		if (Global_262145.f_8057 == 0)
		{
			if (iParam0 < 0)
			{
				stats::playstats_award_xp(iParam0, -1586921397, iParam1);
				return;
			}
		}
		if (func_264(player::player_id()))
		{
			Global_1588660[player::player_id() /*532*/].f_201.f_1 = iParam0;
			Global_1588660[player::player_id() /*532*/].f_201.f_6 = func_262(iParam0, 1);
		}
		func_261(632, iParam0, -1, 1);
		func_260(633, func_262(iParam0, 1), -1, 1, 0);
		Global_1352337[func_265(-1)] = iParam0;
		func_257(7, 0);
	}
}

void func_257(int iParam0, int iParam1)//Position - 0xBDBE
{
	var uVar0;
	
	if (func_259(iParam0, iParam1))
	{
		uVar0 = func_258();
		Global_2451682[uVar0] = iParam0;
	}
}

int func_258()//Position - 0xBDE1
{
	int iVar0;
	int iVar1;
	
	iVar0 = 9;
	iVar1 = 0;
	while (iVar1 <= 9)
	{
		if (Global_2451682[iVar1] == 0)
		{
			iVar0 = iVar1;
			iVar1 = 10;
		}
		iVar1++;
	}
	return iVar0;
}

bool func_259(int iParam0, var uParam1)//Position - 0xBE16
{
	if (Global_1315217)
	{
		return false;
	}
	if (iParam0 == 22)
	{
		return true;
	}
	if ((((((((uParam1 || !Global_1315229) || iParam0 == 3) || iParam0 == 10) || iParam0 == 11) || iParam0 == 27) || iParam0 == 28) || iParam0 == 29) || iParam0 == 30)
	{
		return true;
	}
	else
	{
		return false;
	}
	return true;
}

void func_260(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4)//Position - 0xBE9C
{
	int iVar0;
	
	if (iParam4)
	{
	}
	iVar0 = Global_2491469[iParam0 /*3*/][func_265(iParam2)];
	if (iVar0 != 0)
	{
		stats::stat_set_int(iVar0, iParam1, iParam3);
	}
}

void func_261(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0xBECC
{
	int iVar0;
	
	iVar0 = Global_2491469[iParam0 /*3*/][func_265(iParam2)];
	if (iVar0 != 0)
	{
		stats::stat_set_int(iVar0, iParam1, iParam3);
	}
	switch (iParam0)
	{
		case 780:
			Global_1352283[func_265(iParam2)] = iParam1;
			break;
		
		case 781:
			Global_1352289[func_265(iParam2)] = iParam1;
			break;
		
		case 782:
			Global_1352295[func_265(iParam2)] = iParam1;
			break;
		
		case 783:
			Global_1352301[func_265(iParam2)] = iParam1;
			break;
		
		case 770:
			Global_1352259[func_265(iParam2)] = iParam1;
			break;
		
		case 771:
			Global_1352265[func_265(iParam2)] = iParam1;
			break;
		
		case 772:
			Global_1352271[func_265(iParam2)] = iParam1;
			break;
		
		case 773:
			Global_1352277[func_265(iParam2)] = iParam1;
			break;
		
		case 760:
			Global_1352235[func_265(iParam2)] = iParam1;
			break;
		
		case 761:
			Global_1352241[func_265(iParam2)] = iParam1;
			break;
		
		case 762:
			Global_1352247[func_265(iParam2)] = iParam1;
			break;
		
		case 763:
			Global_1352253[func_265(iParam2)] = iParam1;
			break;
		
		case 750:
			Global_1352307[func_265(iParam2)] = iParam1;
			break;
		
		case 751:
			Global_1352313[func_265(iParam2)] = iParam1;
			break;
		
		case 752:
			Global_1352319[func_265(iParam2)] = iParam1;
			break;
		
		case 753:
			Global_1352325[func_265(iParam2)] = iParam1;
			break;
		
		case 1296:
			Global_1352331[func_265(iParam2)] = iParam1;
			break;
		
		case 632:
			Global_1352337[func_265(iParam2)] = iParam1;
			break;
		
		case 1271:
			Global_1352343[func_265(iParam2)] = iParam1;
			break;
		
		case 1868:
			Global_2507705[0 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 2259:
			Global_2507705[1 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 2909:
			Global_2507705[2 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3038:
			Global_2507705[3 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 4481:
			Global_2507752[func_265(iParam2)] = iParam1;
			break;
		
		case 757:
			Global_1352349[func_265(iParam2)] = iParam1;
			break;
		
		case 758:
			Global_1352355[func_265(iParam2)] = iParam1;
			break;
		
		case 759:
			Global_1352361[func_265(iParam2)] = iParam1;
			break;
		
		case 1229:
			Global_1352367[func_265(iParam2)] = iParam1;
			break;
		
		case 3033:
			Global_2507727[0 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3034:
			Global_2507727[1 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3035:
			Global_2507727[2 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3036:
			Global_2507727[3 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3037:
			Global_2507727[4 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3616:
			Global_2507755[0 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3617:
			Global_2507755[1 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3618:
			Global_2507755[2 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3619:
			Global_2507755[3 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3620:
			Global_2507755[4 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3621:
			Global_2507771[0 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3622:
			Global_2507771[1 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3623:
			Global_2507771[2 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3624:
			Global_2507771[3 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3625:
			Global_2507771[4 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3201:
			Global_2507727[5 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3207:
			Global_2507705[4 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3643:
			Global_2507787[func_265(iParam2)] = iParam1;
			break;
		
		case 3644:
			Global_2507796[func_265(iParam2)] = iParam1;
			break;
		
		case 3645:
			Global_2507790[func_265(iParam2)] = iParam1;
			break;
		
		case 3646:
			Global_2507799[func_265(iParam2)] = iParam1;
			break;
		
		case 3647:
			Global_2507793[func_265(iParam2)] = iParam1;
			break;
		
		case 3648:
			Global_2507802[func_265(iParam2)] = iParam1;
			break;
		
		case 3669:
			Global_2507805[func_265(iParam2)] = iParam1;
			break;
		
		case 3209:
			Global_2507727[6 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3210:
			Global_2507705[5 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3214:
			Global_2507727[7 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		case 3212:
			Global_2507705[6 /*3*/][func_265(iParam2)] = iParam1;
			break;
		
		default:
			break;
	}
}

int func_262(int iParam0, int iParam1)//Position - 0xC55E
{
	if (iParam1)
	{
	}
	return func_263(iParam0, 0);
}

int func_263(int iParam0, int iParam1)//Position - 0xC572
{
	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_278713[iVar3] == iParam0)
		{
			iVar1 = iVar3;
			iVar2 = iVar3;
		}
		else if (Global_278713[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_264(int iParam0)//Position - 0xC631
{
	if (iParam0 == -1)
	{
		return false;
	}
	else
	{
		return gameplay::is_bit_set(Global_2432628.f_1, iParam0);
	}
	return true;
}

int func_265(int iParam0)//Position - 0xC656
{
	int iVar0;
	int iVar1;
	
	iVar0 = iParam0;
	if (iVar0 == -1)
	{
		iVar1 = func_183();
		if (iVar1 > -1)
		{
			Global_2491182 = 0;
			iVar0 = iVar1;
		}
		else
		{
			iVar0 = 0;
			Global_2491182 = 1;
		}
	}
	return iVar0;
}

int func_266(int iParam0)//Position - 0xC68A
{
	if (Global_1312462.f_9 == 0)
	{
		if (iParam0 > -1)
		{
			if (iParam0 == player::player_id())
			{
				return Global_1352337[func_265(-1)];
			}
			else if (func_264(iParam0))
			{
				return Global_1588660[iParam0 /*532*/].f_201.f_1;
			}
		}
	}
	else
	{
		return Global_1352337[func_265(-1)];
	}
	return 0;
}

void func_267(int iParam0, int iParam1, int iParam2)//Position - 0xC6E7
{
	int iVar0;
	
	iVar0 = func_269(iParam0, func_265(iParam2), 0);
	iVar0 = (iVar0 + iParam1);
	if (!func_268(iParam0))
	{
		func_260(iParam0, iVar0, iParam2, 1, 0);
	}
	else
	{
		func_261(iParam0, iVar0, iParam2, 1);
	}
}

bool func_268(int iParam0)//Position - 0xC729
{
	if (Global_1352216)
	{
		switch (iParam0)
		{
			case 780:
			case 781:
			case 782:
			case 783:
			case 770:
			case 771:
			case 772:
			case 773:
			case 760:
			case 761:
			case 762:
			case 763:
			case 750:
			case 751:
			case 752:
			case 753:
			case 1296:
			case 632:
			case 1271:
			case 757:
			case 758:
			case 759:
			case 1229:
			case 1868:
			case 2259:
			case 2909:
			case 3038:
			case 4481:
			case 3033:
			case 3034:
			case 3035:
			case 3036:
			case 3037:
			case 3212:
			case 3214:
			case 3616:
			case 3617:
			case 3618:
			case 3619:
			case 3620:
			case 3621:
			case 3622:
			case 3623:
			case 3624:
			case 3625:
			case 3207:
			case 3201:
			case 3643:
			case 3644:
			case 3645:
			case 3646:
			case 3647:
			case 3648:
			case 3669:
			case 3210:
			case 3209:
				return true;
				break;
			}
	}
	return false;
}

int func_269(var uParam0, int iParam1, int iParam2)//Position - 0xC897
{
	int iVar0;
	var uVar1;
	
	if (iParam2 == 0)
	{
	}
	iVar0 = Global_2491469[uParam0 /*3*/][func_265(iParam1)];
	if (stats::stat_get_int(iVar0, &uVar1, -1))
	{
		return uVar1;
	}
	return 0;
}

void func_270(int iParam0)//Position - 0xC8C9
{
	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_128(player::get_player_team(iVar5), iVar1, 0))
				{
					iVar2++;
					if (iVar5 != player::player_id())
					{
						if (func_127(player::player_id(), iVar5))
						{
							iVar3 = true;
						}
					}
				}
			}
		}
		iVar0++;
	}
	if (iVar3)
	{
		iVar6 = system::round((func_271(*iParam0, 100) * (10f * Global_262145.f_4215)));
	}
	if (iVar2 > 4)
	{
		iVar2 = 4;
	}
	if (iVar2 >= 2)
	{
		iVar7 = system::round((func_271(*iParam0, 100) * (20f * Global_262145.f_4208)));
	}
	*iParam0 = (*iParam0 + iVar6);
	*iParam0 = (*iParam0 + iVar7);
}

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

void func_272(int iParam0, int iParam1)//Position - 0xC9D5
{
	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_6(iVar4, 0, 1))
				{
					if (iVar4 != player::player_id())
					{
						iVar1++;
						if (func_127(player::player_id(), iVar4))
						{
							iVar2 = true;
						}
					}
				}
			}
			iVar0++;
		}
	}
	else
	{
		iVar0 = 0;
		while (iVar0 < 32)
		{
			iVar4 = iVar0;
			if (func_6(iVar4, 1, 1))
			{
				if (iVar4 != player::player_id())
				{
					if (func_273(player::player_id(), iVar4) <= 20f)
					{
						iVar1++;
						if (func_127(player::player_id(), iVar4))
						{
							iVar2 = true;
						}
					}
				}
			}
			iVar0++;
		}
	}
	if (iVar2)
	{
		iVar5 = system::round((func_271(*iParam1, 100) * (10f * Global_262145.f_4215)));
	}
	if (iVar1 > 4)
	{
		iVar1 = 4;
	}
	if (iVar1 >= 1)
	{
		iVar6 = system::round((func_271(*iParam1, 100) * (20f * Global_262145.f_4208)));
	}
	*iParam1 = (*iParam1 + iVar5);
	*iParam1 = (*iParam1 + iVar6);
}

float func_273(int iParam0, int iParam1)//Position - 0xCAED
{
	return system::vdist(func_8(iParam0), func_8(iParam1));
	return 0f;
}

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

int func_275(int iParam0)//Position - 0xCB40
{
	if (iParam0 < 0)
	{
		if (gameplay::absi(iParam0) > func_266(player::player_id()))
		{
			iParam0 = -func_266(player::player_id());
		}
	}
	if (func_276(8000, 0, 0) > 0)
	{
		if (func_276(8000, 0, 0) < (iParam0 + func_266(player::player_id())))
		{
			iParam0 = (func_276(8000, 0, 0) - func_266(player::player_id()));
		}
	}
	return iParam0;
}

var func_276(int iParam0, int iParam1, int iParam2)//Position - 0xCBA4
{
	if (iParam2 == 0)
	{
	}
	if (iParam1)
	{
	}
	if (iParam0 >= 8000)
	{
		iParam0 = 8000;
	}
	return Global_278713[iParam0];
}

bool func_277()//Position - 0xCBCC
{
	return true;
}

bool func_278(char* sParam0)//Position - 0xCBD5
{
	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_279(int iParam0)//Position - 0xCC0D
{
	return Global_2421327[iParam0 /*353*/].f_116 == 2;
}

int func_280(int iParam0)//Position - 0xCC22
{
	return Global_2421327[iParam0 /*353*/].f_116 == 7;
}

void func_281(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0xCC37
{
	struct<4> Var0;
	struct<4> Var4;
	int iVar8;
	var uVar9;
	
	StringCopy(&Var0, func_292(iParam1), 16);
	StringCopy(&Var4, func_291(iParam2), 16);
	switch (iParam1)
	{
		case 0:
			iVar8 = 1287308202;
			break;
		
		case 1:
			iVar8 = 691372038;
			break;
		
		case 2:
			iVar8 = 1480707108;
			break;
		
		case 3:
			iVar8 = 1512499951;
			break;
		
		case 4:
			iVar8 = 562283735;
			break;
		
		case 5:
			iVar8 = -154732333;
			break;
		
		case 6:
			iVar8 = -1362660491;
			break;
		
		case 7:
			iVar8 = 645708827;
			break;
		
		case 8:
			iVar8 = 767907967;
			break;
		
		case 9:
			iVar8 = -1970151306;
			break;
		
		case 10:
			iVar8 = 718859568;
			break;
		
		case 11:
			iVar8 = -1955564771;
			break;
		
		case 12:
			iVar8 = 892388724;
			break;
	}
	if (func_45())
	{
		func_282(iVar8, iParam0, &uVar9, iParam3, iParam3, 0);
		Global_2572880[uVar9 /*73*/].f_8.f_43 = { Var0 };
		Global_2572880[uVar9 /*73*/].f_8.f_47 = { Var4 };
	}
	else
	{
		networkcash::network_refund_cash(iParam0, &Var0, &Var4, iParam3);
	}
}

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

bool func_283(var uParam0, int iParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7)//Position - 0xD0CB
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	
	iVar0 = false;
	if (!func_45())
	{
		iVar0 = true;
	}
	if (!iVar0)
	{
		if (!unk3::_0xB24F0944DA203D9E(func_183()) || unk3::_0x810E8431C0614BF9())
		{
			Global_2573372 = 1;
			return false;
		}
		if (Global_2452901)
		{
			if (iParam3 == 1067618600 || iParam3 == -1303831698)
			{
				Global_2573373 = 1;
				return false;
			}
		}
	}
	iVar2 = false;
	iVar1 = 0;
	while (iVar1 < 5)
	{
		if (Global_2572880[iVar1 /*73*/].f_2 == 0)
		{
			iVar2 = true;
		}
		iVar1++;
	}
	if (!iVar2)
	{
		return false;
	}
	*uParam0 = 5;
	iVar3 = 2147483647;
	if (iVar0 || unk3::_network_shop_begin_service(&iVar3, iParam3, iParam4, iParam2, iParam5, iParam6))
	{
		if (iVar0 || unk3::_network_shop_checkout_start(iVar3))
		{
			*uParam0 = func_290(iVar3, iParam1, iParam4, iParam2, iParam3, iParam5, 0, iParam6, iParam7);
			if (iVar0)
			{
				if (*uParam0 != -1)
				{
					Global_2572880[*uParam0 /*73*/].f_66 = 1;
				}
			}
			Global_2573362 = 1;
			return true;
		}
	}
	else
	{
		if (iParam7 & 2 != 0)
		{
			Global_2573371 = 1;
			Global_2573374 = iParam4;
			Global_2573376 = iParam3;
			Global_2573377 = 1;
			Global_2573375 = iParam5;
		}
		if (iParam7 & 8 != 0)
		{
			Global_2573374 = iParam4;
			Global_2573376 = iParam3;
			Global_2573377 = 1;
			Global_2573375 = iParam5;
		}
		iVar4 = false;
		if (iVar4)
		{
			func_289(1, iParam4);
			Global_2573371 = 0;
		}
		if (iParam7 & 4 != 0)
		{
			func_284(-1, iParam4, iParam6, iParam5, -1);
		}
	}
	return false;
}

void func_284(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4)//Position - 0xD23F
{
	switch (iParam1)
	{
		case 1704445500:
			gameplay::set_bit(&(Global_2421327[player::player_id() /*353*/].f_123.f_71), 0);
			break;
	}
	if (iParam0 != -1)
	{
		func_285(iParam0);
	}
}

void func_285(int iParam0)//Position - 0xD277
{
	int iVar0;
	
	iVar0 = false;
	if (!func_45())
	{
		iVar0 = true;
	}
	if (iParam0 != -1)
	{
		if (func_288(iParam0))
		{
			if (!iVar0)
			{
				unk_0xFA336E7F40C0A0D0();
			}
		}
		else if (!iVar0)
		{
			unk3::_network_shop_end_service(Global_2572880[iParam0 /*73*/]);
		}
		func_286(&(Global_2572880[iParam0 /*73*/]));
	}
}

void func_286(var uParam0)//Position - 0xD2C9
{
	*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_287(&(uParam0->f_8.f_3));
	func_287(&(uParam0->f_8.f_16));
	StringCopy(&(uParam0->f_8.f_29), "", 32);
	StringCopy(&(uParam0->f_8.f_37), "", 24);
	StringCopy(&(uParam0->f_8.f_43), "", 16);
	StringCopy(&(uParam0->f_8.f_47), "", 16);
	uParam0->f_8.f_51 = 0;
	uParam0->f_8.f_52 = 0;
	uParam0->f_8.f_53 = 0;
	uParam0->f_8.f_54 = 0;
	uParam0->f_8.f_55 = 0;
	uParam0->f_8.f_56 = 0;
	uParam0->f_66 = 0;
	uParam0->f_67 = 0;
	uParam0->f_68 = 0;
	uParam0->f_69 = 0;
	uParam0->f_70 = 0;
	uParam0->f_71 = 0;
	uParam0->f_72 = 0;
}

void func_287(var uParam0)//Position - 0xD3B0
{
	*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_288(int iParam0)//Position - 0xD3F8
{
	if (iParam0 >= 0 && iParam0 < 5)
	{
		return Global_2572880[iParam0 /*73*/].f_5 == 1;
	}
	return false;
}

void func_289(int iParam0, int iParam1)//Position - 0xD420
{
	Global_2454055 = iParam1;
	Global_2454054 = iParam0;
}

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

char* func_291(int iParam0)//Position - 0xD508
{
	switch (iParam0)
	{
		case 0:
			return "NOTREACHTARGET";
			break;
		
		case 1:
			return "TARGET_ESCAPE";
			break;
		
		case 2:
			return "DELIVERY_FAIL";
			break;
		
		case 3:
			return "NOT_USED";
			break;
		
		case 4:
			return "TEAM_QUIT";
			break;
		
		case 5:
			return "SERVER_ERROR";
			break;
		
		case 6:
			return "RECEIVE_LJ_L";
			break;
		
		case 8:
			return "CHALLENGE_PLAYER_LEFT";
			break;
	}
	return "DEFAULT";
}

char* func_292(int iParam0)//Position - 0xD592
{
	switch (iParam0)
	{
		case 0:
			return "BACKUP_VAGOS";
		
		case 1:
			return "BACKUP_LOST";
		
		case 2:
			return "BACKUP_FAMILIES";
		
		case 3:
			return "HIRE_MUGGER";
		
		case 4:
			return "HIRE_MERCENARY";
		
		case 5:
			return "BUY_CARDROPOFF";
		
		case 6:
			return "HELI_PICKUP";
		
		case 7:
			return "BOAT_PICKUP";
		
		case 8:
			return "CLEAR_WANTED";
		
		case 9:
			return "HEAD_2_HEAD";
		
		case 10:
			return "CHALLENGE";
		
		case 11:
			return "SHARE_LAST_JOB";
		
		default:
	}
	return "DEFAULT";
}

void func_293(int iParam0, int iParam1, int iParam2, float fParam3)//Position - 0xD63E
{
	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_1588660[player::player_id() /*532*/].f_201.f_4 = iVar1;
	Global_1588660[player::player_id() /*532*/].f_201.f_3 = (Global_1588660[player::player_id() /*532*/].f_201.f_3 + iVar1);
	if (iParam2 == 1)
	{
		func_294(iVar1, 0);
	}
}

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

int func_295(int iParam0)//Position - 0xD6D2
{
	int iVar0;
	
	iVar0 = 0;
	if (func_297(iParam0) >= 0)
	{
		iVar0 = func_297(iParam0);
	}
	else
	{
		iVar0 = func_296(iParam0);
	}
	return iVar0;
}

int func_296(int iParam0)//Position - 0xD6FC
{
	switch (iParam0)
	{
		case 1:
			return 1000;
			break;
		
		case 10:
			return 5000;
			break;
		
		case 11:
			return 8000;
			break;
		
		case 8:
			return 1000;
			break;
		
		case 0:
			return 500;
			break;
		
		case 9:
			return 250;
			break;
		
		case 13:
			return 1000;
			break;
		
		case 12:
			return 7500;
			break;
		
		case 2:
			return 1000;
			break;
		
		case 14:
			return 500;
			break;
		
		case 20:
			if (player::get_player_wanted_level(player::player_id()) == 1)
			{
				return 200;
			}
			else if (player::get_player_wanted_level(player::player_id()) == 2)
			{
				return 400;
			}
			else if (player::get_player_wanted_level(player::player_id()) == 3)
			{
				return 600;
			}
			else if (player::get_player_wanted_level(player::player_id()) == 4)
			{
				return 800;
			}
			else if (player::get_player_wanted_level(player::player_id()) == 5)
			{
				return 1000;
			}
			break;
		
		case 6:
			return 500;
			break;
		
		case 22:
			return 200;
			break;
		
		case 23:
			return 400;
			break;
		
		case 24:
			return 700;
			break;
		
		case 25:
			return 100;
			break;
		
		case 26:
			return 1000;
			break;
		
		case 35:
			return 5000;
			break;
		
		case 15:
			return 0;
			break;
		
		case 17:
			return 0;
			break;
		
		case 18:
			return 0;
			break;
		
		case 19:
			return 0;
			break;
		
		case 21:
			return 0;
			break;
		
		case 36:
			return 0;
			break;
		
		case 39:
			return 200;
			break;
		
		case 40:
			return 1000;
		
		case 41:
			return 750;
		
		case 42:
			return 0;
	}
	return 0;
}

int func_297(int iParam0)//Position - 0xD8F4
{
	switch (iParam0)
	{
		case 1:
			return Global_262145.f_5461;
			break;
		
		case 10:
			return Global_262145.f_4115;
			break;
		
		case 11:
			return Global_262145.f_4116;
			break;
		
		case 8:
			return Global_262145.f_4113;
			break;
		
		case 0:
			return Global_262145.f_4099;
			break;
		
		case 9:
			return Global_262145.f_4114;
			break;
		
		case 13:
			return Global_262145.f_4118;
			break;
		
		case 12:
			return Global_262145.f_4117;
			break;
		
		case 2:
			return Global_262145.f_4109;
			break;
		
		case 14:
			return Global_262145.f_4119;
			break;
		
		case 20:
			if (player::get_player_wanted_level(player::player_id()) == 1)
			{
				return Global_262145.f_5468;
			}
			else if (player::get_player_wanted_level(player::player_id()) == 2)
			{
				return Global_262145.f_5469;
			}
			else if (player::get_player_wanted_level(player::player_id()) == 3)
			{
				return Global_262145.f_5470;
			}
			else if (player::get_player_wanted_level(player::player_id()) == 4)
			{
				return Global_262145.f_5471;
			}
			else if (player::get_player_wanted_level(player::player_id()) == 5)
			{
				return Global_262145.f_5472;
			}
			break;
		
		case 6:
			return Global_262145.f_4112;
			break;
		
		case 22:
			return Global_262145.f_4125;
			break;
		
		case 23:
			return Global_262145.f_4126;
			break;
		
		case 24:
			return Global_262145.f_4127;
			break;
		
		case 25:
			return Global_262145.f_4128;
			break;
		
		case 26:
			return Global_262145.f_4129;
			break;
		
		case 35:
			return Global_262145.f_6037;
			break;
		
		case 15:
			return Global_262145.f_5462;
			break;
		
		case 17:
			return Global_262145.f_5462;
			break;
		
		case 18:
			return Global_262145.f_5462;
			break;
		
		case 19:
			return Global_262145.f_5462;
			break;
		
		case 21:
			return Global_262145.f_5462;
			break;
		
		case 36:
			return Global_262145.f_6502;
			break;
		
		case 39:
			return -1;
			break;
		
		case 40:
			return Global_262145.f_11304;
			break;
		
		case 41:
			return Global_262145.f_11305;
			break;
		
		case 42:
			return Global_262145.f_11306;
			break;
		
		case 43:
			return Global_262145.f_13311;
			break;
		
		case 44:
			return Global_262145.f_13313;
			break;
	}
	return 0;
}

bool func_298()//Position - 0xDBA8
{
	char* sVar0;
	char* sVar1;
	int iVar2;
	
	if (Local_91.f_50)
	{
		if (!Local_91.f_51)
		{
			if (!gameplay::is_bit_set(Local_91.f_3, 7))
			{
				func_299("HS_UNABLE", iLocal_314, 0, 0, 0, 1, 1, 0);
			}
		}
		return true;
	}
	switch (iLocal_312)
	{
		case 0:
			sVar0 = "MPCT_muglost";
			sVar1 = "LAMAR";
			iVar2 = 19;
			break;
		
		case 1:
			sVar0 = "MPCT_MERloc";
			sVar1 = "FM_MERRYWEATHER";
			iVar2 = 85;
			break;
	}
	if (func_323(sVar0, sVar1, iVar2))
	{
		return true;
	}
	return false;
}

int func_299(char* sParam0, int iParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7)//Position - 0xDC2C
{
	int iVar0;
	int iVar1;
	struct<16> Var2;
	int iVar18;
	int iVar19;
	
	iVar0 = -1;
	iVar1 = player::get_player_team(iParam1);
	if (network::_0x9DE986FC9A87C474(player::player_id(), iParam1) || iParam3)
	{
		if (!iParam2)
		{
			StringCopy(&Var2, player::get_player_name(iParam1), 64);
		}
		else
		{
			StringCopy(&Var2, player::get_player_name(iParam1), 64);
		}
		ui::_set_notification_text_entry(sParam0);
		if ((iVar1 != -1 && network::network_is_activity_session()) && iVar1 < 4)
		{
			if (Global_1626500.f_80279[iVar1] != -1)
			{
				ui::_0x39BBF623FC803EAC(func_322(iVar1, iParam1, 0));
			}
			else
			{
				ui::_0x39BBF623FC803EAC(func_307(iParam1, -2, 1, 0));
			}
		}
		else
		{
			ui::_0x39BBF623FC803EAC(func_307(iParam1, -2, 1, 0));
		}
		ui::add_text_component_substring_player_name(func_305(&Var2));
		if (!iParam4)
		{
			iVar0 = ui::_draw_notification(0, 1);
		}
		else
		{
			Global_2471194 = { func_126(iParam1) };
			if (network::network_clan_player_get_desc(&Global_2471124, 35, &Global_2471194))
			{
				iVar18 = 0;
				if (gameplay::are_strings_equal(&(Global_2471124.f_22), "Leader") && Global_2471124.f_30 == 0)
				{
					iVar18 = 1;
				}
				if (Global_2471124.f_21 > 0)
				{
					iVar19 = 0;
				}
				else
				{
					iVar19 = 1;
				}
				if (iParam6)
				{
					if (iParam7)
					{
						Var2 = { func_304(&Var2) };
					}
					iVar0 = ui::_0x137BC35589E34E1E(iVar19, network::_0x7543BB439F63792B(&Global_2471124, 35), &(Global_2471124.f_17), Global_2471124.f_30, iVar18, 0, Global_2471124, &Var2, Global_1316386, Global_1316387, Global_1316388);
				}
				else
				{
					iVar0 = ui::_0x97C9E4E7024A8F2C(iVar19, network::_0x7543BB439F63792B(&Global_2471124, 35), &(Global_2471124.f_17), Global_2471124.f_30, iVar18, 0, Global_2471124, Global_1316386, Global_1316387, Global_1316388);
				}
			}
			else
			{
				iVar0 = ui::_draw_notification(0, 1);
			}
		}
		func_300(14, sParam0, 1, &Var2, 0, 0, 0, 0, 1, 0, 0, 0);
	}
	return iVar0;
}

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

int func_301(int iParam0)//Position - 0xDEE9
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 <= (Global_1747376 - 1))
	{
		if (iParam0 > Global_1747376.f_5[iVar0 /*53*/].f_1)
		{
			func_302(iVar0);
			return iVar0;
		}
		iVar0++;
	}
	Global_1747376++;
	if (Global_1747376 > 5)
	{
		Global_1747376 = 5;
		return Global_1747376;
	}
	return (Global_1747376 - 1);
}

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

int func_303()//Position - 0xDF84
{
	return dlc2::is_dlc_present(-1762644250);
}

struct<16> func_304(char* sParam0)//Position - 0xDF95
{
	struct<16> Var0;
	
	StringCopy(&Var0, "<C>", 64);
	StringConCat(&Var0, "~HUD_COLOUR_SOCIAL_CLUB~", 64);
	StringConCat(&Var0, sParam0, 64);
	StringConCat(&Var0, "</C>", 64);
	return Var0;
}

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

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

int func_307(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0xDFEE
{
	int iVar0;
	int iVar1;
	
	if (func_129(iParam0))
	{
		if (iParam2)
		{
			return 0;
		}
		else
		{
			return 1;
		}
	}
	if (iParam1 == -2)
	{
		iVar0 = player::get_player_team(iParam0);
		if (iVar0 > -1 && iVar0 < 4)
		{
			if (Global_1626500.f_80279[iVar0] != -1)
			{
				iParam1 = iVar0;
			}
		}
	}
	if (func_129(player::player_id()) || (func_321() && func_320()))
	{
		iVar1 = func_319();
		if (entity::does_entity_exist(iVar1))
		{
			if (ped::is_ped_a_player(iVar1))
			{
				if (network::_network_get_ped_player(iVar1) != -1)
				{
					if (func_6(network::_network_get_ped_player(iVar1), 0, 1))
					{
						if ((iParam1 > -1 && network::network_is_activity_session()) && iParam1 < 4)
						{
							if (Global_1626500.f_80279[iParam1] != -1)
							{
								return func_322(iParam1, iParam0, 0);
							}
							else
							{
								return func_314(iParam0, network::_network_get_ped_player(iVar1), iParam1, iParam2, iParam3);
							}
						}
						else
						{
							return func_314(iParam0, network::_network_get_ped_player(iVar1), iParam1, iParam2, iParam3);
						}
					}
				}
			}
			else if ((iParam1 > -1 && network::network_is_activity_session()) && iParam1 < 4)
			{
				if (Global_1626500.f_80279[iParam1] != -1)
				{
					return func_322(iParam1, iParam0, 0);
				}
				else
				{
					return func_308(0, -1, 0);
				}
			}
			else
			{
				return func_308(0, -1, 0);
			}
		}
	}
	if ((iParam1 > -1 && network::network_is_activity_session()) && iParam1 < 4)
	{
		if (Global_1626500.f_80279[iParam1] != -1)
		{
			return func_322(iParam1, iParam0, 0);
		}
		else
		{
			return func_314(iParam0, player::player_id(), iParam1, iParam2, iParam3);
		}
	}
	return func_314(iParam0, player::player_id(), iParam1, iParam2, iParam3);
}

int func_308(int iParam0, int iParam1, int iParam2)//Position - 0xE1AB
{
	return func_309(player::player_id(), iParam0, iParam1, iParam2);
}

int func_309(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0xE1C1
{
	int iVar0;
	
	iVar0 = player::get_player_team(iParam0);
	if (iParam1)
	{
		if (iParam2 > -1)
		{
			if (func_128(iVar0, iParam2, 0) && !gameplay::is_bit_set(Global_1626500.f_15, 18))
			{
				if (iVar0 == iParam2)
				{
					return func_313(1);
				}
				else
				{
					return func_313(0);
				}
			}
			else if (iParam3)
			{
				return 28;
			}
			else if (gameplay::is_bit_set(Global_1626500.f_4, 20))
			{
				return func_310(iVar0, iParam2, 1);
			}
			else
			{
				return func_310(iVar0, iParam2, 0);
			}
		}
		return 28;
	}
	if (iVar0 == iParam2 || iParam2 == -1)
	{
		return func_313(1);
	}
	return func_313(0);
}

int func_310(int iParam0, int iParam1, int iParam2)//Position - 0xE275
{
	int iVar0;
	
	iVar0 = func_312(iParam0, iParam1);
	if (func_311(Global_1626500.f_83867))
	{
		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_311(int iParam0)//Position - 0xE332
{
	int iVar0;
	
	if (iParam0 == 0)
	{
		return false;
	}
	iVar0 = 0;
	while (iVar0 <= 6)
	{
		if (iParam0 == Global_262145.f_7751[iVar0])
		{
			return true;
		}
		iVar0++;
	}
	return false;
}

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

int func_313(int iParam0)//Position - 0xE3B1
{
	if (iParam0)
	{
		return 118;
	}
	return 116;
}

int func_314(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4)//Position - 0xE3C8
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	if (iParam2 == -2)
	{
		iVar0 = player::get_player_team(iParam0);
	}
	else
	{
		iVar0 = iParam2;
	}
	if (Global_1588660[player::player_id() /*532*/] == 148)
	{
		iVar1 = true;
	}
	iVar2 = iParam0;
	if (iVar2 > -1)
	{
		if (Global_1588660[iVar2 /*532*/] == 148)
		{
			iVar1 = true;
		}
	}
	if (!iVar1)
	{
		if (iVar0 != -1)
		{
			if ((func_160(iParam1, iParam0, iVar0, 0) && !gameplay::is_bit_set(Global_1626500.f_15, 18)) || ((func_128(player::get_player_team(iParam1), player::get_player_team(iParam0), 0) && gameplay::is_bit_set(Global_1626500.f_15, 23)) && !gameplay::is_bit_set(Global_1626500.f_15, 18)))
			{
				return func_313(1);
			}
			else if (gameplay::is_bit_set(Global_1626500.f_15, 26))
			{
				return func_318(1);
			}
			else
			{
				return func_309(iParam1, 1, iVar0, iParam4);
			}
		}
		else if ((Global_1573848 || Global_1573839) || Global_1588660[iParam0 /*532*/] == 0)
		{
			if (iParam0 == iParam1 || (Global_1573848 == 1 && Global_1573858 == 0))
			{
				return func_313(1);
			}
			else
			{
				return func_309(iParam1, 1, iVar0, iParam4);
			}
		}
		if (Global_1573843 && Global_1573418.f_14 == iParam0)
		{
			return 28;
		}
	}
	iVar3 = func_317(iParam0);
	if (!iVar3 == -1)
	{
		return func_315(iVar3);
	}
	if (iParam3)
	{
		return 0;
	}
	return 1;
}

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

var func_316(int iParam0)//Position - 0xE60E
{
	return Global_2415586.f_1946.f_44[iParam0 /*2*/].f_1;
}

int func_317(int iParam0)//Position - 0xE625
{
	if (!iParam0 == func_13())
	{
		if (func_14(iParam0, 1))
		{
			return Global_2415586.f_1946.f_11[func_12(iParam0)];
		}
	}
	return -1;
}

int func_318(int iParam0)//Position - 0xE657
{
	if (iParam0)
	{
		return 119;
	}
	return 116;
}

var func_319()//Position - 0xE66E
{
	return Global_2359301.f_2;
}

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

int func_321()//Position - 0xE68D
{
	return gameplay::is_bit_set(Global_1588660[player::player_id() /*532*/].f_39.f_18, 14);
}

int func_322(int iParam0, int iParam1, int iParam2)//Position - 0xE6AA
{
	int iVar0;
	
	if (Global_1626500.f_80279[iParam0] != -1 && Global_1626500.f_80279[iParam0] <= 4)
	{
		if (Global_1626500.f_80279[iParam0] == 0)
		{
			iVar0 = 15;
		}
		else if (Global_1626500.f_80279[iParam0] == 1)
		{
			iVar0 = 18;
		}
		else if (Global_1626500.f_80279[iParam0] == 2)
		{
			iVar0 = 24;
		}
		else if (Global_1626500.f_80279[iParam0] == 4)
		{
			if (gameplay::is_bit_set(Global_1626500.f_15, 29))
			{
				iVar0 = 21;
			}
			else
			{
				iVar0 = 6;
			}
		}
		else
		{
			iVar0 = Global_1626500.f_80279[iParam0];
		}
	}
	else
	{
		iVar0 = func_309(iParam1, !iParam2, iParam0, 0);
	}
	return iVar0;
}

bool func_323(char* sParam0, char* sParam1, int iParam2)//Position - 0xE76F
{
	if (!gameplay::are_strings_equal(sParam0, "NULL"))
	{
		if (!gameplay::is_bit_set(iLocal_311, 0))
		{
			func_420(&uLocal_331, 3, 0, sParam1, 0, 1);
			if (func_325(&uLocal_331, iParam2, "CT_AUD", sParam0, 0, 0))
			{
				gameplay::set_bit(&iLocal_311, 0);
			}
		}
		else if (!gameplay::is_bit_set(iLocal_311, 1))
		{
			if (func_324(0))
			{
				gameplay::set_bit(&iLocal_311, 1);
			}
		}
		else if (!func_324(0))
		{
			iLocal_311 = 0;
			return true;
		}
	}
	return false;
}

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

int func_325(var uParam0, int iParam1, char* sParam2, char* sParam3, int iParam4, int iParam5)//Position - 0xE846
{
	char* sVar0;
	int iVar1;
	int iVar2;
	
	if (func_418())
	{
		return 0;
	}
	if (func_417())
	{
		return 0;
	}
	sVar0 = 0;
	iVar1 = false;
	iVar2 = -99;
	return func_326(uParam0, iParam1, sParam2, sParam3, 1, iParam5, iParam4, sVar0, iVar1, iVar2, sVar0, sVar0, -1);
}

int func_326(var uParam0, int iParam1, char* sParam2, char* sParam3, int iParam4, int iParam5, int iParam6, char* sParam7, int iParam8, int iParam9, char* sParam10, char* sParam11, int iParam12)//Position - 0xE88B
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	if (gameplay::is_string_null_or_empty(sParam2))
	{
		return 0;
	}
	if (ui::_0x43E4111189E54F0E(sParam2) > 7)
	{
		return 0;
	}
	if (gameplay::is_string_null_or_empty(sParam3))
	{
		return 0;
	}
	if (ui::_0x43E4111189E54F0E(sParam3) > 15)
	{
		return 0;
	}
	iVar0 = gameplay::get_hash_key(script::get_this_script_name());
	iVar1 = func_416(sParam2, sParam3);
	iVar2 = 0;
	if (!gameplay::is_string_null_or_empty(sParam7))
	{
		iVar2 = gameplay::get_hash_key(sParam7);
	}
	if (func_415(iVar0, iVar1, iVar2))
	{
		return 1;
	}
	if (!func_410(iParam6))
	{
		return 0;
	}
	if (func_407(iVar0, iVar1, iVar2))
	{
		if (func_406())
		{
			return 0;
		}
		func_405();
		return func_333(uParam0, iParam1, iParam12, sParam2, sParam3, iParam4, iParam5, iParam6, sParam7, iParam8, iParam9, sParam10, sParam11);
	}
	if (!func_332(iParam4))
	{
		return 0;
	}
	func_327(iVar0, iVar1, iVar2, sParam3, iParam4, iParam5, iParam6);
	return 0;
}

void func_327(int iParam0, int iParam1, int iParam2, char* sParam3, int iParam4, int iParam5, int iParam6)//Position - 0xE970
{
	Global_1336446.f_40.f_1 = iParam0;
	Global_1336446.f_40.f_2 = iParam1;
	Global_1336446.f_40.f_3 = iParam2;
	StringCopy(&(Global_1336446.f_40.f_4), sParam3, 16);
	Global_1336446.f_40.f_8 = iParam4;
	Global_1336446.f_40.f_9 = iParam5;
	Global_1336446.f_40.f_14 = iParam6;
	func_328(iParam4);
	func_405();
	Global_1336446.f_40.f_13 = network::get_time_offset(network::get_network_time(), 7000);
}

void func_328(int iParam0)//Position - 0xE9DD
{
	if (func_331(iParam0))
	{
		func_330();
		return;
	}
	func_329();
}

void func_329()//Position - 0xE9F9
{
	Global_1336446.f_40.f_10 = 0;
}

void func_330()//Position - 0xEA0A
{
	Global_1336446.f_40.f_10 = 1;
}

bool func_331(int iParam0)//Position - 0xEA1B
{
	switch (iParam0)
	{
		case 4:
		case 5:
			return true;
		
		case 0:
		case 1:
		case 7:
		case 8:
		case 2:
		case 3:
			return false;
		
		default:
	}
	return false;
}

int func_332(int iParam0)//Position - 0xEA63
{
	return iParam0 > Global_1336446.f_40.f_8;
}

int func_333(var uParam0, int iParam1, var uParam2, char* sParam3, char* sParam4, int iParam5, int iParam6, int iParam7, char* sParam8, int iParam9, int iParam10, char* sParam11, char* sParam12)//Position - 0xEA76
{
	struct<2> Var0;
	
	func_404();
	if (iParam6 == 5)
	{
		iParam6 = 0;
	}
	if (iParam5 == 8)
	{
		return func_401(uParam0, sParam3, sParam4);
	}
	if (iParam5 == 4)
	{
		StringCopy(&Var0, "CELL_226", 16);
		return func_398(uParam0, iParam1, sParam3, sParam4, &Var0);
	}
	if (iParam5 == 1 || iParam5 == 7)
	{
		if (iParam6 == 2)
		{
			return func_401(uParam0, sParam3, sParam4);
		}
		return func_381(uParam0, iParam1, sParam3, sParam4, iParam7);
	}
	if (iParam5 == 5)
	{
		return func_380(iParam1, uParam2, sParam4, iParam7, sParam8, iParam9, iParam10, sParam11, sParam12);
	}
	if (iParam5 == 2)
	{
		return func_370(iParam1, uParam2, sParam4, iParam7, sParam8, iParam9, iParam10, sParam11, sParam12);
	}
	if (iParam5 == 3)
	{
		return func_369(iParam1, uParam2, sParam4, iParam7, sParam8, iParam9, iParam10, sParam11, sParam12);
	}
	if (iParam5 == 6)
	{
		return func_334(iParam1, uParam2, sParam4, iParam7, sParam8, iParam9, iParam10, sParam11, sParam12);
	}
	return 0;
}

bool func_334(int iParam0, var uParam1, char* sParam2, int iParam3, char* sParam4, int iParam5, int iParam6, char* sParam7, char* sParam8)//Position - 0xEB70
{
	int iVar0;
	
	func_368();
	iVar0 = true;
	if (func_336(iParam0, uParam1, sParam2, iVar0, iParam3, sParam4, iParam5, iParam6, sParam7, sParam8))
	{
		func_335(120000);
		return true;
	}
	return false;
}

void func_335(int iParam0)//Position - 0xEBA7
{
	Global_1336446.f_40.f_11 = network::get_time_offset(network::get_network_time(), iParam0);
	Global_1336446.f_40.f_12 = 1;
}

bool func_336(int iParam0, var uParam1, char* sParam2, int iParam3, int iParam4, char* sParam5, int iParam6, int iParam7, char* sParam8, char* sParam9)//Position - 0xEBCA
{
	int iVar0;
	int iVar1;
	char* sVar2;
	int iVar3;
	char* sVar4;
	var uVar5;
	int iVar6;
	int iVar7;
	int iVar8;
	int iVar9;
	int iVar10;
	int iVar11;
	int iVar12;
	
	iVar0 = func_13();
	iVar1 = 0;
	if (iParam0 == 145)
	{
		iVar0 = uParam1;
		sVar2 = player::get_player_name(iVar0);
		iVar1 = func_362(iVar0);
		if (iVar1 == 0)
		{
			if (network::is_time_less_than(network::get_network_time(), Global_1336446.f_40.f_13))
			{
				return false;
			}
		}
	}
	else
	{
		sVar2 = "";
	}
	iVar3 = 0;
	sVar4 = func_361(sParam5, iParam6, &iVar3);
	uVar5 = func_359(iParam7, &iVar3);
	iVar6 = 0;
	if (!gameplay::is_string_null_or_empty(sParam8))
	{
		iVar6++;
		if (!gameplay::is_string_null_or_empty(sParam9))
		{
			iVar6++;
		}
	}
	if (gameplay::are_strings_equal(sVar4, " "))
	{
		sVar4 = "";
	}
	iVar7 = true;
	iVar8 = 0;
	iVar9 = 0;
	iVar10 = 1;
	iVar11 = 0;
	if (iParam3)
	{
		iVar9 = 1;
		iVar10 = 2;
		iVar11 = 1;
		if (gameplay::is_bit_set(iParam4, 1))
		{
			iVar8 = 1;
		}
	}
	if (gameplay::is_bit_set(iParam4, 2))
	{
		iVar10 = 2;
	}
	iVar12 = false;
	if (!iVar3 == 0 || !gameplay::is_string_null_or_empty(sVar2))
	{
		iVar12 = func_358(iParam0, sParam2, iVar10, sVar4, uVar5, sVar2, iVar3, iVar11, 1, iVar9, 0, iVar7, iVar8, 0, iVar6, sParam8, sParam9);
	}
	else
	{
		iVar12 = func_340(iParam0, sParam2, iVar10, iVar11, 1, iVar9, 0, iVar7, iVar8, 0);
	}
	if (!iVar12)
	{
		return false;
	}
	if (gameplay::is_bit_set(iParam4, 0))
	{
		func_339();
	}
	func_368();
	func_338();
	func_337();
	return true;
}

void func_337()//Position - 0xED1C
{
	Global_1336446.f_57 = 0;
	Global_1336446.f_57.f_1 = 0;
}

void func_338()//Position - 0xED34
{
	Global_1336446.f_40 = 3;
}

void func_339()//Position - 0xED43
{
	gameplay::set_bit(&Global_2313, 8);
}

bool func_340(int iParam0, char* sParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8, int iParam9)//Position - 0xED54
{
	int iVar0;
	char* sVar1;
	int iVar2;
	char* sVar3;
	int iVar4;
	char* sVar5;
	char* sVar6;
	int iVar7;
	
	iVar0 = 0;
	sVar1 = "NULL";
	iVar2 = -99;
	sVar3 = "NULL";
	iVar4 = 0;
	sVar5 = "NULL";
	sVar6 = "NULL";
	iVar7 = 3;
	if (func_341(iParam0, sParam1, iParam2, iVar0, sVar1, sVar3, iVar2, iParam3, iParam4, iParam5, iParam7, iParam8, iParam9, iVar4, sVar5, sVar6, iVar7) == 1)
	{
		if (iParam7 == 1)
		{
			Global_3020 = iParam6;
			gameplay::set_bit(&Global_2577921, 0);
		}
		return true;
	}
	return false;
}

bool func_341(var uParam0, char* sParam1, int iParam2, int iParam3, char* sParam4, char* sParam5, int iParam6, int iParam7, var uParam8, var uParam9, int iParam10, var uParam11, var uParam12, int iParam13, char* sParam14, char* sParam15, int iParam16)//Position - 0xEDC0
{
	int iVar0;
	
	if (iParam13 > 99)
	{
	}
	if (gameplay::are_strings_equal(sParam14, sParam15))
	{
	}
	func_352();
	iVar0 = 0;
	switch (iParam16)
	{
		case 0:
			if (Global_14443 == 0)
			{
				iVar0 = 0;
			}
			else
			{
				iVar0 = 1;
			}
			break;
		
		case 2:
			if (Global_14443 == 2)
			{
				iVar0 = 0;
			}
			else
			{
				iVar0 = 1;
			}
			break;
		
		case 1:
			if (Global_14443 == 1)
			{
				iVar0 = 0;
			}
			else
			{
				iVar0 = 1;
			}
			break;
		
		default:
			iVar0 = 0;
			break;
	}
	if (iVar0 == 0)
	{
		if (player::is_player_playing(player::player_id()))
		{
			if (ped::is_ped_swimming_under_water(player::player_ped_id()))
			{
				return false;
			}
		}
		if (Global_2577906 == 1)
		{
			return false;
		}
		if (script::_get_number_of_instances_of_streamed_script(joaat("appemail")) > 0)
		{
			return false;
		}
		if (script::_get_number_of_instances_of_streamed_script(joaat("appmpemail")) > 0)
		{
			return false;
		}
	}
	if (func_351() == 0)
	{
		func_349();
		return false;
	}
	func_348(Global_2577905);
	StringCopy(&(Global_2576656[Global_2577905 /*104*/]), sParam1, 64);
	Global_2576656[Global_2577905 /*104*/].f_17 = uParam0;
	if (iParam2 == 0)
	{
	}
	else
	{
		Global_2576656[Global_2577905 /*104*/].f_24 = iParam2;
	}
	Global_2576656[Global_2577905 /*104*/].f_25 = iParam7;
	Global_2576656[Global_2577905 /*104*/].f_26 = uParam8;
	Global_2576656[Global_2577905 /*104*/].f_29 = uParam9;
	Global_2576656[Global_2577905 /*104*/].f_30 = uParam12;
	Global_2576656[Global_2577905 /*104*/].f_31 = uParam11;
	Global_2576656[Global_2577905 /*104*/].f_28 = 0;
	Global_2576656[Global_2577905 /*104*/].f_32 = iParam3;
	StringCopy(&(Global_2576656[Global_2577905 /*104*/].f_33), sParam4, 64);
	Global_2576656[Global_2577905 /*104*/].f_49 = iParam6;
	StringCopy(&(Global_2576656[Global_2577905 /*104*/].f_50), sParam5, 64);
	Global_2576656[Global_2577905 /*104*/].f_66 = iParam13;
	StringCopy(&(Global_2576656[Global_2577905 /*104*/].f_67), sParam14, 64);
	StringCopy(&(Global_2576656[Global_2577905 /*104*/].f_83), sParam15, 64);
	func_352();
	switch (iParam16)
	{
		case 3:
			Global_2576656[Global_2577905 /*104*/].f_99[Global_14443] = 1;
			break;
		
		case 0:
			Global_2576656[Global_2577905 /*104*/].f_99[0] = 1;
			break;
		
		case 2:
			Global_2576656[Global_2577905 /*104*/].f_99[2] = 1;
			break;
		
		case 1:
			Global_2576656[Global_2577905 /*104*/].f_99[1] = 1;
			break;
	}
	if (iParam16 == 3)
	{
		switch (Global_14443)
		{
			case 0:
				func_347(0);
				break;
			
			case 1:
				func_347(1);
				break;
			
			case 2:
				func_347(2);
				break;
			
			case 3:
				func_347(3);
				break;
			
			default:
				break;
			}
	}
	if (iParam7 == 1)
	{
		switch (iParam16)
		{
			case 3:
				Global_2577906 = 1;
				break;
			
			case 0:
				Global_2577906 = 1;
				break;
			
			case 2:
				Global_2577906 = 1;
				break;
			
			case 1:
				Global_2577906 = 1;
				break;
			}
	}
	Global_16814[Global_2577905] = 0;
	if (iParam10)
	{
		func_352();
		if (Global_14386)
		{
			StringCopy(&Global_14432, "Phone_SoundSet_Prologue", 24);
		}
		else
		{
			switch (Global_14443)
			{
				case 0:
					StringCopy(&Global_14432, "Phone_SoundSet_Michael", 24);
					break;
				
				case 2:
					StringCopy(&Global_14432, "Phone_SoundSet_Trevor", 24);
					break;
				
				case 1:
					StringCopy(&Global_14432, "Phone_SoundSet_Franklin", 24);
					break;
				
				default:
					StringCopy(&Global_14432, "Phone_SoundSet_Default", 24);
					break;
				}
		}
		if (!Global_3118[Global_14443 /*2811*/][0 /*281*/].f_259 == 1)
		{
			if (!func_346())
			{
				audio::play_sound_frontend(-1, "Text_Arrive_Tone", &Global_14432, 1);
			}
		}
	}
	if (!Global_14605)
	{
		if (Global_14443.f_1 == 6)
		{
			func_345(Global_14424, "SET_DATA_SLOT_EMPTY", 1f, -1082130432, -1082130432, -1082130432, -1082130432);
			func_342(1);
			func_345(Global_14424, "DISPLAY_VIEW", 1f, system::to_float(Global_14423), -1082130432, -1082130432, -1082130432);
		}
	}
	return true;
}

void func_342(int iParam0)//Position - 0xF183
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	int iVar6;
	int iVar7;
	int iVar8;
	int iVar9;
	
	Global_16813 = 0;
	Global_2918 = iParam0;
	iVar0 = 0;
	while (iVar0 < 9)
	{
		Global_2882[iVar0] = 0;
		iVar0++;
	}
	iVar0 = 0;
	while (iVar0 < 9)
	{
		iVar1 = 0;
		if (func_243(14))
		{
			while (iVar1 < 34)
			{
				if (iParam0 == Global_2320[iVar1 /*15*/].f_11)
				{
					if (iVar0 == Global_2320[iVar1 /*15*/].f_4)
					{
						if (Global_2882[iVar0] == 0)
						{
							Global_2846[iVar0] = iVar1;
							if (iVar1 == 3)
							{
								if (gameplay::is_bit_set(Global_2314, 3))
								{
									iVar2 = 42;
									Global_14608 = 1;
								}
								else
								{
									iVar2 = 255;
									Global_14608 = 0;
								}
								graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
								graphics::_push_scaleform_movie_function_parameter_int(1);
								graphics::_push_scaleform_movie_function_parameter_int(iVar0);
								graphics::_push_scaleform_movie_function_parameter_int(Global_2320[iVar1 /*15*/].f_10);
								graphics::_push_scaleform_movie_function_parameter_int(0);
								func_344(&(Global_2320[iVar1 /*15*/]));
								graphics::_push_scaleform_movie_function_parameter_int(iVar2);
								graphics::_pop_scaleform_movie_function_void();
							}
							if (Global_2451773)
							{
								if (iVar1 == 14)
								{
									func_343(Global_14424, "SET_DATA_SLOT", system::to_float(1), system::to_float(iVar0), system::to_float(Global_2320[iVar1 /*15*/].f_10), system::to_float(Global_16808), -1f, &(Global_2320[iVar1 /*15*/]), 0, 0, 0, 0);
								}
							}
							Global_2882[iVar0] = 1;
						}
					}
				}
				iVar1++;
			}
		}
		else
		{
			while (iVar1 < 34)
			{
				if (iParam0 == Global_2320[iVar1 /*15*/].f_11)
				{
					if (iVar0 == Global_2320[iVar1 /*15*/].f_4)
					{
						if (Global_2882[iVar0] == 0)
						{
							Global_2846[iVar0] = iVar1;
							if (iVar1 == 1)
							{
								iVar3 = 0;
								while (iVar3 < 35)
								{
									if (Global_101553.f_12996[iVar3 /*104*/].f_24 != 0)
									{
										if (Global_101553.f_12996[iVar3 /*104*/].f_28 == 0)
										{
											if (Global_101553.f_12996[iVar3 /*104*/].f_99[Global_14443] == 1)
											{
												Global_16813++;
											}
										}
									}
									iVar3++;
								}
								func_343(Global_14424, "SET_DATA_SLOT", system::to_float(1), system::to_float(iVar0), system::to_float(Global_2320[iVar1 /*15*/].f_10), system::to_float(Global_16813), -1f, &(Global_2320[iVar1 /*15*/]), 0, 0, 0, 0);
							}
							else if (iVar1 == 7)
							{
								if (Global_69617)
								{
									iVar4 = 0;
									iVar4 = Global_2576655;
									iVar5 = 0;
									while (iVar5 < 12)
									{
										if (Global_2576656[iVar5 /*104*/].f_24 != 0)
										{
											if (Global_2576656[iVar5 /*104*/].f_28 == 0)
											{
												if (Global_2576656[iVar5 /*104*/].f_99[Global_14443] == 1)
												{
													iVar4++;
												}
											}
										}
										iVar5++;
									}
									func_343(Global_14424, "SET_DATA_SLOT", system::to_float(1), system::to_float(iVar0), system::to_float(Global_2320[iVar1 /*15*/].f_10), system::to_float(iVar4), -1f, &(Global_2320[iVar1 /*15*/]), 0, 0, 0, 0);
								}
								else
								{
									switch (Global_14443)
									{
										case 0:
											iVar6 = Global_36911;
											break;
										
										case 1:
											iVar6 = Global_36912;
											break;
										
										case 2:
											iVar6 = Global_36913;
											break;
										
										default:
											break;
									}
									func_343(Global_14424, "SET_DATA_SLOT", system::to_float(1), system::to_float(iVar0), system::to_float(Global_2320[iVar1 /*15*/].f_10), system::to_float(iVar6), -1f, &(Global_2320[iVar1 /*15*/]), 0, 0, 0, 0);
								}
							}
							else if (iVar1 == 14)
							{
								func_343(Global_14424, "SET_DATA_SLOT", system::to_float(1), system::to_float(iVar0), system::to_float(Global_2320[iVar1 /*15*/].f_10), system::to_float(Global_16808), -1f, &(Global_2320[iVar1 /*15*/]), 0, 0, 0, 0);
							}
							else if (iVar1 == 20)
							{
								graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
								graphics::_push_scaleform_movie_function_parameter_int(1);
								graphics::_push_scaleform_movie_function_parameter_int(iVar0);
								graphics::_push_scaleform_movie_function_parameter_int(Global_2320[iVar1 /*15*/].f_10);
								graphics::_push_scaleform_movie_function_parameter_int(0);
								func_344(&(Global_2320[iVar1 /*15*/]));
								graphics::_push_scaleform_movie_function_parameter_int(Global_2319);
								graphics::_pop_scaleform_movie_function_void();
							}
							else if (iVar1 == 2)
							{
								if (gameplay::is_bit_set(Global_2314, 6))
								{
									iVar7 = 42;
								}
								else
								{
									iVar7 = 255;
								}
								graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
								graphics::_push_scaleform_movie_function_parameter_int(1);
								graphics::_push_scaleform_movie_function_parameter_int(iVar0);
								graphics::_push_scaleform_movie_function_parameter_int(Global_2320[iVar1 /*15*/].f_10);
								graphics::_push_scaleform_movie_function_parameter_int(0);
								func_344(&(Global_2320[iVar1 /*15*/]));
								graphics::_push_scaleform_movie_function_parameter_int(iVar7);
								graphics::_pop_scaleform_movie_function_void();
							}
							else if (iVar1 == 3)
							{
								if (gameplay::is_bit_set(Global_2314, 3))
								{
									iVar8 = 42;
									Global_14608 = 1;
								}
								else
								{
									iVar8 = 255;
									Global_14608 = 0;
								}
								graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
								graphics::_push_scaleform_movie_function_parameter_int(1);
								graphics::_push_scaleform_movie_function_parameter_int(iVar0);
								graphics::_push_scaleform_movie_function_parameter_int(Global_2320[iVar1 /*15*/].f_10);
								graphics::_push_scaleform_movie_function_parameter_int(0);
								func_344(&(Global_2320[iVar1 /*15*/]));
								graphics::_push_scaleform_movie_function_parameter_int(iVar8);
								graphics::_pop_scaleform_movie_function_void();
							}
							else if (iVar1 == 8)
							{
								graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
								graphics::_push_scaleform_movie_function_parameter_int(1);
								graphics::_push_scaleform_movie_function_parameter_int(iVar0);
								graphics::_push_scaleform_movie_function_parameter_int(Global_2320[iVar1 /*15*/].f_10);
								graphics::_push_scaleform_movie_function_parameter_int(0);
								func_344(&(Global_2320[iVar1 /*15*/]));
								graphics::_push_scaleform_movie_function_parameter_int(42);
								graphics::_pop_scaleform_movie_function_void();
							}
							else if ((iVar1 == 23 && gameplay::are_strings_equal(&(Global_2320[iVar1 /*15*/]), "CELL_BENWEB")) && gameplay::is_bit_set(Global_2314, 6))
							{
								graphics::_push_scaleform_movie_function(Global_14424, "SET_DATA_SLOT");
								graphics::_push_scaleform_movie_function_parameter_int(1);
								graphics::_push_scaleform_movie_function_parameter_int(iVar0);
								graphics::_push_scaleform_movie_function_parameter_int(Global_2320[iVar1 /*15*/].f_10);
								graphics::_push_scaleform_movie_function_parameter_int(0);
								func_344(&(Global_2320[iVar1 /*15*/]));
								graphics::_push_scaleform_movie_function_parameter_int(42);
								graphics::_pop_scaleform_movie_function_void();
							}
							else if (Global_2320[iVar1 /*15*/].f_10 == 57 && iVar1 == 23)
							{
								iVar9 = 0;
								iVar9 = Global_1613316.f_1;
								func_343(Global_14424, "SET_DATA_SLOT", system::to_float(1), system::to_float(iVar0), system::to_float(Global_2320[iVar1 /*15*/].f_10), system::to_float(iVar9), -1f, &(Global_2320[iVar1 /*15*/]), 0, 0, 0, 0);
							}
							else
							{
								func_343(Global_14424, "SET_DATA_SLOT", system::to_float(1), system::to_float(iVar0), system::to_float(Global_2320[iVar1 /*15*/].f_10), system::to_float(0), -1f, &(Global_2320[iVar1 /*15*/]), 0, 0, 0, 0);
							}
							Global_2882[iVar0] = 1;
						}
					}
				}
				iVar1++;
			}
		}
		iVar0++;
	}
}

void func_343(int iParam0, char* sParam1, float fParam2, float fParam3, float fParam4, float fParam5, float fParam6, char* sParam7, char* sParam8, char* sParam9, char* sParam10, char* sParam11)//Position - 0xF729
{
	graphics::_push_scaleform_movie_function(iParam0, sParam1);
	graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam2));
	if (fParam3 != -1f)
	{
		graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam3));
	}
	if (fParam4 != -1f)
	{
		graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam4));
	}
	if (fParam5 != -1f)
	{
		graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam5));
	}
	if (fParam6 != -1f)
	{
		graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam6));
	}
	if (!gameplay::is_string_null_or_empty(sParam7))
	{
		func_344(sParam7);
	}
	if (!gameplay::is_string_null_or_empty(sParam8))
	{
		func_344(sParam8);
	}
	if (!gameplay::is_string_null_or_empty(sParam9))
	{
		func_344(sParam9);
	}
	if (!gameplay::is_string_null_or_empty(sParam10))
	{
		func_344(sParam10);
	}
	if (!gameplay::is_string_null_or_empty(sParam11))
	{
		func_344(sParam11);
	}
	graphics::_pop_scaleform_movie_function_void();
}

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

void func_345(int iParam0, char* sParam1, float fParam2, float fParam3, float fParam4, float fParam5, float fParam6)//Position - 0xF7EE
{
	graphics::_push_scaleform_movie_function(iParam0, sParam1);
	graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam2));
	if (fParam3 != -1f)
	{
		graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam3));
	}
	if (fParam4 != -1f)
	{
		graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam4));
	}
	if (fParam5 != -1f)
	{
		graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam5));
	}
	if (fParam6 != -1f)
	{
		graphics::_push_scaleform_movie_function_parameter_int(system::round(fParam6));
	}
	graphics::_pop_scaleform_movie_function_void();
}

var func_346()//Position - 0xF851
{
	return Global_1315229;
}

void func_347(int iParam0)//Position - 0xF85D
{
	var uVar0;
	var uVar1;
	
	uVar0 = Global_101553.f_12906[iParam0 /*20*/].f_8;
	uVar0 = uVar0;
	uVar1 = uVar1;
}

void func_348(var uParam0)//Position - 0xF87C
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	var uVar4;
	int iVar5;
	
	iVar0 = time::get_clock_seconds();
	iVar1 = time::get_clock_minutes();
	iVar2 = time::get_clock_hours();
	iVar3 = time::get_clock_day_of_month();
	uVar4 = time::get_clock_month() + 1;
	iVar5 = time::get_clock_year();
	Global_2576656[uParam0 /*104*/].f_18 = iVar0;
	Global_2576656[uParam0 /*104*/].f_18.f_1 = iVar1;
	Global_2576656[uParam0 /*104*/].f_18.f_2 = iVar2;
	Global_2576656[uParam0 /*104*/].f_18.f_3 = iVar3;
	Global_2576656[uParam0 /*104*/].f_18.f_4 = uVar4;
	Global_2576656[uParam0 /*104*/].f_18.f_5 = iVar5;
}

void func_349()//Position - 0xF8FC
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	iVar0 = 0;
	iVar1 = 10;
	iVar2 = iVar0;
	Global_2577905 = 11;
	Global_2576656[Global_2577905 /*104*/].f_18 = -1;
	Global_2576656[Global_2577905 /*104*/].f_18.f_1 = 0;
	Global_2576656[Global_2577905 /*104*/].f_18.f_2 = 0;
	Global_2576656[Global_2577905 /*104*/].f_18.f_3 = 0;
	Global_2576656[Global_2577905 /*104*/].f_18.f_5 = 99999;
	while (iVar2 < iVar1)
	{
		if (!func_350(Global_2576656[iVar2 /*104*/].f_18, Global_2576656[Global_2577905 /*104*/].f_18))
		{
			Global_2577905 = iVar2;
		}
		iVar2++;
	}
	Global_2576656[Global_2577905 /*104*/].f_24 = 1;
}

bool func_350(struct<6> Param0, struct<6> Param6)//Position - 0xF9A6
{
	struct<4> Var0;
	struct<4> Var6;
	int iVar12;
	int iVar13;
	
	if (Param0.f_5 < Param6.f_5)
	{
		return false;
	}
	if (Param0.f_5 > Param6.f_5)
	{
		return true;
	}
	if (Param0.f_5 == Param6.f_5)
	{
		if (Param0.f_4 < Param6.f_4)
		{
			return false;
		}
		if (Param0.f_4 > Param6.f_4)
		{
			return true;
		}
		if (Param0.f_4 == Param6.f_4)
		{
			Var0 = Param0;
			Var0.f_1 = Param0.f_1 * 60;
			Var0.f_2 = Param0.f_2 * 3600;
			Var0.f_3 = (Param0.f_3 * 86400);
			iVar12 = (((Var0 + Var0.f_1) + Var0.f_2) + Var0.f_3);
			Var6 = Param6;
			Var6.f_1 = Param6.f_1 * 60;
			Var6.f_2 = Param6.f_2 * 3600;
			Var6.f_3 = (Param6.f_3 * 86400);
			iVar13 = (((Var6 + Var6.f_1) + Var6.f_2) + Var6.f_3);
			if (iVar12 > iVar13 || iVar12 == iVar13)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
	}
	return false;
}

bool func_351()//Position - 0xFA91
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	iVar0 = 0;
	iVar1 = 10;
	iVar2 = iVar0;
	while (iVar2 < iVar1)
	{
		if (Global_2576656[iVar2 /*104*/].f_24 == 0)
		{
			Global_2577905 = iVar2;
			return true;
		}
		iVar2++;
	}
	iVar2 = iVar0;
	Global_2577905 = 11;
	Global_2576656[Global_2577905 /*104*/].f_18 = -1;
	Global_2576656[Global_2577905 /*104*/].f_18.f_1 = 0;
	Global_2576656[Global_2577905 /*104*/].f_18.f_2 = 0;
	Global_2576656[Global_2577905 /*104*/].f_18.f_3 = 0;
	Global_2576656[Global_2577905 /*104*/].f_18.f_5 = 99999;
	while (iVar2 < iVar1)
	{
		if (Global_2576656[iVar2 /*104*/].f_24 == 0 || Global_2576656[iVar2 /*104*/].f_24 == 1)
		{
			if (!func_350(Global_2576656[iVar2 /*104*/].f_18, Global_2576656[Global_2577905 /*104*/].f_18))
			{
				Global_2577905 = iVar2;
			}
		}
		iVar2++;
	}
	if (Global_2577905 == 11)
	{
		return false;
	}
	Global_2576656[Global_2577905 /*104*/].f_99[0] = 0;
	Global_2576656[Global_2577905 /*104*/].f_99[1] = 0;
	Global_2576656[Global_2577905 /*104*/].f_99[2] = 0;
	return true;
}

void func_352()//Position - 0xFBBC
{
	if (func_243(14))
	{
		if (!entity::is_entity_dead(player::player_ped_id(), 0))
		{
			if (entity::get_entity_model(player::player_ped_id()) == Global_101553.f_32740[0 /*29*/])
			{
				Global_14443 = 0;
			}
			else if (entity::get_entity_model(player::player_ped_id()) == Global_101553.f_32740[1 /*29*/])
			{
				Global_14443 = 1;
			}
			else if (entity::get_entity_model(player::player_ped_id()) == Global_101553.f_32740[2 /*29*/])
			{
				Global_14443 = 2;
			}
			else
			{
				Global_14443 = 0;
			}
		}
	}
	else
	{
		Global_14443 = func_353();
		if (Global_14443 == 145)
		{
			Global_14443 = 3;
		}
		if (Global_69617)
		{
			Global_14443 = 3;
		}
		if (Global_14443 > 3)
		{
			Global_14443 = 3;
		}
	}
}

var func_353()//Position - 0xFC5E
{
	func_354();
	return Global_101553.f_1991.f_539.f_3549;
}

void func_354()//Position - 0xFC77
{
	int iVar0;
	
	if (entity::does_entity_exist(player::player_ped_id()))
	{
		if (func_357(Global_101553.f_1991.f_539.f_3549) != entity::get_entity_model(player::player_ped_id()))
		{
			iVar0 = func_356(player::player_ped_id());
			if (func_355(iVar0) && (!func_243(14) || Global_100505))
			{
				if (Global_101553.f_1991.f_539.f_3549 != iVar0 && func_355(Global_101553.f_1991.f_539.f_3549))
				{
					Global_101553.f_1991.f_539.f_3550 = Global_101553.f_1991.f_539.f_3549;
				}
				Global_101553.f_1991.f_539.f_3551 = iVar0;
				Global_101553.f_1991.f_539.f_3549 = iVar0;
				return;
			}
		}
		else
		{
			if (Global_101553.f_1991.f_539.f_3549 != 145)
			{
				Global_101553.f_1991.f_539.f_3551 = Global_101553.f_1991.f_539.f_3549;
			}
			return;
		}
	}
	Global_101553.f_1991.f_539.f_3549 = 145;
}

int func_355(int iParam0)//Position - 0xFD74
{
	return iParam0 < 3;
}

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

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

bool func_358(int iParam0, char* sParam1, int iParam2, char* sParam3, var uParam4, char* sParam5, int iParam6, int iParam7, int iParam8, int iParam9, int iParam10, int iParam11, int iParam12, int iParam13, int iParam14, char* sParam15, char* sParam16)//Position - 0xFDE7
{
	int iVar0;
	
	switch (iParam14)
	{
		case 0:
			sParam15 = "NULL";
			sParam16 = "NULL";
			break;
		
		case 1:
			sParam16 = "NULL";
			break;
		
		case 2:
			break;
		
		default:
			break;
	}
	iVar0 = 3;
	if (func_341(iParam0, sParam1, iParam2, iParam6, sParam3, sParam5, uParam4, iParam7, iParam8, iParam9, iParam11, iParam12, iParam13, iParam14, sParam15, sParam16, iVar0) == 1)
	{
		if (iParam11 == 1)
		{
			Global_3020 = iParam10;
			gameplay::set_bit(&Global_2577921, 0);
		}
		return true;
	}
	return false;
}

int func_359(int iParam0, int iParam1)//Position - 0xFE69
{
	if (iParam0 == -99)
	{
		return -99;
	}
	func_360(2, iParam1);
	return iParam0;
}

void func_360(int iParam0, var uParam1)//Position - 0xFE88
{
	int iVar0;
	int iVar1;
	
	if (iParam0 == 0)
	{
		return;
	}
	iVar0 = false;
	iVar1 = false;
	switch (iParam0)
	{
		case 1:
			iVar0 = true;
			break;
		
		case 2:
			iVar1 = true;
			break;
		
		default:
			return;
	}
	if (iVar0)
	{
		switch (*uParam1)
		{
			case 1:
			case 3:
				break;
			
			case 0:
				*uParam1 = 1;
				break;
			
			case 2:
				*uParam1 = 3;
				break;
			
			default:
				return;
		}
		return;
	}
	if (iVar1)
	{
		switch (*uParam1)
		{
			case 2:
			case 3:
				break;
			
			case 0:
				*uParam1 = 2;
				break;
			
			case 1:
				*uParam1 = 3;
				break;
			
			default:
				return;
		}
		return;
	}
}

char* func_361(char* sParam0, int iParam1, int iParam2)//Position - 0xFF39
{
	if (gameplay::is_string_null_or_empty(sParam0))
	{
		return sLocal_20;
	}
	if (gameplay::are_strings_equal(sParam0, sLocal_20))
	{
		return sLocal_20;
	}
	func_360(1, iParam2);
	if (iParam1)
	{
		return sParam0;
	}
	return ui::_get_label_text(sParam0);
}

int func_362(int iParam0)//Position - 0xFF76
{
	int iVar0;
	
	iVar0 = func_365(iParam0);
	if (iVar0 == -1)
	{
		func_363(iParam0, 1);
		return 0;
	}
	Global_1353135[iVar0 /*5*/].f_4 = 1;
	return Global_1353135[iVar0 /*5*/].f_2;
}

void func_363(int iParam0, int iParam1)//Position - 0xFFAC
{
	if (!func_6(iParam0, 0, 1))
	{
		return;
	}
	if (func_365(iParam0) != -1)
	{
		return;
	}
	if (Global_1353298)
	{
		if (iParam0 == Global_1353298.f_1)
		{
			return;
		}
	}
	if (func_364(iParam0))
	{
		return;
	}
	if (Global_1353336 >= 32)
	{
		return;
	}
	Global_1353303[Global_1353336] = iParam0;
	Global_1353336++;
	if (iParam1)
	{
	}
}

bool func_364(int iParam0)//Position - 0x1001C
{
	int iVar0;
	
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < Global_1353336)
	{
		if (Global_1353303[iVar0] == iParam0)
		{
			return true;
		}
		iVar0++;
	}
	return false;
}

int func_365(int iParam0)//Position - 0x1004E
{
	int iVar0;
	
	if (!func_6(iParam0, 0, 1))
	{
		return -1;
	}
	if (Global_1353296 == 0)
	{
		return -1;
	}
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < Global_1353296)
	{
		if (Global_1353135[iVar0 /*5*/].f_1 == iParam0)
		{
			if (ped::is_pedheadshot_valid(Global_1353135[iVar0 /*5*/].f_2) && ped::is_pedheadshot_ready(Global_1353135[iVar0 /*5*/].f_2))
			{
				return iVar0;
			}
			func_366(iVar0);
			return -1;
		}
		iVar0++;
	}
	return -1;
}

void func_366(int iParam0)//Position - 0x100CD
{
	char cVar0[64];
	char cVar16[64];
	int iVar32;
	int iVar33;
	
	if (iParam0 >= Global_1353296)
	{
		return;
	}
	if (ped::is_pedheadshot_valid(Global_1353135[iParam0 /*5*/].f_2))
	{
		StringCopy(&cVar0, "CHAR_DEFAULT", 64);
		if (Global_1353135[iParam0 /*5*/].f_2 != 0)
		{
			StringCopy(&cVar16, ped::get_pedheadshot_txd_string(Global_1353135[iParam0 /*5*/].f_2), 64);
			ui::_0x317EBA71D7543F52(&cVar16, &cVar16, &cVar0, &cVar0);
		}
		ped::unregister_pedheadshot(Global_1353135[iParam0 /*5*/].f_2);
	}
	iVar32 = iParam0;
	iVar33 = iVar32 + 1;
	while (iVar33 < Global_1353296)
	{
		Global_1353135[iVar32 /*5*/] = { Global_1353135[iVar33 /*5*/] };
		iVar32++;
		iVar33++;
	}
	func_367(&(Global_1353135[iVar32 /*5*/]));
	Global_1353296 = (Global_1353296 - 1);
}

void func_367(var uParam0)//Position - 0x10183
{
	*uParam0 = 0;
	uParam0->f_1 = func_13();
	uParam0->f_2 = 0;
	uParam0->f_4 = 0;
	if (network::network_is_game_in_progress())
	{
		uParam0->f_3 = network::get_network_time();
	}
}

void func_368()//Position - 0x101B0
{
	Global_1336446.f_40.f_9 = 4;
}

int func_369(int iParam0, var uParam1, char* sParam2, int iParam3, char* sParam4, int iParam5, int iParam6, char* sParam7, char* sParam8)//Position - 0x101C1
{
	int iVar0;
	
	func_368();
	iVar0 = false;
	return func_336(iParam0, uParam1, sParam2, iVar0, iParam3, sParam4, iParam5, iParam6, sParam7, sParam8);
}

int func_370(int iParam0, var uParam1, char* sParam2, int iParam3, char* sParam4, int iParam5, int iParam6, char* sParam7, char* sParam8)//Position - 0x101E8
{
	int iVar0;
	
	iVar0 = false;
	return func_371(iParam0, uParam1, sParam2, iVar0, iParam3, sParam4, iParam5, iParam6, sParam7, sParam8);
}

bool func_371(int iParam0, var uParam1, char* sParam2, int iParam3, int iParam4, char* sParam5, int iParam6, int iParam7, char* sParam8, char* sParam9)//Position - 0x1020B
{
	int iVar0;
	int iVar1;
	char* sVar2;
	int iVar3;
	char* sVar4;
	var uVar5;
	int iVar6;
	int iVar7;
	int iVar8;
	int iVar9;
	int iVar10;
	int iVar11;
	int iVar12;
	
	iVar0 = func_13();
	iVar1 = 0;
	if (iParam0 == 145)
	{
		iVar0 = uParam1;
		sVar2 = player::get_player_name(iVar0);
		iVar1 = func_362(iVar0);
		if (iVar1 == 0)
		{
			if (network::is_time_less_than(network::get_network_time(), Global_1336446.f_40.f_13))
			{
				return false;
			}
		}
		Global_16806 = iVar1;
	}
	else
	{
		sVar2 = "";
	}
	iVar3 = 0;
	sVar4 = func_361(sParam5, iParam6, &iVar3);
	uVar5 = func_359(iParam7, &iVar3);
	iVar6 = 0;
	if (!gameplay::is_string_null_or_empty(sParam8))
	{
		iVar6++;
		if (!gameplay::is_string_null_or_empty(sParam9))
		{
			iVar6++;
		}
	}
	if (gameplay::are_strings_equal(sVar4, " "))
	{
		sVar4 = "";
	}
	iVar7 = true;
	iVar8 = 0;
	iVar9 = 0;
	iVar10 = 1;
	iVar11 = 0;
	if (iParam3)
	{
		iVar9 = 1;
		iVar10 = 2;
		iVar11 = 1;
		if (gameplay::is_bit_set(iParam4, 1))
		{
			iVar8 = 1;
		}
	}
	if (gameplay::is_bit_set(iParam4, 2))
	{
		iVar10 = 2;
	}
	iVar12 = false;
	if (!iVar3 == 0 || !gameplay::is_string_null_or_empty(sVar2))
	{
		iVar12 = func_379(iParam0, sParam2, iVar10, sVar4, uVar5, sVar2, iVar3, iVar11, 1, iVar9, 0, iVar7, iVar8, 0, iVar6, sParam8, sParam9);
	}
	else
	{
		iVar12 = func_373(iParam0, sParam2, iVar10, iVar11, 1, iVar9, 0, iVar7, iVar8, 0);
	}
	if (!iVar12)
	{
		return false;
	}
	if (gameplay::is_bit_set(iParam4, 0))
	{
		func_339();
	}
	func_372();
	func_338();
	func_337();
	return true;
}

void func_372()//Position - 0x10362
{
	Global_1336446.f_40.f_9 = 3;
}

bool func_373(int iParam0, char* sParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8, int iParam9)//Position - 0x10373
{
	int iVar0;
	char* sVar1;
	int iVar2;
	char* sVar3;
	int iVar4;
	char* sVar5;
	char* sVar6;
	int iVar7;
	
	gameplay::clear_bit(&Global_2313, 10);
	iVar0 = 0;
	sVar1 = "NULL";
	iVar2 = -99;
	sVar3 = "NULL";
	iVar4 = 0;
	sVar5 = "NULL";
	sVar6 = "NULL";
	iVar7 = 3;
	if (func_374(iParam0, sParam1, iParam2, iVar0, sVar1, sVar3, iVar2, iParam3, iParam4, iParam5, iParam7, iParam8, iParam9, iVar4, sVar5, sVar6, iVar7) == 1)
	{
		if (iParam7 == 1)
		{
			Global_3020 = iParam6;
			Global_2923[3 /*6*/] = { Global_101553.f_32740[iParam0 /*29*/].f_3 };
			Global_3000 = iParam0;
			gameplay::set_bit(&Global_2313, 1);
			gameplay::set_bit(&Global_2313, 7);
		}
		return true;
	}
	return false;
}

bool func_374(var uParam0, char* sParam1, int iParam2, int iParam3, char* sParam4, char* sParam5, int iParam6, int iParam7, var uParam8, var uParam9, int iParam10, var uParam11, var uParam12, int iParam13, char* sParam14, char* sParam15, int iParam16)//Position - 0x1040B
{
	int iVar0;
	
	if (iParam13 > 99)
	{
	}
	if (gameplay::are_strings_equal(sParam14, sParam15))
	{
	}
	func_352();
	iVar0 = 0;
	switch (iParam16)
	{
		case 0:
			if (Global_14443 == 0)
			{
				iVar0 = 0;
			}
			else
			{
				iVar0 = 1;
			}
			break;
		
		case 2:
			if (Global_14443 == 2)
			{
				iVar0 = 0;
			}
			else
			{
				iVar0 = 1;
			}
			break;
		
		case 1:
			if (Global_14443 == 1)
			{
				iVar0 = 0;
			}
			else
			{
				iVar0 = 1;
			}
			break;
		
		default:
			iVar0 = 0;
			break;
	}
	if (iVar0 == 0)
	{
		if (player::is_player_playing(player::player_id()))
		{
			if (ped::is_ped_swimming_under_water(player::player_ped_id()))
			{
				return false;
			}
		}
		if (Global_101553.f_12906[Global_14443 /*20*/].f_17 == 1)
		{
			return false;
		}
		if (script::_get_number_of_instances_of_streamed_script(joaat("apptextmessage")) > 0)
		{
			return false;
		}
		if (script::_get_number_of_instances_of_streamed_script(joaat("apptextmessage")) > 0)
		{
			return false;
		}
	}
	if (func_378() == 0)
	{
		func_376();
		return false;
	}
	func_375(Global_16812);
	StringCopy(&(Global_101553.f_12996[Global_16812 /*104*/]), sParam1, 64);
	Global_101553.f_12996[Global_16812 /*104*/].f_17 = uParam0;
	if (iParam2 == 0)
	{
	}
	else
	{
		Global_101553.f_12996[Global_16812 /*104*/].f_24 = iParam2;
	}
	Global_101553.f_12996[Global_16812 /*104*/].f_25 = iParam7;
	Global_101553.f_12996[Global_16812 /*104*/].f_26 = uParam8;
	Global_101553.f_12996[Global_16812 /*104*/].f_29 = uParam9;
	Global_101553.f_12996[Global_16812 /*104*/].f_30 = uParam12;
	Global_101553.f_12996[Global_16812 /*104*/].f_31 = uParam11;
	Global_101553.f_12996[Global_16812 /*104*/].f_28 = 0;
	Global_101553.f_12996[Global_16812 /*104*/].f_32 = iParam3;
	StringCopy(&(Global_101553.f_12996[Global_16812 /*104*/].f_33), sParam4, 64);
	Global_101553.f_12996[Global_16812 /*104*/].f_49 = iParam6;
	StringCopy(&(Global_101553.f_12996[Global_16812 /*104*/].f_50), sParam5, 64);
	Global_101553.f_12996[Global_16812 /*104*/].f_66 = iParam13;
	StringCopy(&(Global_101553.f_12996[Global_16812 /*104*/].f_67), sParam14, 64);
	StringCopy(&(Global_101553.f_12996[Global_16812 /*104*/].f_83), sParam15, 64);
	if (gameplay::is_bit_set(Global_2313, 10))
	{
		Global_101553.f_12996[Global_16812 /*104*/].f_99[0] = 1;
		Global_101553.f_12996[Global_16812 /*104*/].f_99[1] = 1;
		Global_101553.f_12996[Global_16812 /*104*/].f_99[2] = 1;
		Global_3019 = 4;
		func_347(0);
		func_347(2);
		func_347(1);
	}
	else
	{
		func_352();
		switch (iParam16)
		{
			case 3:
				Global_101553.f_12996[Global_16812 /*104*/].f_99[Global_14443] = 1;
				break;
			
			case 0:
				Global_101553.f_12996[Global_16812 /*104*/].f_99[0] = 1;
				break;
			
			case 2:
				Global_101553.f_12996[Global_16812 /*104*/].f_99[2] = 1;
				break;
			
			case 1:
				Global_101553.f_12996[Global_16812 /*104*/].f_99[1] = 1;
				break;
		}
		if (iParam16 == 3)
		{
			switch (Global_14443)
			{
				case 0:
					func_347(0);
					Global_3019 = 0;
					break;
				
				case 1:
					func_347(1);
					Global_3019 = 1;
					break;
				
				case 2:
					func_347(2);
					Global_3019 = 2;
					break;
				
				case 3:
					func_347(3);
					Global_3019 = 3;
					break;
				
				default:
					Global_3019 = 4;
					break;
				}
			}
	}
	if (iParam7 == 1)
	{
		if (gameplay::is_bit_set(Global_2313, 10))
		{
			Global_101553.f_12906[0 /*20*/].f_17 = 1;
			Global_101553.f_12906[1 /*20*/].f_17 = 1;
			Global_101553.f_12906[2 /*20*/].f_17 = 1;
		}
		else
		{
			switch (iParam16)
			{
				case 3:
					Global_101553.f_12906[Global_14443 /*20*/].f_17 = 1;
					break;
				
				case 0:
					Global_101553.f_12906[0 /*20*/].f_17 = 1;
					break;
				
				case 2:
					Global_101553.f_12906[2 /*20*/].f_17 = 1;
					break;
				
				case 1:
					Global_101553.f_12906[1 /*20*/].f_17 = 1;
					break;
				}
			}
	}
	Global_16814[Global_16812] = 0;
	if (iParam10)
	{
		func_352();
		if (Global_14386)
		{
			StringCopy(&Global_14432, "Phone_SoundSet_Prologue", 24);
		}
		else
		{
			switch (Global_14443)
			{
				case 0:
					StringCopy(&Global_14432, "Phone_SoundSet_Michael", 24);
					break;
				
				case 2:
					StringCopy(&Global_14432, "Phone_SoundSet_Trevor", 24);
					break;
				
				case 1:
					StringCopy(&Global_14432, "Phone_SoundSet_Franklin", 24);
					break;
				
				default:
					StringCopy(&Global_14432, "Phone_SoundSet_Default", 24);
					break;
				}
		}
		if (!Global_3118[Global_14443 /*2811*/][0 /*281*/].f_259 == 1)
		{
			if (!func_346())
			{
				audio::play_sound_frontend(-1, "Text_Arrive_Tone", &Global_14432, 1);
			}
		}
	}
	if (!Global_14605)
	{
		if (Global_14443.f_1 == 6)
		{
			func_345(Global_14424, "SET_DATA_SLOT_EMPTY", 1f, -1082130432, -1082130432, -1082130432, -1082130432);
			func_342(1);
			func_345(Global_14424, "DISPLAY_VIEW", 1f, system::to_float(Global_14423), -1082130432, -1082130432, -1082130432);
		}
	}
	return true;
}

void func_375(var uParam0)//Position - 0x108C2
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	var uVar4;
	int iVar5;
	
	iVar0 = time::get_clock_seconds();
	iVar1 = time::get_clock_minutes();
	iVar2 = time::get_clock_hours();
	iVar3 = time::get_clock_day_of_month();
	uVar4 = time::get_clock_month() + 1;
	iVar5 = time::get_clock_year();
	Global_101553.f_12996[uParam0 /*104*/].f_18 = iVar0;
	Global_101553.f_12996[uParam0 /*104*/].f_18.f_1 = iVar1;
	Global_101553.f_12996[uParam0 /*104*/].f_18.f_2 = iVar2;
	Global_101553.f_12996[uParam0 /*104*/].f_18.f_3 = iVar3;
	Global_101553.f_12996[uParam0 /*104*/].f_18.f_4 = uVar4;
	Global_101553.f_12996[uParam0 /*104*/].f_18.f_5 = iVar5;
}

void func_376()//Position - 0x10954
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	if (Global_69617)
	{
		iVar0 = 24;
		iVar1 = 33;
	}
	else
	{
		iVar0 = 0;
		iVar1 = 20;
	}
	iVar2 = iVar0;
	Global_16812 = 34;
	Global_101553.f_12996[Global_16812 /*104*/].f_18 = -1;
	Global_101553.f_12996[Global_16812 /*104*/].f_18.f_1 = 0;
	Global_101553.f_12996[Global_16812 /*104*/].f_18.f_2 = 0;
	Global_101553.f_12996[Global_16812 /*104*/].f_18.f_3 = 0;
	Global_101553.f_12996[Global_16812 /*104*/].f_18.f_5 = 99999;
	while (iVar2 < iVar1)
	{
		if (!func_377(Global_101553.f_12996[iVar2 /*104*/].f_18, Global_101553.f_12996[Global_16812 /*104*/].f_18))
		{
			Global_16812 = iVar2;
		}
		iVar2++;
	}
	Global_101553.f_12996[Global_16812 /*104*/].f_24 = 1;
}

bool func_377(struct<6> Param0, struct<6> Param6)//Position - 0x10A1F
{
	struct<4> Var0;
	struct<4> Var6;
	int iVar12;
	int iVar13;
	
	if (Param0.f_5 < Param6.f_5)
	{
		return false;
	}
	if (Param0.f_5 > Param6.f_5)
	{
		return true;
	}
	if (Param0.f_5 == Param6.f_5)
	{
		if (Param0.f_4 < Param6.f_4)
		{
			return false;
		}
		if (Param0.f_4 > Param6.f_4)
		{
			return true;
		}
		if (Param0.f_4 == Param6.f_4)
		{
			Var0 = Param0;
			Var0.f_1 = Param0.f_1 * 60;
			Var0.f_2 = Param0.f_2 * 3600;
			Var0.f_3 = (Param0.f_3 * 86400);
			iVar12 = (((Var0 + Var0.f_1) + Var0.f_2) + Var0.f_3);
			Var6 = Param6;
			Var6.f_1 = Param6.f_1 * 60;
			Var6.f_2 = Param6.f_2 * 3600;
			Var6.f_3 = (Param6.f_3 * 86400);
			iVar13 = (((Var6 + Var6.f_1) + Var6.f_2) + Var6.f_3);
			if (iVar12 > iVar13 || iVar12 == iVar13)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
	}
	return false;
}

bool func_378()//Position - 0x10B0A
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	if (Global_69617)
	{
		iVar0 = 24;
		iVar1 = 33;
	}
	else
	{
		iVar0 = 0;
		iVar1 = 20;
	}
	iVar2 = iVar0;
	while (iVar2 < iVar1)
	{
		if (Global_101553.f_12996[iVar2 /*104*/].f_24 == 0)
		{
			Global_16812 = iVar2;
			return true;
		}
		iVar2++;
	}
	iVar2 = iVar0;
	Global_16812 = 34;
	Global_101553.f_12996[Global_16812 /*104*/].f_18 = -1;
	Global_101553.f_12996[Global_16812 /*104*/].f_18.f_1 = 0;
	Global_101553.f_12996[Global_16812 /*104*/].f_18.f_2 = 0;
	Global_101553.f_12996[Global_16812 /*104*/].f_18.f_3 = 0;
	Global_101553.f_12996[Global_16812 /*104*/].f_18.f_5 = 99999;
	while (iVar2 < iVar1)
	{
		if (Global_101553.f_12996[iVar2 /*104*/].f_24 == 0 || Global_101553.f_12996[iVar2 /*104*/].f_24 == 1)
		{
			if (!func_377(Global_101553.f_12996[iVar2 /*104*/].f_18, Global_101553.f_12996[Global_16812 /*104*/].f_18))
			{
				Global_16812 = iVar2;
			}
		}
		iVar2++;
	}
	if (Global_16812 == 34)
	{
		return false;
	}
	Global_101553.f_12996[Global_16812 /*104*/].f_99[0] = 0;
	Global_101553.f_12996[Global_16812 /*104*/].f_99[1] = 0;
	Global_101553.f_12996[Global_16812 /*104*/].f_99[2] = 0;
	return true;
}

bool func_379(int iParam0, char* sParam1, int iParam2, char* sParam3, var uParam4, char* sParam5, int iParam6, int iParam7, int iParam8, int iParam9, int iParam10, int iParam11, int iParam12, int iParam13, int iParam14, char* sParam15, char* sParam16)//Position - 0x10C61
{
	int iVar0;
	
	switch (iParam14)
	{
		case 0:
			sParam15 = "NULL";
			sParam16 = "NULL";
			break;
		
		case 1:
			sParam16 = "NULL";
			break;
		
		case 2:
			break;
		
		default:
			break;
	}
	gameplay::clear_bit(&Global_2313, 10);
	iVar0 = 3;
	if (func_374(iParam0, sParam1, iParam2, iParam6, sParam3, sParam5, uParam4, iParam7, iParam8, iParam9, iParam11, iParam12, iParam13, iParam14, sParam15, sParam16, iVar0) == 1)
	{
		if (iParam11 == 1)
		{
			Global_3020 = iParam10;
			Global_2923[3 /*6*/] = { Global_101553.f_32740[iParam0 /*29*/].f_3 };
			Global_3000 = iParam0;
			StringCopy(&Global_3001, sParam5, 64);
			gameplay::set_bit(&Global_2313, 1);
			gameplay::set_bit(&Global_2313, 7);
		}
		return true;
	}
	return false;
}

bool func_380(int iParam0, var uParam1, char* sParam2, int iParam3, char* sParam4, int iParam5, int iParam6, char* sParam7, char* sParam8)//Position - 0x10D16
{
	int iVar0;
	
	if (!ped::is_ped_injured(player::player_ped_id()))
	{
	}
	if (ai::is_ped_sprinting(player::player_ped_id()))
	{
		return false;
	}
	func_372();
	iVar0 = true;
	if (func_371(iParam0, uParam1, sParam2, iVar0, iParam3, sParam4, iParam5, iParam6, sParam7, sParam8))
	{
		func_335(120000);
		return true;
	}
	return false;
}

bool func_381(var uParam0, int iParam1, char* sParam2, char* sParam3, int iParam4)//Position - 0x10D68
{
	int iVar0;
	int iVar1;
	
	if (!ped::is_ped_injured(player::player_ped_id()))
	{
		if (ai::is_ped_sprinting(player::player_ped_id()))
		{
			return false;
		}
	}
	iVar0 = false;
	iVar1 = 12;
	if (gameplay::is_bit_set(iParam4, 7))
	{
		iVar1 = 9;
	}
	if (gameplay::is_bit_set(iParam4, 4))
	{
		iVar0 = func_397(uParam0, iParam1, sParam2, sParam3, iVar1, 0, 0, 1);
	}
	else
	{
		iVar0 = func_387(uParam0, iParam1, sParam2, sParam3, iVar1, 0, 0, 1);
	}
	if (iVar0)
	{
		if (gameplay::is_bit_set(iParam4, 3))
		{
			func_386(1);
		}
		if (gameplay::is_bit_set(iParam4, 5))
		{
			func_385(1);
		}
		func_384();
		func_338();
		func_383();
		func_382();
		return true;
	}
	return false;
}

void func_382()//Position - 0x10E0B
{
	Global_2489614 = 0;
}

void func_383()//Position - 0x10E18
{
	Global_1336446.f_57 = 1;
	Global_1336446.f_57.f_1 = 0;
}

void func_384()//Position - 0x10E30
{
	Global_1336446.f_40.f_9 = 1;
}

void func_385(int iParam0)//Position - 0x10E41
{
	if (iParam0 == 1)
	{
		gameplay::set_bit(&Global_2315, 0);
	}
	else
	{
		gameplay::clear_bit(&Global_2315, 0);
	}
}

void func_386(int iParam0)//Position - 0x10E62
{
	if (iParam0 == 1)
	{
		gameplay::set_bit(&Global_2313, 20);
	}
	else
	{
		gameplay::clear_bit(&Global_2313, 20);
	}
}

int func_387(var uParam0, int iParam1, char* sParam2, char* sParam3, int iParam4, int iParam5, int iParam6, int iParam7)//Position - 0x10E85
{
	func_396(uParam0, iParam1, sParam2, iParam5, iParam6, 0);
	Global_15793 = 0;
	Global_15752 = 1;
	Global_15759 = 0;
	Global_15754 = 0;
	Global_16736 = 0;
	Global_16738 = 0;
	Global_16742 = 0;
	Global_15750 = 0;
	Global_15797 = 0;
	Global_15799 = 0;
	Global_2621441 = 0;
	return func_388(sParam3, iParam4, iParam7);
}

bool func_388(char* sParam0, int iParam1, int iParam2)//Position - 0x10ED3
{
	Global_15746 = 0;
	if (Global_15745 == 0 || Global_15747 == 2)
	{
		if (Global_15745 != 0)
		{
			if (iParam1 > Global_15747)
			{
				if (Global_15752 == 0)
				{
					audio::stop_scripted_conversation(false);
					Global_14443.f_1 = 3;
					Global_15745 = 0;
					Global_15746 = 1;
					Global_15798 = 0;
					Global_15741 = 0;
					Global_15742 = 0;
					Global_15756 = 0;
					Global_15755 = 0;
					Global_14442 = 0;
				}
				else
				{
					func_395();
					return false;
				}
			}
			else
			{
				return false;
			}
		}
		if (audio::is_scripted_conversation_ongoing())
		{
			return false;
		}
		if (func_394(8, -1))
		{
			return false;
		}
		Global_15821 = { Global_15815 };
		func_393();
		Global_15034 = { Global_15199 };
		Global_15751 = Global_15752;
		Global_15758 = Global_15759;
		Global_2621442 = Global_2621441;
		Global_15760 = { Global_15776 };
		Global_15753 = Global_15754;
		Global_16735 = Global_16736;
		Global_16743 = { Global_16749 };
		Global_16737 = Global_16738;
		Global_16739 = Global_16740;
		Global_16741 = Global_16742;
		Global_15364.f_370 = Global_16734;
		Global_15364.f_368 = Global_16732;
		Global_15364.f_369 = Global_16733;
		Global_15741 = Global_15742;
		if (Global_15751)
		{
			gameplay::clear_bit(&Global_2313, 20);
			gameplay::clear_bit(&Global_2314, 17);
			gameplay::clear_bit(&Global_2315, 0);
			if (iParam2)
			{
				func_352();
				if (Global_3118[Global_14443 /*2811*/][0 /*281*/].f_259 == 2)
				{
					if (iParam1 == 13)
					{
					}
					else
					{
						return false;
					}
				}
				if (Global_14443.f_1 > 3)
				{
					return false;
				}
			}
			if (Global_14409 == 1)
			{
				return false;
			}
			if (player::is_player_playing(player::player_id()))
			{
				if (ped::is_ped_in_melee_combat(player::player_ped_id()))
				{
					return false;
				}
				if (func_392())
				{
					return false;
				}
				if (ai::is_ped_sprinting(player::player_ped_id()))
				{
					return false;
				}
				if (ped::is_ped_ragdoll(player::player_ped_id()))
				{
					return false;
				}
				if (ped::is_ped_in_parachute_free_fall(player::player_ped_id()))
				{
					return false;
				}
				if (weapon::get_is_ped_gadget_equipped(player::player_ped_id(), joaat("gadget_parachute")))
				{
					return false;
				}
				if (!Global_69617)
				{
					if (entity::is_entity_in_water(player::player_ped_id()))
					{
						return false;
					}
					if (player::is_player_climbing(player::player_id()))
					{
						return false;
					}
					if (ped::is_ped_planting_bomb(player::player_ped_id()))
					{
						return false;
					}
					if (player::is_special_ability_active(player::player_id()))
					{
						return false;
					}
				}
			}
			if (func_391())
			{
				return false;
			}
			else
			{
				switch (Global_14443.f_1)
				{
					case 7:
						return false;
						break;
					
					case 8:
						return false;
						break;
					
					case 9:
						break;
					
					case 10:
						break;
					
					default:
						break;
				}
				if (gameplay::is_bit_set(Global_2313, 9))
				{
					return false;
				}
			}
			func_390();
			Global_15755 = iParam2;
		}
		Global_15747 = iParam1;
		StringCopy(&Global_15364, sParam0, 24);
		Global_14611 = 0;
		func_389();
		return true;
	}
	if (Global_15745 == 5)
	{
		return false;
	}
	if (iParam1 < Global_15747 || iParam1 == Global_15747)
	{
		return false;
	}
	if (iParam1 == 2)
	{
	}
	else
	{
		func_395();
	}
	return false;
}

void func_389()//Position - 0x1119F
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 <= 69)
	{
		StringCopy(&(Global_14613[iVar0 /*6*/]), "", 24);
		iVar0++;
	}
	audio::stop_scripted_conversation(false);
	Global_15745 = 1;
}

void func_390()//Position - 0x111D0
{
	Global_15798 = Global_15797;
	Global_15792 = Global_15793;
	Global_15839 = { Global_15827 };
	Global_15845 = { Global_15833 };
	Global_15800 = Global_15799;
	Global_15869 = { Global_15851 };
	Global_15875 = { Global_15857 };
	Global_15881 = { Global_15863 };
	Global_15887 = { Global_15893 };
	Global_1628 = Global_1629;
	Global_1630 = Global_1631;
	Global_15756 = Global_15757;
	Global_15758 = Global_15759;
	Global_15760 = { Global_15776 };
	Global_15749 = Global_15750;
	Global_16761 = 0;
	Global_15794 = 0;
	Global_15795 = 0;
	gameplay::clear_bit(&Global_2314, 16);
}

bool func_391()//Position - 0x11265
{
	if (Global_14443.f_1 == 1 || Global_14443.f_1 == 0)
	{
		return true;
	}
	return false;
}

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

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

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

void func_395()//Position - 0x113B7
{
	audio::restart_scripted_conversation();
	Global_16756 = 0;
	if ((audio::is_mobile_phone_call_ongoing() || Global_14443.f_1 == 9) || Global_14442 == 1)
	{
		audio::stop_scripted_conversation(false);
		Global_15745 = 6;
		Global_14443.f_1 = 3;
		return;
	}
	if (audio::is_scripted_conversation_ongoing())
	{
		audio::stop_scripted_conversation(true);
		Global_15745 = 6;
		return;
	}
}

void func_396(var uParam0, int iParam1, char* sParam2, int iParam3, int iParam4, int iParam5)//Position - 0x1140E
{
	Global_15199 = { *uParam0 };
	Global_1629 = iParam1;
	StringCopy(&Global_15815, sParam2, 24);
	Global_16734 = iParam5;
	if (iParam3 == 0)
	{
		Global_16732 = 1;
		Global_16730 = 0;
	}
	else
	{
		Global_16732 = 0;
		Global_16730 = 1;
	}
	if (iParam4 == 0)
	{
		Global_16733 = 1;
		Global_16731 = 0;
	}
	else
	{
		Global_16733 = 0;
		Global_16731 = 1;
	}
}

int func_397(var uParam0, int iParam1, char* sParam2, char* sParam3, int iParam4, int iParam5, int iParam6, int iParam7)//Position - 0x11464
{
	func_396(uParam0, iParam1, sParam2, iParam5, iParam6, 0);
	Global_15793 = 1;
	Global_15752 = 1;
	Global_15759 = 0;
	Global_15754 = 0;
	Global_16736 = 0;
	Global_16738 = 0;
	Global_16742 = 0;
	Global_15750 = 0;
	Global_15797 = 0;
	Global_15799 = 0;
	Global_2621441 = 0;
	return func_388(sParam3, iParam4, iParam7);
}

bool func_398(var uParam0, int iParam1, char* sParam2, char* sParam3, char* sParam4)//Position - 0x114B2
{
	if (!ped::is_ped_injured(player::player_ped_id()))
	{
	}
	if (ai::is_ped_sprinting(player::player_ped_id()))
	{
		return false;
	}
	if (func_400(uParam0, iParam1, sParam2, sParam3, 9, sParam4, 0, 0, 1))
	{
		func_399();
		func_384();
		func_338();
		func_383();
		func_382();
		return true;
	}
	return false;
}

void func_399()//Position - 0x11504
{
	Global_16763 = 0;
}

int func_400(var uParam0, int iParam1, char* sParam2, char* sParam3, int iParam4, char* sParam5, int iParam6, int iParam7, int iParam8)//Position - 0x11510
{
	func_396(uParam0, iParam1, sParam2, iParam6, iParam7, 0);
	Global_15793 = 0;
	Global_15752 = 1;
	Global_15759 = 0;
	Global_15754 = 1;
	Global_16736 = 0;
	Global_16738 = 0;
	Global_16742 = 0;
	Global_15750 = 0;
	Global_15797 = 1;
	Global_15799 = 0;
	StringCopy(&Global_15893, sParam5, 24);
	Global_2621441 = 0;
	return func_388(sParam3, iParam4, iParam8);
}

bool func_401(var uParam0, char* sParam1, char* sParam2)//Position - 0x11565
{
	if (func_403(uParam0, sParam1, sParam2, 12, 0, 0, 0))
	{
		func_402();
		func_338();
		func_383();
		return true;
	}
	return false;
}

void func_402()//Position - 0x11590
{
	Global_1336446.f_40.f_9 = 2;
}

int func_403(var uParam0, char* sParam1, char* sParam2, int iParam3, int iParam4, int iParam5, int iParam6)//Position - 0x115A1
{
	func_396(uParam0, 145, sParam1, iParam4, iParam5, iParam6);
	if (iParam3 > 7)
	{
		if (iParam3 < 12)
		{
			iParam3 = 7;
		}
	}
	Global_15752 = 0;
	Global_15754 = 0;
	Global_15759 = 0;
	Global_16736 = 0;
	Global_16738 = 0;
	Global_16742 = 0;
	Global_2621441 = 0;
	return func_388(sParam2, iParam3, 0);
}

void func_404()//Position - 0x115EF
{
	Global_1336446.f_55 = Global_1336446.f_40.f_1;
	Global_1336446.f_55.f_1 = Global_1336446.f_40.f_10;
}

void func_405()//Position - 0x11615
{
	Global_1336446.f_40 = 1;
}

int func_406()//Position - 0x11624
{
	return Global_1336446.f_40 == 1;
}

bool func_407(int iParam0, int iParam1, int iParam2)//Position - 0x11634
{
	if (!func_408(iParam0))
	{
		return false;
	}
	if (Global_1336446.f_40.f_2 != iParam1)
	{
		return false;
	}
	if (iParam2 != 0)
	{
		if (Global_1336446.f_40.f_3 != iParam2)
		{
			return false;
		}
	}
	return true;
}

bool func_408(int iParam0)//Position - 0x11673
{
	if (!func_409())
	{
		return false;
	}
	if (!Global_1336446.f_40.f_1 == iParam0)
	{
		return false;
	}
	return true;
}

bool func_409()//Position - 0x1169B
{
	if (Global_1336446.f_40 == 0)
	{
		return false;
	}
	return true;
}

bool func_410(int iParam0)//Position - 0x116B2
{
	if (func_414())
	{
		return false;
	}
	if (func_413())
	{
		return false;
	}
	if (func_324(0))
	{
		return false;
	}
	if (Global_1312462.f_18 != 0)
	{
		return false;
	}
	if (Global_1738544 || func_412())
	{
		return false;
	}
	if (!gameplay::is_bit_set(iParam0, 6))
	{
		if (func_411())
		{
			return false;
		}
	}
	return true;
}

int func_411()//Position - 0x11716
{
	return network::is_time_less_than(network::get_network_time(), Global_1352032);
}

bool func_412()//Position - 0x1172A
{
	if (Global_2567282.f_797 > -1)
	{
		return true;
	}
	return false;
}

int func_413()//Position - 0x11742
{
	return Global_1336446.f_40 == 3;
}

int func_414()//Position - 0x11752
{
	return func_391();
}

int func_415(int iParam0, int iParam1, int iParam2)//Position - 0x1175E
{
	if (!func_413())
	{
		return 0;
	}
	return func_407(iParam0, iParam1, iParam2);
}

int func_416(char* sParam0, char* sParam1)//Position - 0x1177C
{
	char cVar0[64];
	
	StringCopy(&cVar0, sParam0, 64);
	StringConCat(&cVar0, sParam1, 64);
	return gameplay::get_hash_key(&cVar0);
}

var func_417()//Position - 0x11796
{
	return Global_2487434.f_1;
}

int func_418()//Position - 0x117A4
{
	if (Global_1336634.f_2)
	{
		return 1;
	}
	return func_419();
}

int func_419()//Position - 0x117BD
{
	return func_414();
}

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

bool func_421(int iParam0)//Position - 0x11864
{
	switch (iParam0)
	{
		case 0:
			return true;
			break;
	}
	return false;
}

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

void func_423(var uParam0)//Position - 0x118AA
{
	if (!uParam0->f_1)
	{
		if (network::network_is_host_of_this_script())
		{
			func_424(uParam0, 0, 0);
		}
	}
}

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

void func_425()//Position - 0x1190E
{
	if (network::network_does_entity_exist_with_network_id(Local_91.f_10[iLocal_322 /*7*/]) && !entity::is_entity_dead(network::net_to_ped(Local_91.f_10[iLocal_322 /*7*/]), 0))
	{
		if (!entity::is_entity_dead(player::player_ped_id(), 0))
		{
			if (func_5(entity::get_entity_coords(network::net_to_ped(Local_91.f_10[iLocal_322 /*7*/]), 1), entity::get_entity_coords(player::player_ped_id(), 1), 50625f))
			{
				if (!gameplay::is_bit_set(iLocal_306, 4))
				{
					gameplay::set_bit(&iLocal_306, 4);
				}
			}
			else if (!gameplay::is_bit_set(iLocal_306, 5))
			{
				if (Local_91.f_42 != -1)
				{
					if (iLocal_322 == Local_91.f_42)
					{
						if (!gameplay::is_bit_set(iLocal_306, 5))
						{
							gameplay::set_bit(&iLocal_306, 5);
						}
					}
				}
			}
		}
	}
	func_426(iLocal_322);
	iLocal_322++;
	if (iLocal_322 >= func_421(iLocal_312))
	{
		if ((!gameplay::is_bit_set(iLocal_306, 4) && gameplay::is_bit_set(Local_91.f_1, 8)) || gameplay::is_bit_set(iLocal_306, 5))
		{
			if (!gameplay::is_bit_set(Local_145[player::network_player_id_to_int() /*5*/].f_1, 1))
			{
				gameplay::set_bit(&(Local_145[player::network_player_id_to_int() /*5*/].f_1), 1);
			}
		}
		else if (gameplay::is_bit_set(Local_145[player::network_player_id_to_int() /*5*/].f_1, 1))
		{
			gameplay::clear_bit(&(Local_145[player::network_player_id_to_int() /*5*/].f_1), 1);
		}
		gameplay::clear_bit(&iLocal_306, 4);
		gameplay::clear_bit(&iLocal_306, 5);
		iLocal_322 = 0;
	}
}

void func_426(int iParam0)//Position - 0x11A5A
{
	int iVar0;
	int iVar1;
	int iVar2;
	vector3 vVar3;
	int iVar6;
	float fVar7;
	int iVar8;
	int iVar9;
	int iVar10;
	
	iVar2 = 0;
	vVar3 = { 0f, 0f, 0f };
	iVar6 = false;
	if (network::network_does_network_id_exist(Local_91.f_10[iParam0 /*7*/]))
	{
		iVar0 = network::net_to_ped(Local_91.f_10[iParam0 /*7*/]);
		if (iLocal_312 == 0)
		{
			if (player::player_id() == iLocal_314)
			{
				if (Local_91.f_10[iParam0 /*7*/].f_4 == 0)
				{
					if (Local_91.f_10[iParam0 /*7*/].f_5 == 2)
					{
						iVar6 = true;
					}
				}
			}
		}
		if (player::player_id() == iLocal_313)
		{
			if (gameplay::is_bit_set(Local_91.f_10[iParam0 /*7*/].f_2, 1))
			{
				if (!gameplay::is_bit_set(iLocal_307[iParam0], 0))
				{
					gameplay::set_bit(&Global_1572922, 0);
					gameplay::set_bit(&(iLocal_307[iParam0]), 0);
				}
				if (!gameplay::is_bit_set(Local_91.f_10[iParam0 /*7*/].f_2, 9))
				{
					if (!gameplay::is_bit_set(iLocal_307[iParam0], 1))
					{
						iVar6 = true;
					}
				}
				else if (gameplay::is_bit_set(iLocal_307[iParam0], 1))
				{
					gameplay::clear_bit(&(iLocal_307[iParam0]), 1);
				}
			}
		}
		if (iVar6)
		{
			if (network::network_does_network_id_exist(Local_91.f_10[iParam0 /*7*/]))
			{
				if (!network::network_has_control_of_network_id(Local_91.f_10[iParam0 /*7*/]))
				{
					network::network_request_control_of_network_id(Local_91.f_10[iParam0 /*7*/]);
				}
			}
		}
		if (network::network_has_control_of_network_id(Local_91.f_10[iParam0 /*7*/]))
		{
			if (player::player_id() == iLocal_313)
			{
				if (!gameplay::is_bit_set(Local_91.f_10[iParam0 /*7*/].f_2, 9) && !gameplay::is_bit_set(iLocal_307[iParam0], 1))
				{
					if (network::_0x0EDE326D47CD0F3E(iVar0, player::player_id()))
					{
						switch (Local_91.f_10[iParam0 /*7*/].f_1)
						{
							case 0:
								func_449(iVar0, 3);
								break;
						}
						gameplay::set_bit(&(iLocal_307[iParam0]), 1);
					}
				}
			}
			if (!entity::is_entity_dead(iVar0, 0) && !ped::is_ped_injured(iVar0))
			{
				switch (Local_91.f_10[iParam0 /*7*/].f_5)
				{
					case 0:
						break;
					
					case 1:
						ped::set_ped_reset_flag(iVar0, 187, true);
						if (Local_91.f_10[iParam0 /*7*/].f_4 == 0)
						{
							if (gameplay::is_bit_set(Local_91.f_10[iParam0 /*7*/].f_2, 2))
							{
								if (!gameplay::is_bit_set(Local_91.f_10[iParam0 /*7*/].f_2, 3))
								{
									ai::set_ped_desired_move_blend_ratio(iVar0, 3f);
									ped::set_blocking_of_non_temporary_events(iVar0, true);
									ped::set_ped_config_flag(iVar0, 118, false);
								}
							}
						}
						if (player::player_id() == iLocal_314 && func_5(entity::get_entity_coords(iVar0, 1), entity::get_entity_coords(player::get_player_ped(iLocal_314), 1), 25f))
						{
							gameplay::set_bit(&(Global_2482149.f_4440), 0);
						}
						else
						{
							gameplay::clear_bit(&(Global_2482149.f_4440), 0);
						}
						if (!ped::is_ped_fleeing(iVar0))
						{
							if (!ped::is_ped_responding_to_event(iVar0, 29))
							{
								if (func_6(iLocal_314, 1, 1))
								{
									if (!gameplay::is_bit_set(Local_91.f_2, 13))
									{
										if (func_448(iLocal_314) && !ped::is_ped_hanging_on_to_vehicle(player::get_player_ped(iLocal_314)))
										{
											if (!func_447(iVar0, -1794415470))
											{
												if (func_446(iVar0))
												{
													iVar1 = ped::get_vehicle_ped_is_in(player::get_player_ped(iLocal_314), 0);
													if (entity::does_entity_exist(iVar1))
													{
														if (vehicle::is_vehicle_driveable(iVar1, 0))
														{
														}
														if (!vehicle::_0xF7F203E31F96F6A1(iVar1, func_445(player::get_player_ped(iLocal_314), 0)))
														{
															ai::task_enter_vehicle(iVar0, iVar1, -1, func_444(player::get_player_ped(iLocal_314), iVar1), func_443(iParam0), 1179977, 0);
														}
													}
												}
											}
										}
										else if (!(ped::is_ped_jacking(iVar0) && ped::get_jack_target(iVar0) == player::get_player_ped(iLocal_314)) && !ped::is_ped_in_any_vehicle(iVar0, 1))
										{
											if (func_447(iVar0, -1794415470))
											{
												ai::clear_ped_tasks(iVar0);
											}
											if (!func_447(iVar0, 1227113341))
											{
												if (func_446(iVar0))
												{
													ai::task_go_to_entity(iVar0, player::get_player_ped(iLocal_314), -1, 0f, func_443(iParam0), 1073741824, 0);
												}
											}
											else
											{
												ped::set_ped_reset_flag(iVar0, 151, true);
											}
										}
									}
								}
							}
						}
						break;
					
					case 2:
						if (player::player_id() == iLocal_314 && func_5(entity::get_entity_coords(iVar0, 1), entity::get_entity_coords(player::get_player_ped(iLocal_314), 1), 25f))
						{
							gameplay::set_bit(&(Global_2482149.f_4440), 0);
						}
						else
						{
							gameplay::clear_bit(&(Global_2482149.f_4440), 0);
						}
						if (player::player_id() == iLocal_314)
						{
							if (!gameplay::is_bit_set(Local_145[player::network_player_id_to_int() /*5*/].f_1, 0))
							{
								if (!entity::is_entity_dead(player::player_ped_id(), 0))
								{
									if ((func_4(entity::get_entity_coords(iVar0, 1), entity::get_entity_coords(player::player_ped_id(), 1)) && (ped::is_ped_on_foot(player::player_ped_id()) || ped::is_ped_hanging_on_to_vehicle(player::player_ped_id()))) || (ped::is_ped_jacking(iVar0) && ped::get_jack_target(iVar0) == player::player_ped_id()))
									{
										iVar2 = func_441(player::player_id());
										fVar7 = (system::to_float(Global_262145.f_5466) / 100f);
										iVar2 = system::round((system::to_float(iVar2) * fVar7));
										iVar8 = func_440(player::player_id());
										if (iVar8 > 100)
										{
											iVar8 = 100;
										}
										if (iVar2 > (iVar8 * Global_262145.f_5467))
										{
											iVar2 = (iVar8 * Global_262145.f_5467);
										}
										if (iVar2 > 0)
										{
											gameplay::set_bit(&iLocal_306, 16);
										}
										ai::set_high_fall_task(player::player_ped_id(), 5000, 10000, 4);
										if (!(ped::is_ped_jacking(iVar0) && ped::get_jack_target(iVar0) == player::get_player_ped(iLocal_314)))
										{
											vVar3 = { entity::get_entity_coords(player::player_ped_id(), 1) - entity::get_entity_coords(iVar0, 1) };
											vVar3 = { func_439(vVar3) };
											vVar3.x = (vVar3.x * 3f);
											vVar3.y = (vVar3.y * 3f);
											vVar3.z = (vVar3.y * 3f);
											entity::apply_force_to_entity(player::player_ped_id(), 1, vVar3, 0f, 0f, 0.5f, 0, 0, 1, 1, 0, 1);
										}
										ped::set_ped_flee_attributes(iVar0, 512, false);
										ped::set_ped_combat_attributes(iVar0, 17, true);
										if (((ped::is_ped_in_any_vehicle(iVar0, 1) || ped::is_ped_jacking(iVar0)) && func_437(iVar0)) && func_445(iVar0, 0) == -1)
										{
											ped::set_ped_flee_attributes(iVar0, 2, true);
											ped::set_ped_combat_attributes(iVar0, 3, false);
											ped::set_ped_combat_attributes(iVar0, 6, true);
										}
										else
										{
											ai::clear_ped_tasks(iVar0);
											ai::task_smart_flee_ped(iVar0, player::player_ped_id(), 10000f, -1, 1, 0);
										}
										Local_145[player::network_player_id_to_int() /*5*/].f_3 = iVar2;
										if (iVar2 > 0)
										{
											Local_145[player::network_player_id_to_int() /*5*/].f_2 = iParam0;
										}
										else
										{
											Local_145[player::network_player_id_to_int() /*5*/].f_2 = -1;
										}
										ped::set_ped_relationship_group_hash(iVar0, Global_1574280);
										gameplay::set_bit(&(Local_145[player::network_player_id_to_int() /*5*/].f_1), 0);
										gameplay::set_bit(&(Global_2482149.f_4440), 2);
									}
								}
							}
						}
						break;
					
					case 3:
						if (ped::get_ped_reset_flag(iVar0, 187))
						{
							ped::set_ped_reset_flag(iVar0, 187, false);
						}
						if (Local_91.f_10[iParam0 /*7*/].f_4 == 0)
						{
							if (!gameplay::is_bit_set(Local_91.f_10[iParam0 /*7*/].f_2, 4))
							{
								ped::set_blocking_of_non_temporary_events(iVar0, false);
								ped::set_ped_config_flag(iVar0, 118, true);
							}
						}
						if (!(ped::is_ped_jacking(iVar0) && ped::get_jack_target(iVar0) == player::get_player_ped(iLocal_314)))
						{
							if (!ped::is_ped_fleeing(iVar0))
							{
								if (func_446(iVar0))
								{
									if ((ped::is_ped_in_any_vehicle(iVar0, 1) || ped::is_ped_jacking(iVar0)) && !gameplay::is_bit_set(Local_91.f_2, 10))
									{
										if (!func_447(iVar0, -258271821) && !func_447(iVar0, -1273030092))
										{
											if (ped::is_ped_sitting_in_any_vehicle(iVar0))
											{
												iVar9 = ped::get_vehicle_ped_is_in(iVar0, 1);
												iVar10 = entity::get_entity_model(iVar9);
												if (gameplay::is_bit_set(Local_91.f_2, 13))
												{
													ped::set_ped_combat_attributes(iVar0, 17, true);
													ped::set_ped_combat_attributes(iVar0, 6, false);
													ped::set_ped_combat_attributes(iVar0, 1, false);
												}
												else if (vehicle::is_this_model_a_heli(iVar10))
												{
													ai::task_heli_mission(iVar0, iVar9, 0, player::player_ped_id(), 0f, 0f, 0f, 8, 20f, 0f, -1f, 80, 80, -1f, 0);
												}
												else if (vehicle::is_this_model_a_plane(iVar10))
												{
													ai::task_plane_mission(iVar0, iVar9, 0, player::player_ped_id(), 0f, 0f, 0f, 8, 25f, 0f, -1f, 80, 80);
												}
												else if (entity::get_entity_model(iVar9) == joaat("taxi"))
												{
													ped::set_ped_flee_attributes(iVar0, 2, false);
													ped::set_ped_combat_attributes(iVar0, 3, true);
													ped::set_ped_combat_attributes(iVar0, 6, false);
													ai::task_smart_flee_ped(iVar0, player::get_player_ped(iLocal_314), 10000f, -1, 1, 0);
												}
												else
												{
													ai::task_vehicle_drive_wander(iVar0, ped::get_vehicle_ped_is_in(iVar0, 1), 60f, 786468);
												}
											}
										}
									}
									else if (!func_447(iVar0, 1805844857))
									{
										if (func_6(iLocal_314, 1, 1))
										{
											ai::task_smart_flee_ped(iVar0, player::get_player_ped(iLocal_314), 10000f, -1, 1, 0);
										}
									}
								}
							}
						}
						break;
					
					case 4:
						func_435(Local_91.f_10[iParam0 /*7*/], 0);
						break;
				}
				if (gameplay::is_bit_set(Local_91.f_2, 13))
				{
					ai::clear_ped_tasks(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]));
					ped::set_ped_combat_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 17, true);
					ped::set_ped_combat_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 6, false);
					ped::set_ped_combat_attributes(network::net_to_ped(Local_91.f_10[iParam0 /*7*/]), 1, false);
				}
				func_427(iVar0);
			}
		}
	}
}

void func_427(int iParam0)//Position - 0x122C5
{
	int iVar0;
	int iVar1;
	
	if (gameplay::is_bit_set(iLocal_306, 16))
	{
		iVar0 = Local_145[player::network_player_id_to_int() /*5*/].f_3;
		iVar1 = func_428(iVar0);
		if (iVar1 == 1)
		{
			gameplay::clear_bit(&iLocal_306, 15);
			gameplay::clear_bit(&iLocal_306, 16);
			if (!func_45())
			{
				networkcash::_0x995A65F15F581359(iVar0, 0, 0);
			}
			if (iVar0 > Global_262145.f_6847)
			{
				iVar0 = Global_262145.f_6847;
			}
			ped::set_ped_money(iParam0, iVar0);
			gameplay::set_bit(&(Local_145[player::network_player_id_to_int() /*5*/].f_1), 5);
		}
		else if (iVar1 == 0)
		{
			gameplay::clear_bit(&iLocal_306, 15);
			gameplay::clear_bit(&iLocal_306, 16);
			gameplay::set_bit(&(Local_145[player::network_player_id_to_int() /*5*/].f_1), 6);
		}
		else
		{
			return;
		}
	}
}

int func_428(int iParam0)//Position - 0x12371
{
	if (func_45())
	{
		if (func_431(iParam0))
		{
			if (func_430(iLocal_515) == 2)
			{
				unk3::_network_shop_set_telemetry_nonce_seed(func_429(iLocal_515));
				networkcash::_0x995A65F15F581359(iParam0, 0, 0);
				func_285(iLocal_515);
				return 1;
			}
			else
			{
				func_285(iLocal_515);
				return 0;
			}
		}
	}
	else
	{
		return 1;
	}
	return -1;
}

int func_429(int iParam0)//Position - 0x123C9
{
	if (iParam0 >= 0 && iParam0 < 5)
	{
		return Global_2572880[iParam0 /*73*/];
	}
	return -1;
}

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

bool func_431(int iParam0)//Position - 0x12413
{
	if (!gameplay::is_bit_set(iLocal_306, 15))
	{
		func_283(&iLocal_515, -1135378931, 537254313, 1474183246, 1839532116, iParam0, 4, 3);
		func_434(&uLocal_516, 0, 0);
		gameplay::set_bit(&iLocal_306, 15);
	}
	else if (func_433(iLocal_515) || func_432(&uLocal_516, 10000, 0))
	{
		return true;
	}
	return false;
}

bool func_432(var uParam0, int iParam1, int iParam2)//Position - 0x1247D
{
	if (iParam1 == -1)
	{
		return true;
	}
	func_424(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;
}

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

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

void func_435(int iParam0, int iParam1)//Position - 0x12540
{
	if (network::network_does_network_id_exist(iParam0))
	{
		if (network::network_has_control_of_network_id(iParam0))
		{
			if (!func_436(iParam0))
			{
				if (gameplay::is_bit_set(Local_91.f_2, 13))
				{
					ai::clear_ped_tasks(network::net_to_ped(iParam0));
					ped::set_ped_combat_attributes(network::net_to_ped(iParam0), 17, true);
					ped::set_ped_combat_attributes(network::net_to_ped(iParam0), 6, false);
					ped::set_ped_combat_attributes(network::net_to_ped(iParam0), 1, false);
				}
				else
				{
					if (iParam1)
					{
						ai::clear_ped_tasks(network::net_to_ped(iParam0));
					}
					ped::set_ped_combat_attributes(network::net_to_ped(iParam0), 6, true);
					ped::set_ped_combat_attributes(network::net_to_ped(iParam0), 1, true);
				}
			}
		}
		func_212(&iParam0);
	}
}

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

bool func_437(int iParam0)//Position - 0x125EF
{
	int iVar0;
	
	if (ped::is_ped_in_any_vehicle(iParam0, 1))
	{
		iVar0 = ped::get_vehicle_ped_is_in(iParam0, 1);
	}
	if (ped::is_ped_jacking(iParam0))
	{
		iVar0 = ped::set_exclusive_phone_relationships(iParam0);
	}
	if (!entity::does_entity_exist(iVar0))
	{
		if (func_448(iLocal_314))
		{
			iVar0 = ped::get_vehicle_ped_is_in(player::get_player_ped(iLocal_314), 1);
		}
	}
	if (entity::does_entity_exist(iVar0))
	{
		if (func_438(iVar0))
		{
			return false;
		}
		if (ped::is_ped_in_any_boat(iParam0) || vehicle::is_this_model_a_boat(entity::get_entity_model(iVar0)))
		{
			if (!entity::is_entity_in_water(iVar0))
			{
				return false;
			}
		}
	}
	return true;
}

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

Vector3 func_439(vector3 vParam0)//Position - 0x126BE
{
	float fVar0;
	float fVar1;
	
	fVar0 = system::vmag(vParam0);
	if (fVar0 != 0f)
	{
		fVar1 = (1f / fVar0);
		vParam0 = { vParam0 * Vector(fVar1, fVar1, fVar1) };
	}
	else
	{
		vParam0.x = 0f;
		vParam0.y = 0f;
		vParam0.z = 0f;
	}
	return vParam0;
}

var func_440(int iParam0)//Position - 0x126FD
{
	return Global_1588660[iParam0 /*532*/].f_201.f_6;
}

var func_441(int iParam0)//Position - 0x12712
{
	var uVar0;
	
	uVar0 = func_442(iParam0);
	return uVar0;
}

int func_442(int iParam0)//Position - 0x12724
{
	if (iParam0 > -1)
	{
		if (iParam0 == player::player_id())
		{
			return networkcash::_0xA40F9C2623F6A8B5(-1);
		}
		else if (func_264(iParam0))
		{
			return Global_1588660[iParam0 /*532*/].f_201.f_3;
		}
		else
		{
			return 0;
		}
	}
	return 0;
}

float func_443(var uParam0)//Position - 0x12767
{
	if (!gameplay::is_bit_set(Local_91.f_10[uParam0 /*7*/].f_2, 2))
	{
		return 1f;
	}
	return 3f;
}

int func_444(int iParam0, int iParam1)//Position - 0x12787
{
	if (!entity::is_entity_dead(iParam0, 0) && !entity::is_entity_dead(iParam1, 0))
	{
		if (ped::is_ped_sitting_in_vehicle(iParam0, iParam1))
		{
			if (vehicle::get_ped_in_vehicle_seat(iParam1, -1, 0) == iParam0)
			{
				return -1;
			}
			if (vehicle::get_ped_in_vehicle_seat(iParam1, 0, 0) == iParam0)
			{
				return 0;
			}
			if (vehicle::get_ped_in_vehicle_seat(iParam1, 1, 0) == iParam0)
			{
				return 1;
			}
			if (vehicle::get_ped_in_vehicle_seat(iParam1, 2, 0) == iParam0)
			{
				return 2;
			}
		}
	}
	return -2;
}

int func_445(int iParam0, int iParam1)//Position - 0x127F9
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	if (!ped::is_ped_injured(iParam0))
	{
		if (ped::is_ped_in_any_vehicle(iParam0, iParam1))
		{
			iVar0 = ped::get_vehicle_ped_is_in(iParam0, iParam1);
			if (entity::does_entity_exist(iVar0))
			{
				if (!entity::is_entity_dead(iVar0, 0))
				{
					iVar1 = vehicle::_get_vehicle_model_max_number_of_passengers(entity::get_entity_model(iVar0));
					iVar2 = 0;
					while (iVar2 < iVar1)
					{
						iVar3 = (iVar2 - 1);
						if (!vehicle::is_vehicle_seat_free(iVar0, iVar3, 0))
						{
							if (vehicle::get_ped_in_vehicle_seat(iVar0, iVar3, 0) == iParam0)
							{
								return iVar3;
							}
						}
						iVar2++;
					}
				}
			}
		}
	}
	return iVar3;
}

bool func_446(int iParam0)//Position - 0x1287B
{
	if ((!ped::is_ped_injured(iParam0) && !ped::is_ped_being_stunned(iParam0, 0)) && !ped::is_ped_ragdoll(iParam0))
	{
		return true;
	}
	return false;
}

bool func_447(int iParam0, int iParam1)//Position - 0x128AB
{
	if (ai::get_script_task_status(iParam0, iParam1) == 1 || ai::get_script_task_status(iParam0, iParam1) == 0)
	{
		return true;
	}
	return false;
}

bool func_448(int iParam0)//Position - 0x128D5
{
	if (player::_0x690A61A6D13583F6(iParam0))
	{
		return false;
	}
	if (ped::is_ped_sitting_in_any_vehicle(player::get_player_ped(iParam0)))
	{
		return true;
	}
	return false;
}

void func_449(int iParam0, int iParam1)//Position - 0x128FC
{
	int iVar0;
	
	iVar0 = 0;
	if (decorator::decor_exist_on(iParam0, "AttributeDamage"))
	{
		iVar0 = decorator::decor_get_int(iParam0, "AttributeDamage");
	}
	gameplay::set_bit(&iVar0, iParam1);
	decorator::decor_set_int(iParam0, "AttributeDamage", iVar0);
}

void func_450()//Position - 0x12932
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	iVar0 = gameplay::is_bit_set(Local_91.f_2, 6);
	iVar1 = gameplay::is_bit_set(Local_91.f_2, 10);
	func_455();
	if (iLocal_312 != 1)
	{
		if (gameplay::is_bit_set(Local_91.f_3, 12))
		{
			func_452();
		}
	}
	if (ui::does_blip_exist(iLocal_323))
	{
		func_451(&iLocal_323);
	}
	iVar3 = 0;
	while (iVar3 < func_421(iLocal_312))
	{
		iLocal_307[iVar3] = 0;
		iVar3++;
	}
	if (network::network_is_host_of_this_script())
	{
		Local_91.f_42 = -1;
		Local_91.f_5 = iLocal_319;
		Local_91.f_6 = iLocal_319;
		Local_91.f_7 = iLocal_319;
		Local_91.f_1 = 0;
		Local_91.f_4 = 0;
		Local_91.f_2 = 0;
		iVar3 = 0;
		while (iVar3 < func_421(iLocal_312))
		{
			iVar2 = gameplay::is_bit_set(Local_91.f_10[iVar3 /*7*/].f_2, 6);
			Local_91.f_10[iVar3 /*7*/].f_2 = 0;
			Local_91.f_10[iVar3 /*7*/].f_6 = -1;
			if (iVar2)
			{
				gameplay::set_bit(&(Local_91.f_10[iVar3 /*7*/].f_2), 6);
			}
			iVar3++;
		}
	}
	Local_145[player::network_player_id_to_int() /*5*/].f_1 = 0;
	Local_145[player::network_player_id_to_int() /*5*/].f_2 = -1;
	iLocal_306 = 0;
	if (iVar0)
	{
		gameplay::set_bit(&(Local_91.f_2), 6);
	}
	if (iVar1)
	{
		gameplay::set_bit(&(Local_91.f_2), 11);
		gameplay::set_bit(&iLocal_306, 8);
	}
	gameplay::set_bit(&iLocal_306, 4);
	gameplay::set_bit(&iLocal_306, 11);
}

void func_451(int iParam0)//Position - 0x12A72
{
	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 };
	}
}

void func_452()//Position - 0x12AE0
{
	switch (iLocal_312)
	{
		case 0:
			func_454(&(Global_1574284[3]));
			break;
		
		case 1:
			func_453();
			break;
	}
}

void func_453()//Position - 0x12B11
{
	int iVar0;
	
	if (network::network_is_game_in_progress())
	{
		iVar0 = 0;
		while (iVar0 < 32)
		{
			ped::set_relationship_between_groups(3, Global_1574240[iVar0], -1467815081);
			ped::set_relationship_between_groups(3, -1467815081, Global_1574240[iVar0]);
			iVar0++;
		}
	}
}

void func_454(var uParam0)//Position - 0x12B57
{
	int iVar0;
	
	if (network::network_is_game_in_progress())
	{
		iVar0 = 0;
		while (iVar0 < 32)
		{
			ped::set_relationship_between_groups(3, Global_1574240[iVar0], *uParam0);
			ped::set_relationship_between_groups(3, *uParam0, Global_1574240[iVar0]);
			iVar0++;
		}
	}
}

void func_455()//Position - 0x12B99
{
	int iVar0;
	int iVar1;
	
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < func_421(iLocal_312))
	{
		iVar1 = false;
		if (iLocal_312 == 0)
		{
			if (!gameplay::is_bit_set(Local_91.f_2, 1))
			{
				iVar1 = true;
			}
		}
		func_435(Local_91.f_10[iVar0 /*7*/], iVar1);
		iVar0++;
	}
}

void func_456()//Position - 0x12BE4
{
	func_457();
	if (iLocal_312 != 1)
	{
		func_425();
	}
}

void func_457()//Position - 0x12BFB
{
	int iVar0;
	int iVar1;
	
	iVar0 = 0;
	while (iVar0 < func_421(iLocal_312))
	{
		if (network::network_does_network_id_exist(Local_91.f_10[iVar0 /*7*/]))
		{
			if (network::network_has_control_of_network_id(Local_91.f_10[iVar0 /*7*/]))
			{
				iVar1 = network::net_to_ped(Local_91.f_10[iVar0 /*7*/]);
				if (!entity::is_entity_dead(iVar1, 0))
				{
					ped::set_ped_reset_flag(iVar1, 151, true);
				}
			}
		}
		iVar0++;
	}
	if (Global_2482149.f_1610)
	{
	}
	if (iLocal_312 == 1)
	{
		if (player::player_id() == iLocal_314)
		{
			if (gameplay::is_bit_set(Local_91.f_1, 0))
			{
				if (!gameplay::is_incident_valid(uLocal_496))
				{
					if (func_6(iLocal_314, 1, 1))
					{
						if (Local_91.f_50)
						{
							gameplay::create_incident_with_entity(15, player::get_player_ped(iLocal_314), 4, 0f, &uLocal_496, -1467815081);
						}
						else
						{
							gameplay::create_incident_with_entity(14, player::get_player_ped(iLocal_314), 4, 0f, &uLocal_496, 0);
						}
					}
				}
				if (Global_2482149.f_1610)
				{
					if (!gameplay::is_bit_set(Local_145[player::network_player_id_to_int() /*5*/].f_1, 3))
					{
						gameplay::set_bit(&(Local_145[player::network_player_id_to_int() /*5*/].f_1), 3);
					}
				}
			}
		}
	}
	else if (iLocal_312 == 0)
	{
		if (Local_91.f_42 != -1)
		{
			if (network::network_does_entity_exist_with_network_id(Local_91.f_10[Local_91.f_42 /*7*/]))
			{
				if (!entity::is_entity_dead(network::net_to_ped(Local_91.f_10[Local_91.f_42 /*7*/]), 0) && !func_461(network::net_to_ped(Local_91.f_10[Local_91.f_42 /*7*/])))
				{
					if (Local_91.f_10[Local_91.f_42 /*7*/].f_5 == 3)
					{
						func_458(Local_91.f_10[Local_91.f_42 /*7*/], &iLocal_323, -1082130432, 0, 1, 0, 0, -1, -1, 1);
						if (ui::does_blip_exist(iLocal_323))
						{
							if (!gameplay::is_bit_set(iLocal_306, 6))
							{
								ui::set_blip_name_from_text_file(iLocal_323, "FM_MGR_BLP");
								gameplay::set_bit(&iLocal_306, 6);
							}
						}
					}
				}
				else if (ui::does_blip_exist(iLocal_323))
				{
					func_451(&iLocal_323);
				}
			}
			if (player::player_id() == iLocal_313)
			{
				if (!gameplay::is_bit_set(iLocal_306, 14))
				{
					if (func_323("MPCT_mugsuc", "LAMAR", 19))
					{
						gameplay::set_bit(&iLocal_306, 14);
					}
				}
			}
		}
	}
}

void func_458(int iParam0, int iParam1, float fParam2, int iParam3, int iParam4, int iParam5, char* sParam6, int iParam7, int iParam8, int iParam9)//Position - 0x12DF0
{
	if (network::network_does_network_id_exist(iParam0))
	{
		if (func_460())
		{
			Global_2432628 = player::player_id();
		}
		if (iParam3)
		{
			func_459(network::net_to_ped(iParam0), iParam1, 1, Global_2432628, iParam4, iParam5, fParam2, sParam6, iParam7, iParam8, iParam9);
		}
		else
		{
			func_459(network::net_to_ped(iParam0), iParam1, -1, Global_2432628, iParam4, iParam5, fParam2, sParam6, iParam7, iParam8, iParam9);
		}
	}
	else if (ui::does_blip_exist(*iParam1))
	{
		func_451(iParam1);
	}
}

bool func_459(int iParam0, var uParam1, int iParam2, int iParam3, int iParam4, int iParam5, float fParam6, char* sParam7, int iParam8, int iParam9, int iParam10)//Position - 0x12E6B
{
	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);
			}
		}
		if (!iParam9 == -1)
		{
			unk_0xFCFACD0DB9D7A57D(iParam0, iParam9);
		}
		ui::_0x0C4BBF625CA98C4E(iParam0, iParam4);
		ui::hide_special_ability_lockon_operation(iParam0, iParam5);
		*uParam1 = ui::_0x7CD934010E115C2C(iParam0);
		if (!iParam9 == -1)
		{
			if (ui::does_blip_exist(*uParam1))
			{
				if (!iParam8 == -1)
				{
					ui::set_blip_colour(*uParam1, iParam8);
				}
				ui::begin_text_command_set_blip_name("STRING");
				if (iParam10)
				{
					ui::add_text_component_substring_player_name(sParam7);
				}
				else
				{
					ui::_add_text_component_item_string(sParam7);
				}
				ui::end_text_command_set_blip_name(*uParam1);
				ui::set_blip_priority(*uParam1, 7);
			}
		}
		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("STRING");
					if (iParam10)
					{
						ui::add_text_component_substring_player_name(sParam7);
					}
					else
					{
						ui::_add_text_component_item_string(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_460()//Position - 0x13008
{
	return Global_1315206;
}

bool func_461(int iParam0)//Position - 0x13014
{
	int iVar0;
	int iVar1;
	
	if (ped::is_ped_in_any_vehicle(iParam0, 0))
	{
		iVar0 = ped::get_vehicle_ped_is_in(iParam0, 0);
		if (vehicle::is_vehicle_driveable(iVar0, 0))
		{
			if (decorator::decor_is_registered_as_type("MPBitset", 3))
			{
				if (decorator::decor_exist_on(iVar0, "MPBitset"))
				{
					iVar1 = decorator::decor_get_int(iVar0, "MPBitset");
				}
				if (gameplay::is_bit_set(iVar1, 12))
				{
					return true;
				}
			}
		}
	}
	return false;
}

int func_462()//Position - 0x13068
{
	return Local_91;
}

var func_463(int iParam0)//Position - 0x13072
{
	return Local_145[iParam0 /*5*/];
}

void func_464()//Position - 0x13080
{
	if (player::player_id() == iLocal_314)
	{
		if (Global_25335)
		{
			if (!gameplay::is_bit_set(Local_145[iLocal_321 /*5*/].f_1, 4))
			{
				gameplay::set_bit(&(Local_145[iLocal_321 /*5*/].f_1), 4);
			}
		}
		else
		{
			gameplay::clear_bit(&(Local_145[iLocal_321 /*5*/].f_1), 4);
		}
	}
}

void func_465()//Position - 0x130C9
{
	int iVar0;
	
	iVar0 = false;
	if (player::player_id() == iLocal_313)
	{
		if (gameplay::is_bit_set(Global_1572922, 0))
		{
			gameplay::clear_bit(&Global_1572922, 0);
			iVar0 = true;
		}
		if (!gameplay::is_bit_set(Local_145[iLocal_313 /*5*/].f_1, 2))
		{
			if (gameplay::is_bit_set(Local_91.f_1, 11))
			{
				gameplay::set_bit(&(Local_145[iLocal_313 /*5*/].f_1), 2);
				iVar0 = true;
			}
		}
		else if (!gameplay::is_bit_set(Local_91.f_1, 11))
		{
			gameplay::clear_bit(&(Local_145[iLocal_313 /*5*/].f_1), 2);
		}
		if (iVar0)
		{
			Local_145[player::network_player_id_to_int() /*5*/].f_4 = func_469();
			func_466(Local_145[player::network_player_id_to_int() /*5*/].f_4);
		}
	}
	else if (Local_145[player::network_player_id_to_int() /*5*/].f_4 != Local_91.f_44)
	{
		Local_145[player::network_player_id_to_int() /*5*/].f_4 = Local_91.f_44;
		func_466(Local_145[player::network_player_id_to_int() /*5*/].f_4);
		iVar0 = true;
	}
}

void func_466(int iParam0)//Position - 0x13199
{
	switch (iLocal_312)
	{
		case 0:
			func_468(&(Global_1574284[3]), iParam0);
			break;
		
		case 1:
			func_467(iParam0);
			break;
	}
}

void func_467(int iParam0)//Position - 0x131CE
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < 32)
	{
		if (gameplay::is_bit_set(iParam0, iVar0))
		{
			ped::set_relationship_between_groups(1, Global_1574240[iVar0], -1467815081);
			ped::set_relationship_between_groups(1, -1467815081, Global_1574240[iVar0]);
		}
		else
		{
			ped::set_relationship_between_groups(3, Global_1574240[iVar0], -1467815081);
			ped::set_relationship_between_groups(3, -1467815081, Global_1574240[iVar0]);
		}
		iVar0++;
	}
}

void func_468(var uParam0, int iParam1)//Position - 0x1323F
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < 32)
	{
		if (gameplay::is_bit_set(iParam1, iVar0))
		{
			ped::set_relationship_between_groups(1, Global_1574240[iVar0], *uParam0);
			ped::set_relationship_between_groups(1, *uParam0, Global_1574240[iVar0]);
		}
		else
		{
			ped::set_relationship_between_groups(3, Global_1574240[iVar0], *uParam0);
			ped::set_relationship_between_groups(3, *uParam0, Global_1574240[iVar0]);
		}
		iVar0++;
	}
}

int func_469()//Position - 0x132A8
{
	int iVar0;
	int iVar1;
	
	iVar0 = 0;
	iVar1 = 0;
	iVar1 = 0;
	while (iVar1 < 32)
	{
		if (iLocal_312 == 1 || iLocal_312 == 0)
		{
			if (iLocal_313 == player::int_to_playerindex(iVar1))
			{
				gameplay::set_bit(&iVar0, iVar1);
			}
		}
		else if (player::player_id() == player::int_to_playerindex(iVar1))
		{
			gameplay::set_bit(&iVar0, iVar1);
		}
		else if (func_6(player::int_to_playerindex(iVar1), 0, 1))
		{
			if (func_46(player::int_to_playerindex(iVar1)))
			{
				gameplay::set_bit(&iVar0, iVar1);
			}
		}
		iVar1++;
	}
	return iVar0;
}

void func_470()//Position - 0x13331
{
	switch (iLocal_312)
	{
		case 0:
			if (!gameplay::is_bit_set(iLocal_306, 11))
			{
				if (player::player_id() == iLocal_313)
				{
					if (func_6(iLocal_314, 1, 1))
					{
						func_299("GC_TCK_60", iLocal_314, 0, 0, 0, 1, 1, 0);
						gameplay::set_bit(&iLocal_306, 11);
					}
				}
			}
			if (!gameplay::is_bit_set(iLocal_306, 12))
			{
				if (gameplay::is_bit_set(Local_91.f_1, 8))
				{
					if (player::player_id() == iLocal_313)
					{
						if (func_6(iLocal_314, 1, 1))
						{
							func_299("GC_TCK_62", iLocal_314, 0, 0, 0, 1, 1, 0);
							gameplay::set_bit(&iLocal_306, 12);
						}
					}
				}
			}
			if (gameplay::is_bit_set(Local_91.f_2, 10))
			{
				if (!gameplay::is_bit_set(iLocal_306, 8))
				{
					if (player::player_id() == iLocal_313)
					{
						if (func_6(iLocal_314, 1, 1))
						{
							func_299("GC_TCK_65", iLocal_314, 0, 0, 0, 1, 1, 0);
							gameplay::set_bit(&iLocal_306, 8);
						}
					}
				}
			}
			else if (!gameplay::is_bit_set(iLocal_306, 13))
			{
				if (!gameplay::is_bit_set(Local_91.f_2, 11))
				{
					if (gameplay::is_bit_set(Local_91.f_1, 8))
					{
						if (gameplay::is_bit_set(Local_91.f_2, 6))
						{
							if (player::player_id() == iLocal_313)
							{
								if (func_6(iLocal_314, 1, 1))
								{
									func_299("GC_TCK_63", iLocal_314, 0, 0, 0, 1, 1, 0);
									gameplay::set_bit(&iLocal_306, 13);
								}
							}
						}
					}
				}
			}
			break;
		
		case 1:
			if (!gameplay::is_bit_set(iLocal_306, 11))
			{
				if (player::player_id() == iLocal_313)
				{
					if (func_6(iLocal_314, 1, 1))
					{
						if (Local_91.f_50)
						{
							func_299("HS_SUCC", iLocal_314, 0, 0, 0, 1, 1, 0);
						}
						else
						{
							func_299("GC_TCK_70", iLocal_314, 0, 0, 0, 1, 1, 0);
						}
						gameplay::set_bit(&iLocal_306, 11);
					}
				}
				else if (player::player_id() == iLocal_314)
				{
					if (func_6(iLocal_313, 1, 1))
					{
						if (Local_91.f_50)
						{
							if (Local_91.f_51)
							{
								func_472("HS_A_SUCC", 1);
							}
							else
							{
								func_299("HS_SENT", iLocal_313, 0, 0, 0, 1, 1, 0);
							}
						}
						else
						{
							func_299("GC_TCK_71", iLocal_313, 0, 0, 0, 1, 1, 0);
						}
						gameplay::set_bit(&iLocal_306, 11);
					}
				}
			}
			if (!gameplay::is_bit_set(iLocal_306, 10))
			{
				if (gameplay::is_bit_set(Local_91.f_1, 0))
				{
					if (gameplay::is_bit_set(Local_91.f_3, 6))
					{
						if (player::player_id() == iLocal_313)
						{
							if (func_6(iLocal_314, 0, 1))
							{
								func_471(-1);
								if (Local_91.f_50)
								{
									if (!Local_91.f_51)
									{
										func_299("HS_KILLED", iLocal_314, 0, 0, 0, 1, 1, 0);
									}
								}
								else
								{
									func_299("GC_TCK_73", iLocal_314, 0, 0, 0, 1, 1, 0);
								}
								gameplay::set_bit(&iLocal_306, 10);
							}
						}
					}
				}
			}
			if (!gameplay::is_bit_set(iLocal_306, 9))
			{
				if (gameplay::is_bit_set(Local_91.f_1, 0))
				{
					if (gameplay::is_bit_set(Local_91.f_3, 7))
					{
						if (player::player_id() == iLocal_313)
						{
							if (func_6(iLocal_314, 0, 1))
							{
								if (Local_91.f_50)
								{
									func_299("HS_ESCAPED", iLocal_314, 0, 0, 0, 1, 1, 0);
								}
								else
								{
									func_299("GC_TCK_75", iLocal_314, 0, 0, 0, 1, 1, 0);
								}
								gameplay::set_bit(&iLocal_306, 9);
							}
						}
					}
				}
			}
			break;
	}
}

void func_471(int iParam0)//Position - 0x1363E
{
	if (Global_1573839)
	{
		if (Global_1573843 && Global_1588660[player::player_id() /*532*/] != 148)
		{
			if (Global_1573418.f_14 == player::int_to_playerindex(iParam0))
			{
				Global_1613026++;
			}
		}
		else
		{
			Global_1613026++;
		}
	}
}

int func_472(char* sParam0, int iParam1)//Position - 0x1368D
{
	int iVar0;
	
	iVar0 = -1;
	ui::_set_notification_text_entry(sParam0);
	iVar0 = ui::_draw_notification(0, 1);
	func_300(0, sParam0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0);
	return iVar0;
}

void func_473()//Position - 0x136B9
{
	if (network::get_num_reserved_mission_peds(false) != Local_91.f_45)
	{
		if (func_481(Local_91.f_45, 0, 1))
		{
			if (network::_0xCB215C4B56A7FAE7(0) <= Local_91.f_45)
			{
				network::reserve_network_mission_peds(Local_91.f_45);
			}
		}
	}
	if (network::get_num_reserved_mission_vehicles(false) != Local_91.f_46)
	{
		if (func_480(Local_91.f_45, 0, 1))
		{
			if (network::_0x0CD9AB83489430EA(0) <= Local_91.f_46)
			{
				network::reserve_network_mission_vehicles(Local_91.f_46);
			}
		}
	}
	if (network::get_num_reserved_mission_objects(false) != Local_91.f_47)
	{
		if (func_474(Local_91.f_45, 0, 1))
		{
			if (network::_0x12B6281B6C6706C0(0) <= Local_91.f_47)
			{
				network::reserve_network_mission_objects(Local_91.f_47);
			}
		}
	}
}

int func_474(int iParam0, int iParam1, int iParam2)//Position - 0x13748
{
	return func_475(2, iParam0, 1, iParam1, iParam2);
}

bool func_475(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4)//Position - 0x1375C
{
	int iVar0;
	int iVar1;
	
	if (!gameplay::is_bit_set(Global_1353353, 0))
	{
		return false;
	}
	if ((iParam2 && !iParam3) && iParam1 <= (func_479(iParam0) - func_478(iParam0, 0)))
	{
		return true;
	}
	else
	{
		if (iParam3)
		{
			if (iParam2)
			{
				iVar0 = (iParam1 - func_478(iParam0, 0));
			}
			else
			{
				iVar0 = iParam1;
			}
			iVar1 = (func_479(iParam0) - func_477(iParam0));
		}
		else
		{
			if (iParam2)
			{
				iVar0 = (iParam1 - func_478(iParam0, 0));
			}
			else
			{
				iVar0 = iParam1;
			}
			iVar1 = (func_479(iParam0) - func_478(iParam0, 1));
		}
		if (!iParam4 && Global_1588660[player::player_id() /*532*/] != 3)
		{
			iVar1 = (iVar1 - func_476(iParam0));
		}
		if (iVar0 < iVar1)
		{
			return true;
		}
	}
	return false;
}

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

int func_477(int iParam0)//Position - 0x1385F
{
	switch (iParam0)
	{
		case 0:
			return Global_1353353.f_1;
			break;
		
		case 1:
			return Global_1353353.f_2;
			break;
		
		case 2:
			return Global_1353353.f_3;
			break;
	}
	return 0;
}

int func_478(int iParam0, int iParam1)//Position - 0x138A5
{
	int iVar0;
	
	iVar0 = player::player_id();
	switch (iParam0)
	{
		case 0:
			if (!network::network_get_this_script_is_network_script())
			{
				return Global_2421327[iVar0 /*353*/].f_209;
			}
			else
			{
				return network::get_num_reserved_mission_peds(!iParam1);
			}
			break;
		
		case 1:
			if (!network::network_get_this_script_is_network_script())
			{
				return Global_2421327[iVar0 /*353*/].f_210;
			}
			else
			{
				return network::get_num_reserved_mission_vehicles(!iParam1);
			}
			break;
		
		case 2:
			if (!network::network_get_this_script_is_network_script())
			{
				return Global_2421327[iVar0 /*353*/].f_211;
			}
			else
			{
				return network::get_num_reserved_mission_objects(!iParam1);
			}
			break;
	}
	return 0;
}

int func_479(int iParam0)//Position - 0x1393F
{
	switch (iParam0)
	{
		case 0:
			return Global_1353361;
			break;
		
		case 1:
			return Global_1353362;
			break;
		
		case 2:
			return Global_1353363;
			break;
	}
	return 0;
}

int func_480(int iParam0, int iParam1, int iParam2)//Position - 0x1397F
{
	return func_475(1, iParam0, 1, iParam1, iParam2);
}

int func_481(int iParam0, int iParam1, int iParam2)//Position - 0x13993
{
	return func_475(0, iParam0, 1, iParam1, iParam2);
}

void func_482()//Position - 0x139A7
{
	if (Local_91.f_50)
	{
		if (player::player_id() == iLocal_313)
		{
			func_484(5);
		}
		else if (player::player_id() == iLocal_314)
		{
			func_484(9);
		}
	}
	func_483();
}

void func_483()//Position - 0x139DC
{
	script::terminate_this_thread();
}

void func_484(int iParam0)//Position - 0x139E8
{
	gameplay::clear_bit(&(Global_1614576[player::player_id() /*324*/].f_10.f_5), iParam0);
}

bool func_485()//Position - 0x13A05
{
	int iVar0;
	var uVar1;
	
	func_492(&iVar0, &uVar1);
	if (iVar0)
	{
		return true;
	}
	if (Global_1315206 == 0)
	{
		if (!network::network_is_game_in_progress())
		{
			return true;
		}
	}
	if (func_491())
	{
		return true;
	}
	if (Global_2453962)
	{
		return true;
	}
	if (func_490())
	{
		return true;
	}
	if (func_489(157))
	{
		if (!func_488())
		{
			return true;
		}
	}
	if (func_489(155))
	{
		return true;
	}
	if (!network::network_is_signed_online())
	{
		return true;
	}
	if (func_486() != 0)
	{
		if (script::_get_number_of_instances_of_streamed_script(func_486()) == 0)
		{
			return true;
		}
	}
	return false;
}

int func_486()//Position - 0x13A9A
{
	switch (func_487())
	{
		case 0:
			return joaat("freemode");
			break;
		
		case 2:
			return joaat("creator");
			break;
	}
	return 0;
}

var func_487()//Position - 0x13ACE
{
	return Global_25185;
}

var func_488()//Position - 0x13AD9
{
	return Global_2442442.f_576;
}

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

var func_490()//Position - 0x13AFF
{
	return Global_2451777;
}

var func_491()//Position - 0x13B0B
{
	return Global_2442442.f_571;
}

void func_492(var uParam0, var uParam1)//Position - 0x13B1A
{
	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 351:
					func_493(iVar0);
					break;
				
				case 2:
					script::get_event_data(1, iVar0, &vVar4, 3);
					if (vVar4.y == 55)
					{
						*uParam0 = 1;
					}
					else if (vVar4.y == 32)
					{
						*uParam1 = 1;
					}
					break;
				}
		}
		iVar0++;
	}
}

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

bool func_494(int iParam0, var uParam1)//Position - 0x13C1B
{
	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_495()//Position - 0x13C69
{
	system::wait(0);
}

void func_496(struct<20> Param0)//Position - 0x13C76
{
	func_500(32, Param0);
	func_499(0, -1, 0);
	network::network_register_host_broadcast_variables(&Local_91, 54);
	network::network_register_player_broadcast_variables(&Local_145, 161);
	gameplay::set_this_script_can_be_paused(0);
	if (!func_498())
	{
		func_229();
	}
	iLocal_312 = Param0.f_16;
	iLocal_313 = player::int_to_playerindex(Param0.f_17);
	if (network::network_is_player_active(iLocal_313))
	{
	}
	iLocal_314 = player::int_to_playerindex(Param0.f_18);
	if (network::network_is_player_active(iLocal_314))
	{
		iLocal_315 = gameplay::get_hash_key(player::get_player_name(iLocal_314));
	}
	if (func_497(iLocal_313, 5) && iLocal_312 == 1)
	{
		Local_91.f_50 = 1;
		if (func_497(iLocal_314, 9))
		{
			Local_91.f_51 = 1;
		}
	}
	vLocal_316 = { Param0.f_10 };
	if (iLocal_312 == 1)
	{
		if (player::player_id() == iLocal_313)
		{
			gameplay::set_bit(&Global_1572922, 0);
		}
	}
	Global_1729860 = 0;
	Global_1729861 = 0;
	if (iLocal_312 == 1)
	{
		Global_2482149.f_1610 = 0;
	}
	Local_145[player::network_player_id_to_int() /*5*/] = 0;
}

int func_497(int iParam0, int iParam1)//Position - 0x13D62
{
	return gameplay::is_bit_set(Global_1614576[iParam0 /*324*/].f_10.f_5, iParam1);
}

bool func_498()//Position - 0x13D7D
{
	int iVar0;
	
	iVar0 = 0;
	while (true)
	{
		iVar0++;
		if (!network::network_is_game_in_progress())
		{
			return false;
		}
		if (network::_0x5D10B3795F3FC886())
		{
			return true;
		}
		if (func_491())
		{
			return false;
		}
		if (func_489(155))
		{
			return false;
		}
		if (iVar0 >= 3600)
		{
			return false;
		}
		system::wait(0);
	}
	return false;
}

bool func_499(int iParam0, int iParam1, int iParam2)//Position - 0x13DD6
{
	int iVar0;
	
	iVar0 = network::network_get_script_status();
	while (iVar0 != 2)
	{
		if (((iVar0 == 3 || iVar0 == 4) || iVar0 == 5) || iVar0 == 6)
		{
			if (!iParam2)
			{
				func_483();
			}
			else
			{
				return false;
			}
		}
		if (!func_460())
		{
			if (iParam0 == 0)
			{
				if (!network::network_is_game_in_progress())
				{
					if (!iParam2)
					{
						func_483();
					}
					else
					{
						return false;
					}
				}
				if (func_491())
				{
					if (!iParam2)
					{
						func_483();
					}
					else
					{
						return false;
					}
				}
				if (func_489(155))
				{
					if (!iParam2)
					{
						func_483();
					}
					else
					{
						return false;
					}
				}
			}
			else if (!network::network_is_in_session())
			{
				if (!iParam2)
				{
					func_483();
				}
				else
				{
					return false;
				}
			}
		}
		system::wait(0);
		iVar0 = network::network_get_script_status();
	}
	if (iParam1 > -1)
	{
		Global_1312496 = iVar0;
	}
	if (iParam0 == 0)
	{
		if (!network::network_is_game_in_progress())
		{
			if (!iParam2)
			{
				func_483();
			}
			else
			{
				return false;
			}
		}
	}
	else if (!network::network_is_in_session())
	{
		if (!iParam2)
		{
			func_483();
		}
		else
		{
			return false;
		}
	}
	return true;
}

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

