#region Local Var
	var uLocal_0 = 0;
	var uLocal_1 = 0;
	int iLocal_2 = 0;
	int iLocal_3 = 0;
	int iLocal_4 = 0;
	int iLocal_5 = 0;
	int iLocal_6 = 0;
	int iLocal_7 = 0;
	int iLocal_8 = 0;
	int iLocal_9 = 0;
	int iLocal_10 = 0;
	int iLocal_11 = 0;
	var uLocal_12 = 0;
	var uLocal_13 = 0;
	float fLocal_14 = 0f;
	var uLocal_15 = 0;
	var uLocal_16 = 0;
	int iLocal_17 = 0;
	char* sLocal_18 = NULL;
	var uLocal_19 = 0;
	var uLocal_20 = 0;
	var uLocal_21 = 0;
	var uLocal_22 = 0;
	float fLocal_23 = 0f;
	float fLocal_24 = 0f;
	float fLocal_25 = 0f;
	var uLocal_26 = 0;
	var uLocal_27 = 0;
	float fLocal_28 = 0f;
	var uLocal_29 = 0;
	var uLocal_30 = 0;
	var uLocal_31 = 0;
	float fLocal_32 = 0f;
	float fLocal_33 = 0f;
	var uLocal_34 = 0;
	var uLocal_35 = 0;
	int iLocal_36 = 0;
	var uLocal_37 = 0;
	var uLocal_38 = 0;
	var uLocal_39 = 0;
	int iLocal_40 = 0;
	int iLocal_41 = 0;
	int iLocal_42 = 0;
	int iLocal_43 = 0;
	var uLocal_44 = 0;
	var uLocal_45 = 0;
	var uLocal_46 = 0;
	var uLocal_47 = 0;
	var uLocal_48 = 0;
	var uLocal_49 = 0;
	var uLocal_50 = 0;
	var uLocal_51 = 0;
	var uLocal_52 = 0;
	var uLocal_53 = 0;
	var uLocal_54 = 0;
	var uLocal_55 = 0;
	var uLocal_56 = 0;
	var uLocal_57 = 8;
	var uLocal_58 = 0;
	var uLocal_59 = 0;
	var uLocal_60 = 0;
	var uLocal_61 = 0;
	var uLocal_62 = 0;
	var uLocal_63 = 0;
	var uLocal_64 = 0;
	var uLocal_65 = 0;
	var uLocal_66 = 2;
	var uLocal_67 = 0;
	var uLocal_68 = 0;
	var uLocal_69 = 8;
	var uLocal_70 = 0;
	var uLocal_71 = 0;
	var uLocal_72 = 0;
	var uLocal_73 = 0;
	var uLocal_74 = 0;
	var uLocal_75 = 0;
	var uLocal_76 = 0;
	var uLocal_77 = 0;
	var uLocal_78 = 8;
	var uLocal_79 = 0;
	var uLocal_80 = 0;
	var uLocal_81 = 0;
	var uLocal_82 = 0;
	var uLocal_83 = 0;
	var uLocal_84 = 0;
	var uLocal_85 = 0;
	var uLocal_86 = 0;
	float fLocal_87 = 0f;
	var uLocal_88 = 0;
	var uLocal_89 = 0;
	float fLocal_90 = 0f;
	float fLocal_91 = 0f;
	float fLocal_92 = 0f;
	float fLocal_93 = 0f;
	float fLocal_94 = 0f;
	var uLocal_95 = 0;
	struct<196> Local_96 = { 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 744705981, -178150202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1 } ;
	struct<8> Local_292[32];
	int iLocal_549 = 0;
	int iLocal_550 = 0;
	int iLocal_551 = 0;
	int iLocal_552 = 0;
	int iLocal_553 = 0;
	int iLocal_554 = 0;
	var uLocal_555 = 1;
	var uLocal_556 = 0;
	var uLocal_557 = 0;
	var uLocal_558 = 0;
	var uLocal_559 = 0;
	var uLocal_560 = 0;
	var uLocal_561 = 0;
	var uLocal_562 = 0;
	var uLocal_563 = 0;
	int iLocal_564 = 0;
	int iLocal_565 = 0;
	int iLocal_566 = 0;
	int iLocal_567 = 0;
	int iLocal_568 = 0;
	int iLocal_569 = 0;
	vector3 vLocal_570 = { 0f, 0f, 0f };
	vector3 vLocal_573 = { 0f, 0f, 0f };
	int iLocal_576 = 0;
	float fLocal_577 = 0f;
	float fLocal_578 = 0f;
	var uLocal_579 = 0;
	var uLocal_580 = 0;
	var uLocal_581 = 0;
	var uLocal_582 = 0;
	var uLocal_583 = 0;
	struct<14> Local_584 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } ;
	var uLocal_598 = 0;
	var uLocal_599 = 0;
	vector3 vLocal_600[100] = {{ 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f }, { 0f, 0f, 0f } };
	float fLocal_901[100] = { 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f };
	int iLocal_1002 = 0;
	float fLocal_1003 = 0f;
	float fLocal_1004 = 0f;
	float fLocal_1005 = 0f;
	int iLocal_1006 = 0;
	struct<47> Local_1007[32];
	struct<105> Local_2512 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 32, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, -1, 0 } ;
	var uLocal_2617 = 0;
	var uLocal_2618 = 0;
	var uLocal_2619 = 0;
	var uLocal_2620 = 0;
	var uLocal_2621 = 32;
	var uLocal_2622 = 0;
	var uLocal_2623 = 0;
	var uLocal_2624 = 0;
	var uLocal_2625 = 0;
	var uLocal_2626 = 0;
	var uLocal_2627 = 0;
	var uLocal_2628 = 0;
	var uLocal_2629 = 0;
	var uLocal_2630 = 0;
	var uLocal_2631 = 0;
	var uLocal_2632 = 0;
	var uLocal_2633 = 0;
	var uLocal_2634 = 0;
	var uLocal_2635 = 0;
	var uLocal_2636 = 0;
	var uLocal_2637 = 0;
	var uLocal_2638 = 0;
	var uLocal_2639 = 0;
	var uLocal_2640 = 0;
	var uLocal_2641 = 0;
	var uLocal_2642 = 0;
	var uLocal_2643 = 0;
	var uLocal_2644 = 0;
	var uLocal_2645 = 0;
	var uLocal_2646 = 0;
	var uLocal_2647 = 0;
	var uLocal_2648 = 0;
	var uLocal_2649 = 0;
	var uLocal_2650 = 0;
	var uLocal_2651 = 0;
	var uLocal_2652 = 0;
	var uLocal_2653 = 0;
	var uLocal_2654 = 0;
	var uLocal_2655 = 0;
	var uLocal_2656 = 0;
	var uLocal_2657 = 0;
	var uLocal_2658 = 0;
	var uLocal_2659 = 0;
	var uLocal_2660 = 0;
	var uLocal_2661 = 0;
	var uLocal_2662 = 0;
	var uLocal_2663 = 0;
	var uLocal_2664 = 0;
	var uLocal_2665 = 0;
	var uLocal_2666 = 0;
	var uLocal_2667 = 0;
	var uLocal_2668 = 0;
	var uLocal_2669 = 0;
	var uLocal_2670 = 0;
	var uLocal_2671 = 0;
	var uLocal_2672 = 0;
	var uLocal_2673 = 0;
	var uLocal_2674 = 0;
	var uLocal_2675 = 0;
	var uLocal_2676 = 0;
	var uLocal_2677 = 0;
	var uLocal_2678 = 0;
	var uLocal_2679 = 0;
	var uLocal_2680 = 0;
	var uLocal_2681 = 0;
	var uLocal_2682 = 0;
	var uLocal_2683 = 0;
	var uLocal_2684 = 0;
	var uLocal_2685 = 0;
	var uLocal_2686 = 0;
	var uLocal_2687 = 0;
	var uLocal_2688 = 0;
	var uLocal_2689 = 0;
	var uLocal_2690 = 0;
	var uLocal_2691 = 0;
	var uLocal_2692 = 0;
	var uLocal_2693 = 0;
	var uLocal_2694 = 0;
	var uLocal_2695 = 0;
	var uLocal_2696 = 0;
	var uLocal_2697 = 0;
	var uLocal_2698 = 0;
	var uLocal_2699 = 0;
	var uLocal_2700 = 0;
	var uLocal_2701 = 0;
	var uLocal_2702 = 0;
	var uLocal_2703 = 0;
	var uLocal_2704 = 0;
	var uLocal_2705 = 0;
	var uLocal_2706 = 0;
	var uLocal_2707 = 0;
	var uLocal_2708 = 0;
	var uLocal_2709 = 0;
	var uLocal_2710 = 0;
	var uLocal_2711 = 0;
	var uLocal_2712 = 0;
	var uLocal_2713 = 0;
	var uLocal_2714 = 0;
	var uLocal_2715 = 0;
	var uLocal_2716 = 0;
	var uLocal_2717 = 0;
	var uLocal_2718 = 0;
	var uLocal_2719 = 0;
	var uLocal_2720 = 0;
	var uLocal_2721 = 0;
	var uLocal_2722 = 0;
	var uLocal_2723 = 0;
	var uLocal_2724 = 0;
	var uLocal_2725 = 0;
	var uLocal_2726 = 0;
	var uLocal_2727 = 0;
	var uLocal_2728 = 0;
	var uLocal_2729 = 0;
	var uLocal_2730 = 0;
	var uLocal_2731 = 0;
	var uLocal_2732 = 0;
	var uLocal_2733 = 0;
	var uLocal_2734 = 0;
	var uLocal_2735 = 0;
	var uLocal_2736 = 0;
	var uLocal_2737 = 0;
	var uLocal_2738 = 0;
	var uLocal_2739 = 0;
	var uLocal_2740 = 0;
	var uLocal_2741 = 0;
	var uLocal_2742 = 0;
	var uLocal_2743 = 0;
	var uLocal_2744 = 0;
	var uLocal_2745 = 0;
	var uLocal_2746 = 0;
	var uLocal_2747 = 0;
	var uLocal_2748 = 0;
	var uLocal_2749 = 0;
	var uLocal_2750 = 0;
	var uLocal_2751 = 0;
	var uLocal_2752 = 0;
	var uLocal_2753 = 0;
	var uLocal_2754 = 0;
	var uLocal_2755 = 0;
	var uLocal_2756 = 0;
	var uLocal_2757 = 0;
	var uLocal_2758 = 0;
	var uLocal_2759 = 0;
	var uLocal_2760 = 0;
	var uLocal_2761 = 0;
	var uLocal_2762 = 0;
	var uLocal_2763 = 0;
	var uLocal_2764 = 0;
	var uLocal_2765 = 0;
	var uLocal_2766 = 0;
	var uLocal_2767 = 0;
	var uLocal_2768 = 0;
	var uLocal_2769 = 0;
	var uLocal_2770 = 0;
	var uLocal_2771 = 0;
	var uLocal_2772 = 0;
	var uLocal_2773 = 0;
	var uLocal_2774 = 0;
	var uLocal_2775 = 0;
	var uLocal_2776 = 0;
	var uLocal_2777 = 0;
	var uLocal_2778 = 0;
	var uLocal_2779 = 0;
	var uLocal_2780 = 0;
	var uLocal_2781 = 0;
	var uLocal_2782 = 0;
	var uLocal_2783 = 0;
	var uLocal_2784 = 0;
	var uLocal_2785 = 0;
	var uLocal_2786 = 0;
	var uLocal_2787 = 0;
	var uLocal_2788 = 0;
	var uLocal_2789 = 0;
	var uLocal_2790 = 0;
	var uLocal_2791 = 0;
	var uLocal_2792 = 0;
	var uLocal_2793 = 0;
	var uLocal_2794 = 0;
	var uLocal_2795 = 0;
	var uLocal_2796 = 0;
	var uLocal_2797 = 0;
	var uLocal_2798 = 0;
	var uLocal_2799 = 0;
	var uLocal_2800 = 0;
	var uLocal_2801 = 0;
	var uLocal_2802 = 0;
	var uLocal_2803 = 0;
	var uLocal_2804 = 0;
	var uLocal_2805 = 0;
	var uLocal_2806 = 0;
	var uLocal_2807 = 0;
	var uLocal_2808 = 0;
	var uLocal_2809 = 0;
	var uLocal_2810 = 0;
	var uLocal_2811 = 0;
	var uLocal_2812 = 0;
	var uLocal_2813 = 0;
	var uLocal_2814 = 0;
	var uLocal_2815 = 0;
	var uLocal_2816 = 0;
	var uLocal_2817 = 0;
	var uLocal_2818 = 0;
	var uLocal_2819 = 0;
	var uLocal_2820 = 0;
	var uLocal_2821 = 0;
	var uLocal_2822 = 0;
	var uLocal_2823 = 0;
	var uLocal_2824 = 0;
	var uLocal_2825 = 0;
	var uLocal_2826 = 0;
	var uLocal_2827 = 0;
	var uLocal_2828 = 0;
	var uLocal_2829 = 0;
	var uLocal_2830 = 0;
	var uLocal_2831 = 0;
	var uLocal_2832 = 0;
	var uLocal_2833 = 0;
	var uLocal_2834 = 0;
	var uLocal_2835 = 0;
	var uLocal_2836 = 0;
	var uLocal_2837 = 0;
	var uLocal_2838 = 0;
	var uLocal_2839 = 0;
	var uLocal_2840 = 0;
	var uLocal_2841 = 0;
	var uLocal_2842 = 0;
	var uLocal_2843 = 0;
	var uLocal_2844 = 0;
	var uLocal_2845 = 0;
	var uLocal_2846 = 0;
	var uLocal_2847 = 0;
	var uLocal_2848 = 0;
	var uLocal_2849 = 0;
	var uLocal_2850 = 0;
	var uLocal_2851 = 0;
	var uLocal_2852 = 0;
	var uLocal_2853 = 0;
	var uLocal_2854 = 0;
	var uLocal_2855 = 0;
	var uLocal_2856 = 0;
	var uLocal_2857 = 0;
	var uLocal_2858 = 0;
	var uLocal_2859 = 0;
	var uLocal_2860 = 0;
	var uLocal_2861 = 0;
	var uLocal_2862 = 0;
	var uLocal_2863 = 0;
	var uLocal_2864 = 0;
	var uLocal_2865 = 0;
	var uLocal_2866 = 0;
	var uLocal_2867 = 0;
	var uLocal_2868 = 0;
	var uLocal_2869 = 0;
	var uLocal_2870 = 0;
	var uLocal_2871 = 0;
	var uLocal_2872 = 0;
	var uLocal_2873 = 0;
	var uLocal_2874 = 0;
	var uLocal_2875 = 0;
	var uLocal_2876 = 0;
	var uLocal_2877 = 0;
	var uLocal_2878 = 0;
	var uLocal_2879 = 0;
	var uLocal_2880 = 0;
	var uLocal_2881 = 0;
	var uLocal_2882 = 0;
	var uLocal_2883 = 0;
	var uLocal_2884 = 0;
	var uLocal_2885 = 0;
	var uLocal_2886 = 0;
	var uLocal_2887 = 0;
	var uLocal_2888 = 0;
	var uLocal_2889 = 0;
	var uLocal_2890 = 0;
	var uLocal_2891 = 0;
	var uLocal_2892 = 0;
	var uLocal_2893 = 0;
	var uLocal_2894 = 0;
	var uLocal_2895 = 0;
	var uLocal_2896 = 0;
	var uLocal_2897 = 0;
	var uLocal_2898 = 0;
	var uLocal_2899 = 0;
	var uLocal_2900 = 0;
	var uLocal_2901 = 0;
	var uLocal_2902 = 0;
	var uLocal_2903 = 0;
	var uLocal_2904 = 0;
	var uLocal_2905 = 0;
	var uLocal_2906 = 0;
	var uLocal_2907 = 0;
	var uLocal_2908 = 0;
	var uLocal_2909 = 0;
	var uLocal_2910 = 0;
	var uLocal_2911 = 0;
	var uLocal_2912 = 0;
	var uLocal_2913 = 0;
	var uLocal_2914 = 0;
	var uLocal_2915 = 0;
	var uLocal_2916 = 0;
	var uLocal_2917 = 0;
	var uLocal_2918 = 0;
	var uLocal_2919 = 0;
	var uLocal_2920 = 0;
	var uLocal_2921 = 0;
	var uLocal_2922 = 0;
	var uLocal_2923 = 0;
	var uLocal_2924 = 0;
	var uLocal_2925 = 0;
	var uLocal_2926 = 0;
	var uLocal_2927 = 0;
	var uLocal_2928 = 0;
	var uLocal_2929 = 0;
	var uLocal_2930 = 0;
	var uLocal_2931 = 0;
	var uLocal_2932 = 0;
	var uLocal_2933 = 0;
	var uLocal_2934 = 0;
	var uLocal_2935 = 0;
	var uLocal_2936 = 0;
	var uLocal_2937 = 0;
	var uLocal_2938 = 0;
	var uLocal_2939 = 0;
	var uLocal_2940 = 0;
	var uLocal_2941 = 0;
	var uLocal_2942 = 0;
	var uLocal_2943 = 0;
	var uLocal_2944 = 0;
	var uLocal_2945 = 0;
	var uLocal_2946 = 0;
	var uLocal_2947 = 0;
	var uLocal_2948 = 0;
	var uLocal_2949 = 0;
	var uLocal_2950 = 0;
	var uLocal_2951 = 0;
	var uLocal_2952 = 0;
	var uLocal_2953 = 0;
	var uLocal_2954 = 0;
	var uLocal_2955 = 0;
	var uLocal_2956 = 0;
	var uLocal_2957 = 0;
	var uLocal_2958 = 0;
	var uLocal_2959 = 0;
	var uLocal_2960 = 0;
	var uLocal_2961 = 0;
	var uLocal_2962 = 0;
	var uLocal_2963 = 0;
	var uLocal_2964 = 0;
	var uLocal_2965 = 0;
	var uLocal_2966 = 0;
	var uLocal_2967 = 0;
	var uLocal_2968 = 0;
	var uLocal_2969 = 0;
	var uLocal_2970 = 0;
	var uLocal_2971 = 0;
	var uLocal_2972 = 0;
	var uLocal_2973 = 0;
	var uLocal_2974 = 0;
	var uLocal_2975 = 0;
	var uLocal_2976 = 0;
	var uLocal_2977 = 0;
	var uLocal_2978 = 0;
	var uLocal_2979 = 0;
	var uLocal_2980 = 0;
	var uLocal_2981 = 0;
	var uLocal_2982 = 0;
	var uLocal_2983 = 0;
	var uLocal_2984 = 0;
	var uLocal_2985 = 0;
	var uLocal_2986 = 0;
	var uLocal_2987 = 0;
	var uLocal_2988 = 0;
	var uLocal_2989 = 0;
	var uLocal_2990 = 0;
	var uLocal_2991 = 0;
	var uLocal_2992 = 0;
	var uLocal_2993 = 0;
	var uLocal_2994 = 0;
	var uLocal_2995 = 0;
	var uLocal_2996 = 0;
	var uLocal_2997 = 0;
	var uLocal_2998 = 0;
	var uLocal_2999 = 0;
	var uLocal_3000 = 0;
	var uLocal_3001 = 0;
	var uLocal_3002 = 0;
	var uLocal_3003 = 0;
	var uLocal_3004 = 0;
	var uLocal_3005 = 0;
	var uLocal_3006 = 0;
	var uLocal_3007 = 0;
	var uLocal_3008 = 0;
	var uLocal_3009 = 0;
	var uLocal_3010 = 0;
	var uLocal_3011 = 0;
	var uLocal_3012 = 0;
	var uLocal_3013 = 0;
	var uLocal_3014 = 0;
	var uLocal_3015 = 0;
	var uLocal_3016 = 0;
	var uLocal_3017 = 0;
	var uLocal_3018 = 0;
	var uLocal_3019 = 0;
	var uLocal_3020 = 0;
	var uLocal_3021 = 0;
	var uLocal_3022 = 0;
	var uLocal_3023 = 0;
	var uLocal_3024 = 0;
	var uLocal_3025 = 0;
	var uLocal_3026 = 0;
	var uLocal_3027 = 0;
	var uLocal_3028 = 0;
	var uLocal_3029 = 0;
	var uLocal_3030 = 0;
	var uLocal_3031 = 0;
	var uLocal_3032 = 0;
	var uLocal_3033 = 0;
	var uLocal_3034 = 0;
	var uLocal_3035 = 0;
	var uLocal_3036 = 0;
	var uLocal_3037 = 0;
	int iLocal_3038 = 0;
	int iLocal_3039 = 0;
	int iLocal_3040 = 0;
	int iLocal_3041 = 0;
	int iLocal_3042 = 0;
	int iLocal_3043 = 0;
	vector3 vLocal_3044 = { 0f, 0f, 0f };
	var uLocal_3047 = 0;
	var uLocal_3048 = 0;
	var uLocal_3049 = 0;
	var uLocal_3050 = 0;
	var uLocal_3051 = 0;
	var uLocal_3052 = 12;
	var uLocal_3053 = 0;
	var uLocal_3054 = 0;
	var uLocal_3055 = 0;
	var uLocal_3056 = 0;
	var uLocal_3057 = 0;
	var uLocal_3058 = 0;
	var uLocal_3059 = 0;
	var uLocal_3060 = 0;
	var uLocal_3061 = 0;
	var uLocal_3062 = 0;
	var uLocal_3063 = 0;
	var uLocal_3064 = 0;
	var uLocal_3065 = 0;
	var uLocal_3066 = 0;
	var uLocal_3067 = 0;
	var uLocal_3068 = 0;
	var uLocal_3069 = 0;
	var uLocal_3070 = 0;
	var uLocal_3071 = 0;
	var uLocal_3072 = 0;
	var uLocal_3073 = 0;
	var uLocal_3074 = 0;
	var uLocal_3075 = 0;
	var uLocal_3076 = 0;
	var uLocal_3077 = 0;
	var uLocal_3078 = 0;
	var uLocal_3079 = 0;
	var uLocal_3080 = 0;
	var uLocal_3081 = 0;
	var uLocal_3082 = 0;
	var uLocal_3083 = 0;
	var uLocal_3084 = 0;
	var uLocal_3085 = 0;
	var uLocal_3086 = 0;
	var uLocal_3087 = 0;
	var uLocal_3088 = 0;
	var uLocal_3089 = 0;
	var uLocal_3090 = 0;
	var uLocal_3091 = 0;
	var uLocal_3092 = 0;
	var uLocal_3093 = 0;
	var uLocal_3094 = 0;
	var uLocal_3095 = 0;
	var uLocal_3096 = 0;
	var uLocal_3097 = 0;
	var uLocal_3098 = 0;
	var uLocal_3099 = 0;
	var uLocal_3100 = 0;
	var uLocal_3101 = 0;
	var uLocal_3102 = 0;
	var uLocal_3103 = 0;
	var uLocal_3104 = 0;
	var uLocal_3105 = 0;
	var uLocal_3106 = 0;
	var uLocal_3107 = 0;
	var uLocal_3108 = 0;
	var uLocal_3109 = 0;
	var uLocal_3110 = 0;
	var uLocal_3111 = 0;
	var uLocal_3112 = 0;
	var uLocal_3113 = 0;
	var uLocal_3114 = 0;
	var uLocal_3115 = 0;
	var uLocal_3116 = 0;
	var uLocal_3117 = 0;
	var uLocal_3118 = 0;
	var uLocal_3119 = 0;
	var uLocal_3120 = 0;
	var uLocal_3121 = 0;
	var uLocal_3122 = 0;
	var uLocal_3123 = 0;
	var uLocal_3124 = 0;
	var uLocal_3125 = 0;
	var uLocal_3126 = 0;
	var uLocal_3127 = 0;
	var uLocal_3128 = 0;
	var uLocal_3129 = 0;
	var uLocal_3130 = 0;
	var uLocal_3131 = 0;
	var uLocal_3132 = 0;
	var uLocal_3133 = 0;
	var uLocal_3134 = 0;
	var uLocal_3135 = 0;
	var uLocal_3136 = 0;
	var uLocal_3137 = 0;
	var uLocal_3138 = 0;
	var uLocal_3139 = 0;
	var uLocal_3140 = 0;
	var uLocal_3141 = 0;
	var uLocal_3142 = 0;
	var uLocal_3143 = 0;
	var uLocal_3144 = 0;
	var uLocal_3145 = 0;
	var uLocal_3146 = 0;
	var uLocal_3147 = 0;
	var uLocal_3148 = 0;
	var uLocal_3149 = 0;
	var uLocal_3150 = 0;
	var uLocal_3151 = 0;
	var uLocal_3152 = 0;
	var uLocal_3153 = 0;
	var uLocal_3154 = 0;
	var uLocal_3155 = 0;
	var uLocal_3156 = 0;
	var uLocal_3157 = 0;
	var uLocal_3158 = 0;
	var uLocal_3159 = 0;
	var uLocal_3160 = 0;
	var uLocal_3161 = 0;
	var uLocal_3162 = 0;
	var uLocal_3163 = 0;
	var uLocal_3164 = 0;
	var uLocal_3165 = 0;
	var uLocal_3166 = 0;
	var uLocal_3167 = 0;
	var uLocal_3168 = 0;
	var uLocal_3169 = 0;
	var uLocal_3170 = 0;
	var uLocal_3171 = 0;
	var uLocal_3172 = 0;
	var uLocal_3173 = 0;
	var uLocal_3174 = 0;
	var uLocal_3175 = 0;
	var uLocal_3176 = 0;
	var uLocal_3177 = 0;
	var uLocal_3178 = 0;
	var uLocal_3179 = 0;
	var uLocal_3180 = 0;
	var uLocal_3181 = 0;
	var uLocal_3182 = 0;
	var uLocal_3183 = 0;
	var uLocal_3184 = 0;
	var uLocal_3185 = 0;
	var uLocal_3186 = 0;
	var uLocal_3187 = 0;
	var uLocal_3188 = 0;
	var uLocal_3189 = 0;
	var uLocal_3190 = 0;
	var uLocal_3191 = 0;
	var uLocal_3192 = 0;
	var uLocal_3193 = 0;
	var uLocal_3194 = 0;
	var uLocal_3195 = 0;
	var uLocal_3196 = 0;
	var uLocal_3197 = 0;
	var uLocal_3198 = 0;
	var uLocal_3199 = 0;
	var uLocal_3200 = 0;
	var uLocal_3201 = 0;
	var uLocal_3202 = 0;
	var uLocal_3203 = 0;
	var uLocal_3204 = 0;
	var uLocal_3205 = 0;
	var uLocal_3206 = 0;
	var uLocal_3207 = 0;
	var uLocal_3208 = 0;
	var uLocal_3209 = 0;
	var uLocal_3210 = 0;
	var uLocal_3211 = 0;
	var uLocal_3212 = 0;
	var uLocal_3213 = 0;
	var uLocal_3214 = 0;
	var uLocal_3215 = 0;
	var uLocal_3216 = 0;
	var uLocal_3217 = 0;
	var uLocal_3218 = 0;
	var uLocal_3219 = 0;
	var uLocal_3220 = 0;
	var uLocal_3221 = 0;
	var uLocal_3222 = 0;
	var uLocal_3223 = 0;
	var uLocal_3224 = 0;
	var uLocal_3225 = 0;
	var uLocal_3226 = 0;
	var uLocal_3227 = 0;
	var uLocal_3228 = 0;
	var uLocal_3229 = 0;
	var uLocal_3230 = 0;
	var uLocal_3231 = 0;
	var uLocal_3232 = 0;
	var uLocal_3233 = 0;
	var uLocal_3234 = 0;
	var uLocal_3235 = 0;
	var uLocal_3236 = 0;
	var uLocal_3237 = 0;
	var uLocal_3238 = 0;
	var uLocal_3239 = 0;
	var uLocal_3240 = 0;
	var uLocal_3241 = 0;
	var uLocal_3242 = 0;
	var uLocal_3243 = 0;
	var uLocal_3244 = 0;
	var uLocal_3245 = 0;
	var uLocal_3246 = 0;
	var uLocal_3247 = 0;
	var uLocal_3248 = 0;
	var uLocal_3249 = 0;
	var uLocal_3250 = 0;
	var uLocal_3251 = 0;
	var uLocal_3252 = 0;
	var uLocal_3253 = 0;
	var uLocal_3254 = 0;
	var uLocal_3255 = 0;
	var uLocal_3256 = 0;
	var uLocal_3257 = 0;
	var uLocal_3258 = 0;
	var uLocal_3259 = 0;
	var uLocal_3260 = 0;
	var uLocal_3261 = 0;
	var uLocal_3262 = 0;
	var uLocal_3263 = 0;
	var uLocal_3264 = 0;
	var uLocal_3265 = 0;
	var uLocal_3266 = 0;
	var uLocal_3267 = 0;
	var uLocal_3268 = 0;
	var uLocal_3269 = 0;
	var uLocal_3270 = 0;
	var uLocal_3271 = 0;
	var uLocal_3272 = 0;
	var uLocal_3273 = 0;
	var uLocal_3274 = 0;
	var uLocal_3275 = 0;
	var uLocal_3276 = 0;
	var uLocal_3277 = 0;
	var uLocal_3278 = 0;
	var uLocal_3279 = 0;
	var uLocal_3280 = 0;
	var uLocal_3281 = 0;
	var uLocal_3282 = 0;
	var uLocal_3283 = 0;
	var uLocal_3284 = 0;
	var uLocal_3285 = 0;
	var uLocal_3286 = 0;
	var uLocal_3287 = 0;
	var uLocal_3288 = 0;
	var uLocal_3289 = 0;
	var uLocal_3290 = 0;
	var uLocal_3291 = 0;
	var uLocal_3292 = 0;
	var uLocal_3293 = 0;
	var uLocal_3294 = 0;
	var uLocal_3295 = 0;
	var uLocal_3296 = 0;
	var uLocal_3297 = 0;
	var uLocal_3298 = 0;
	var uLocal_3299 = 0;
	var uLocal_3300 = 0;
	var uLocal_3301 = 0;
	var uLocal_3302 = 0;
	var uLocal_3303 = 0;
	var uLocal_3304 = 0;
	var uLocal_3305 = 0;
	var uLocal_3306 = 0;
	var uLocal_3307 = 0;
	var uLocal_3308 = 0;
	var uLocal_3309 = 0;
	var uLocal_3310 = 0;
	var uLocal_3311 = 0;
	var uLocal_3312 = 0;
	var uLocal_3313 = 0;
	var uLocal_3314 = 0;
	var uLocal_3315 = 0;
	var uLocal_3316 = 0;
	var uLocal_3317 = 0;
	var uLocal_3318 = 0;
	var uLocal_3319 = 0;
	var uLocal_3320 = 0;
	var uLocal_3321 = 0;
	var uLocal_3322 = 0;
	var uLocal_3323 = 0;
	var uLocal_3324 = 0;
	var uLocal_3325 = 0;
	var uLocal_3326 = 0;
	var uLocal_3327 = 0;
	var uLocal_3328 = 0;
	var uLocal_3329 = 0;
	var uLocal_3330 = 0;
	var uLocal_3331 = 0;
	var uLocal_3332 = 0;
	var uLocal_3333 = 0;
	var uLocal_3334 = 0;
	var uLocal_3335 = 0;
	var uLocal_3336 = 0;
	var uLocal_3337 = 0;
	var uLocal_3338 = 0;
	var uLocal_3339 = 0;
	var uLocal_3340 = 0;
	var uLocal_3341 = 0;
	var uLocal_3342 = 0;
	var uLocal_3343 = 0;
	var uLocal_3344 = 0;
	var uLocal_3345 = 0;
	var uLocal_3346 = 0;
	var uLocal_3347 = 0;
	var uLocal_3348 = 0;
	var uLocal_3349 = 0;
	var uLocal_3350 = 0;
	var uLocal_3351 = 0;
	var uLocal_3352 = 0;
	var uLocal_3353 = 0;
	var uLocal_3354 = 0;
	var uLocal_3355 = 0;
	var uLocal_3356 = 0;
	var uLocal_3357 = 0;
	var uLocal_3358 = 0;
	var uLocal_3359 = 0;
	var uLocal_3360 = 0;
	var uLocal_3361 = 0;
	var uLocal_3362 = 0;
	var uLocal_3363 = 0;
	var uLocal_3364 = 0;
	var uLocal_3365 = 0;
	var uLocal_3366 = 0;
	var uLocal_3367 = 0;
	var uLocal_3368 = 0;
	var uLocal_3369 = 0;
	var uLocal_3370 = 0;
	var uLocal_3371 = 0;
	var uLocal_3372 = 0;
	var uLocal_3373 = 0;
	var uLocal_3374 = 0;
	var uLocal_3375 = 0;
	var uLocal_3376 = 0;
	var uLocal_3377 = 0;
	var uLocal_3378 = 0;
	var uLocal_3379 = 0;
	var uLocal_3380 = 0;
	var uLocal_3381 = 0;
	var uLocal_3382 = 0;
	var uLocal_3383 = 0;
	var uLocal_3384 = 0;
	var uLocal_3385 = 0;
	var uLocal_3386 = 0;
	var uLocal_3387 = 0;
	var uLocal_3388 = 0;
	var uLocal_3389 = 0;
	var uLocal_3390 = 0;
	var uLocal_3391 = 0;
	var uLocal_3392 = 0;
	var uLocal_3393 = 0;
	var uLocal_3394 = 0;
	var uLocal_3395 = 0;
	var uLocal_3396 = 0;
	var uLocal_3397 = 0;
	var uLocal_3398 = 0;
	var uLocal_3399 = 0;
	var uLocal_3400 = 0;
	var uLocal_3401 = 0;
	var uLocal_3402 = 0;
	var uLocal_3403 = 0;
	var uLocal_3404 = 0;
	var uLocal_3405 = 0;
	var uLocal_3406 = 0;
	var uLocal_3407 = 0;
	var uLocal_3408 = 0;
	var uLocal_3409 = 0;
	var uLocal_3410 = 0;
	var uLocal_3411 = 0;
	var uLocal_3412 = 0;
	var uLocal_3413 = 0;
	var uLocal_3414 = 0;
	var uLocal_3415 = 0;
	var uLocal_3416 = 0;
	var uLocal_3417 = 0;
	var uLocal_3418 = 0;
	var uLocal_3419 = 0;
	var uLocal_3420 = 0;
	var uLocal_3421 = 0;
	var uLocal_3422 = 0;
	var uLocal_3423 = 0;
	var uLocal_3424 = 0;
	var uLocal_3425 = 0;
	var uLocal_3426 = 0;
	var uLocal_3427 = 0;
	var uLocal_3428 = 0;
	var uLocal_3429 = 0;
	var uLocal_3430 = 0;
	var uLocal_3431 = 0;
	var uLocal_3432 = 0;
	var uLocal_3433 = 0;
	var uLocal_3434 = 0;
	var uLocal_3435 = 0;
	var uLocal_3436 = 0;
	var uLocal_3437 = 0;
	var uLocal_3438 = 0;
	var uLocal_3439 = 0;
	var uLocal_3440 = 0;
	var uLocal_3441 = 0;
	var uLocal_3442 = 0;
	var uLocal_3443 = 0;
	var uLocal_3444 = 0;
	var uLocal_3445 = 0;
	var uLocal_3446 = 0;
	var uLocal_3447 = 0;
	var uLocal_3448 = 0;
	var uLocal_3449 = 0;
	var uLocal_3450 = 0;
	var uLocal_3451 = 0;
	var uLocal_3452 = 0;
	var uLocal_3453 = 0;
	var uLocal_3454 = 0;
	var uLocal_3455 = 0;
	var uLocal_3456 = 0;
	var uLocal_3457 = 0;
	var uLocal_3458 = 0;
	var uLocal_3459 = 0;
	var uLocal_3460 = 0;
	var uLocal_3461 = 0;
	var uLocal_3462 = 0;
	var uLocal_3463 = 0;
	var uLocal_3464 = 0;
	var uLocal_3465 = 0;
	var uLocal_3466 = 0;
	var uLocal_3467 = 0;
	var uLocal_3468 = 0;
	var uLocal_3469 = 0;
	var uLocal_3470 = 0;
	var uLocal_3471 = 0;
	var uLocal_3472 = 0;
	var uLocal_3473 = 0;
	var uLocal_3474 = 0;
	var uLocal_3475 = 0;
	var uLocal_3476 = 0;
	var uLocal_3477 = 0;
	var uLocal_3478 = 0;
	var uLocal_3479 = 0;
	var uLocal_3480 = 0;
	var uLocal_3481 = 0;
	var uLocal_3482 = 0;
	var uLocal_3483 = 0;
	var uLocal_3484 = 0;
	var uLocal_3485 = 0;
	var uLocal_3486 = 0;
	var uLocal_3487 = 0;
	var uLocal_3488 = 0;
	var uLocal_3489 = 0;
	var uLocal_3490 = 0;
	var uLocal_3491 = 0;
	var uLocal_3492 = 0;
	var uLocal_3493 = 0;
	var uLocal_3494 = 0;
	var uLocal_3495 = 0;
	var uLocal_3496 = 0;
	var uLocal_3497 = 0;
	var uLocal_3498 = 0;
	var uLocal_3499 = 0;
	var uLocal_3500 = 0;
	var uLocal_3501 = 0;
	var uLocal_3502 = 0;
	var uLocal_3503 = 0;
	var uLocal_3504 = 0;
	var uLocal_3505 = 0;
	var uLocal_3506 = 0;
	var uLocal_3507 = 0;
	var uLocal_3508 = 0;
	var uLocal_3509 = 0;
	var uLocal_3510 = 0;
	var uLocal_3511 = 0;
	var uLocal_3512 = 0;
	var uLocal_3513 = 0;
	var uLocal_3514 = 0;
	var uLocal_3515 = 0;
	var uLocal_3516 = 0;
	var uLocal_3517 = 0;
	var uLocal_3518 = 0;
	var uLocal_3519 = 0;
	var uLocal_3520 = 0;
	var uLocal_3521 = 0;
	var uLocal_3522 = 0;
	var uLocal_3523 = 0;
	var uLocal_3524 = 0;
	var uLocal_3525 = 0;
	var uLocal_3526 = 0;
	var uLocal_3527 = 0;
	var uLocal_3528 = 0;
	var uLocal_3529 = 0;
	var uLocal_3530 = 0;
	var uLocal_3531 = 0;
	var uLocal_3532 = 0;
	var uLocal_3533 = 0;
	var uLocal_3534 = 0;
	var uLocal_3535 = 0;
	var uLocal_3536 = 0;
	var uLocal_3537 = 0;
	var uLocal_3538 = 0;
	var uLocal_3539 = 0;
	var uLocal_3540 = 0;
	var uLocal_3541 = 0;
	var uLocal_3542 = 0;
	var uLocal_3543 = 0;
	var uLocal_3544 = 0;
	var uLocal_3545 = 0;
	var uLocal_3546 = 0;
	var uLocal_3547 = 0;
	var uLocal_3548 = 0;
	var uLocal_3549 = 0;
	var uLocal_3550 = 0;
	var uLocal_3551 = 0;
	var uLocal_3552 = 0;
	var uLocal_3553 = 0;
	var uLocal_3554 = 0;
	var uLocal_3555 = 0;
	var uLocal_3556 = 0;
	var uLocal_3557 = 0;
	var uLocal_3558 = 0;
	var uLocal_3559 = 0;
	var uLocal_3560 = 0;
	var uLocal_3561 = 0;
	var uLocal_3562 = 0;
	var uLocal_3563 = 0;
	var uLocal_3564 = 0;
	var uLocal_3565 = 0;
	var uLocal_3566 = 0;
	var uLocal_3567 = 0;
	var uLocal_3568 = 0;
	var uLocal_3569 = 0;
	var uLocal_3570 = 0;
	var uLocal_3571 = 0;
	var uLocal_3572 = 0;
	var uLocal_3573 = 0;
	var uLocal_3574 = 0;
	var uLocal_3575 = 0;
	var uLocal_3576 = 0;
	var uLocal_3577 = 0;
	var uLocal_3578 = 0;
	var uLocal_3579 = 0;
	var uLocal_3580 = 0;
	var uLocal_3581 = 0;
	var uLocal_3582 = 0;
	var uLocal_3583 = 0;
	var uLocal_3584 = 0;
	var uLocal_3585 = 0;
	var uLocal_3586 = 0;
	var uLocal_3587 = 0;
	var uLocal_3588 = 0;
	var uLocal_3589 = 0;
	var uLocal_3590 = 0;
	var uLocal_3591 = 0;
	var uLocal_3592 = 0;
	var uLocal_3593 = 0;
	var uLocal_3594 = 0;
	var uLocal_3595 = 0;
	var uLocal_3596 = 0;
	var uLocal_3597 = 0;
	var uLocal_3598 = 0;
	var uLocal_3599 = 0;
	var uLocal_3600 = 0;
	var uLocal_3601 = 0;
	var uLocal_3602 = 0;
	var uLocal_3603 = 0;
	var uLocal_3604 = 0;
	var uLocal_3605 = 0;
	var uLocal_3606 = 0;
	var uLocal_3607 = 0;
	var uLocal_3608 = 0;
	var uLocal_3609 = 0;
	var uLocal_3610 = 0;
	var uLocal_3611 = 0;
	var uLocal_3612 = 0;
	var uLocal_3613 = 0;
	var uLocal_3614 = 0;
	var uLocal_3615 = 0;
	var uLocal_3616 = 0;
	var uLocal_3617 = 0;
	var uLocal_3618 = 0;
	var uLocal_3619 = 0;
	var uLocal_3620 = 0;
	var uLocal_3621 = 0;
	var uLocal_3622 = 0;
	var uLocal_3623 = 0;
	var uLocal_3624 = 0;
	var uLocal_3625 = 0;
	var uLocal_3626 = 0;
	var uLocal_3627 = 0;
	var uLocal_3628 = 0;
	var uLocal_3629 = 0;
	var uLocal_3630 = 0;
	var uLocal_3631 = 0;
	var uLocal_3632 = 0;
	var uLocal_3633 = 0;
	var uLocal_3634 = 0;
	var uLocal_3635 = 0;
	var uLocal_3636 = 0;
	var uLocal_3637 = 0;
	var uLocal_3638 = 0;
	var uLocal_3639 = 0;
	var uLocal_3640 = 0;
	var uLocal_3641 = 0;
	var uLocal_3642 = 0;
	var uLocal_3643 = 0;
	var uLocal_3644 = 0;
	var uLocal_3645 = 0;
	var uLocal_3646 = 0;
	var uLocal_3647 = 0;
	var uLocal_3648 = 0;
	var uLocal_3649 = 0;
	var uLocal_3650 = 0;
	var uLocal_3651 = 0;
	var uLocal_3652 = 0;
	var uLocal_3653 = 0;
	var uLocal_3654 = 0;
	var uLocal_3655 = 0;
	var uLocal_3656 = 0;
	var uLocal_3657 = 0;
	var uLocal_3658 = 0;
	var uLocal_3659 = 0;
	var uLocal_3660 = 0;
	var uLocal_3661 = 0;
	var uLocal_3662 = 0;
	var uLocal_3663 = 0;
	var uLocal_3664 = 0;
	var uLocal_3665 = 0;
	var uLocal_3666 = 0;
	var uLocal_3667 = 0;
	var uLocal_3668 = 0;
	var uLocal_3669 = 0;
	var uLocal_3670 = 0;
	var uLocal_3671 = 0;
	var uLocal_3672 = 0;
	var uLocal_3673 = 0;
	var uLocal_3674 = 0;
	var uLocal_3675 = 0;
	var uLocal_3676 = 0;
	var uLocal_3677 = 0;
	var uLocal_3678 = 0;
	var uLocal_3679 = 0;
	var uLocal_3680 = 0;
	var uLocal_3681 = 0;
	var uLocal_3682 = 0;
	var uLocal_3683 = 0;
	var uLocal_3684 = 0;
	var uLocal_3685 = 0;
	var uLocal_3686 = 0;
	var uLocal_3687 = 0;
	var uLocal_3688 = 0;
	var uLocal_3689 = 0;
	var uLocal_3690 = 0;
	var uLocal_3691 = 0;
	var uLocal_3692 = 0;
	var uLocal_3693 = 0;
	var uLocal_3694 = 0;
	var uLocal_3695 = 0;
	var uLocal_3696 = 0;
	var uLocal_3697 = 0;
	var uLocal_3698 = 0;
	var uLocal_3699 = 0;
	var uLocal_3700 = 0;
	var uLocal_3701 = 0;
	var uLocal_3702 = 0;
	var uLocal_3703 = 0;
	var uLocal_3704 = 0;
	var uLocal_3705 = 0;
	var uLocal_3706 = 0;
	var uLocal_3707 = 0;
	var uLocal_3708 = 0;
	var uLocal_3709 = 0;
	var uLocal_3710 = 0;
	var uLocal_3711 = 0;
	var uLocal_3712 = 0;
	var uLocal_3713 = 0;
	var uLocal_3714 = 0;
	var uLocal_3715 = 0;
	var uLocal_3716 = 0;
	var uLocal_3717 = 0;
	var uLocal_3718 = 0;
	var uLocal_3719 = 0;
	var uLocal_3720 = 0;
	var uLocal_3721 = 0;
	var uLocal_3722 = 0;
	var uLocal_3723 = 0;
	var uLocal_3724 = 0;
	var uLocal_3725 = 0;
	var uLocal_3726 = 0;
	var uLocal_3727 = 0;
	var uLocal_3728 = 0;
	var uLocal_3729 = 0;
	var uLocal_3730 = 0;
	var uLocal_3731 = 0;
	var uLocal_3732 = 0;
	var uLocal_3733 = 0;
	var uLocal_3734 = 0;
	var uLocal_3735 = 0;
	var uLocal_3736 = 0;
	var uLocal_3737 = 1065353216;
	var uLocal_3738 = 0;
	var uLocal_3739 = 0;
	var uLocal_3740 = 0;
	int iLocal_3741 = 0;
	var uLocal_3742 = 0;
	var uLocal_3743 = 0;
	var uLocal_3744 = 0;
	var uLocal_3745 = 0;
	var uLocal_3746 = 0;
	struct<12> Local_3747 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } ;
	var uLocal_3759 = 0;
	var uLocal_3760 = 0;
	var uLocal_3761 = 0;
	var uLocal_3762 = 0;
	var uLocal_3763 = 0;
	var uLocal_3764 = 0;
	var uLocal_3765 = 0;
	var uLocal_3766 = 0;
	var uLocal_3767 = 0;
	var uLocal_3768 = 0;
	int iLocal_3769 = 0;
	int iLocal_3770 = 0;
	int iLocal_3771 = 0;
	int iLocal_3772 = 0;
	int iLocal_3773 = 0;
	int iLocal_3774 = 0;
	vector3 vLocal_3775 = { 0f, 0f, 0f };
	float fLocal_3778 = 0f;
	float fLocal_3779 = 0f;
	vector3 vLocal_3780 = { 0f, 0f, 0f };
	float fLocal_3783 = 0f;
	int iLocal_3784 = 0;
	int iLocal_3785 = 0;
	int iLocal_3786 = 0;
	struct<20> Local_3787 = { 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1 } ;
#endregion

void __EntryFunction__()//Position - 0x0
{
	iLocal_2 = 1;
	iLocal_3 = 134;
	iLocal_4 = 134;
	iLocal_5 = 1;
	iLocal_6 = 1;
	iLocal_7 = 1;
	iLocal_8 = 134;
	iLocal_9 = 1;
	iLocal_10 = 12;
	iLocal_11 = 12;
	fLocal_14 = 0.001f;
	iLocal_17 = -1;
	sLocal_18 = "NULL";
	fLocal_23 = 80f;
	fLocal_24 = 140f;
	fLocal_25 = 180f;
	fLocal_28 = 0f;
	fLocal_32 = -0.0375f;
	fLocal_33 = 0.17f;
	iLocal_36 = 3;
	iLocal_40 = 1;
	iLocal_41 = 65;
	iLocal_42 = 49;
	iLocal_43 = 64;
	fLocal_87 = ((0.05f + 0.275f) - 0.01f);
	fLocal_90 = -0.05f;
	fLocal_91 = 0.92f;
	fLocal_92 = 1.94f;
	fLocal_93 = 2.99f;
	fLocal_94 = 3.7f;
	iLocal_3772 = -1;
	iLocal_3773 = -1;
	fLocal_3779 = -1f;
	if (network::network_is_game_in_progress() && func_694(player::player_id(), 0, 1))
	{
		func_684(Local_3787);
	}
	else
	{
		func_677();
	}
	while (true)
	{
		func_676();
		if (func_669() || func_666(24))
		{
			func_677();
		}
		if (func_665())
		{
			func_677();
		}
		func_646();
		switch (func_645(network::participant_id_to_int()))
		{
			case 0:
				if (func_644() == 1)
				{
					if (func_643())
					{
						if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 7))
						{
							if (func_642(11))
							{
								gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 7);
							}
						}
						func_639();
						vLocal_570 = { vLocal_600[0 /*3*/] };
						fLocal_577 = func_638();
						fLocal_578 = fLocal_577;
						iLocal_569 = 0;
						uLocal_579 = func_637();
						if (!func_615(1))
						{
							func_613(func_614(), 1);
							func_610();
						}
						func_603(136, Local_96.f_165, 0, 0);
						Local_292[network::participant_id_to_int() /*8*/] = 1;
					}
				}
				else if (func_644() == 4)
				{
					Local_292[network::participant_id_to_int() /*8*/] = 3;
				}
				break;
			
			case 1:
				if (func_644() == 1)
				{
					func_599();
					func_471();
					func_412();
					func_90();
					func_89();
					func_85();
					func_81();
					func_66();
				}
				else if (func_644() == 4)
				{
					Local_292[network::participant_id_to_int() /*8*/] = 3;
				}
				break;
			
			case 3:
				func_65(&(Local_96.f_22));
				if (func_64(&(Local_96.f_22)))
				{
					Local_292[network::participant_id_to_int() /*8*/] = 4;
				}
				break;
			
			case 2:
				Local_292[network::participant_id_to_int() /*8*/] = 4;
			
			case 4:
				func_677();
				break;
		}
		if (network::network_is_host_of_this_script())
		{
			switch (func_644())
			{
				case 0:
					if (func_60(&(Local_96.f_165)))
					{
						func_59();
						if (func_643())
						{
							func_639();
							Local_96.f_182.f_7 = func_58();
							Local_96.f_8 = func_638();
							Local_96.f_164 = func_637();
							Local_96 = 1;
							func_55(func_57(136, Local_96.f_165, 0, 0));
						}
					}
					break;
				
				case 1:
					func_42();
					func_27();
					func_3();
					if (func_1())
					{
						Local_96 = 4;
					}
					break;
				
				case 4:
					break;
				}
		}
	}
}

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

bool func_2()//Position - 0x2EF
{
	int iVar0;
	int iVar1;
	
	if (Local_96.f_21 >= 2)
	{
		iVar0 = true;
		iVar1 = 0;
		while (iVar1 < network::_network_get_num_participants_host())
		{
			if (network::network_is_participant_active(player::int_to_participantindex(iVar1)))
			{
				if (Local_292[iVar1 /*8*/].f_7 < 5)
				{
					iVar0 = false;
				}
			}
			iVar1++;
		}
	}
	if (iVar0)
	{
		return true;
	}
	return false;
}

void func_3()//Position - 0x33E
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	iVar1 = true;
	if (Local_96.f_21 > 0)
	{
		if (func_26())
		{
			iVar0 = player::get_player_ped(Local_96.f_182.f_7);
		}
		else
		{
			func_25();
		}
		if (!func_24(vLocal_570, Local_96.f_192, 1056964608, 0))
		{
			Local_96.f_192 = { vLocal_570 };
		}
		iVar2 = Global_262145.f_9358;
		func_4(&(Local_96.f_182), iVar0, Local_96.f_192, iVar1, Global_262145.f_9356, Global_262145.f_9357, iVar2, 4352);
	}
}

void func_4(var uParam0, int iParam1, vector3 vParam2, int iParam5, float fParam6, float fParam7, int iParam8, int iParam9)//Position - 0x3BD
{
	int iVar0;
	int iVar1;
	
	switch (func_23(uParam0))
	{
		case 0:
			if (network::get_num_reserved_mission_peds(false) == 0)
			{
				network::reserve_network_mission_peds(1);
			}
			func_22(uParam0, 1);
			break;
		
		case 1:
			if (!func_21(vParam2))
			{
				if (func_17(uParam0, func_20(vParam2), func_19()))
				{
					if (func_13(uParam0))
					{
						func_11(uParam0);
						func_22(uParam0, 2);
					}
				}
			}
			break;
		
		case 2:
			if (iParam5)
			{
				if (func_10(uParam0))
				{
					iVar0 = network::net_to_ped(uParam0->f_3);
					iVar1 = network::net_to_veh(uParam0->f_2);
					func_5(uParam0, iVar0, iVar1, iParam1, fParam6, fParam7, iParam8, iParam9);
				}
			}
			break;
		
		default:
			break;
	}
}

void func_5(var uParam0, int iParam1, int iParam2, int iParam3, float fParam4, float fParam5, int iParam6, int iParam7)//Position - 0x470
{
	int iVar0;
	
	if (!func_9(&(uParam0->f_8)))
	{
		func_8(&(uParam0->f_8), 0, 0);
	}
	else if (func_7(&(uParam0->f_8), 5000, 0))
	{
		func_6(&(uParam0->f_8));
		iVar0 = 1;
	}
	if ((!ped::is_ped_injured(iParam1) && !entity::is_entity_dead(iParam2, 0)) && !ped::is_ped_injured(iParam3))
	{
		if (((ai::get_script_task_status(iParam1, -1273030092) != 1 && ai::get_script_task_status(iParam1, -1273030092) != 0) || iParam3 != uParam0->f_4) || iVar0)
		{
			if (iParam3 != uParam0->f_4)
			{
				uParam0->f_4 = iParam3;
				ai::clear_ped_tasks(iParam1);
			}
			ai::task_vehicle_heli_protect(iParam1, iParam2, iParam3, fParam4, 32, fParam5, iParam6, iParam7);
		}
	}
}

void func_6(var uParam0)//Position - 0x52E
{
	uParam0->f_1 = 0;
}

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

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

var func_9(var uParam0)//Position - 0x5DE
{
	return uParam0->f_1;
}

bool func_10(var uParam0)//Position - 0x5EA
{
	if (network::network_does_network_id_exist(uParam0->f_2) && network::network_does_network_id_exist(uParam0->f_3))
	{
		return true;
	}
	return false;
}

void func_11(var uParam0)//Position - 0x60F
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	iVar0 = network::net_to_ent(uParam0->f_2);
	entity::set_entity_proofs(iVar0, true, true, true, true, false, false, 0, false);
	entity::_0x3910051CCECDB00C(iVar0, false);
	iVar1 = network::net_to_veh(uParam0->f_2);
	vehicle::_0x7D6F9A3EF26136A0(iVar1, false, 0);
	vehicle::set_vehicle_allow_no_passengers_lockon(iVar1, false);
	iVar2 = network::net_to_ent(uParam0->f_3);
	entity::set_entity_invincible(iVar2, true);
	vehicle::set_vehicle_engine_on(iVar1, true, 1, 0);
	vehicle::_0xE6F13851780394DA(iVar1, 0.3f);
	vehicle::set_heli_blades_full_speed(iVar1);
	rope::activate_physics(iVar1);
	func_12(1);
}

void func_12(int iParam0)//Position - 0x685
{
	if (iParam0)
	{
		if (Global_2359296 == 0)
		{
			Global_2359296 = 1;
		}
	}
	else if (Global_2359296 == 1)
	{
		Global_2359296 = 0;
	}
}

bool func_13(var uParam0)//Position - 0x6AF
{
	int iVar0;
	
	if (network::network_does_network_id_exist(uParam0->f_3))
	{
		return true;
	}
	streaming::request_model(uParam0->f_1);
	if (streaming::has_model_loaded(uParam0->f_1))
	{
		if (func_15(uParam0->f_2))
		{
			iVar0 = network::net_to_ent(uParam0->f_2);
			if (network::network_has_control_of_entity(iVar0))
			{
				if (func_14(&(uParam0->f_3), uParam0->f_2, 4, uParam0->f_1, -1, 1, 1, 1))
				{
					return true;
				}
			}
			else
			{
				network::network_request_control_of_entity(iVar0);
			}
		}
	}
	return false;
}

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

int func_15(int iParam0)//Position - 0x7A6
{
	if (network::network_does_network_id_exist(iParam0))
	{
		return !func_16(network::net_to_veh(iParam0));
	}
	return false;
}

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

bool func_17(var uParam0, vector3 vParam1, float fParam4)//Position - 0x7FF
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	
	if (network::network_does_network_id_exist(uParam0->f_2))
	{
		return true;
	}
	iVar0 = true;
	iVar1 = 1;
	iVar2 = true;
	iVar3 = false;
	iVar4 = true;
	streaming::request_model(*uParam0);
	if (streaming::has_model_loaded(*uParam0))
	{
		if (!func_21(vParam1))
		{
			if (func_18(&(uParam0->f_2), *uParam0, vParam1, fParam4, iVar0, iVar1, iVar2, iVar3, iVar4, 1))
			{
				return true;
			}
		}
	}
	return false;
}

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

var func_19()//Position - 0x8E9
{
	return Global_1617902.f_49585[0 /*128*/].f_3;
}

Vector3 func_20(vector3 vParam0)//Position - 0x8FF
{
	vector3 vVar0;
	
	vVar0 = { vParam0 };
	vVar0.z = (vVar0.y + 100f);
	return vVar0;
}

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

void func_22(var uParam0, int iParam1)//Position - 0x94B
{
	uParam0->f_5 = iParam1;
}

var func_23(var uParam0)//Position - 0x959
{
	return uParam0->f_5;
}

bool func_24(vector3 vParam0, vector3 vParam3, float fParam6, int iParam7)//Position - 0x965
{
	if (fParam6 < 0f)
	{
		fParam6 = 0f;
	}
	if (!iParam7)
	{
		if (gameplay::absf((vParam0.x - vParam3.x)) <= fParam6)
		{
			if (gameplay::absf((vParam0.y - vParam3.y)) <= fParam6)
			{
				if (gameplay::absf((vParam0.y - vParam3.y)) <= fParam6)
				{
					return true;
				}
			}
		}
	}
	else if (gameplay::absf((vParam0.x - vParam3.x)) <= fParam6)
	{
		if (gameplay::absf((vParam0.y - vParam3.y)) <= fParam6)
		{
			return true;
		}
	}
	return false;
}

void func_25()//Position - 0x9E0
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	iVar1 = func_58();
	iVar2 = 0;
	while (iVar2 < network::_network_get_num_participants_host())
	{
		if (network::network_is_participant_active(player::int_to_participantindex(iVar2)))
		{
			iVar0 = network::network_get_player_index(player::int_to_participantindex(iVar2));
			if (func_694(iVar0, 1, 1))
			{
				if (gameplay::is_bit_set(Local_292[iVar2 /*8*/].f_1, 0))
				{
					if (!gameplay::is_bit_set(Local_292[iVar2 /*8*/].f_1, 1))
					{
						if (!gameplay::is_bit_set(Local_292[iVar2 /*8*/].f_1, 11))
						{
							iVar1 = iVar0;
						}
					}
				}
			}
		}
		iVar2++;
	}
	if (Local_96.f_182.f_7 != iVar1)
	{
		Local_96.f_182.f_7 = iVar1;
	}
}

bool func_26()//Position - 0xA74
{
	int iVar0;
	int iVar1;
	
	if (Local_96.f_182.f_7 != func_58())
	{
		if (func_694(Local_96.f_182.f_7, 1, 1))
		{
			if (network::network_is_player_a_participant(Local_96.f_182.f_7))
			{
				iVar0 = network::network_get_participant_index(Local_96.f_182.f_7);
				if (network::network_is_participant_active(iVar0))
				{
					iVar1 = iVar0;
					if (!gameplay::is_bit_set(Local_292[iVar1 /*8*/].f_1, 1))
					{
						if (!gameplay::is_bit_set(Local_292[iVar1 /*8*/].f_1, 11))
						{
							if (gameplay::is_bit_set(Local_292[iVar1 /*8*/].f_1, 0))
							{
								return true;
							}
						}
					}
				}
			}
		}
	}
	return false;
}

void func_27()//Position - 0xAF9
{
	switch (Local_96.f_21)
	{
		case 0:
			func_36();
			if (gameplay::is_bit_set(Local_96.f_1, 2))
			{
				if (gameplay::is_bit_set(Local_96.f_1, 0))
				{
					gameplay::set_bit(&(Local_96.f_1), 8);
					Local_96.f_21 = 1;
					gameplay::clear_area_of_projectiles(vLocal_600[0 /*3*/], (func_638() + 50f), 1);
				}
			}
			else if (gameplay::is_bit_set(Local_96.f_1, 13))
			{
				gameplay::set_bit(&(Local_96.f_1), 8);
				Local_96.f_21 = 1;
				gameplay::clear_area_of_projectiles(vLocal_600[0 /*3*/], (func_638() + 50f), 1);
			}
			if (gameplay::is_bit_set(Local_96.f_1, 12))
			{
				Local_96.f_21 = 3;
			}
			break;
		
		case 1:
			if (gameplay::is_bit_set(Local_96.f_1, 9))
			{
				Local_96.f_21 = 2;
			}
			break;
		
		case 2:
			func_32();
			func_28(0);
			if (gameplay::is_bit_set(Local_96.f_1, 3))
			{
				Local_96.f_21 = 3;
			}
			if (gameplay::is_bit_set(Local_96.f_1, 10))
			{
				Local_96.f_21 = 3;
			}
			break;
		
		case 3:
			if (gameplay::is_bit_set(Local_96.f_1, 5))
			{
				if (Local_96.f_21 == 3)
				{
					Local_96.f_21 = 5;
				}
			}
			break;
		
		case 4:
			break;
		
		case 5:
			break;
	}
}

void func_28(int iParam0)//Position - 0xC21
{
	int iVar0;
	vector3 vVar1;
	vector3 vVar4;
	vector3 vVar7;
	vector3 vVar10;
	float fVar13;
	float fVar14;
	int iVar15;
	int iVar16;
	vector3 vVar17;
	vector3 vVar20;
	int iVar23;
	
	if (iParam0)
	{
		if (network::network_is_host_of_this_script())
		{
			return;
		}
	}
	if (Local_96.f_195 == 0)
	{
		fLocal_3778 = func_31();
	}
	iVar0 = iLocal_569 + 1;
	if (!func_30(vLocal_570, 0f, 0f, 0f, 0))
	{
		if (!func_30(vLocal_3775, vLocal_570, 0))
		{
			vLocal_3775 = { vLocal_570 };
		}
	}
	if (iVar0 < 100)
	{
		vVar1 = { vLocal_600[iVar0 /*3*/] };
		fVar13 = system::vdist2(vLocal_570, vVar1);
		if (!func_30(vLocal_600[iVar0 /*3*/], 0f, 0f, 0f, 0))
		{
			if (!func_30(vLocal_600[iLocal_569 /*3*/], 0f, 0f, 0f, 0))
			{
				if (fVar13 < (0.1f * 0.1f))
				{
					vLocal_570 = { vLocal_600[iVar0 /*3*/] };
					iLocal_569++;
					iVar15 = true;
				}
				else
				{
					vVar4 = { vVar1 - vLocal_570 };
					vVar7 = { func_29(vVar4) };
					if (!network::network_is_host_of_this_script())
					{
						vVar10 = { vLocal_570 + vVar7 * FtoV(gameplay::get_frame_time()) * Vector(Local_96.f_164, Local_96.f_164, Local_96.f_164) * Vector(fLocal_3778, fLocal_3778, fLocal_3778) };
					}
					else
					{
						vVar10 = { vLocal_570 + vVar7 * FtoV(gameplay::get_frame_time()) * Vector(Local_96.f_164, Local_96.f_164, Local_96.f_164) };
					}
					fVar14 = system::vdist2(vLocal_570, vVar10);
					if (fVar14 > fVar13)
					{
						vVar17 = { vVar1 };
					}
					else
					{
						vVar17 = { vVar10 };
					}
				}
			}
		}
		else
		{
			if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 3))
			{
				gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 3);
			}
			if (!gameplay::is_bit_set(Local_96.f_1, 4))
			{
				if (!func_30(vLocal_600[(iLocal_1002 - 1) /*3*/], 0f, 0f, 0f, 0))
				{
					vVar17 = { vLocal_600[(iLocal_1002 - 1) /*3*/] };
				}
			}
		}
	}
	if (network::network_is_host_of_this_script())
	{
		if (!func_9(&(Local_96.f_170)))
		{
			func_8(&(Local_96.f_170), 0, 0);
		}
		if (!gameplay::is_bit_set(Local_96.f_1, 4))
		{
			if (!func_7(&(Local_96.f_170), 20000, 0))
			{
				if (!iVar15)
				{
					Local_96.f_174 = { vVar17 };
					Local_96.f_169 = iLocal_569;
				}
				else
				{
					Local_96.f_174 = { vLocal_570 };
					Local_96.f_169 = iLocal_569;
				}
			}
			else if (func_7(&(Local_96.f_170), 21000, 0))
			{
				func_6(&(Local_96.f_170));
			}
		}
	}
	if (!func_30(Local_96.f_174, 0f, 0f, 0f, 0))
	{
		if (iLocal_576 != Local_96.f_169 || !func_30(vLocal_573, Local_96.f_174, 0))
		{
			if (iLocal_576 != Local_96.f_169)
			{
				iLocal_576 = Local_96.f_169;
				vLocal_573 = { Local_96.f_174 };
				vLocal_570 = { vLocal_573 };
				iLocal_569 = iLocal_576;
				iVar15 = true;
			}
			else
			{
				vLocal_573 = { Local_96.f_174 };
				vVar20 = { Local_96.f_174 };
			}
			iVar16 = true;
		}
	}
	if (!iVar15)
	{
		if (iVar16)
		{
			iVar23 = true;
			if (iVar23)
			{
				vLocal_570 = { vVar20 };
			}
		}
		else
		{
			vLocal_570 = { vVar17 };
		}
	}
	if (gameplay::is_bit_set(Local_96.f_1, 4))
	{
		if (!func_30(vLocal_570, vLocal_600[(iLocal_1002 - 1) /*3*/], 0))
		{
			vLocal_570 = { vLocal_600[(iLocal_1002 - 1) /*3*/] };
		}
	}
	if (ui::does_blip_exist(iLocal_567))
	{
		ui::set_blip_coords(iLocal_567, vLocal_570);
	}
}

Vector3 func_29(vector3 vParam0)//Position - 0xF4E
{
	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;
}

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

float func_31()//Position - 0xFD4
{
	return 0.9f;
}

void func_32()//Position - 0xFE1
{
	float fVar0;
	float fVar1;
	float fVar2;
	float fVar3;
	float fVar4;
	
	if (!func_9(&(Local_96.f_26)))
	{
		func_8(&(Local_96.f_26), 0, 0);
	}
	if (!func_7(&(Local_96.f_26), 10000, 0))
	{
		return;
	}
	else if (!func_7(&(Local_96.f_26), 20000, 0))
	{
		if (!func_9(&uLocal_582))
		{
			func_8(&uLocal_582, 0, 0);
		}
		if (func_7(&uLocal_582, 1000, 0))
		{
			fVar0 = Local_96.f_164;
			if (fVar0 < func_35())
			{
				fVar0 = (fVar0 + 0.5f);
				fVar0 = (fVar0 * func_34());
				if (fVar0 > func_35())
				{
					fVar0 = func_35();
				}
				Local_96.f_164 = fVar0;
			}
			func_6(&uLocal_582);
		}
	}
	else if (fLocal_1004 <= (fLocal_1003 / 2f))
	{
		if (Local_96.f_164 != func_35())
		{
			Local_96.f_164 = func_35();
		}
	}
	else if (!func_9(&uLocal_582))
	{
		func_8(&uLocal_582, 0, 0);
	}
	else if (func_7(&uLocal_582, 1000, 0))
	{
		if (Local_96.f_164 > func_33())
		{
			fVar1 = (func_35() - func_33());
			fVar3 = (fLocal_1003 / 2f);
			fVar2 = ((fLocal_1004 - fVar3) / fVar3);
			fVar4 = (func_35() - (fVar1 * fVar2));
			fVar4 = (fVar4 * 0.8f);
			fVar4 = (fVar4 * func_34());
			if (fVar4 < func_33())
			{
				fVar4 = func_33();
			}
			Local_96.f_164 = fVar4;
			func_6(&uLocal_582);
		}
	}
}

var func_33()//Position - 0x1137
{
	return Global_262145.f_9347;
}

var func_34()//Position - 0x1146
{
	return Global_262145.f_9348;
}

var func_35()//Position - 0x1155
{
	return Global_262145.f_9345;
}

void func_36()//Position - 0x1164
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	iVar0 = gameplay::is_bit_set(Local_96.f_1, 1);
	if (gameplay::is_bit_set(Local_96.f_1, 6))
	{
		if (!gameplay::is_bit_set(Local_96.f_1, 7))
		{
			if (func_41() - func_40(&(Local_96.f_24), 0, 0)) >= func_39()
			{
				func_6(&(Local_96.f_24));
				gameplay::set_bit(&(Local_96.f_1), 7);
			}
		}
	}
	iVar1 = func_41();
	if (gameplay::is_bit_set(Local_96.f_1, 7))
	{
		iVar1 = func_39();
	}
	if (!gameplay::is_bit_set(Local_96.f_1, 12))
	{
		if (iVar0)
		{
			if (func_9(&(Local_96.f_30)))
			{
				func_6(&(Local_96.f_30));
			}
			if (!func_9(&(Local_96.f_24)))
			{
				func_8(&(Local_96.f_24), 0, 0);
				if (Local_96.f_32 > 0)
				{
					iVar2 = network::get_time_offset(network::get_network_time(), (-1 * Local_96.f_32));
					func_38(&(Local_96.f_24), iVar2);
					Local_96.f_32 = 0;
				}
			}
			else if (!gameplay::is_bit_set(Local_96.f_1, 2))
			{
				if ((iVar1 - func_40(&(Local_96.f_24), 0, 0)) <= 0)
				{
					gameplay::set_bit(&(Local_96.f_1), 2);
				}
			}
		}
		else
		{
			if (gameplay::is_bit_set(Local_96.f_1, 0))
			{
				if (func_9(&(Local_96.f_24)))
				{
					Local_96.f_32 = func_40(&(Local_96.f_24), 0, 0);
				}
			}
			else
			{
				Local_96.f_32 = 0;
			}
			if (func_9(&(Local_96.f_24)))
			{
				func_6(&(Local_96.f_24));
			}
			if (!func_9(&(Local_96.f_30)))
			{
				func_8(&(Local_96.f_30), 0, 0);
			}
			else if (func_7(&(Local_96.f_30), func_37(), 0))
			{
				gameplay::set_bit(&(Local_96.f_1), 12);
			}
		}
	}
}

var func_37()//Position - 0x12D2
{
	return Global_262145.f_9336;
}

void func_38(var uParam0, int iParam1)//Position - 0x12E1
{
	*uParam0 = iParam1;
	uParam0->f_1 = 1;
}

var func_39()//Position - 0x12F3
{
	return Global_262145.f_9351;
}

int func_40(var uParam0, int iParam1, int iParam2)//Position - 0x1302
{
	if (network::network_is_game_in_progress() && !iParam1)
	{
		if (!iParam2)
		{
			return network::get_time_difference(network::get_network_time(), *uParam0);
		}
		else
		{
			return network::get_time_difference(network::_0x89023FBBF9200E9F(), *uParam0);
		}
	}
	return network::get_time_difference(gameplay::get_game_timer(), *uParam0);
}

var func_41()//Position - 0x1349
{
	return Global_262145.f_9335;
}

void func_42()//Position - 0x1358
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	int iVar6;
	int iVar7;
	int iVar8;
	int iVar9;
	int iVar10;
	
	iVar6 = false;
	iVar7 = false;
	if (Local_96 != 4)
	{
		iLocal_551 = 0;
		while (iLocal_551 < network::_network_get_num_participants_host())
		{
			if (network::network_is_participant_active(player::int_to_participantindex(iLocal_551)))
			{
				iVar0++;
				iVar10 = network::network_get_player_index(player::int_to_participantindex(iLocal_551));
				if (!func_52(iVar10, 0))
				{
					if (gameplay::is_bit_set(Local_292[iLocal_551 /*8*/].f_1, 0))
					{
						iVar1++;
					}
					if (!func_51(iVar10))
					{
						iVar4++;
					}
					if (Local_96.f_21 == 0)
					{
						if (!gameplay::is_bit_set(Local_292[iLocal_551 /*8*/].f_1, 0))
						{
							if (gameplay::is_bit_set(Local_292[iLocal_551 /*8*/].f_1, 13))
							{
								iVar5 = func_50();
								if (iVar5 < func_49())
								{
									gameplay::set_bit(&(Local_96.f_33), iLocal_551);
								}
							}
							else if (gameplay::is_bit_set(Local_96.f_33, iLocal_551))
							{
								gameplay::clear_bit(&(Local_96.f_33), iLocal_551);
							}
						}
					}
					if (!gameplay::is_bit_set(Local_96.f_1, 9))
					{
						if (Local_96.f_21 == 1)
						{
							if (gameplay::is_bit_set(Local_292[iLocal_551 /*8*/].f_1, 0))
							{
								if (!gameplay::is_bit_set(Local_292[iLocal_551 /*8*/].f_1, 4))
								{
									iVar7 = true;
								}
							}
						}
						else
						{
							iVar7 = true;
						}
					}
					if (!gameplay::is_bit_set(Local_96.f_1, 4))
					{
						if (gameplay::is_bit_set(Local_292[iLocal_551 /*8*/].f_1, 3))
						{
							iVar8 = true;
						}
					}
					if (gameplay::is_bit_set(Local_292[iLocal_551 /*8*/].f_1, 0))
					{
						if (!gameplay::is_bit_set(Local_292[iLocal_551 /*8*/].f_1, 1))
						{
							if (!gameplay::is_bit_set(Local_96.f_1, 4) || (gameplay::is_bit_set(Local_96.f_1, 4) && !gameplay::is_bit_set(Local_292[iLocal_551 /*8*/].f_1, 5)))
							{
								if (func_48(iVar8))
								{
									iVar2++;
									if (!gameplay::is_bit_set(Local_96.f_9, iLocal_551))
									{
										gameplay::set_bit(&(Local_96.f_9), iLocal_551);
										gameplay::set_bit(&(Local_96.f_10), iVar10);
										if (gameplay::is_bit_set(Local_96.f_1, 3) && !gameplay::is_bit_set(Local_96.f_1, 11))
										{
										}
									}
									if (gameplay::is_bit_set(Local_96.f_1, 4))
									{
										iVar9 = 1;
									}
								}
							}
							else if (!gameplay::is_bit_set(Local_96.f_1, 3))
							{
								if (gameplay::is_bit_set(Local_96.f_9, iLocal_551))
								{
									gameplay::clear_bit(&(Local_96.f_9), iLocal_551);
									gameplay::clear_bit(&(Local_96.f_10), iVar10);
								}
								if (gameplay::is_bit_set(Local_96.f_1, 4))
								{
									if (gameplay::is_bit_set(Local_292[iLocal_551 /*8*/].f_1, 5))
									{
										iVar3++;
									}
								}
							}
						}
						else if (gameplay::is_bit_set(Local_96.f_9, iLocal_551))
						{
							gameplay::clear_bit(&(Local_96.f_9), iLocal_551);
							gameplay::clear_bit(&(Local_96.f_10), iVar10);
						}
					}
					else
					{
						if (gameplay::is_bit_set(Local_96.f_9, iLocal_551))
						{
							gameplay::clear_bit(&(Local_96.f_9), iLocal_551);
						}
						if (gameplay::is_bit_set(Local_96.f_10, iVar10))
						{
							gameplay::clear_bit(&(Local_96.f_10), iVar10);
						}
					}
					if (func_694(iVar10, 1, 1))
					{
					}
				}
				else
				{
					if (gameplay::is_bit_set(Local_96.f_9, iLocal_551))
					{
						gameplay::clear_bit(&(Local_96.f_9), iLocal_551);
					}
					if (gameplay::is_bit_set(Local_96.f_33, iLocal_551))
					{
						gameplay::clear_bit(&(Local_96.f_33), iLocal_551);
					}
				}
				if (Local_96.f_21 <= 2)
				{
					iVar6 = true;
				}
				else if (!gameplay::is_bit_set(Local_292[iLocal_551 /*8*/].f_1, 2))
				{
					if (!func_52(iVar10, 0))
					{
					}
					iVar6 = true;
				}
			}
			else
			{
				if (gameplay::is_bit_set(Local_96.f_9, iLocal_551))
				{
					gameplay::clear_bit(&(Local_96.f_9), iLocal_551);
				}
				if (gameplay::is_bit_set(Local_96.f_33, iLocal_551))
				{
					gameplay::clear_bit(&(Local_96.f_33), iLocal_551);
				}
			}
			iLocal_551++;
		}
		if (iVar1 > Local_96.f_181)
		{
			Local_96.f_181 = iVar1;
		}
		if (iVar0 > Local_96.f_180)
		{
			Local_96.f_180 = iVar0;
		}
		else
		{
			Local_96.f_179 = (Local_96.f_180 - iVar0);
		}
		if (Local_96.f_163 != (iVar2 + iVar3))
		{
			Local_96.f_163 = (iVar2 + iVar3);
			func_44();
		}
		if (!gameplay::is_bit_set(Local_96.f_1, 13))
		{
			if (Local_96.f_163 >= func_49() || (iVar4 >= 2 && Local_96.f_163 >= iVar4))
			{
				gameplay::set_bit(&(Local_96.f_1), 13);
			}
		}
		if (Local_96.f_21 == 0)
		{
			if (!gameplay::is_bit_set(Local_96.f_1, 0))
			{
				if (iVar1 >= 1)
				{
					gameplay::set_bit(&(Local_96.f_1), 0);
				}
			}
			else if (iVar1 == 0)
			{
				gameplay::clear_bit(&(Local_96.f_1), 0);
			}
			if (!gameplay::is_bit_set(Local_96.f_1, 1))
			{
				if (iVar1 >= 2)
				{
					gameplay::set_bit(&(Local_96.f_1), 1);
				}
			}
			else if (iVar1 < 2)
			{
				gameplay::clear_bit(&(Local_96.f_1), 1);
			}
			if (!gameplay::is_bit_set(Local_96.f_1, 6))
			{
				if (iVar1 >= func_43())
				{
					gameplay::set_bit(&(Local_96.f_1), 6);
				}
			}
		}
		if (!gameplay::is_bit_set(Local_96.f_1, 9))
		{
			if (Local_96.f_21 == 1)
			{
				if (!iVar7)
				{
					gameplay::set_bit(&(Local_96.f_1), 9);
				}
			}
		}
		if (!gameplay::is_bit_set(Local_96.f_1, 4))
		{
			if (iVar8)
			{
				gameplay::set_bit(&(Local_96.f_1), 4);
			}
		}
		if (gameplay::is_bit_set(Local_96.f_1, 4))
		{
			if (!gameplay::is_bit_set(Local_96.f_1, 3))
			{
				if (!gameplay::is_bit_set(Local_96.f_1, 10))
				{
					if (!func_9(&(Local_96.f_28)))
					{
						func_8(&(Local_96.f_28), 0, 0);
					}
					else if (func_7(&(Local_96.f_28), 60000, 0))
					{
						gameplay::set_bit(&(Local_96.f_1), 10);
					}
				}
				if (iVar2 == 0 && iVar3 == 0)
				{
					if (!gameplay::is_bit_set(Local_96.f_1, 10))
					{
						gameplay::set_bit(&(Local_96.f_1), 10);
					}
				}
			}
		}
		if (Local_96.f_21 == 2)
		{
			if (!gameplay::is_bit_set(Local_96.f_1, 3))
			{
				if (iVar2 == 1 || iVar9)
				{
					Local_96.f_167 = 1900;
					Local_96.f_166 = 18000;
					gameplay::set_bit(&(Local_96.f_1), 3);
					if (!gameplay::is_bit_set(Local_96.f_1, 4))
					{
						gameplay::set_bit(&(Local_96.f_1), 11);
					}
					if (iVar1 == 1)
					{
						if (!gameplay::is_bit_set(Local_96.f_1, 14))
						{
							gameplay::set_bit(&(Local_96.f_1), 14);
						}
					}
				}
				else if (iVar2 == 0)
				{
					if (!gameplay::is_bit_set(Local_96.f_1, 3))
					{
						if (!gameplay::is_bit_set(Local_96.f_1, 4) || (gameplay::is_bit_set(Local_96.f_1, 4) && iVar3 == 0))
						{
							gameplay::set_bit(&(Local_96.f_1), 3);
							if (!gameplay::is_bit_set(Local_96.f_1, 4))
							{
								gameplay::set_bit(&(Local_96.f_1), 11);
							}
						}
					}
				}
				else if (iVar4 == 0)
				{
					Local_96.f_21 = 5;
				}
				else if (gameplay::is_bit_set(Local_96.f_1, 4))
				{
				}
			}
		}
		if (gameplay::is_bit_set(Local_96.f_1, 3))
		{
			if (!func_9(&(Local_96.f_172)))
			{
				func_8(&(Local_96.f_172), 0, 0);
			}
			if (func_7(&(Local_96.f_172), 100, 0))
			{
				if (!gameplay::is_bit_set(Local_96.f_1, 11))
				{
					func_44();
					gameplay::set_bit(&(Local_96.f_1), 11);
				}
			}
		}
		if (Local_96.f_21 > 2)
		{
			if (!gameplay::is_bit_set(Local_96.f_1, 5))
			{
				if (!iVar6)
				{
					gameplay::set_bit(&(Local_96.f_1), 5);
				}
			}
		}
	}
}

var func_43()//Position - 0x19D4
{
	if (Global_262145.f_9605 < Global_262145.f_9674)
	{
		return Global_262145.f_9605;
	}
	return Global_262145.f_9674;
}

void func_44()//Position - 0x19FE
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	iVar0 = 0;
	while (iVar0 < network::_network_get_num_participants_host())
	{
		if (network::network_is_participant_active(player::int_to_participantindex(iVar0)))
		{
			iVar1 = network::network_get_player_index(player::int_to_participantindex(iVar0));
			func_47(iVar0);
			iVar2 = gameplay::is_bit_set(Local_292[iVar0 /*8*/].f_1, 0);
			iVar3 = true;
			if (!iVar2)
			{
				iVar3 = false;
			}
			if (gameplay::is_bit_set(Local_292[iVar0 /*8*/].f_1, 1))
			{
				iVar3 = false;
			}
			if (gameplay::is_bit_set(Local_96.f_1, 4))
			{
				if (gameplay::is_bit_set(Local_292[iVar0 /*8*/].f_1, 5))
				{
					iVar3 = false;
				}
			}
			func_46(iVar0, iVar1, iVar3, iVar2);
		}
		else if (Local_96.f_34[iVar0 /*4*/].f_2 != -1)
		{
			func_47(iVar0);
		}
		iVar0++;
	}
	func_45();
}

void func_45()//Position - 0x1AB1
{
	int iVar0;
	int iVar1;
	var uVar2;
	var uVar3;
	var uVar4;
	var uVar5;
	
	iVar0 = 31;
	while (iVar0 >= 0)
	{
		iVar1 = 31;
		while (iVar1 >= 0)
		{
			if ((iVar1 - 1) >= 0)
			{
				if (Local_96.f_34[iVar1 /*4*/].f_2 > Local_96.f_34[(iVar1 - 1) /*4*/].f_2)
				{
					uVar2 = Local_96.f_34[iVar1 /*4*/].f_2;
					uVar3 = Local_96.f_34[iVar1 /*4*/];
					uVar4 = Local_96.f_34[iVar1 /*4*/].f_1;
					uVar5 = Local_96.f_34[iVar1 /*4*/].f_3;
					Local_96.f_34[iVar1 /*4*/].f_2 = Local_96.f_34[(iVar1 - 1) /*4*/].f_2;
					Local_96.f_34[iVar1 /*4*/] = Local_96.f_34[(iVar1 - 1) /*4*/];
					Local_96.f_34[iVar1 /*4*/].f_1 = Local_96.f_34[(iVar1 - 1) /*4*/].f_1;
					Local_96.f_34[iVar1 /*4*/].f_3 = Local_96.f_34[(iVar1 - 1) /*4*/].f_3;
					Local_96.f_34[(iVar1 - 1) /*4*/].f_2 = uVar2;
					Local_96.f_34[(iVar1 - 1) /*4*/].f_3 = uVar5;
					Local_96.f_34[(iVar1 - 1) /*4*/] = uVar3;
					Local_96.f_34[(iVar1 - 1) /*4*/].f_1 = uVar4;
				}
			}
			iVar1 = (iVar1 + -1);
		}
		iVar0 = (iVar0 + -1);
	}
}

void func_46(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x1BB8
{
	int iVar0;
	int iVar1;
	
	if (iParam2)
	{
		iVar0 = 1;
	}
	if (iParam3)
	{
		iVar1 = 1;
	}
	Local_96.f_34[iParam0 /*4*/] = iParam0;
	Local_96.f_34[iParam0 /*4*/].f_1 = iParam1;
	Local_96.f_34[iParam0 /*4*/].f_2 = iVar0;
	Local_96.f_34[iParam0 /*4*/].f_3 = iVar1;
}

void func_47(int iParam0)//Position - 0x1BFE
{
	Local_96.f_34[iParam0 /*4*/] = -1;
	Local_96.f_34[iParam0 /*4*/].f_1 = -1;
	Local_96.f_34[iParam0 /*4*/].f_2 = -1;
	Local_96.f_34[iParam0 /*4*/].f_3 = -1;
}

bool func_48(int iParam0)//Position - 0x1C30
{
	if (!gameplay::is_bit_set(Local_96.f_1, 3))
	{
		return true;
	}
	if (gameplay::is_bit_set(Local_96.f_1, 3))
	{
		if (!gameplay::is_bit_set(Local_96.f_1, 11))
		{
			if (gameplay::is_bit_set(Local_96.f_1, 4))
			{
				return true;
			}
			if (iParam0)
			{
				return true;
			}
		}
	}
	return false;
}

var func_49()//Position - 0x1C7D
{
	return Global_262145.f_9605;
}

int func_50()//Position - 0x1C8C
{
	int iVar0;
	int iVar1;
	
	iVar1 = 0;
	while (iVar1 < 32)
	{
		if (gameplay::is_bit_set(Local_96.f_33, iVar1))
		{
			iVar0++;
		}
		iVar1++;
	}
	return iVar0;
}

int func_51(int iParam0)//Position - 0x1CBC
{
	return gameplay::is_bit_set(Global_1610705[iParam0 /*178*/].f_1, 2);
}

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

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

var func_54()//Position - 0x1D5F
{
	return Global_1312747;
}

void func_55(var uParam0)//Position - 0x1D6B
{
	vector3 vVar0;
	int iVar3;
	
	vVar0.x = 423;
	vVar0.y = player::player_id();
	vVar0.z = uParam0;
	iVar3 = func_56(1, 1);
	if (!iVar3 == 0)
	{
		script::trigger_script_event(1, &vVar0, 3, iVar3);
	}
}

var func_56(int iParam0, int iParam1)//Position - 0x1DA3
{
	var uVar0;
	int iVar1;
	int iVar2;
	
	iVar1 = 0;
	while (iVar1 < 32)
	{
		iVar2 = player::int_to_playerindex(iVar1);
		if (func_694(iVar2, 0, 0))
		{
			if (iVar2 != player::player_id() || iParam0)
			{
				if (iParam1)
				{
					gameplay::set_bit(&uVar0, iVar1);
				}
				else if (!func_52(iVar2, 0))
				{
					gameplay::set_bit(&uVar0, iVar1);
				}
			}
		}
		iVar1++;
	}
	return uVar0;
}

int func_57(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x1E08
{
	switch (iParam0)
	{
		case 136:
		case 139:
		case 141:
		case 133:
		case 138:
		case 144:
			return iParam1;
		
		case 132:
			switch (iParam2)
			{
				case 0:
					switch (iParam2)
					{
						case 0:
							return 0;
						
						case 1:
							return 1;
						
						case 2:
							return 2;
						
						case 3:
							return 3;
						
						default:
					}
					break;
				
				case 1:
					switch (iParam2)
					{
						case 0:
							return 4;
						
						case 1:
							return 5;
						
						case 2:
							return 6;
						
						case 3:
							return 7;
						
						default:
					}
					break;
			}
			break;
		
		case 131:
			switch (iParam3)
			{
				case 0:
					switch (iParam1)
					{
						case 0:
							switch (iParam2)
							{
								case 0:
									return 0;
								
								case 1:
									return 1;
								
								case 2:
									return 2;
								
								case 3:
									return 3;
								
								case 4:
									return 4;
								
								default:
							}
							break;
						
						case 1:
							switch (iParam2)
							{
								case 0:
									return 5;
								
								case 1:
									return 6;
								
								case 2:
									return 7;
								
								case 3:
									return 8;
								
								case 4:
									return 9;
								
								default:
							}
							break;
						
						case 2:
							switch (iParam2)
							{
								case 0:
									return 10;
								
								case 1:
									return 11;
								
								case 2:
									return 12;
								
								case 3:
									return 13;
								
								case 4:
									return 14;
								
								default:
							}
							break;
						
						case 3:
							switch (iParam2)
							{
								case 0:
									return 15;
								
								case 1:
									return 16;
								
								case 2:
									return 17;
								
								case 3:
									return 18;
								
								case 4:
									return 19;
								
								default:
							}
							break;
						
						case 4:
							switch (iParam2)
							{
								case 0:
									return 20;
								
								case 1:
									return 21;
								
								case 2:
									return 22;
								
								case 3:
									return 24;
								
								case 4:
									return 25;
								
								default:
							}
							break;
						
						case 5:
							switch (iParam2)
							{
								case 0:
									return 26;
								
								case 1:
									return 27;
								
								case 2:
									return 28;
								
								case 3:
									return 29;
								
								case 4:
									return 30;
								
								default:
							}
							break;
						
						case 6:
							switch (iParam2)
							{
								case 0:
									return 31;
								
								case 1:
									return 32;
								
								case 2:
									return 33;
								
								case 3:
									return 34;
								
								case 4:
									return 35;
								
								default:
							}
							break;
					}
					break;
				
				case 1:
					switch (iParam1)
					{
						case 0:
							switch (iParam2)
							{
								case 0:
									return 0;
								
								case 1:
									return 1;
								
								case 2:
									return 2;
								
								case 3:
									return 3;
								
								case 4:
									return 4;
								
								default:
							}
							break;
						
						case 1:
							switch (iParam2)
							{
								case 0:
									return 5;
								
								case 1:
									return 6;
								
								case 2:
									return 7;
								
								case 3:
									return 8;
								
								case 4:
									return 9;
								
								default:
							}
							break;
						
						case 2:
							switch (iParam2)
							{
								case 0:
									return 10;
								
								case 1:
									return 11;
								
								case 2:
									return 12;
								
								case 3:
									return 13;
								
								case 4:
									return 14;
								
								default:
							}
							break;
					}
					break;
				
				case 2:
					switch (iParam1)
					{
						case 0:
							switch (iParam2)
							{
								case 0:
									return 41;
								
								default:
							}
							break;
						
						case 1:
							switch (iParam2)
							{
								case 1:
									return 42;
								
								default:
							}
							break;
						
						case 2:
							switch (iParam2)
							{
								case 2:
									return 43;
								
								default:
							}
							break;
						
						case 3:
							switch (iParam2)
							{
								case 3:
									return 44;
								
								default:
							}
							break;
						
						case 4:
							switch (iParam2)
							{
								case 4:
									return 45;
								
								default:
							}
							break;
					}
					break;
			}
			break;
		
		case 129:
			switch (iParam1)
			{
				case 0:
					switch (iParam2)
					{
						case 0:
							return 0;
						
						case 1:
							return 1;
						
						case 2:
							return 2;
						
						case 3:
							return 3;
						
						default:
					}
					break;
				
				case 1:
					switch (iParam2)
					{
						case 0:
							return 4;
						
						case 1:
							return 5;
						
						case 2:
							return 6;
						
						case 3:
							return 7;
						
						case 4:
							return 8;
						
						default:
					}
					break;
				
				case 2:
					switch (iParam2)
					{
						case 0:
							return 9;
						
						case 1:
							return 10;
						
						case 2:
							return 11;
						
						default:
					}
					break;
				
				case 3:
					switch (iParam2)
					{
						case 0:
							return 12;
						
						case 1:
							return 13;
						
						case 2:
							return 14;
						
						case 3:
							return 15;
						
						case 4:
							return 16;
						
						default:
					}
					break;
				
				case 4:
					switch (iParam2)
					{
						case 0:
							return 17;
						
						case 1:
							return 18;
						
						case 2:
							return 19;
						
						case 3:
							return 20;
						
						case 4:
							return 21;
						
						default:
					}
					break;
				
				case 5:
					switch (iParam2)
					{
						case 0:
							return 22;
						
						case 1:
							return 24;
						
						case 2:
							return 25;
						
						case 3:
							return 26;
						
						default:
					}
					break;
				
				case 6:
					switch (iParam2)
					{
						case 0:
							return 27;
						
						case 1:
							return 28;
						
						case 2:
							return 29;
						
						default:
					}
					break;
				
				case 7:
					switch (iParam2)
					{
						case 0:
							return 30;
						
						case 1:
							return 31;
						
						case 2:
							return 32;
						
						default:
					}
					break;
				
				case 8:
					switch (iParam2)
					{
						case 0:
							return 33;
						
						case 1:
							return 34;
						
						case 2:
							return 35;
						
						case 3:
							return 36;
						
						default:
					}
					break;
				
				case 9:
					switch (iParam2)
					{
						case 0:
							return 37;
						
						case 1:
							return 38;
						
						case 2:
							return 39;
						
						case 3:
							return 40;
						
						default:
					}
					break;
			}
			break;
		
		case 140:
			switch (iParam1)
			{
				case 0:
					switch (iParam2)
					{
						case 0:
							return 0;
						
						case 1:
							return 1;
						
						case 2:
							return 2;
						
						default:
					}
					break;
				
				case 1:
					switch (iParam2)
					{
						case 0:
							return 3;
						
						case 1:
							return 4;
						
						case 2:
							return 5;
						
						default:
					}
					break;
				
				case 2:
					switch (iParam2)
					{
						case 0:
							return 6;
						
						case 1:
							return 7;
						
						case 2:
							return 8;
						
						default:
					}
					break;
				
				case 3:
					switch (iParam2)
					{
						case 0:
							return 9;
						
						case 1:
							return 10;
						
						case 2:
							return 11;
						
						default:
					}
					break;
				
				case 4:
					switch (iParam2)
					{
						case 0:
							return 12;
						
						case 1:
							return 13;
						
						case 2:
							return 14;
						
						default:
					}
					break;
			}
			break;
		
		case 146:
			switch (iParam1)
			{
				case 0:
					switch (iParam2)
					{
						case 0:
							return 0;
						
						case 1:
							return 1;
						
						case 2:
							return 2;
						
						default:
					}
					break;
				
				case 1:
					switch (iParam2)
					{
						case 0:
							return 3;
						
						case 1:
							return 4;
						
						case 2:
							return 5;
						
						default:
					}
					break;
				
				case 2:
					switch (iParam2)
					{
						case 0:
							return 6;
						
						case 1:
							return 7;
						
						case 2:
							return 8;
						
						default:
					}
					break;
				
				case 3:
					switch (iParam2)
					{
						case 0:
							return 9;
						
						case 1:
							return 10;
						
						case 2:
							return 11;
						
						default:
					}
					break;
			}
			break;
	}
	return -1;
}

int func_58()//Position - 0x2667
{
	return -1;
}

void func_59()//Position - 0x2670
{
	if (Local_96.f_195 != -1)
	{
		return;
	}
	switch (Local_96.f_165)
	{
		case 0:
		case 1:
		case 2:
		case 3:
		case 4:
			Local_96.f_195 = 0;
			break;
	}
}

bool func_60(var uParam0)//Position - 0x26B2
{
	*uParam0 = gameplay::get_random_int_in_range(0, 5);
	if (!func_63(*uParam0))
	{
		if (!func_61(136, *uParam0, 0, 0))
		{
			return true;
		}
	}
	return false;
}

bool func_61(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x26E5
{
	int iVar0;
	int iVar1;
	
	switch (iParam0)
	{
		case 132:
		case 144:
			return false;
		
		default:
	}
	iVar1 = func_62(iParam0);
	iVar0 = 0;
	while (iVar0 < 23)
	{
		if (iVar0 < Global_262145.f_6691)
		{
			if (Global_2455819.f_148[iVar0 /*2*/] == iVar1 && Global_2455819.f_148[iVar0 /*2*/].f_1 == func_57(iParam0, iParam1, iParam2, iParam3))
			{
				return true;
			}
		}
		iVar0++;
	}
	return false;
}

int func_62(int iParam0)//Position - 0x275E
{
	switch (iParam0)
	{
		case 136:
			return 12;
		
		case 139:
			return 14;
		
		case 141:
			return 16;
		
		case 133:
			return 9;
		
		case 138:
			return 13;
		
		case 144:
			return 17;
		
		case 132:
			return 8;
		
		case 131:
			return 10;
		
		case 146:
			return 18;
		
		case 129:
			return 11;
		
		case 140:
			return 15;
		
		default:
	}
	return -1;
}

int func_63(int iParam0)//Position - 0x27E7
{
	switch (iParam0)
	{
		case 0:
			return Global_262145.f_9338;
			break;
		
		case 1:
			return Global_262145.f_9339;
			break;
		
		case 2:
			return Global_262145.f_9340;
			break;
		
		case 3:
			return Global_262145.f_9341;
			break;
		
		case 4:
			return Global_262145.f_9342;
			break;
	}
	return 0;
}

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

void func_65(var uParam0)//Position - 0x287F
{
	if (!uParam0->f_1)
	{
		if (network::network_is_host_of_this_script())
		{
			func_8(uParam0, 0, 0);
		}
	}
}

void func_66()//Position - 0x289E
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	if (!func_52(player::player_id(), 0))
	{
		switch (iLocal_3786)
		{
			case 0:
				if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_4, 0))
				{
					if (func_80("PEN_BIKE"))
					{
						gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_4), 0);
					}
				}
				else if (!func_80("PEN_BIKE"))
				{
					gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_4), 0);
				}
				iLocal_3786++;
				break;
			
			case 1:
				if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_4, 1))
				{
					if (func_80("PEN_VEHG"))
					{
						gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_4), 1);
					}
				}
				else if (!func_80("PEN_VEHG"))
				{
					gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_4), 1);
				}
				iLocal_3786++;
				break;
			
			case 2:
				if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_4, 2))
				{
					if (func_80("PEN_PBIKE"))
					{
						gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_4), 2);
					}
				}
				else if (!func_80("PEN_PBIKE"))
				{
					gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_4), 2);
				}
				iLocal_3786++;
				break;
			
			case 3:
				if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_4, 3))
				{
					if (func_80("PEN_PVEHG"))
					{
						gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_4), 3);
					}
				}
				else if (!func_80("PEN_PVEHG"))
				{
					gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_4), 3);
				}
				iLocal_3786++;
				break;
			
			case 4:
				if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_4, 4))
				{
					if (func_80("PEN_AREA"))
					{
						gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_4), 4);
					}
				}
				else if (!func_80("PEN_AREA"))
				{
					gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_4), 4);
				}
				iLocal_3786++;
				break;
			
			case 5:
				if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_4, 5))
				{
					if (func_80("PEN_BAREA"))
					{
						gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_4), 5);
					}
				}
				else if (!func_80("PEN_BAREA"))
				{
					gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_4), 5);
				}
				iLocal_3786++;
				break;
			
			case 6:
				if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_4, 6))
				{
					if (func_80("PEN_EXITV"))
					{
						gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_4), 6);
					}
				}
				else if (!func_80("PEN_EXITV"))
				{
					gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_4), 6);
				}
				iLocal_3786++;
				break;
			
			case 7:
				if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_4, 7))
				{
					if (func_80("PEN_STARTO"))
					{
						gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_4), 7);
					}
				}
				else if (!func_80("PEN_STARTO"))
				{
					gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_4), 7);
				}
				iLocal_3786++;
				break;
		}
		if (iLocal_3786 > 7)
		{
			iLocal_3786 = 0;
		}
	}
	else
	{
		if (Local_292[network::participant_id_to_int() /*8*/].f_4 != 0)
		{
			Local_292[network::participant_id_to_int() /*8*/].f_4 = 0;
		}
		iVar0 = Global_1587816[player::player_id() /*444*/].f_355;
		if (network::network_is_player_active(iVar0))
		{
			if (network::network_is_player_a_participant(iVar0))
			{
				iVar1 = network::network_get_participant_index(iVar0);
				iVar2 = iVar1;
				switch (iLocal_3786)
				{
					case 0:
						if (!gameplay::is_bit_set(Local_292[iVar2 /*8*/].f_4, 0))
						{
							if (func_80("PEN_BIKE"))
							{
								func_79();
							}
						}
						else if (!func_80("PEN_BIKE"))
						{
							func_67("PEN_BIKE", 0);
						}
						iLocal_3786++;
						break;
					
					case 1:
						if (!gameplay::is_bit_set(Local_292[iVar2 /*8*/].f_4, 1))
						{
							if (func_80("PEN_VEHG"))
							{
								func_79();
							}
						}
						else if (!func_80("PEN_VEHG"))
						{
							func_67("PEN_VEHG", 0);
						}
						iLocal_3786++;
						break;
					
					case 2:
						if (!gameplay::is_bit_set(Local_292[iVar2 /*8*/].f_4, 2))
						{
							if (func_80("PEN_PBIKE"))
							{
								func_79();
							}
						}
						else if (!func_80("PEN_PBIKE"))
						{
							func_67("PEN_PBIKE", 0);
						}
						iLocal_3786++;
						break;
					
					case 3:
						if (!gameplay::is_bit_set(Local_292[iVar2 /*8*/].f_4, 3))
						{
							if (func_80("PEN_PVEHG"))
							{
								func_79();
							}
						}
						else if (!func_80("PEN_PVEHG"))
						{
							func_67("PEN_PVEHG", 0);
						}
						iLocal_3786++;
						break;
					
					case 4:
						if (!gameplay::is_bit_set(Local_292[iVar2 /*8*/].f_4, 4))
						{
							if (func_80("PEN_AREA"))
							{
								func_79();
							}
						}
						else if (!func_80("PEN_AREA"))
						{
							func_67("PEN_AREA", 0);
						}
						iLocal_3786++;
						break;
					
					case 5:
						if (!gameplay::is_bit_set(Local_292[iVar2 /*8*/].f_4, 5))
						{
							if (func_80("PEN_BAREA"))
							{
								func_79();
							}
						}
						else if (!func_80("PEN_BAREA"))
						{
							func_67("PEN_BAREA", 0);
						}
						iLocal_3786++;
						break;
					
					case 6:
						if (!gameplay::is_bit_set(Local_292[iVar2 /*8*/].f_4, 6))
						{
							if (func_80("PEN_EXITV"))
							{
								func_79();
							}
						}
						else if (!func_80("PEN_EXITV"))
						{
							func_67("PEN_EXITV", 0);
						}
						iLocal_3786++;
						break;
					
					case 7:
						if (!gameplay::is_bit_set(Local_292[iVar2 /*8*/].f_4, 7))
						{
							if (func_80("PEN_STARTO"))
							{
								func_79();
							}
						}
						else if (!func_80("PEN_STARTO"))
						{
							func_67("PEN_STARTO", 0);
						}
						iLocal_3786++;
						break;
				}
				if (iLocal_3786 > 7)
				{
					iLocal_3786 = 0;
				}
			}
		}
	}
}

void func_67(char* sParam0, int iParam1)//Position - 0x2E40
{
	if (gameplay::is_string_null_or_empty(sParam0))
	{
		return;
	}
	if (ui::_0x43E4111189E54F0E(sParam0) > 23)
	{
		return;
	}
	if (func_77(sParam0))
	{
		return;
	}
	func_71();
	Global_1312577 = 0;
	StringCopy(&(Global_1312577.f_1), script::get_this_script_name(), 24);
	Global_1312577.f_7 = gameplay::get_hash_key(&(Global_1312577.f_1));
	StringCopy(&(Global_1312577.f_10), sParam0, 16);
	func_70();
	func_69(iParam1);
	func_68();
}

void func_68()//Position - 0x2EAB
{
	gameplay::set_bit(&(Global_1312577.f_57), 1);
}

void func_69(int iParam0)//Position - 0x2EBE
{
	if (iParam0)
	{
		gameplay::set_bit(&(Global_1312577.f_57), 0);
		return;
	}
	gameplay::clear_bit(&(Global_1312577.f_57), 0);
}

void func_70()//Position - 0x2EE4
{
	Global_1312577.f_8 = network::get_time_offset(network::get_network_time(), 86400000);
	Global_1312577.f_9 = network::get_network_time();
}

void func_71()//Position - 0x2F09
{
	func_73();
	func_72(0);
}

void func_72(int iParam0)//Position - 0x2F1A
{
	int iVar0;
	
	iVar0 = network::network_is_game_in_progress();
	Global_1312577 = 19;
	StringCopy(&(Global_1312577.f_1), "", 24);
	Global_1312577.f_7 = 0;
	if (iVar0)
	{
		Global_1312577.f_8 = network::get_network_time();
		Global_1312577.f_9 = network::get_network_time();
	}
	StringCopy(&(Global_1312577.f_10), "", 16);
	StringCopy(&(Global_1312577.f_14), "", 64);
	StringCopy(&(Global_1312577.f_30), "", 64);
	Global_1312577.f_50 = 0;
	Global_1312577.f_51 = 0;
	Global_1312577.f_52 = 0;
	Global_1312577.f_53 = -1;
	Global_1312577.f_54 = 0;
	Global_1312577.f_57 = 0;
	if (iParam0)
	{
		return;
	}
}

void func_73()//Position - 0x2FAC
{
	if (!func_76())
	{
	}
	if (func_75())
	{
		ui::_0xE124FA80A759019C(&(Global_1312577.f_10));
		func_74();
		ui::_0xFCC75460ABA29378();
	}
}

void func_74()//Position - 0x2FD5
{
	switch (Global_1312577)
	{
		case 19:
			return;
		
		case 0:
			return;
		
		case 1:
			ui::add_text_component_integer(Global_1312577.f_50);
			return;
		
		case 2:
			ui::add_text_component_integer(Global_1312577.f_50);
			ui::add_text_component_integer(Global_1312577.f_51);
			return;
		
		case 3:
			ui::_add_text_component_item_string(&(Global_1312577.f_14));
			return;
		
		case 4:
			ui::_add_text_component_item_string(&(Global_1312577.f_14));
			ui::_add_text_component_item_string(&(Global_1312577.f_30));
			return;
		
		case 5:
			ui::add_text_component_substring_player_name(&(Global_1312577.f_14));
			return;
		
		case 6:
			ui::_0x39BBF623FC803EAC(Global_1312577.f_54);
			ui::add_text_component_substring_player_name(&(Global_1312577.f_14));
			return;
		
		case 7:
			ui::_add_text_component_item_string(&(Global_1312577.f_14));
			return;
		
		case 8:
			ui::_0x39BBF623FC803EAC(Global_1312577.f_54);
			ui::_add_text_component_item_string(&(Global_1312577.f_14));
			return;
		
		case 9:
			ui::_0x5F68520888E69014(&(Global_1312577.f_14));
			return;
		
		case 10:
			ui::add_text_component_substring_player_name(&(Global_1312577.f_14));
			ui::add_text_component_substring_player_name(&(Global_1312577.f_30));
			return;
		
		case 12:
			ui::add_text_component_substring_player_name(&(Global_1312577.f_14));
			ui::_add_text_component_item_string(&(Global_1312577.f_30));
			return;
		
		case 11:
			ui::_0x5F68520888E69014(&(Global_1312577.f_14));
			return;
		
		case 13:
			ui::_0x39BBF623FC803EAC(Global_1312577.f_54);
			ui::add_text_component_substring_player_name(&(Global_1312577.f_14));
			ui::_0x39BBF623FC803EAC(Global_1312577.f_54);
			ui::_add_text_component_item_string(&(Global_1312577.f_30));
			return;
		
		case 14:
			ui::_0x39BBF623FC803EAC(Global_1312577.f_54);
			ui::add_text_component_substring_player_name(&(Global_1312577.f_14));
			ui::_0x39BBF623FC803EAC(Global_1312577.f_55);
			ui::_add_text_component_item_string(&(Global_1312577.f_30));
			return;
		
		case 16:
			ui::add_text_component_substring_player_name(&(Global_1312577.f_14));
			ui::add_text_component_substring_player_name(&(Global_1312577.f_30));
			ui::_0x39BBF623FC803EAC(Global_1312577.f_54);
			ui::_add_text_component_item_string(&(Global_1312577.f_46));
			return;
		
		case 15:
			ui::_0x39BBF623FC803EAC(Global_1312577.f_54);
			ui::add_text_component_substring_player_name(&(Global_1312577.f_14));
			return;
		
		case 18:
			ui::_0x39BBF623FC803EAC(Global_1312577.f_54);
			ui::_add_text_component_item_string(&(Global_1312577.f_14));
			return;
		
		case 17:
			ui::add_text_component_substring_player_name(&(Global_1312577.f_14));
			ui::_0x39BBF623FC803EAC(Global_1312577.f_54);
			ui::_add_text_component_item_string(&(Global_1312577.f_46));
			ui::add_text_component_substring_player_name(&(Global_1312577.f_30));
			return;
		
		default:
	}
}

bool func_75()//Position - 0x3216
{
	if (Global_1312577 == 19)
	{
		return false;
	}
	return true;
}

int func_76()//Position - 0x322C
{
	if (!func_75())
	{
		return 0;
	}
	ui::_0x853648FD1063A213(&(Global_1312577.f_10));
	func_74();
	return ui::_0x8A9BA1AB3E237613();
}

int func_77(char* sParam0)//Position - 0x3252
{
	if (!func_75())
	{
		return false;
	}
	if (Global_1312577 == 11)
	{
		return func_78(sParam0);
	}
	if (gameplay::is_string_null_or_empty(sParam0))
	{
		return false;
	}
	return gameplay::get_hash_key(sParam0) == gameplay::get_hash_key(&(Global_1312577.f_10));
}

int func_78(char* sParam0)//Position - 0x3296
{
	if (!func_75())
	{
		return false;
	}
	if (gameplay::is_string_null_or_empty(sParam0))
	{
		return false;
	}
	return gameplay::get_hash_key(sParam0) == gameplay::get_hash_key(&(Global_1312577.f_14));
}

void func_79()//Position - 0x32C8
{
	if (!func_75())
	{
		return;
	}
	if (!gameplay::get_hash_key(script::get_this_script_name()) == Global_1312577.f_7)
	{
		return;
	}
	func_71();
}

int func_80(char* sParam0)//Position - 0x32F5
{
	if (gameplay::is_string_null_or_empty(sParam0))
	{
		return 0;
	}
	if (!func_75())
	{
		return 0;
	}
	if (Global_1312577 == 11)
	{
		if (ui::_0x43E4111189E54F0E(sParam0) > 63)
		{
			return 0;
		}
	}
	else if (ui::_0x43E4111189E54F0E(sParam0) > 23)
	{
		return 0;
	}
	return func_77(sParam0);
}

void func_81()//Position - 0x3346
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	
	if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 0))
	{
		if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 1))
		{
			iVar5 = true;
		}
	}
	if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
	{
		if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 1))
		{
			if (!ped::is_ped_injured(player::player_ped_id()))
			{
				if (ped::is_ped_sitting_in_any_vehicle(player::player_ped_id()))
				{
					iVar0 = ped::get_vehicle_ped_is_in(player::player_ped_id(), 0);
					iVar1 = vehicle::get_ped_in_vehicle_seat(iVar0, -1);
					if (entity::does_entity_exist(iVar1))
					{
						if (iVar1 != player::player_ped_id())
						{
							if (ped::is_ped_a_player(iVar1))
							{
								iVar2 = network::_network_get_ped_player(iVar1);
								if (network::network_is_player_a_participant(iVar2))
								{
									iVar3 = network::network_get_participant_index(iVar2);
									iVar4 = iVar3;
									if (gameplay::is_bit_set(Local_292[iVar4 /*8*/].f_1, 0))
									{
										iVar5 = true;
									}
								}
							}
						}
					}
				}
			}
		}
	}
	if (func_84(player::player_id()))
	{
		iVar5 = true;
	}
	if (iVar5)
	{
		func_83();
		func_82();
	}
}

void func_82()//Position - 0x3431
{
	Global_2464975.f_1650.f_56 = 1;
}

void func_83()//Position - 0x3443
{
	Global_2464975.f_1650.f_54 = 1;
}

int func_84(int iParam0)//Position - 0x3455
{
	return gameplay::is_bit_set(Global_1610705[iParam0 /*178*/].f_1, 4);
}

void func_85()//Position - 0x346C
{
	float fVar0;
	
	if (!func_9(&uLocal_3759) || (func_9(&uLocal_3759) && func_7(&uLocal_3759, 5000, 0)))
	{
		fVar0 = func_88(player::player_ped_id(), vLocal_570, 1);
		if (!func_87(player::player_id()))
		{
			if (fVar0 <= 700f)
			{
				func_86(1);
			}
		}
		else if (fVar0 > 700f)
		{
			func_86(0);
		}
		func_6(&uLocal_3759);
		func_8(&uLocal_3759, 0, 0);
	}
}

void func_86(int iParam0)//Position - 0x34EB
{
	if (iParam0)
	{
		gameplay::set_bit(&(Global_1610705[player::player_id() /*178*/].f_1), 5);
	}
	else
	{
		gameplay::clear_bit(&(Global_1610705[player::player_id() /*178*/].f_1), 5);
	}
}

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

float func_88(int iParam0, vector3 vParam1, int iParam4)//Position - 0x3542
{
	vector3 vVar0;
	
	if (!entity::is_entity_dead(iParam0, 0))
	{
		vVar0 = { entity::get_entity_coords(iParam0, 1) };
	}
	else
	{
		vVar0 = { entity::get_entity_coords(iParam0, 0) };
	}
	return gameplay::get_distance_between_coords(vVar0, vParam1, iParam4);
}

void func_89()//Position - 0x357C
{
	if (!gameplay::is_bit_set(iLocal_550, 11))
	{
		if (Local_96.f_21 == 2)
		{
			if (audio::trigger_music_event("PENNED_IN_START_MUSIC"))
			{
				gameplay::set_bit(&iLocal_550, 11);
			}
		}
	}
	else if (gameplay::is_bit_set(iLocal_550, 15))
	{
		if (!gameplay::is_bit_set(iLocal_550, 12))
		{
			if (!gameplay::is_bit_set(iLocal_550, 16))
			{
				if (audio::trigger_music_event("PENNED_IN_70_PERCENT"))
				{
					gameplay::set_bit(&iLocal_550, 16);
				}
			}
		}
	}
	if (!gameplay::is_bit_set(iLocal_550, 12))
	{
		if (gameplay::is_bit_set(iLocal_550, 11))
		{
			if (Local_292[network::participant_id_to_int() /*8*/].f_7 > 2)
			{
				if (audio::trigger_music_event("PENNED_IN_STOP_MUSIC"))
				{
					gameplay::set_bit(&iLocal_550, 12);
				}
			}
		}
	}
}

void func_90()//Position - 0x3623
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	if (!func_52(player::player_id(), 0))
	{
		if (gameplay::is_bit_set(iLocal_550, 22))
		{
			gameplay::clear_bit(&iLocal_550, 22);
		}
		return;
	}
	if (func_410())
	{
		func_282(0);
	}
	iVar0 = Global_1587816[player::player_id() /*444*/].f_355;
	if (!gameplay::is_bit_set(iLocal_550, 22))
	{
		if (Local_292[network::participant_id_to_int() /*8*/].f_1 != 0)
		{
			Local_292[network::participant_id_to_int() /*8*/].f_1 = 0;
		}
		gameplay::set_bit(&iLocal_550, 22);
	}
	if (!gameplay::is_bit_set(iLocal_550, 13))
	{
		gameplay::set_bit(&iLocal_550, 13);
		func_79();
	}
	if (iLocal_3785 == 2)
	{
		func_273();
	}
	if (network::network_is_player_active(iVar0))
	{
		if (network::network_is_player_a_participant(iVar0))
		{
			iVar1 = network::network_get_participant_index(iVar0);
			iVar2 = iVar1;
			iVar3 = Local_292[iVar2 /*8*/].f_7;
			if (iVar3 > 0)
			{
				if (ui::does_blip_exist(iLocal_568))
				{
					ui::remove_blip(&iLocal_568);
				}
			}
			switch (iVar3)
			{
				case 0:
					func_268(1, 0);
					func_262();
					func_245();
					break;
				
				case 1:
					func_245();
					func_268(!gameplay::is_bit_set(iLocal_549, 9), 0);
					break;
				
				case 2:
					func_28(1);
					func_239();
					func_268(0, 0);
					func_230();
					if (gameplay::is_bit_set(Local_292[iVar2 /*8*/].f_1, 5))
					{
						if (!gameplay::is_bit_set(Local_292[iVar2 /*8*/].f_1, 1))
						{
							if (!func_9(&uLocal_580))
							{
								func_8(&uLocal_580, 0, 0);
							}
							if (func_9(&uLocal_580))
							{
								if ((func_229() - func_40(&uLocal_580, 0, 0)) >= 0)
								{
									func_226((func_229() - func_40(&uLocal_580, 0, 0)), "PEN_ELM", 0, 1, -1, 0, 2, 0, 6, 0, 0, 0, 6, 0, 0, 0);
								}
							}
						}
					}
					else if (func_9(&uLocal_580))
					{
						func_6(&uLocal_580);
					}
					func_92();
					break;
				
				case 3:
					if (gameplay::is_bit_set(Local_292[iVar2 /*8*/].f_1, 0) || gameplay::is_bit_set(Local_292[iVar2 /*8*/].f_1, 6))
					{
						func_268(0, 1);
					}
					if (ui::does_blip_exist(iLocal_567))
					{
						ui::set_blip_colour(iLocal_567, 55);
					}
					func_92();
					break;
				
				default:
					if (gameplay::is_bit_set(Local_292[iVar2 /*8*/].f_1, 2))
					{
						func_91();
					}
					break;
				}
			}
	}
	if (Local_96.f_21 > 4)
	{
		func_677();
	}
}

void func_91()//Position - 0x3855
{
	if (ui::does_blip_exist(iLocal_567))
	{
		ui::remove_blip(&iLocal_567);
	}
}

void func_92()//Position - 0x386E
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	int iVar6;
	int iVar7;
	int iVar8;
	int iVar9;
	int iVar10;
	int iVar11;
	int iVar12;
	var uVar13;
	var uVar14;
	var uVar18;
	var uVar19;
	int iVar23;
	char* sVar24;
	var uVar25;
	var uVar26;
	var uVar27;
	var uVar31;
	var uVar32;
	
	iVar5 = -1;
	iVar6 = func_58();
	if (!func_52(player::player_id(), 0))
	{
		iVar5 = network::participant_id_to_int();
		iVar6 = player::player_id();
	}
	else
	{
		iVar7 = Global_1587816[player::player_id() /*444*/].f_355;
		if (network::network_is_player_active(iVar7))
		{
			if (network::network_is_player_a_participant(iVar7))
			{
				iVar6 = iVar7;
				iVar5 = network::network_get_participant_index(iVar7);
			}
		}
	}
	if (func_225(player::player_id()))
	{
		gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 2);
		return;
	}
	if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 2))
	{
		return;
	}
	if (gameplay::is_bit_set(Local_96.f_1, 12))
	{
		gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 2);
		return;
	}
	if (!func_615(1))
	{
		if (iVar5 > -1)
		{
			if (iVar6 != func_58())
			{
				if (gameplay::is_bit_set(Local_292[iVar5 /*8*/].f_1, 0))
				{
					if (!gameplay::is_bit_set(iLocal_549, 17))
					{
						if (!gameplay::is_bit_set(Local_96.f_1, 10))
						{
							if (gameplay::is_bit_set(Local_96.f_1, 3) && gameplay::is_bit_set(Local_96.f_1, 11))
							{
								if (!gameplay::is_bit_set(iLocal_549, 19))
								{
									if (!ped::is_ped_injured(player::player_ped_id()))
									{
										if (ped::is_ped_sitting_in_any_vehicle(player::player_ped_id()))
										{
											if (network::network_has_control_of_entity(ped::get_vehicle_ped_is_in(player::player_ped_id(), 0)))
											{
												gameplay::set_bit(&iLocal_549, 19);
											}
										}
									}
								}
								if (gameplay::is_bit_set(Local_96.f_10, iVar5))
								{
									if (!gameplay::is_bit_set(Local_292[iVar5 /*8*/].f_1, 1))
									{
										iVar12 = true;
									}
								}
								if (func_224(&iVar8, &iVar9, &iVar10))
								{
									if (iVar10 > 2)
									{
										if (func_221(iVar6, iVar8, iVar9))
										{
											iVar2 = true;
										}
										if (!iVar2)
										{
											iVar11 = true;
										}
									}
									else if (iVar10 == 2)
									{
										if (iVar6 == iVar8 || iVar6 == iVar9)
										{
											if (iVar6 == iVar8)
											{
												func_220(67, "PEN_DRAWP", player::get_player_name(iVar9), 1, 15000, "PEN_OVR", 2);
											}
											else
											{
												func_220(67, "PEN_DRAWP", player::get_player_name(iVar8), 1, 15000, "PEN_OVR", 2);
											}
										}
										else
										{
											if (func_221(iVar6, iVar8, iVar9))
											{
												iVar2 = true;
											}
											if (!iVar2)
											{
												func_219(65, func_58(), func_58(), -1, "PEN_DRAW2P", "PEN_OVR", 1, 15000, 2, player::get_player_name(iVar8), player::get_player_name(iVar9), 0);
											}
										}
									}
									if (!iVar2 || (iVar2 && iVar4))
									{
										if (iVar5 == network::participant_id_to_int())
										{
											func_198(iVar12, &iVar0, &iVar1, iVar10);
											Local_3747.f_6 = iVar0;
											Local_3747.f_7 = iVar1;
											Global_2446413 = iVar0;
											if (iVar0 > 0)
											{
												if (func_197())
												{
													func_188(968073639, iVar0, &uVar13, 0, 1, 0);
												}
												else
												{
													networkcash::_0xFB6DB092FBAE29E6(iVar0, "AM_PENNED_IN", &uVar14);
												}
											}
											if (!func_187())
											{
												if (Local_3747.f_6 > 0)
												{
													func_186(11, Local_3747.f_6);
												}
											}
											func_185();
											func_148(0, "", -1636175450, 1487716476, iVar1, 1, -1, 0);
										}
										gameplay::set_bit(&iLocal_549, 17);
									}
								}
								else if (iVar12)
								{
									if (iVar5 == network::participant_id_to_int())
									{
										func_198(1, &iVar0, &iVar1, 1);
										Local_3747.f_6 = iVar0;
										Local_3747.f_7 = iVar1;
										Global_2446413 = iVar0;
										if (iVar0 > 0)
										{
											if (func_197())
											{
												func_188(968073639, iVar0, &uVar18, 0, 1, 0);
											}
											else
											{
												networkcash::_0xFB6DB092FBAE29E6(iVar0, "AM_PENNED_IN", &uVar19);
											}
										}
										if (!func_187())
										{
											if (Local_3747.f_6 > 0)
											{
												func_186(11, Local_3747.f_6);
											}
										}
										func_185();
										func_148(0, "", -1636175450, 1487716476, iVar1, 1, -1, 0);
									}
									func_147(63, "PEN_WIN", "PEN_WON", 1, 15000, 2);
									gameplay::set_bit(&iLocal_549, 17);
								}
								else if (gameplay::is_bit_set(Local_96.f_1, 3))
								{
									if (func_694(iVar6, 1, 1))
									{
										iVar8 = func_146();
										if (iVar8 != func_58())
										{
											if (network::network_is_player_active(iVar8))
											{
												if (!iVar2)
												{
													if (func_144(iVar8, 1))
													{
														iVar23 = func_143(iVar8);
														if (iVar23 > -1)
														{
															uVar25 = func_141(iVar23);
															sVar24 = func_135(iVar8);
															iVar3 = true;
														}
													}
												}
												if (!iVar2 && !iVar3)
												{
													func_220(65, "PEN_WONP", player::get_player_name(iVar8), 1, 15000, "PEN_OVR", 2);
												}
												else if (iVar3)
												{
													func_108(65, "PEN_OVR", "PEN_WONPG2", sVar24, uVar25, 0, -1, -1, -1, 2, -1);
												}
												else if (network::network_is_player_a_participant(iVar8))
												{
													func_220(89, "PEN_WONPG", player::get_player_name(iVar8), 1, 15000, "PEN_OVR", 2);
													iVar4 = 1;
												}
												else
												{
													func_220(65, "PEN_WONP", player::get_player_name(iVar8), 1, 15000, "PEN_OVR", 2);
													iVar4 = 1;
												}
											}
										}
										else
										{
											func_147(65, "PEN_OVR", "PEN_NWN", 1, 15000, 2);
										}
										if (!iVar2 || (iVar2 && iVar4))
										{
											if (iVar5 == network::participant_id_to_int())
											{
												func_198(0, &iVar0, &iVar1, 1);
												Local_3747.f_6 = iVar0;
												Local_3747.f_7 = iVar1;
												Global_2446413 = iVar0;
												if (iVar0 > 0)
												{
													if (func_197())
													{
														func_188(968073639, iVar0, &uVar26, 0, 1, 0);
													}
													else
													{
														networkcash::_0xFB6DB092FBAE29E6(iVar0, "AM_PENNED_IN", &uVar27);
													}
												}
												if (!func_187())
												{
													if (Local_3747.f_6 > 0)
													{
														func_186(11, Local_3747.f_6);
													}
												}
												func_185();
												func_148(0, "", -1636175450, 1487716476, iVar1, 1, -1, 0);
											}
											gameplay::set_bit(&iLocal_549, 17);
										}
									}
								}
								if (iVar11)
								{
									if (iVar12)
									{
										func_147(67, "PEN_OVR", "PEN_DRAWD", 1, -1, 2);
									}
									else
									{
										func_147(67, "PEN_OVR", "PEN_DRAWD", 1, -1, 2);
									}
								}
							}
						}
						else
						{
							func_147(65, "PEN_OVR", "PEN_NWN", 1, 15000, 2);
							if (iVar5 == network::participant_id_to_int())
							{
								func_198(0, &iVar0, &iVar1, 1);
								Local_3747.f_6 = iVar0;
								Local_3747.f_7 = iVar1;
								Global_2446413 = iVar0;
								if (iVar0 > 0)
								{
									if (func_197())
									{
										func_188(968073639, iVar0, &uVar31, 0, 1, 0);
									}
									else
									{
										networkcash::_0xFB6DB092FBAE29E6(iVar0, "AM_PENNED_IN", &uVar32);
									}
								}
								func_185();
								func_148(0, "", -1636175450, 1487716476, iVar1, 1, -1, 0);
							}
							gameplay::set_bit(&iLocal_549, 17);
						}
					}
					if (gameplay::is_bit_set(iLocal_549, 17))
					{
						if (gameplay::is_bit_set(Local_292[iVar5 /*8*/].f_1, 5))
						{
							if (!gameplay::is_bit_set(Local_292[iVar5 /*8*/].f_1, 1))
							{
								audio::stop_sound(iLocal_3043);
								audio::release_sound_id(iLocal_3043);
							}
						}
						if (cam::is_screen_faded_in())
						{
							gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 2);
						}
					}
				}
				else if (!gameplay::is_bit_set(Local_96.f_1, 10))
				{
					if (gameplay::is_bit_set(Local_96.f_1, 3))
					{
						iVar8 = func_146();
						if (iVar8 != func_58())
						{
							if (!func_224(&iVar8, &iVar9, &iVar10))
							{
								func_105("PEN_WONP", iVar8, 1, 0, 0, 0, 1, 1, 0);
							}
							else if (iVar10 == 2)
							{
								func_102("PEN_WON2P", iVar8, iVar9, 1, 1, 0, 0, 1);
							}
							else
							{
								func_97("PEN_DRAWD", 1);
							}
						}
						gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 2);
						func_93(0);
					}
				}
				else
				{
					gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 2);
					func_93(0);
				}
			}
			else if (func_52(player::player_id(), 0))
			{
				if (gameplay::is_bit_set(Local_96.f_1, 3) && gameplay::is_bit_set(Local_96.f_1, 11))
				{
					gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 2);
				}
				else if (gameplay::is_bit_set(Local_96.f_1, 10))
				{
					gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 2);
				}
			}
		}
	}
	else if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 2))
	{
		if (gameplay::is_bit_set(Local_96.f_1, 3) || gameplay::is_bit_set(Local_96.f_1, 10))
		{
			gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 2);
		}
	}
}

void func_93(int iParam0)//Position - 0x3FEC
{
	if (iParam0)
	{
		if (func_94(1))
		{
			gameplay::set_bit(&Global_1573927, 1);
		}
	}
	else if (func_94(2))
	{
		gameplay::set_bit(&Global_1573927, 2);
	}
}

bool func_94(int iParam0)//Position - 0x4020
{
	int iVar0;
	
	iVar0 = func_95(2512, -1, 0);
	if (iParam0 == 0)
	{
		if ((gameplay::is_bit_set(iVar0, 0) && gameplay::is_bit_set(iVar0, 1)) && gameplay::is_bit_set(iVar0, 2))
		{
			return false;
		}
	}
	else if (iParam0 == 1)
	{
		if ((gameplay::is_bit_set(iVar0, 3) && gameplay::is_bit_set(iVar0, 4)) && gameplay::is_bit_set(iVar0, 5))
		{
			return false;
		}
	}
	else if (iParam0 == 2)
	{
		if ((gameplay::is_bit_set(iVar0, 6) && gameplay::is_bit_set(iVar0, 7)) && gameplay::is_bit_set(iVar0, 8))
		{
			return false;
		}
	}
	else if (iParam0 == 3)
	{
		if ((gameplay::is_bit_set(iVar0, 9) && gameplay::is_bit_set(iVar0, 10)) && gameplay::is_bit_set(iVar0, 11))
		{
			return false;
		}
	}
	return true;
}

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

int func_96(int iParam0)//Position - 0x4123
{
	int iVar0;
	int iVar1;
	
	iVar0 = iParam0;
	if (iVar0 == -1)
	{
		iVar1 = func_54();
		if (iVar1 > -1)
		{
			Global_2473567 = 0;
			iVar0 = iVar1;
		}
		else
		{
			iVar0 = 0;
			Global_2473567 = 1;
		}
	}
	return iVar0;
}

int func_97(char* sParam0, int iParam1)//Position - 0x4157
{
	int iVar0;
	
	iVar0 = -1;
	ui::_set_notification_text_entry(sParam0);
	iVar0 = ui::_draw_notification(0, 1);
	func_98(0, sParam0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0);
	return iVar0;
}

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

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

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

int func_101()//Position - 0x4326
{
	return dlc2::is_dlc_present(-1762644250);
}

int func_102(char* sParam0, int iParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7)//Position - 0x4337
{
	int iVar0;
	struct<8> Var1;
	struct<8> Var17;
	
	iVar0 = -1;
	if ((network::_0x9DE986FC9A87C474(player::player_id(), iParam1) && network::_0x9DE986FC9A87C474(player::player_id(), iParam2)) || iParam6)
	{
		if (!iParam5)
		{
			StringCopy(&Var1, player::get_player_name(iParam1), 64);
			StringCopy(&Var17, player::get_player_name(iParam2), 64);
		}
		else
		{
			StringCopy(&Var1, player::get_player_name(iParam1), 64);
			StringCopy(&Var17, player::get_player_name(iParam2), 64);
		}
		ui::_set_notification_text_entry(sParam0);
		ui::_0x39BBF623FC803EAC(iParam3);
		ui::add_text_component_substring_player_name(func_103(&Var1));
		ui::_0x39BBF623FC803EAC(iParam4);
		ui::add_text_component_substring_player_name(func_103(&Var17));
		iVar0 = ui::_draw_notification(0, 1);
		func_98(22, sParam0, 1, &Var1, 0, 0, 0, 0f, 0, &Var17, 0, 0);
	}
	return iVar0;
}

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

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

int func_105(char* sParam0, int iParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8)//Position - 0x4409
{
	int iVar0;
	struct<16> Var1;
	int iVar17;
	int iVar18;
	
	iVar0 = -1;
	if (network::_0x9DE986FC9A87C474(player::player_id(), iParam1) || iParam4)
	{
		if (!iParam3)
		{
			StringCopy(&Var1, player::get_player_name(iParam1), 64);
		}
		else
		{
			StringCopy(&Var1, player::get_player_name(iParam1), 64);
		}
		ui::_set_notification_text_entry(sParam0);
		ui::_0x39BBF623FC803EAC(iParam2);
		ui::add_text_component_substring_player_name(func_103(&Var1));
		if (!iParam5)
		{
			iVar0 = ui::_draw_notification(0, 1);
		}
		else
		{
			Global_2460474 = { func_107(iParam1) };
			if (network::network_clan_player_get_desc(&Global_2460404, 35, &Global_2460474))
			{
				iVar17 = 0;
				if (gameplay::are_strings_equal(&(Global_2460404.f_22), "Leader") && Global_2460404.f_30 == 0)
				{
					iVar17 = 1;
				}
				if (Global_2460404.f_21 > 0)
				{
					iVar18 = 0;
				}
				else
				{
					iVar18 = 1;
				}
				if (iParam7)
				{
					if (iParam8)
					{
						Var1 = { func_106(&Var1) };
					}
					iVar0 = ui::_0x137BC35589E34E1E(iVar18, network::_0x7543BB439F63792B(&Global_2460404, 35), &(Global_2460404.f_17), Global_2460404.f_30, iVar17, 0, Global_2460404, &Var1, Global_1317072, Global_1317073, Global_1317074);
				}
				else
				{
					iVar0 = ui::_0x97C9E4E7024A8F2C(iVar18, network::_0x7543BB439F63792B(&Global_2460404, 35), &(Global_2460404.f_17), Global_2460404.f_30, iVar17, 0, Global_2460404, Global_1317072, Global_1317073, Global_1317074);
				}
			}
			else
			{
				iVar0 = ui::_draw_notification(0, 1);
			}
		}
		func_98(14, sParam0, 1, &Var1, 0, 0, 0, 0, 1, 0, 0, 0);
	}
	return iVar0;
}

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

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

int func_108(int iParam0, char* sParam1, char* sParam2, char* sParam3, var uParam4, char* sParam5, int iParam6, int iParam7, int iParam8, int iParam9, int iParam10)//Position - 0x45A3
{
	var uVar0;
	var uVar1;
	var uVar2;
	
	uVar0 = func_58();
	uVar1 = func_58();
	uVar2 = func_58();
	return func_109(iParam0, sParam1, sParam2, sParam3, uParam4, uVar0, uVar1, uVar2, sParam5, iParam6, iParam7, iParam8, iParam9, iParam10);
}

int func_109(var uParam0, char* sParam1, char* sParam2, char* sParam3, var uParam4, var uParam5, var uParam6, var uParam7, char* sParam8, int iParam9, var uParam10, var uParam11, var uParam12, var uParam13)//Position - 0x45DD
{
	struct<72> Var0;
	
	Var0.f_3 = -1;
	Var0.f_4 = -1;
	Var0.f_5 = -1;
	Var0.f_6 = -1;
	Var0.f_7 = -1082130432;
	Var0.f_65 = 1;
	Var0.f_66 = 2;
	Var0.f_71 = -1;
	func_134(uParam0, &Var0, iParam9, sParam2, sParam1);
	Var0.f_4 = uParam10;
	Var0.f_5 = uParam11;
	Var0.f_16 = uParam5;
	Var0.f_17 = uParam6;
	Var0.f_18 = uParam7;
	StringCopy(&(Var0.f_23), sParam3, 64);
	StringCopy(&(Var0.f_55), sParam8, 16);
	Var0.f_65 = uParam4;
	Var0.f_6 = uParam13;
	Var0.f_66 = uParam12;
	gameplay::set_bit(&(Var0.f_63), 2);
	return func_110(&Var0);
}

bool func_110(var uParam0)//Position - 0x4679
{
	int iVar0;
	
	if (uParam0->f_1 == 1)
	{
		if (Global_2428549.f_2481)
		{
			return false;
		}
	}
	func_116(uParam0, uParam0->f_16);
	func_113(uParam0);
	if (func_112(uParam0->f_1))
	{
		if (Global_2428549.f_2191[0 /*72*/].f_2 == 0)
		{
			Global_2428549.f_2191[0 /*72*/] = { *uParam0 };
			return true;
		}
		if (((Global_2428549.f_2191[0 /*72*/].f_1 == 13 || Global_2428549.f_2191[0 /*72*/].f_1 == 52) || Global_2428549.f_2191[0 /*72*/].f_1 == 53) || Global_2428549.f_2191[0 /*72*/].f_1 == 57)
		{
			Global_2428549.f_2191[0 /*72*/].f_2 = 5;
		}
		iVar0 = 2;
		while (iVar0 >= 1)
		{
			Global_2428549.f_2191[iVar0 + 1 /*72*/] = { Global_2428549.f_2191[iVar0 /*72*/] };
			iVar0 = (iVar0 + -1);
		}
		Global_2428549.f_2191[1 /*72*/] = { *uParam0 };
		return true;
	}
	iVar0 = 0;
	while (iVar0 < 4)
	{
		if (Global_2428549.f_2191[iVar0 /*72*/].f_2 == 0)
		{
			Global_2428549.f_2191[iVar0 /*72*/] = { *uParam0 };
			return true;
		}
		else
		{
			if (uParam0->f_1 == 1)
			{
				gameplay::set_bit(&(Global_2428549.f_2191[iVar0 /*72*/].f_63), 1);
				Global_2428549.f_2191[iVar0 /*72*/].f_2 = 5;
			}
			if (uParam0->f_1 == 85)
			{
				if (func_111(Global_2428549.f_2191[iVar0 /*72*/].f_1))
				{
					Global_2428549.f_2191[iVar0 /*72*/].f_2 = 5;
					gameplay::set_bit(&(Global_2428549.f_2191[iVar0 /*72*/].f_63), 0);
				}
			}
		}
		iVar0++;
	}
	return false;
}

bool func_111(int iParam0)//Position - 0x481F
{
	switch (iParam0)
	{
		case 87:
		case 86:
		case 89:
		case 90:
		case 85:
		case 91:
		case 92:
		case 93:
		case 94:
		case 95:
		case 96:
		case 97:
		case 88:
		case 98:
			return true;
		
		default:
	}
	return false;
}

bool func_112(int iParam0)//Position - 0x4887
{
	if ((((((((((((((((((iParam0 == 3 || iParam0 == 4) || iParam0 == 5) || iParam0 == 6) || iParam0 == 11) || iParam0 == 12) || iParam0 == 28) || iParam0 == 29) || iParam0 == 30) || iParam0 == 24) || iParam0 == 32) || iParam0 == 31) || iParam0 == 26) || iParam0 == 25) || iParam0 == 55) || iParam0 == 7) || iParam0 == 8) || iParam0 == 9) || iParam0 == 10)
	{
		return true;
	}
	return false;
}

void func_113(var uParam0)//Position - 0x495D
{
	if (func_115(uParam0->f_1))
	{
		uParam0->f_66 = func_114();
	}
}

int func_114()//Position - 0x4978
{
	return 21;
}

bool func_115(int iParam0)//Position - 0x4982
{
	switch (iParam0)
	{
		case 62:
		case 63:
		case 64:
		case 65:
		case 66:
		case 67:
		case 68:
		case 69:
		case 70:
		case 71:
		case 72:
		case 73:
		case 74:
		case 75:
		case 76:
		case 77:
		case 78:
		case 79:
		case 80:
		case 81:
		case 82:
			return true;
		
		default:
	}
	return false;
}

void func_116(var uParam0, int iParam1)//Position - 0x4A14
{
	if (func_115(uParam0->f_1))
	{
		uParam0->f_67 = 1;
	}
	if (iParam1 == func_58())
	{
		return;
	}
	if (func_111(uParam0->f_1))
	{
		if (uParam0->f_65 == 1)
		{
			uParam0->f_67 = func_117(iParam1, -2, 0, 0);
		}
	}
}

int func_117(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x4A5A
{
	int iVar0;
	
	if (func_132(iParam0))
	{
		if (iParam2)
		{
			return 0;
		}
		else
		{
			return 1;
		}
	}
	if (func_132(player::player_id()) || (func_131() && func_130()))
	{
		iVar0 = func_129();
		if (entity::does_entity_exist(iVar0))
		{
			if (ped::is_ped_a_player(iVar0))
			{
				if (network::_network_get_ped_player(iVar0) != -1)
				{
					if (func_694(network::_network_get_ped_player(iVar0), 0, 1))
					{
						if ((iParam1 > -1 && network::network_is_activity_session()) && iParam1 < 4)
						{
							if (Global_1617902.f_73330[iParam1] != -1)
							{
								return func_128(iParam1, iParam0, 0);
							}
							else
							{
								return func_125(iParam0, network::_network_get_ped_player(iVar0), iParam1, iParam2, iParam3);
							}
						}
						else
						{
							return func_125(iParam0, network::_network_get_ped_player(iVar0), iParam1, iParam2, iParam3);
						}
					}
				}
			}
			else if ((iParam1 > -1 && network::network_is_activity_session()) && iParam1 < 4)
			{
				if (Global_1617902.f_73330[iParam1] != -1)
				{
					return func_128(iParam1, iParam0, 0);
				}
				else
				{
					return func_118(0, -1, 0);
				}
			}
			else
			{
				return func_118(0, -1, 0);
			}
		}
	}
	if ((iParam1 > -1 && network::network_is_activity_session()) && iParam1 < 4)
	{
		if (Global_1617902.f_73330[iParam1] != -1)
		{
			return func_128(iParam1, iParam0, 0);
		}
		else
		{
			return func_125(iParam0, player::player_id(), iParam1, iParam2, iParam3);
		}
	}
	return func_125(iParam0, player::player_id(), iParam1, iParam2, iParam3);
}

int func_118(int iParam0, int iParam1, int iParam2)//Position - 0x4BE2
{
	return func_119(player::player_id(), iParam0, iParam1, iParam2);
}

int func_119(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x4BF8
{
	int iVar0;
	
	iVar0 = player::get_player_team(iParam0);
	if (iParam1)
	{
		if (iParam2 > -1)
		{
			if (func_124(iVar0, iParam2, 0) && !gameplay::is_bit_set(Global_1617902.f_15, 18))
			{
				if (iVar0 == iParam2)
				{
					return func_123(1);
				}
				else
				{
					return func_123(0);
				}
			}
			else if (iParam3)
			{
				return 28;
			}
			else if (gameplay::is_bit_set(Global_1617902.f_4, 20))
			{
				return func_120(iVar0, iParam2, 1);
			}
			else
			{
				return func_120(iVar0, iParam2, 0);
			}
		}
		return 28;
	}
	if (iVar0 == iParam2 || iParam2 == -1)
	{
		return func_123(1);
	}
	return func_123(0);
}

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

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

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

int func_123(int iParam0)//Position - 0x4DE8
{
	if (iParam0)
	{
		return 118;
	}
	return 116;
}

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

int func_125(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4)//Position - 0x4FCA
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	if (iParam2 == -2)
	{
		iVar0 = player::get_player_team(iParam0);
	}
	else
	{
		iVar0 = iParam2;
	}
	if (Global_1587816[player::player_id() /*444*/] == 148)
	{
		iVar1 = true;
	}
	iVar2 = iParam0;
	if (iVar2 > -1)
	{
		if (Global_1587816[iVar2 /*444*/] == 148)
		{
			iVar1 = true;
		}
	}
	if (!iVar1)
	{
		if (iVar0 != -1)
		{
			if ((func_127(iParam1, iParam0, iVar0, 0) && !gameplay::is_bit_set(Global_1617902.f_15, 18)) || ((func_124(player::get_player_team(iParam1), player::get_player_team(iParam0), 0) && gameplay::is_bit_set(Global_1617902.f_15, 23)) && !gameplay::is_bit_set(Global_1617902.f_15, 18)))
			{
				return func_123(1);
			}
			else if (gameplay::is_bit_set(Global_1617902.f_15, 26))
			{
				return func_126(1);
			}
			else
			{
				return func_119(iParam1, 1, iVar0, iParam4);
			}
		}
		else if ((Global_1573837 || Global_1573828) || Global_1587816[iParam0 /*444*/] == 0)
		{
			if (iParam0 == iParam1 || (Global_1573837 == 1 && Global_1573847 == 0))
			{
				return func_123(1);
			}
			else
			{
				return func_119(iParam1, 1, iVar0, iParam4);
			}
		}
		if (Global_1573832 && Global_1573410.f_14 == iParam0)
		{
			return 28;
		}
	}
	iVar3 = func_143(iParam0);
	if (!iVar3 == -1)
	{
		return func_141(iVar3);
	}
	if (iParam3)
	{
		return 0;
	}
	return 1;
}

int func_126(int iParam0)//Position - 0x514D
{
	if (iParam0)
	{
		return 119;
	}
	return 116;
}

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

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

var func_129()//Position - 0x52A1
{
	return Global_2359301.f_2;
}

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

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

bool func_132(int iParam0)//Position - 0x52DD
{
	if (func_52(iParam0, 0))
	{
		return true;
	}
	if (func_133())
	{
		if (iParam0 == player::player_id())
		{
			return true;
		}
	}
	if (gameplay::is_bit_set(Global_2418529[iParam0 /*313*/].f_194, 2))
	{
		return true;
	}
	return false;
}

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

void func_134(var uParam0, var uParam1, int iParam2, char* sParam3, char* sParam4)//Position - 0x5330
{
	uParam1->f_16 = func_58();
	uParam1->f_17 = func_58();
	uParam1->f_18 = func_58();
	uParam1->f_1 = uParam0;
	uParam1->f_2 = 1;
	StringCopy(&(uParam1->f_19), sParam4, 16);
	StringCopy(&(uParam1->f_8), sParam3, 32);
	uParam1->f_3 = iParam2;
	uParam1->f_65 = 1;
	uParam1->f_68 = 1;
	uParam1->f_69 = 1;
	uParam1->f_67 = 0;
	StringCopy(&(uParam1->f_23), "", 64);
	StringCopy(&(uParam1->f_39), "", 64);
}

char* func_135(int iParam0)//Position - 0x5397
{
	char* sVar0;
	int iVar1;
	
	if (iParam0 == player::player_id())
	{
		sVar0 = func_140(&(Global_1610705[iParam0 /*178*/].f_10.f_77));
		return sVar0;
	}
	if (((func_139(iParam0, 28) || func_139(player::player_id(), 28)) || func_138(iParam0)) && !func_137(iParam0))
	{
		return ui::_get_label_text("GB_REST_ACC");
	}
	iVar1 = func_136(iParam0);
	if (iVar1 != func_58())
	{
		if (iVar1 != player::player_id())
		{
			if (!network::_0x595F028698072DD9(0, -1, 1))
			{
				return ui::_get_label_text("GB_REST_ACC");
			}
		}
	}
	if (iVar1 != func_58())
	{
		sVar0 = func_140(&(Global_1610705[iVar1 /*178*/].f_10.f_77));
		if (gameplay::is_string_null_or_empty(sVar0))
		{
			return ui::_get_label_text("GB_REST_ACC");
		}
		else
		{
			return sVar0;
		}
	}
	return "";
}

int func_136(int iParam0)//Position - 0x5467
{
	if (iParam0 != func_58())
	{
		return Global_1610705[iParam0 /*178*/].f_10;
	}
	return func_58();
}

bool func_137(int iParam0)//Position - 0x5489
{
	struct<13> Var0;
	
	Var0 = { func_107(iParam0) };
	if (gameplay::is_durango_version() && network::_0xB57A49545BA53CE7(&Var0))
	{
		return true;
	}
	return false;
}

bool func_138(int iParam0)//Position - 0x54B3
{
	struct<13> Var0;
	
	Var0 = { func_107(iParam0) };
	if (gameplay::is_orbis_version() || gameplay::is_pc_version())
	{
		if (network::_0x72D918C99BCACC54(0))
		{
			return false;
		}
	}
	else if (gameplay::is_durango_version())
	{
		if (network::_0xB57A49545BA53CE7(&Var0))
		{
			return false;
		}
	}
	return true;
}

int func_139(int iParam0, int iParam1)//Position - 0x54FB
{
	return gameplay::is_bit_set(Global_1610705[iParam0 /*178*/].f_10.f_4, iParam1);
}

var func_140(var uParam0)//Position - 0x5515
{
	return uParam0;
}

int func_141(int iParam0)//Position - 0x551F
{
	int iVar0;
	
	iVar0 = func_142(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_142(var uParam0)//Position - 0x55DC
{
	return Global_2413817.f_1946.f_44[uParam0 /*2*/].f_1;
}

int func_143(int iParam0)//Position - 0x55F3
{
	if (!iParam0 == func_58())
	{
		if (func_144(iParam0, 1))
		{
			return Global_2413817.f_1946.f_11[func_136(iParam0)];
		}
	}
	return -1;
}

int func_144(int iParam0, int iParam1)//Position - 0x5625
{
	if (!iParam1)
	{
		if (func_145(iParam0))
		{
			return false;
		}
	}
	return Global_1610705[iParam0 /*178*/].f_10 != func_58();
}

int func_145(int iParam0)//Position - 0x564F
{
	if (iParam0 != func_58())
	{
		if (Global_1610705[iParam0 /*178*/].f_10 != func_58())
		{
			return Global_1610705[iParam0 /*178*/].f_10 == iParam0;
		}
	}
	return false;
}

int func_146()//Position - 0x5682
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	iVar0 = func_58();
	iVar2 = 0;
	while (iVar2 < 32)
	{
		if (iVar0 == func_58())
		{
			if (gameplay::is_bit_set(Local_96.f_10, iVar2))
			{
				if (network::network_is_participant_active(player::int_to_participantindex(iVar2)))
				{
					iVar1 = network::network_get_player_index(player::int_to_participantindex(iVar2));
					if (network::network_is_player_a_participant(iVar1))
					{
						iVar0 = iVar1;
					}
				}
			}
		}
		iVar2++;
	}
	return iVar0;
}

int func_147(int iParam0, char* sParam1, char* sParam2, int iParam3, int iParam4, int iParam5)//Position - 0x56E1
{
	struct<72> Var0;
	
	Var0.f_3 = -1;
	Var0.f_4 = -1;
	Var0.f_5 = -1;
	Var0.f_6 = -1;
	Var0.f_7 = -1082130432;
	Var0.f_65 = 1;
	Var0.f_66 = 2;
	Var0.f_71 = -1;
	func_134(iParam0, &Var0, -1, sParam2, sParam1);
	Var0.f_65 = iParam3;
	Var0.f_6 = iParam4;
	Var0.f_66 = iParam5;
	return func_110(&Var0);
}

var func_148(int iParam0, char* sParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7)//Position - 0x5745
{
	return func_149(iParam0, sParam1, iParam2, iParam3, iParam4, iParam5, iParam6, iParam7);
}

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

int func_150(int iParam0, int iParam1, char* sParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8, int iParam9, int iParam10)//Position - 0x5784
{
	float fVar0;
	int iVar1;
	int iVar2;
	float fVar3;
	
	if (func_184(player::player_id()) || func_183(player::player_id()))
	{
		if (Global_262145.f_7844 > 8000)
		{
			iVar2 = 8000;
		}
		else
		{
			iVar2 = Global_262145.f_7844;
		}
	}
	else if (Global_262145.f_5249 > 5000)
	{
		iVar2 = 5000;
	}
	else
	{
		iVar2 = Global_262145.f_5249;
	}
	if (func_182(sParam2))
	{
	}
	if (func_181())
	{
		if (iParam4 < 1)
		{
			iParam4 = 1;
		}
		iVar1 = system::round((IntToFloat(iParam3) * (IntToFloat(iParam4) + fVar0)));
		iVar1 = func_179(iVar1);
		fVar3 = (system::to_float(iVar1) * Global_262145.f_1);
		iVar1 = system::round(fVar3);
		if (iParam10)
		{
			iVar1 = func_178(&iVar1);
		}
		if (iParam1 == 0)
		{
			switch (iParam0)
			{
				case 2:
					func_175(0, &iVar1);
					break;
				
				case 3:
					func_175(1, &iVar1);
					break;
				
				case 1:
					func_172(&iVar1);
					break;
				}
		}
		if (iParam1 == 0)
		{
			if (iVar1 > iVar2)
			{
				if (iParam0 == 1)
				{
					iVar1 = iVar2;
				}
				if (iParam0 == 2 || iParam0 == 3)
				{
					iVar1 = iVar2;
				}
			}
		}
		if (iParam7)
		{
			func_170(1157, iVar1, -1);
			if (iParam1 == 0)
			{
				func_160((func_169(player::player_id()) + iVar1), iParam9, 0);
				if (iParam8 == 0)
				{
				}
				if (iParam9 == 0)
				{
				}
				stats::playstats_award_xp(iVar1, iParam8, iParam9);
				if (Global_1587816[player::player_id() /*444*/].f_39.f_2 != -1)
				{
					func_170(1158, iVar1, -1);
				}
				if (iParam1 == 0)
				{
					func_155(iVar1);
				}
			}
		}
		if (iParam5)
		{
		}
		if (iParam7)
		{
			if (iParam6 == -1)
			{
				func_151((func_153(player::player_id()) + iVar1));
			}
			else
			{
				func_151((func_153(player::player_id()) + iParam6));
			}
		}
		if (iParam7)
		{
		}
	}
	return iVar1;
}

void func_151(int iParam0)//Position - 0x593F
{
	if (func_181())
	{
		Global_1587816[player::player_id() /*444*/].f_195.f_5 = iParam0;
		func_152(joaat("mpply_globalxp"), iParam0);
	}
}

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

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

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

void func_155(int iParam0)//Position - 0x59F5
{
	struct<13> Var0;
	int iVar13;
	
	Var0 = { func_107(player::player_id()) };
	if (network::_network_player_is_in_clan())
	{
		if (network::network_clan_player_is_active(&Var0))
		{
			iVar13 = func_158(func_159(&Var0));
			if (iVar13 == 0)
			{
				func_157(&Global_1347700, iParam0);
				func_156(joaat("mpply_crew_local_xp_0"), Global_1347700);
			}
			else if (iVar13 == 1)
			{
				func_157(&Global_1347701, iParam0);
				func_156(joaat("mpply_crew_local_xp_1"), Global_1347701);
			}
			else if (iVar13 == 2)
			{
				func_157(&Global_1347702, iParam0);
				func_156(joaat("mpply_crew_local_xp_2"), Global_1347702);
			}
			else if (iVar13 == 3)
			{
				func_157(&Global_1347703, iParam0);
				func_156(joaat("mpply_crew_local_xp_3"), Global_1347703);
			}
			else if (iVar13 == 4)
			{
				func_157(&Global_1347704, iParam0);
				func_156(joaat("mpply_crew_local_xp_4"), Global_1347704);
			}
		}
	}
}

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

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

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

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

void func_160(int iParam0, int iParam1, int iParam2)//Position - 0x5C7F
{
	if (func_181())
	{
		if (iParam0 >= 1787576850)
		{
			iParam0 = 1787576850;
		}
		if (Global_262145.f_7814 == 0 && iParam1 != -1076930708)
		{
			if (iParam2 == 0)
			{
				if (iParam0 < Global_1347815[func_96(-1)])
				{
					stats::playstats_award_xp(iParam0, -523908350, iParam1);
					return;
				}
				else if (iParam0 == Global_1347815[func_96(-1)])
				{
					return;
				}
			}
		}
		if (Global_262145.f_7813 == 0)
		{
			if (iParam0 == 0)
			{
				stats::playstats_award_xp(iParam0, -1158693853, -1345423847);
				if (iParam2 == 0)
				{
					return;
				}
			}
		}
		if (Global_262145.f_7813 == 0)
		{
			if (iParam0 < 0)
			{
				stats::playstats_award_xp(iParam0, -1586921397, iParam1);
				return;
			}
		}
		if (func_168(player::player_id()))
		{
			Global_1587816[player::player_id() /*444*/].f_195.f_1 = iParam0;
			Global_1587816[player::player_id() /*444*/].f_195.f_6 = func_166(iParam0, 1);
		}
		func_165(632, iParam0, -1, 1);
		func_164(633, func_166(iParam0, 1), -1, 1);
		Global_1347815[func_96(-1)] = iParam0;
		func_161(7, 0);
	}
}

void func_161(int iParam0, int iParam1)//Position - 0x5D9F
{
	var uVar0;
	
	if (func_163(iParam0, iParam1))
	{
		uVar0 = func_162();
		Global_2444000[uVar0] = iParam0;
	}
}

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

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

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

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

int func_166(int iParam0, int iParam1)//Position - 0x63C8
{
	if (iParam1)
	{
	}
	return func_167(iParam0, 0);
}

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

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

int func_169(int iParam0)//Position - 0x64C0
{
	if (Global_1312466.f_9 == 0)
	{
		if (iParam0 > -1)
		{
			if (iParam0 == player::player_id())
			{
				return Global_1347815[func_96(-1)];
			}
			else if (func_168(iParam0))
			{
				return Global_1587816[iParam0 /*444*/].f_195.f_1;
			}
		}
	}
	else
	{
		return Global_1347815[func_96(-1)];
	}
	return 0;
}

void func_170(int iParam0, int iParam1, int iParam2)//Position - 0x651D
{
	int iVar0;
	
	iVar0 = func_95(iParam0, func_96(iParam2), 0);
	iVar0 = (iVar0 + iParam1);
	if (!func_171(iParam0))
	{
		func_164(iParam0, iVar0, iParam2, 1);
	}
	else
	{
		func_165(iParam0, iVar0, iParam2, 1);
	}
}

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

void func_172(int iParam0)//Position - 0x66B4
{
	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_124(player::get_player_team(iVar5), iVar1, 0))
				{
					iVar2++;
					if (iVar5 != player::player_id())
					{
						if (func_174(player::player_id(), iVar5))
						{
							iVar3 = true;
						}
					}
				}
			}
		}
		iVar0++;
	}
	if (iVar3)
	{
		iVar6 = system::round((func_173(*iParam0, 100) * (10f * Global_262145.f_4213)));
	}
	if (iVar2 > 4)
	{
		iVar2 = 4;
	}
	if (iVar2 >= 2)
	{
		iVar7 = system::round((func_173(*iParam0, 100) * (20f * Global_262145.f_4206)));
	}
	*iParam0 = (*iParam0 + iVar6);
	*iParam0 = (*iParam0 + iVar7);
}

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

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

void func_175(int iParam0, int iParam1)//Position - 0x682D
{
	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_694(iVar4, 0, 1))
				{
					if (iVar4 != player::player_id())
					{
						iVar1++;
						if (func_174(player::player_id(), iVar4))
						{
							iVar2 = true;
						}
					}
				}
			}
			iVar0++;
		}
	}
	else
	{
		iVar0 = 0;
		while (iVar0 < 32)
		{
			iVar4 = iVar0;
			if (func_694(iVar4, 1, 1))
			{
				if (iVar4 != player::player_id())
				{
					if (func_176(player::player_id(), iVar4) <= 20f)
					{
						iVar1++;
						if (func_174(player::player_id(), iVar4))
						{
							iVar2 = true;
						}
					}
				}
			}
			iVar0++;
		}
	}
	if (iVar2)
	{
		iVar5 = system::round((func_173(*iParam1, 100) * (10f * Global_262145.f_4213)));
	}
	if (iVar1 > 4)
	{
		iVar1 = 4;
	}
	if (iVar1 >= 1)
	{
		iVar6 = system::round((func_173(*iParam1, 100) * (20f * Global_262145.f_4206)));
	}
	*iParam1 = (*iParam1 + iVar5);
	*iParam1 = (*iParam1 + iVar6);
}

float func_176(int iParam0, int iParam1)//Position - 0x6945
{
	return system::vdist(func_177(iParam0), func_177(iParam1));
	return 0f;
}

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

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

int func_179(int iParam0)//Position - 0x69AB
{
	if (iParam0 < 0)
	{
		if (gameplay::absi(iParam0) > func_169(player::player_id()))
		{
			iParam0 = -func_169(player::player_id());
		}
	}
	if (func_180(8000, 0, 0) > 0)
	{
		if (func_180(8000, 0, 0) < (iParam0 + func_169(player::player_id())))
		{
			iParam0 = (func_180(8000, 0, 0) - func_169(player::player_id()));
		}
	}
	return iParam0;
}

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

bool func_181()//Position - 0x6A37
{
	return true;
}

bool func_182(char* sParam0)//Position - 0x6A40
{
	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_183(int iParam0)//Position - 0x6A79
{
	return Global_2418529[iParam0 /*313*/].f_114 == 2;
}

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

void func_185()//Position - 0x6AA3
{
	Global_2445583 = 1;
}

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

var func_187()//Position - 0x6AED
{
	return Global_262145.f_9604;
}

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

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

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

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

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

void func_193(var uParam0)//Position - 0x712D
{
	*uParam0 = 0;
	uParam0->f_1 = 0;
	uParam0->f_2 = 0;
	uParam0->f_3 = 0;
	uParam0->f_4 = 0;
	uParam0->f_5 = 0;
	uParam0->f_6 = 0;
	uParam0->f_7 = 0;
	uParam0->f_8 = 0;
	uParam0->f_9 = 0;
	uParam0->f_10 = 0;
	uParam0->f_11 = 0;
	uParam0->f_12 = 0;
}

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

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

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

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

void func_198(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x7299
{
	float fVar0;
	float fVar1;
	float fVar2;
	float fVar3;
	float fVar4;
	float fVar5;
	int iVar6;
	var uVar7;
	var uVar8;
	int iVar9;
	
	if (iLocal_3772 == -1)
	{
		iLocal_3772 = func_40(&uLocal_598, 0, 0);
	}
	if (!iParam0)
	{
		func_93(1);
	}
	if (iLocal_3772 < (Global_262145.f_9487 * 60000))
	{
		fVar0 = Global_262145.f_9491;
	}
	else if (iLocal_3772 < (Global_262145.f_9488 * 60000))
	{
		fVar0 = Global_262145.f_9492;
	}
	else if (iLocal_3772 < (Global_262145.f_9489 * 60000))
	{
		fVar0 = Global_262145.f_9493;
	}
	else if (iLocal_3772 < (Global_262145.f_9490 * 60000))
	{
		fVar0 = Global_262145.f_9494;
	}
	else
	{
		fVar0 = Global_262145.f_9495;
	}
	fVar1 = system::to_float(func_218());
	fVar2 = system::to_float(func_217());
	fVar3 = system::to_float(func_216());
	fVar4 = system::to_float(func_215());
	fVar5 = func_214();
	iVar6 = func_213();
	if (iLocal_3773 > iVar6)
	{
		iLocal_3773 = iVar6;
	}
	uVar7 = func_212(1);
	uVar8 = func_210(1);
	*iParam1 = uVar7;
	*iParam2 = uVar8;
	if (iParam0)
	{
		if (!gameplay::is_bit_set(Local_96.f_1, 14))
		{
			iVar9 = system::round((((fVar1 * fVar0) + (((fVar3 * fVar0) * (system::to_float(iLocal_3773) * fVar5)) / IntToFloat(iParam3))) * Global_262145.f_9642));
			*iParam2 = (*iParam2 + system::round((((fVar2 * fVar0) + ((fVar4 * fVar0) * (system::to_float(iLocal_3773) * fVar5))) * Global_262145.f_9643)));
			if (Local_292[network::participant_id_to_int() /*8*/].f_5 == -1)
			{
				Local_292[network::participant_id_to_int() /*8*/].f_5 = *iParam1;
			}
			func_199(&iVar9, 1);
			*iParam1 = (*iParam1 + iVar9);
		}
	}
}

void func_199(int iParam0, int iParam1)//Position - 0x742D
{
	int iVar0;
	
	if (*iParam0 > 0)
	{
		if (!func_209())
		{
			if (func_208(0))
			{
				if (network::network_is_player_active(func_207()))
				{
					if (func_206() == 100)
					{
						iVar0 = *iParam0;
						*iParam0 = 0;
					}
					else
					{
						iVar0 = ((*iParam0 / 100) * func_206());
						*iParam0 = (*iParam0 - iVar0);
					}
					func_204(&iVar0, 0);
					if (iParam1 == 1)
					{
						func_203("GB_BCUT_TICK1", func_207(), iVar0, 0, 0, 1, 1);
					}
					func_202(20);
					func_200(func_207(), iVar0, 1);
				}
			}
		}
	}
}

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

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

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

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

void func_204(int iParam0, int iParam1)//Position - 0x75C8
{
	int iVar0;
	int iVar1;
	
	if (iParam1)
	{
		iVar1 = func_205(1);
	}
	else
	{
		iVar1 = func_205(0);
	}
	iVar0 = ((*iParam0 / 100) * iVar1);
	*iParam0 = (*iParam0 - iVar0);
}

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

var func_206()//Position - 0x7620
{
	return Global_262145.f_10576;
}

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

int func_208(int iParam0)//Position - 0x7643
{
	return func_144(player::player_id(), iParam0);
}

int func_209()//Position - 0x7655
{
	return func_145(player::player_id());
}

int func_210(int iParam0)//Position - 0x7665
{
	int iVar0;
	
	if (!iParam0)
	{
		return Global_262145.f_9499;
	}
	func_211();
	iVar0 = (Global_262145.f_9499 * iLocal_3769);
	return iVar0;
}

void func_211()//Position - 0x7690
{
	float fVar0;
	
	if (iLocal_3769 != 0)
	{
		return;
	}
	if (func_9(&uLocal_3767))
	{
		iLocal_3769 = func_40(&uLocal_3767, 0, 0);
	}
	fVar0 = system::to_float(iLocal_3769);
	fVar0 = (fVar0 / 60000f);
	iLocal_3769 = system::floor(fVar0);
	if (iLocal_3769 >= 1)
	{
	}
	else
	{
		iLocal_3769 = 1;
	}
	if (iLocal_3769 > Global_262145.f_9633)
	{
		iLocal_3769 = Global_262145.f_9633;
	}
}

int func_212(int iParam0)//Position - 0x76F9
{
	int iVar0;
	
	if (!iParam0)
	{
		return Global_262145.f_9498;
	}
	func_211();
	iVar0 = (Global_262145.f_9498 * iLocal_3769);
	return iVar0;
}

var func_213()//Position - 0x7724
{
	return Global_262145.f_9497;
}

var func_214()//Position - 0x7733
{
	return Global_262145.f_9496;
}

var func_215()//Position - 0x7742
{
	return Global_262145.f_9486;
}

var func_216()//Position - 0x7751
{
	return Global_262145.f_9485;
}

var func_217()//Position - 0x7760
{
	return Global_262145.f_9484;
}

var func_218()//Position - 0x776F
{
	return Global_262145.f_9483;
}

int func_219(int iParam0, var uParam1, var uParam2, int iParam3, char* sParam4, char* sParam5, int iParam6, int iParam7, int iParam8, char* sParam9, char* sParam10, char* sParam11)//Position - 0x777E
{
	struct<72> Var0;
	
	Var0.f_3 = -1;
	Var0.f_4 = -1;
	Var0.f_5 = -1;
	Var0.f_6 = -1;
	Var0.f_7 = -1082130432;
	Var0.f_65 = 1;
	Var0.f_66 = 2;
	Var0.f_71 = -1;
	func_134(iParam0, &Var0, iParam3, sParam4, sParam5);
	Var0.f_16 = uParam1;
	Var0.f_17 = uParam2;
	Var0.f_65 = iParam6;
	Var0.f_6 = iParam7;
	Var0.f_66 = iParam8;
	StringCopy(&(Var0.f_23), sParam9, 64);
	StringCopy(&(Var0.f_39), sParam10, 64);
	StringCopy(&(Var0.f_55), sParam11, 16);
	return func_110(&Var0);
}

int func_220(int iParam0, char* sParam1, char* sParam2, int iParam3, int iParam4, char* sParam5, int iParam6)//Position - 0x7807
{
	struct<72> Var0;
	
	Var0.f_3 = -1;
	Var0.f_4 = -1;
	Var0.f_5 = -1;
	Var0.f_6 = -1;
	Var0.f_7 = -1082130432;
	Var0.f_65 = 1;
	Var0.f_66 = 2;
	Var0.f_71 = -1;
	func_134(iParam0, &Var0, -1, sParam1, sParam5);
	StringCopy(&(Var0.f_23), sParam2, 64);
	Var0.f_65 = iParam3;
	Var0.f_6 = iParam4;
	Var0.f_66 = iParam6;
	return func_110(&Var0);
}

bool func_221(int iParam0, int iParam1, int iParam2)//Position - 0x7873
{
	return false;
	if (!func_209())
	{
		return false;
	}
	if (iParam1 != func_58())
	{
		if (func_222(iParam1, iParam0, 1))
		{
			return true;
		}
	}
	if (iParam2 != func_58())
	{
		if (func_222(iParam2, iParam0, 1))
		{
			return true;
		}
	}
	return false;
}

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

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

bool func_224(int iParam0, int iParam1, int iParam2)//Position - 0x7949
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	
	iVar0 = func_146();
	*iParam1 = func_58();
	if (iVar0 != func_58())
	{
		*iParam2 = 1;
		iVar2 = 0;
		while (iVar2 < 32)
		{
			if (gameplay::is_bit_set(Local_96.f_10, iVar2))
			{
				if (network::network_is_participant_active(player::int_to_participantindex(iVar2)))
				{
					iVar1 = network::network_get_player_index(player::int_to_participantindex(iVar2));
					if (!func_52(iVar1, 0))
					{
						if (iVar1 != iVar0)
						{
							if (network::network_is_player_a_participant(iVar1))
							{
								iVar4 = network::network_get_participant_index(iVar1);
								iVar3 = iVar4;
								if (!gameplay::is_bit_set(Local_292[iVar3 /*8*/].f_1, 1))
								{
									*iParam2++;
									if (*iParam1 == func_58())
									{
										*iParam0 = iVar0;
										*iParam1 = iVar1;
									}
								}
							}
						}
					}
				}
			}
			iVar2++;
		}
	}
	if (*iParam2 > 1)
	{
		return true;
	}
	return false;
}

int func_225(int iParam0)//Position - 0x7A05
{
	if (func_51(iParam0))
	{
		return true;
	}
	return gameplay::is_bit_set(Global_1610705[iParam0 /*178*/].f_1, 8);
}

void func_226(int iParam0, char* sParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8, int iParam9, int iParam10, int iParam11, int iParam12, int iParam13, int iParam14, int iParam15)//Position - 0x7A2A
{
	int iVar0;
	int iVar1;
	
	iVar0 = -1;
	iVar1 = 0;
	while (iVar1 <= 9)
	{
		if (iVar0 == -1)
		{
			if (func_228(7, iVar1) == 0)
			{
				iVar0 = iVar1;
			}
		}
		iVar1++;
	}
	if (iVar0 > -1)
	{
		Global_1339962.f_1 = 1;
		func_227(7, iVar0);
		Global_1339962.f_4109[iVar0] = iParam0;
		StringCopy(&(Global_1339962.f_4109.f_11[iVar0 /*16*/]), sParam1, 64);
		Global_1339962.f_4109.f_172[iVar0] = iParam2;
		Global_1339962.f_4109.f_216[iVar0] = iParam3;
		Global_1339962.f_4109.f_183[iVar0] = iParam4;
		Global_1339962.f_4109.f_194[iVar0] = iParam5;
		Global_1339962.f_4109.f_249[iVar0] = iParam6;
		Global_1339962.f_4109.f_260[iVar0] = iParam7;
		Global_1339962.f_4109.f_205[iVar0] = iParam8;
		Global_1339962.f_4109.f_314[iVar0] = iParam9;
		Global_1339962.f_4109.f_325[iVar0] = iParam10;
		Global_1339962.f_4109.f_357[iVar0] = iParam11;
		Global_1339962.f_4109.f_238[iVar0] = iParam12;
		Global_1339962.f_4109.f_271[iVar0] = iParam13;
		Global_1339962.f_4109.f_368[iVar0] = iParam14;
		Global_1339962.f_4109.f_379[iVar0] = iParam15;
	}
}

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

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

var func_229()//Position - 0x7B9A
{
	return Global_262145.f_9352;
}

void func_230()//Position - 0x7BA9
{
	float fVar0;
	float fVar1;
	
	if (gameplay::is_bit_set(Local_96.f_1, 3))
	{
		return;
	}
	if (iLocal_3773 == -1)
	{
		if (Local_96.f_163 > 0)
		{
			iLocal_3773 = Local_96.f_163;
		}
	}
	else if (Local_96.f_163 > iLocal_3773)
	{
		iLocal_3773 = Local_96.f_163;
	}
	if (func_236(0))
	{
		if (!func_615(1))
		{
			func_233(Local_96.f_163, "PEN_REMP", -1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
		}
	}
	fVar0 = func_232();
	if (fVar0 >= fLocal_1004)
	{
		fLocal_1004 = fVar0;
	}
	if (!gameplay::is_bit_set(iLocal_550, 15))
	{
		if (fLocal_1004 >= fLocal_1005)
		{
			gameplay::set_bit(&iLocal_550, 15);
		}
	}
	fVar1 = (fLocal_1003 - fLocal_1004);
	if (func_236(0))
	{
		if (!func_615(1))
		{
			func_231(system::round(fVar1), system::round(fLocal_1003), "PEN_DST", 1, -1, 2, -1082130432, -1082130432, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1);
		}
	}
}

void func_231(int iParam0, int iParam1, char* sParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8, int iParam9, int iParam10, int iParam11, int iParam12, int iParam13, int iParam14, int iParam15, int iParam16, int iParam17, int iParam18, int iParam19)//Position - 0x7C94
{
	int iVar0;
	int iVar1;
	
	iVar0 = -1;
	iVar1 = 0;
	while (iVar1 <= 9)
	{
		if (iVar0 == -1)
		{
			if (func_228(0, iVar1) == 0)
			{
				iVar0 = iVar1;
			}
		}
		iVar1++;
	}
	if (iVar0 > -1)
	{
		Global_1339962.f_1 = 1;
		func_227(0, iVar0);
		Global_1339962.f_946[iVar0] = iParam0;
		Global_1339962.f_946.f_11[iVar0] = iParam1;
		StringCopy(&(Global_1339962.f_946.f_22[iVar0 /*16*/]), sParam2, 64);
		Global_1339962.f_946.f_194[iVar0] = iParam3;
		Global_1339962.f_946.f_183[iVar0] = iParam4;
		Global_1339962.f_946.f_216[iVar0] = iParam5;
		Global_1339962.f_946.f_227[iVar0 /*3*/] = iParam6;
		Global_1339962.f_946.f_227[iVar0 /*3*/].f_1 = iParam7;
		Global_1339962.f_946.f_258[iVar0] = iParam8;
		Global_1339962.f_946.f_269[iVar0] = iParam9;
		Global_1339962.f_946.f_312[iVar0] = iParam10;
		Global_1339962.f_946.f_323[iVar0] = iParam11;
		Global_1339962.f_946.f_334[iVar0] = iParam12;
		Global_1339962.f_946.f_345[iVar0] = iParam13;
		Global_1339962.f_941 = 1;
		Global_1339962.f_946.f_356[iVar0] = iParam14;
		Global_1339962.f_946.f_367[iVar0] = iParam15;
		Global_1339962.f_946.f_378[iVar0] = iParam16;
		Global_1339962.f_946.f_389[iVar0] = iParam17;
		Global_1339962.f_946.f_400[iVar0] = iParam18;
		Global_1339962.f_946.f_411[iVar0] = iParam19;
	}
}

float func_232()//Position - 0x7E1D
{
	float fVar0;
	int iVar1;
	
	fVar0 = gameplay::get_distance_between_coords(vLocal_570, vLocal_600[iLocal_569 /*3*/], 1);
	if (iLocal_569 > 0)
	{
		iVar1 = 0;
		while (iVar1 <= (iLocal_569 - 1))
		{
			fVar0 = (fVar0 + fLocal_901[iVar1]);
			iVar1++;
		}
	}
	return fVar0;
}

void func_233(int iParam0, char* sParam1, int iParam2, int iParam3, int iParam4, int iParam5, char* sParam6, int iParam7, int iParam8, int iParam9, int iParam10, int iParam11, int iParam12, int iParam13, int iParam14, int iParam15, int iParam16, int iParam17, int iParam18)//Position - 0x7E66
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	
	iVar0 = -1;
	iVar1 = 0;
	while (iVar1 <= 9)
	{
		if (iVar0 == -1)
		{
			if (func_228(6, iVar1) == 0)
			{
				iVar0 = iVar1;
			}
		}
		iVar1++;
	}
	if (iVar0 > -1)
	{
		Global_1339962.f_1 = 1;
		func_227(6, iVar0);
		Global_1339962.f_3557[iVar0] = iParam0;
		StringCopy(&(Global_1339962.f_3557.f_11[iVar0 /*16*/]), sParam1, 64);
		Global_1339962.f_3557.f_183[iVar0] = iParam3;
		Global_1339962.f_3557.f_172[iVar0] = iParam2;
		Global_1339962.f_3557.f_260[iVar0] = iParam4;
		Global_1339962.f_3557.f_271[iVar0] = iParam5;
		StringCopy(&(Global_1339962.f_3557.f_282[iVar0 /*16*/]), sParam6, 64);
		Global_1339962.f_3557.f_443[iVar0] = iParam7;
		Global_1339962.f_3557.f_454[iVar0] = iParam8;
		Global_1339962.f_3557.f_497[iVar0] = iParam9;
		Global_1339962.f_3557.f_508[iVar0] = iParam10;
		Global_1339962.f_3557.f_205[iVar0] = iParam11;
		Global_1339962.f_3557.f_216[iVar0] = iParam12;
		Global_1339962.f_3557.f_227[iVar0] = iParam13;
		Global_1339962.f_3557.f_238[iVar0] = iParam14;
		Global_1339962.f_3557.f_249[iVar0] = iParam15;
		Global_1339962.f_3557.f_519[iVar0] = iParam16;
		Global_1339962.f_3557.f_530[iVar0] = iParam17;
		Global_1339962.f_3557.f_541[iVar0] = iParam18;
		if (iParam15 == 4 && func_235())
		{
			Global_1339962.f_941 = 1;
		}
		if (gameplay::is_pc_version())
		{
			iVar2 = 0;
			graphics::_get_screen_active_resolution(&iVar3, &iVar4);
			if (iVar3 == 1280 && iVar4 >= 960)
			{
				iVar2 = 1;
			}
			if (iParam0 > 99999999)
			{
				Global_1339962.f_945 = 1;
			}
			else if (iParam0 > 9999999 || iVar2)
			{
				Global_1339962.f_944 = 1;
			}
			else if (iParam0 > 999)
			{
				Global_1339962.f_941 = 1;
			}
			if (func_234())
			{
				Global_1339962.f_945 = 1;
			}
		}
	}
}

bool func_234()//Position - 0x8069
{
	int iVar0;
	var uVar1;
	
	if (gameplay::is_pc_version())
	{
		graphics::_get_screen_active_resolution(&iVar0, &uVar1);
		if (iVar0 <= 1024)
		{
			return true;
		}
	}
	return false;
}

bool func_235()//Position - 0x808D
{
	if ((unk::_get_ui_language_id() == 8 || unk::_get_ui_language_id() == 9) || unk::_get_ui_language_id() == 10)
	{
		return true;
	}
	return false;
}

bool func_236(int iParam0)//Position - 0x80BE
{
	if (func_238())
	{
		return false;
	}
	if (func_237())
	{
		return false;
	}
	if (!iParam0)
	{
		if (func_694(player::player_id(), 1, 1) == 0)
		{
			return false;
		}
	}
	return true;
}

int func_237()//Position - 0x80F5
{
	return Global_1587816[player::player_id() /*444*/].f_180 != 0;
}

int func_238()//Position - 0x810C
{
	return gameplay::is_bit_set(Global_2359301, 12);
}

void func_239()//Position - 0x811E
{
	if (iLocal_3774)
	{
		func_91();
		if (func_244(100f, 10f, 5f))
		{
			iLocal_3774 = 1;
		}
	}
	func_240();
	if (ui::does_blip_exist(iLocal_567))
	{
		ui::set_blip_scale(iLocal_567, fLocal_577);
	}
}

void func_240()//Position - 0x815E
{
	float fVar0;
	float fVar1;
	float fVar2;
	
	fVar0 = func_243();
	fVar1 = (fVar0 / fLocal_1003);
	fVar2 = ((((func_638() - func_242()) * fVar1) + func_242()) * func_241());
	if (fVar2 < func_242())
	{
		fVar2 = func_242();
	}
	if (fVar2 > func_638())
	{
		fVar2 = func_638();
	}
	fLocal_578 = fLocal_577;
	if (fVar2 > fLocal_578)
	{
		fVar2 = fLocal_578;
	}
	fLocal_577 = fVar2;
	if (gameplay::is_bit_set(Local_96.f_1, 4))
	{
		if (fLocal_577 != func_242())
		{
			fLocal_577 = func_242();
		}
	}
	if (!func_9(&uLocal_3763) || (func_9(&uLocal_3763) && func_7(&uLocal_3763, 5000, 0)))
	{
		func_6(&uLocal_3763);
		func_8(&uLocal_3763, 0, 0);
		Local_292[network::participant_id_to_int() /*8*/].f_6 = fLocal_577;
	}
}

var func_241()//Position - 0x8229
{
	return Global_262145.f_9349;
}

var func_242()//Position - 0x8238
{
	return Global_262145.f_9344;
}

float func_243()//Position - 0x8247
{
	float fVar0;
	int iVar1;
	int iVar2;
	
	fVar0 = gameplay::get_distance_between_coords(vLocal_570, vLocal_600[iLocal_569 + 1 /*3*/], 1);
	iVar1 = iLocal_569 + 1;
	if (iVar1 < (iLocal_1002 - 1))
	{
		iVar2 = iVar1;
		while (iVar2 <= (iLocal_1002 - 1))
		{
			fVar0 = (fVar0 + fLocal_901[iVar2]);
			iVar2++;
		}
	}
	return fVar0;
}

bool func_244(float fParam0, float fParam1, float fParam2)//Position - 0x829D
{
	float fVar0;
	
	fVar0 = gameplay::absf((fParam0 - fParam1));
	if (fLocal_577 > fParam1)
	{
		fLocal_577 = (fLocal_577 - IntToFloat(system::floor(((fVar0 / fParam2) * gameplay::get_frame_time()))));
		if (fLocal_577 < fParam1)
		{
			fLocal_577 = fParam1;
		}
	}
	else
	{
		fLocal_577 = fParam1;
		return true;
	}
	return false;
}

void func_245()//Position - 0x82EA
{
	if (!gameplay::is_bit_set(iLocal_549, 7))
	{
		func_261(&iLocal_3741);
		gameplay::set_bit(&iLocal_549, 7);
	}
	if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 4))
	{
		if (func_260(&iLocal_3741))
		{
			if (gameplay::is_bit_set(Local_96.f_1, 8))
			{
				if (func_246(&iLocal_3741, 1, 0, 1))
				{
					gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 4);
				}
			}
		}
	}
}

bool func_246(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x8355
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	var uVar6;
	int iVar7;
	int iVar8;
	int iVar9;
	int iVar10;
	
	if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
	{
		if (func_615(1))
		{
			return true;
		}
	}
	if (func_260(iParam0))
	{
		if (!func_259(&(iParam0->f_3)))
		{
			func_257(&(iParam0->f_3));
		}
		graphics::_set_2d_layer(4);
		if (graphics::has_scaleform_movie_loaded(*iParam0))
		{
			graphics::draw_scaleform_movie_fullscreen(*iParam0, 255, 255, 255, 100, 0);
		}
		iVar0 = system::floor(func_254(&(iParam0->f_3)));
		iVar1 = gameplay::absi((iVar0 - 3));
		iVar2 = false;
		if (func_253(iParam0->f_1, 4))
		{
			if (iParam0->f_2 >= 5)
			{
				if (!func_253(iParam0->f_1, 16))
				{
					audio::play_sound_frontend(-1, "GO", "HUD_MINI_GAME_SOUNDSET", 0);
					func_251(&(iParam0->f_1), 16);
					audio::stop_stream();
				}
			}
			else
			{
				iParam0->f_2++;
			}
		}
		if (!func_253(iParam0->f_1, 8))
		{
			if (iVar1 == 3 && !func_253(iParam0->f_1, 1))
			{
				func_251(&(iParam0->f_1), 1);
				audio::play_sound_frontend(-1, "3_2_1", "HUD_MINI_GAME_SOUNDSET", 0);
				func_250(iParam0, iVar1);
			}
			else if (iVar1 == 2 && !func_253(iParam0->f_1, 2))
			{
				func_251(&(iParam0->f_1), 2);
				audio::play_sound_frontend(-1, "3_2_1", "HUD_MINI_GAME_SOUNDSET", 0);
				func_250(iParam0, iVar1);
			}
			else if (iVar1 == 1 && !func_253(iParam0->f_1, 4))
			{
				func_251(&(iParam0->f_1), 4);
				audio::play_sound_frontend(-1, "3_2_1", "HUD_MINI_GAME_SOUNDSET", 0);
				func_250(iParam0, iVar1);
				if (!func_52(player::player_id(), 0))
				{
					func_67("PEN_AREA", 0);
				}
			}
			else if (iVar1 == 0 && !func_253(iParam0->f_1, 8))
			{
				func_251(&(iParam0->f_1), 8);
				ui::get_hud_colour(18, &iVar3, &iVar4, &iVar5, &uVar6);
				graphics::_push_scaleform_movie_function(*iParam0, "SET_MESSAGE");
				func_249("CNTDWN_GO");
				graphics::_push_scaleform_movie_function_parameter_int(iVar3);
				graphics::_push_scaleform_movie_function_parameter_int(iVar4);
				graphics::_push_scaleform_movie_function_parameter_int(iVar5);
				graphics::_push_scaleform_movie_function_parameter_bool(true);
				graphics::_pop_scaleform_movie_function_void();
				func_91();
				func_613(func_614(), 0);
				gameplay::set_bit(&iLocal_549, 9);
				if (!gameplay::is_bit_set(iLocal_549, 6))
				{
					graphics::_start_screen_effect("pennedIn", 0, 1);
					gameplay::set_bit(&iLocal_549, 6);
					if (audio::is_audio_scene_active("MP_Player_Outside_Bubble_Scene"))
					{
						audio::stop_audio_scene("MP_Player_Outside_Bubble_Scene");
					}
					audio::start_audio_scene("MP_Player_Inside_Bubble_Scene");
				}
				if (!iParam1)
				{
					iVar2 = true;
				}
			}
		}
		else if (iVar1 == 1)
		{
			iVar2 = true;
		}
		if ((iParam2 && func_248()) || iVar0 > 5)
		{
			iVar2 = true;
		}
		if (iVar2)
		{
			if (iParam3)
			{
				iParam0->f_1 = 0;
				func_247(&(iParam0->f_3));
			}
			audio::stop_audio_scene("RACES_RADIO_MUTE_scene");
			audio::start_audio_scene("MP_RACE_GENERAL_SCENE");
			iVar7 = 0;
			while (iVar7 < network::_network_get_num_participants_host())
			{
				if (network::network_is_participant_active(player::int_to_participantindex(iVar7)))
				{
					iVar8 = network::network_get_player_index(player::int_to_participantindex(iVar7));
					if (iVar8 != player::player_id())
					{
						iVar9 = player::get_player_ped(iVar8);
						if (ped::is_ped_in_any_vehicle(iVar9, 0))
						{
							iVar10 = ped::get_vehicle_ped_is_in(iVar9, 0);
							audio::_0x153973AB99FE8980(iVar10, "MP_RACE_NPC_CAR_Group", 0f);
						}
					}
				}
				iVar7++;
			}
			return true;
		}
	}
	return false;
}

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

bool func_248()//Position - 0x8668
{
	if (ui::is_pause_menu_active())
	{
		return false;
	}
	if (controls::is_control_pressed(0, 18) || controls::is_control_pressed(2, 18))
	{
		return true;
	}
	return false;
}

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

void func_250(int iParam0, int iParam1)//Position - 0x86AC
{
	int iVar0;
	int iVar1;
	int iVar2;
	var uVar3;
	
	ui::get_hud_colour(12, &iVar0, &iVar1, &iVar2, &uVar3);
	graphics::_push_scaleform_movie_function(*iParam0, "SET_MESSAGE");
	graphics::_begin_text_component("NUMBER");
	ui::add_text_component_integer(gameplay::absi(iParam1));
	graphics::_end_text_component();
	graphics::_push_scaleform_movie_function_parameter_int(iVar0);
	graphics::_push_scaleform_movie_function_parameter_int(iVar1);
	graphics::_push_scaleform_movie_function_parameter_int(iVar2);
	graphics::_push_scaleform_movie_function_parameter_bool(true);
	graphics::_pop_scaleform_movie_function_void();
}

void func_251(var uParam0, int iParam1)//Position - 0x86FF
{
	func_252(uParam0, iParam1);
}

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

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

float func_254(var uParam0)//Position - 0x872F
{
	if (func_259(uParam0))
	{
		if (func_256(uParam0))
		{
			return uParam0->f_2;
		}
		else
		{
			return (func_255(gameplay::is_bit_set(*uParam0, 4)) - uParam0->f_1);
		}
	}
	return uParam0->f_1;
}

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

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

void func_257(int iParam0)//Position - 0x87CE
{
	func_258(iParam0, 0f);
}

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

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

bool func_260(int iParam0)//Position - 0x881B
{
	if (!graphics::has_scaleform_movie_loaded(*iParam0))
	{
		return false;
	}
	return true;
}

void func_261(int iParam0)//Position - 0x8833
{
	*iParam0 = unk_0x67D02A194A2FC2BD("COUNTDOWN");
}

void func_262()//Position - 0x8846
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	iVar0 = gameplay::is_bit_set(Local_96.f_1, 1);
	iVar1 = func_41();
	if (gameplay::is_bit_set(Local_96.f_1, 7))
	{
		iVar1 = func_39();
	}
	if (iVar0)
	{
		iVar2 = func_49();
		if (iVar2 > iLocal_3770)
		{
			iVar2 = iLocal_3770;
		}
		if (iVar3 != Local_96.f_163)
		{
			iVar3 = Local_96.f_163;
		}
		if (!func_52(player::player_id(), 0))
		{
			if (!func_80("PEN_STARTO"))
			{
				func_67("PEN_STARTO", 0);
			}
		}
		if ((iVar1 - func_40(&(Local_96.f_24), 0, 0)) >= 0)
		{
			func_267((iVar1 - func_40(&(Local_96.f_24), 0, 0)));
			func_263(iVar3, iVar2, (iVar1 - func_40(&(Local_96.f_24), 0, 0)), 1, func_266(-1));
		}
		else
		{
			func_263(iVar3, iVar2, 0, 1, func_266(-1));
		}
	}
	else if (!func_52(player::player_id(), 0))
	{
		if (func_80("PEN_STARTO"))
		{
			func_79();
		}
	}
}

void func_263(int iParam0, int iParam1, int iParam2, int iParam3, char* sParam4)//Position - 0x8925
{
	char* sVar0;
	
	if (func_236(0) == 0)
	{
		return;
	}
	func_265();
	func_264(iParam0, iParam1, "HUD_PARITIC", -1, 1, 4, 0, 0, 0, 0, 0, 1, 1, 0);
	sVar0 = "HUD_COUNTDOWN";
	if (!func_182(sParam4))
	{
		sVar0 = sParam4;
	}
	func_226(iParam2, sVar0, 0, 0, -1, 0, 3, 0, iParam3, 0, 0, 0, iParam3, 0, 0, 0);
}

void func_264(int iParam0, int iParam1, char* sParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8, int iParam9, int iParam10, int iParam11, int iParam12, int iParam13)//Position - 0x8980
{
	int iVar0;
	int iVar1;
	
	iVar0 = -1;
	iVar1 = 0;
	while (iVar1 <= 9)
	{
		if (iVar0 == -1)
		{
			if (func_228(4, iVar1) == 0)
			{
				iVar0 = iVar1;
			}
		}
		iVar1++;
	}
	if (iVar0 > -1)
	{
		Global_1339962.f_1 = 1;
		func_227(4, iVar0);
		Global_1339962.f_2907[iVar0] = iParam0;
		Global_1339962.f_2907.f_172[iVar0] = iParam1;
		StringCopy(&(Global_1339962.f_2907.f_11[iVar0 /*16*/]), sParam2, 64);
		Global_1339962.f_2907.f_183[iVar0] = iParam3;
		Global_1339962.f_2907.f_216[iVar0] = iParam5;
		Global_1339962.f_2907.f_194[iVar0] = iParam4;
		Global_1339962.f_2907.f_227[iVar0] = iParam6;
		Global_1339962.f_2907.f_270[iVar0] = iParam7;
		Global_1339962.f_2907.f_281[iVar0] = iParam8;
		Global_1339962.f_2907.f_292[iVar0] = iParam9;
		Global_1339962.f_2907.f_303[iVar0] = iParam10;
		Global_1339962.f_2907.f_314[iVar0] = iParam11;
		Global_1339962.f_2907.f_325[iVar0] = iParam13;
		if (((iParam0 > 9 && iParam1 > 9) && gameplay::is_pc_version()) && iParam12)
		{
			Global_1339962.f_941 = 1;
		}
	}
}

void func_265()//Position - 0x8ABA
{
	ui::hide_hud_component_this_frame(8);
	ui::hide_hud_component_this_frame(9);
	ui::hide_hud_component_this_frame(6);
	ui::hide_hud_component_this_frame(7);
	Global_2445587 = 1;
}

char* func_266(int iParam0)//Position - 0x8ADD
{
	char* sVar0;
	
	sVar0 = script::get_this_script_name();
	return "HUD_STARTING";
	if (gameplay::are_strings_equal(sVar0, "am_hot_target"))
	{
		return "AST_HOT_TARG";
	}
	else if (gameplay::are_strings_equal(sVar0, "am_cp_collection"))
	{
		return "AST_CHK_COLL";
	}
	else if (gameplay::are_strings_equal(sVar0, "am_challenges"))
	{
		switch (iParam0)
		{
			case 0:
				return "AST_CHALL_LJ";
			
			case 1:
				return "AST_CHALL_LS";
			
			case 2:
				return "AST_CHALL_HS";
			
			case 3:
				return "AST_CHALL_LST";
			
			case 4:
				return "AST_CHALL_LW";
			
			case 5:
				return "AST_CHALL_NC";
			
			case 6:
				return "AST_CHALL_LP";
			
			case 7:
				return "AST_CHALL_VS";
			
			case 8:
				return "AST_CHALL_NM";
			
			case 9:
				return "AST_CHALL_RD";
			
			case 10:
				return "AST_CHALL_LF";
			
			case 11:
				return "AST_CHALL_LFL";
			
			case 12:
				return "AST_CHALL_LFI";
			
			case 13:
				return "AST_CHALL_LB";
			
			case 14:
				return "AST_CHALL_MB";
			
			case 15:
				return "AST_CHALL_HSH";
			
			case 16:
				return "AST_CHALL_DB";
			
			case 17:
				return "AST_CHALL_ML";
			
			case 18:
				return "AST_CHALL_LSN";
			
			default:
		}
	}
	else if (gameplay::are_strings_equal(sVar0, "am_penned_in"))
	{
		return "AST_PENNED";
	}
	else if (gameplay::are_strings_equal(sVar0, "am_pass_the_parcel"))
	{
		return "AST_PARCEL";
	}
	else if (gameplay::are_strings_equal(sVar0, "am_hot_property"))
	{
		return "AST_PROPERTY";
	}
	else if (gameplay::are_strings_equal(sVar0, "am_dead_drop"))
	{
		return "AST_DDROP";
	}
	else if (gameplay::are_strings_equal(sVar0, "am_king_of_the_castle"))
	{
		return "AST_KCASTLE";
	}
	else if (gameplay::are_strings_equal(sVar0, "AM_CRIMINAL_DAMAGE"))
	{
		return "AST_BLAST";
	}
	else if (gameplay::are_strings_equal(sVar0, "AM_KILL_LIST"))
	{
		return "AST_UWARF";
	}
	else if (gameplay::are_strings_equal(sVar0, "AM_HUNT_THE_BEAST"))
	{
		return "AST_BEAST";
	}
	return "";
}

void func_267(int iParam0)//Position - 0x8CE6
{
	if (IntToFloat(iParam0) < gameplay::get_frame_time())
	{
		Global_2464975.f_4588 = 0;
	}
	else if (iParam0 < 6000)
	{
		if (!gameplay::is_bit_set(Global_2464975.f_4588, 1))
		{
			audio::play_sound_frontend(-1, "5s_To_Event_Start_Countdown", "GTAO_FM_Events_Soundset", 0);
			Global_2464975.f_4588 = 0;
			gameplay::set_bit(&(Global_2464975.f_4588), 1);
		}
	}
}

void func_268(int iParam0, int iParam1)//Position - 0x8D3E
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	float fVar4;
	vector3 vVar5;
	float fVar8;
	float fVar9;
	float fVar10;
	int iVar11;
	
	if (!iParam0)
	{
		if (!iParam1 || func_272())
		{
			ui::get_hud_colour(12, &iVar0, &iVar1, &iVar2, &iVar3);
		}
		else
		{
			ui::get_hud_colour(3, &iVar0, &iVar1, &iVar2, &iVar3);
		}
	}
	else
	{
		ui::get_hud_colour(29, &iVar0, &iVar1, &iVar2, &iVar3);
	}
	fVar4 = 0.5f;
	vVar5 = { vLocal_570 };
	fVar8 = (fLocal_577 * 2f);
	switch (Local_96.f_165)
	{
		case 0:
			fVar9 = 36.9f;
			fVar10 = 7.875f;
			fVar8 = func_271();
			vVar5 = { func_270() };
			break;
		
		case 1:
			fVar9 = 26.25f;
			fVar10 = 4.375f;
			fVar8 = func_271();
			vVar5 = { func_270() };
			break;
		
		case 2:
			fVar9 = 49.875f;
			fVar10 = 12f;
			fVar8 = func_271();
			vVar5 = { func_270() };
			break;
		
		case 3:
			fVar9 = 9.5f;
			fVar10 = 0f;
			fVar8 = func_271();
			vVar5 = { func_270() };
			break;
		
		case 4:
			fVar9 = 38.75f;
			fVar10 = 10.25f;
			fVar8 = func_271();
			vVar5 = { func_270() };
			break;
	}
	vVar5.z = (vVar5.y - fVar10);
	if (func_272())
	{
		fVar4 = (fVar4 / 2f);
	}
	if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
	{
		if (func_615(1))
		{
			iVar11 = true;
		}
	}
	if (!func_269())
	{
		if (!iParam0)
		{
			if (!gameplay::is_bit_set(Local_96.f_1, 3))
			{
				if (!iVar11)
				{
					unk_0x799017F9E3B10112(vLocal_570, fLocal_577, iVar0, iVar1, iVar2, fVar4);
				}
			}
		}
		else
		{
			graphics::draw_marker(1, vVar5, 0f, 0f, 0f, 0f, 0f, 0f, fVar8, fVar8, fVar9, iVar0, iVar1, iVar2, iVar3, 0, 0, 2, 0, 0, 0, false);
		}
	}
}

int func_269()//Position - 0x8EF5
{
	return (gameplay::is_bit_set(iLocal_550, 5) || gameplay::is_bit_set(iLocal_550, 8));
}

Vector3 func_270()//Position - 0x8F14
{
	vector3 vVar0;
	
	switch (Local_96.f_165)
	{
		case 0:
			vVar0 = { vLocal_570 };
			vVar0.x = 1457.639f;
			vVar0.y = -2371.45f;
			break;
		
		case 1:
			vVar0 = { vLocal_570 };
			vVar0.x = -1903.733f;
			vVar0.y = 2042.75f;
			break;
		
		case 2:
			vVar0 = { vLocal_570 };
			vVar0.x = 2237.85f;
			vVar0.y = 1469f;
			break;
		
		case 3:
			vVar0 = { vLocal_570 };
			vVar0.x = -1210.197f;
			vVar0.y = -2437.739f;
			break;
		
		case 4:
			vVar0 = { vLocal_570 };
			vVar0.x = 106.968f;
			vVar0.y = 7003.605f;
			break;
	}
	return vVar0;
}

float func_271()//Position - 0x8FD3
{
	float fVar0;
	
	switch (Local_96.f_165)
	{
		case 0:
			fVar0 = 155.375f;
			break;
		
		case 1:
			fVar0 = 94.75f;
			break;
		
		case 2:
			fVar0 = 198.75f;
			break;
		
		case 3:
			fVar0 = 250f;
			break;
		
		case 4:
			fVar0 = 196.375f;
			break;
	}
	return fVar0;
}

int func_272()//Position - 0x9036
{
	if (network::participant_id_to_int() != -1)
	{
		return gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 11);
	}
	return false;
}

void func_273()//Position - 0x905B
{
	if (!gameplay::is_bit_set(iLocal_550, 19))
	{
		func_281();
		unk_0xCD74233600C4EA6B(0);
		if (func_280("SCTV_HELI_HLP"))
		{
			ui::clear_help(1);
		}
		func_275(&(Local_96.f_182), 1, gameplay::is_bit_set(Local_96.f_1, 5), 0);
		if (!func_52(player::player_id(), 0))
		{
			gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 11);
			gameplay::clear_bit(&(Global_2418529[player::network_player_id_to_int() /*313*/].f_194), 2);
			func_274(player::player_id(), 0);
		}
		gameplay::set_bit(&iLocal_550, 19);
	}
}

void func_274(int iParam0, int iParam1)//Position - 0x90DE
{
	int iVar0;
	
	iVar0 = 0;
	if (decorator::decor_exist_on(player::get_player_ped_script_index(iParam0), "MPBitset"))
	{
		iVar0 = decorator::decor_get_int(player::get_player_ped_script_index(iParam0), "MPBitset");
	}
	gameplay::clear_bit(&iVar0, iParam1);
	decorator::decor_set_int(player::get_player_ped_script_index(iParam0), "MPBitset", iVar0);
}

void func_275(var uParam0, int iParam1, int iParam2, int iParam3)//Position - 0x9123
{
	int iVar0;
	int iVar1;
	
	if (iParam1)
	{
		cam::render_script_cams(false, false, 3000, 1, 0, 0);
	}
	if (iParam2)
	{
		if (network::network_does_network_id_exist(uParam0->f_2) && network::network_has_control_of_network_id(uParam0->f_2))
		{
			iVar0 = network::net_to_ent(uParam0->f_2);
			if (iParam3)
			{
				func_279(&(uParam0->f_2));
			}
			else
			{
				entity::set_entity_as_no_longer_needed(&iVar0);
			}
		}
		if (network::network_does_network_id_exist(uParam0->f_3) && network::network_has_control_of_network_id(uParam0->f_3))
		{
			iVar1 = network::net_to_ent(uParam0->f_3);
			if (iParam3)
			{
				func_279(&(uParam0->f_3));
			}
			else
			{
				entity::set_entity_as_no_longer_needed(&iVar1);
			}
		}
	}
	func_276(1, -1);
	func_12(0);
}

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

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

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

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

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

void func_281()//Position - 0x938C
{
	Global_2428549.f_648.f_10 = 0;
}

void func_282(int iParam0)//Position - 0x939E
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 < network::_network_get_num_participants_host())
	{
		Local_1007[iVar0 /*47*/] = -1;
		Local_1007[iVar0 /*47*/].f_1 = func_58();
		Local_1007[iVar0 /*47*/].f_9 = -1;
		Local_1007[iVar0 /*47*/].f_30 = -1;
		StringCopy(&(Local_2512.f_104), "FM_AE_SORT_12", 16);
		if (Local_96.f_34[iVar0 /*4*/] > -1)
		{
			if (Local_96.f_34[iVar0 /*4*/].f_3 > 0)
			{
				Local_1007[iVar0 /*47*/] = Local_96.f_34[iVar0 /*4*/];
				Local_1007[iVar0 /*47*/].f_1 = Local_96.f_34[iVar0 /*4*/].f_1;
				Local_1007[iVar0 /*47*/].f_9 = -1;
				Local_1007[iVar0 /*47*/].f_46 = Local_96.f_34[iVar0 /*4*/].f_2;
			}
		}
		iVar0++;
	}
	if (iParam0)
	{
		if (!func_409())
		{
			if (Local_2512.f_103 != 136)
			{
				Local_2512.f_103 = 136;
			}
			else
			{
				func_407(1, 136);
			}
		}
	}
	func_283(&Local_1007, &iLocal_1006, 23, &Local_2512, &uLocal_2621, -1, 0);
}

void func_283(int iParam0, int iParam1, int iParam2, var uParam3, var uParam4, int iParam5, int iParam6)//Position - 0x9484
{
	int iVar0;
	int iVar1[32];
	int iVar34;
	int iVar35;
	char* sVar36;
	int iVar37;
	struct<4> Var38;
	int iVar42;
	int iVar43;
	int iVar44;
	float fVar45;
	int iVar46;
	int iVar47;
	int iVar48;
	int iVar49;
	int iVar50;
	int iVar51;
	int iVar52;
	int iVar53;
	int iVar54;
	int iVar55;
	int iVar56;
	
	if (func_392(iParam2))
	{
		return;
	}
	fVar45 = -1f;
	iVar46 = -1;
	iVar47 = -1;
	iVar49 = 0;
	iVar50 = 0;
	uParam3->f_36 = 0;
	if (func_391() || iParam2 == 24)
	{
		if (func_347(iParam1, iParam2, uParam3, Global_1573685, 0, func_410()))
		{
			func_346(1);
			if ((!func_345() && !func_344()) || gameplay::is_bit_set(Global_2464975.f_4426, 1))
			{
				if (func_343())
				{
					func_340();
				}
				else
				{
					graphics::_set_screen_draw_position(76, 84);
					if (uParam3->f_27 == 0)
					{
						func_339(1);
						Global_1573685 = 0;
						iVar54 = -1;
						if (Global_1573833 != 1)
						{
							func_338(iParam1);
							if (gameplay::is_bit_set(uParam3->f_33, 7))
							{
								gameplay::clear_bit(&(uParam3->f_33), 7);
							}
						}
						if (iParam2 == 24)
						{
							iVar52 = 0;
							while (iVar52 < 32)
							{
								iVar1[iVar52] = -1;
								iVar52++;
							}
							iVar52 = 0;
							while (iVar52 < 32)
							{
								if (func_694(player::int_to_playerindex(iVar52), 0, 1))
								{
									iVar35 = player::int_to_playerindex(iVar52);
									if (!func_52(iVar35, 0))
									{
										if ((network::_0x9DE986FC9A87C474(iVar35, player::player_id()) || Global_2418529[iVar35 /*313*/].f_232 != -1) || func_337(iVar35))
										{
											iVar44 = iVar35;
											if (func_145(iVar35))
											{
												iVar1[iVar44] = iVar55;
												iVar55++;
												iVar0++;
												func_336(&iVar1, iVar35, &iVar55, &iVar0);
											}
										}
									}
								}
								iVar52++;
							}
						}
						if (!func_334(player::player_id(), 0))
						{
							iVar34 = iVar0 > 0;
						}
						iVar52 = 0;
						while (iVar52 < 32)
						{
							if (func_330())
							{
								if (func_694(player::int_to_playerindex(iVar52), 0, 1))
								{
									iVar35 = player::int_to_playerindex(iVar52);
								}
								else
								{
									iVar35 = func_58();
								}
							}
							else
							{
								iVar35 = (iParam0[iVar52 /*47*/])->f_1;
							}
							if ((func_329(iVar35) && func_325(iVar35, iParam2)) && func_694(iVar35, 0, 1))
							{
								iVar44 = iVar35;
								iVar42 = Global_1587816[iVar44 /*444*/].f_195.f_6;
								Var38 = { func_320(iVar35) };
								if (iVar35 == player::player_id())
								{
									uParam3->f_35 = iVar53;
								}
								StringCopy(&(uParam3->f_1), player::get_player_name(iVar35), 64);
								*(uParam4[iVar52 /*13*/]) = { func_107(iVar35) };
								iVar37 = func_314(iVar35);
								sVar36 = "";
								if (iVar37 != 0)
								{
									sVar36 = ped::get_pedheadshot_txd_string(iVar37);
								}
								Global_1573685++;
								if ((iParam0[iVar52 /*47*/])->f_22 != -1f)
								{
									fVar45 = (iParam0[iVar52 /*47*/])->f_22;
								}
								if ((iParam0[iVar52 /*47*/])->f_30 != -1)
								{
									iVar46 = (iParam0[iVar52 /*47*/])->f_30;
								}
								if ((iParam0[iVar52 /*47*/])->f_46 != -1)
								{
									iVar47 = (iParam0[iVar52 /*47*/])->f_46;
								}
								iVar43 = (iParam0[iVar52 /*47*/])->f_9;
								if (((iParam0[iVar52 /*47*/])->f_9 != -1 || (iParam0[iVar52 /*47*/])->f_22 != -1f) || (iParam0[iVar52 /*47*/])->f_30 != -1)
								{
									if (!func_330())
									{
										iVar50 = 1;
									}
								}
								if (iParam5 != -1)
								{
									func_309(&iVar43, &fVar45, (iParam0[iVar52 /*47*/])->f_9, iParam5);
									StringCopy(&(uParam3->f_104), func_308(iParam5, 1, 0, 0), 16);
								}
								if (iParam6)
								{
									iVar48 = (iParam0[iVar52 /*47*/])->f_2 + 1;
									if (iVar54 != iVar48)
									{
										iVar54 = iVar48;
									}
									else
									{
										iVar48 = -2;
									}
								}
								iVar51 = func_305(iVar35, 0);
								if (iVar34)
								{
									if (func_144(iVar35, 1) && iVar1[iVar44] != -1)
									{
										iVar53 = iVar1[iVar44];
									}
									else
									{
										iVar53 = (iVar0 + iVar56);
										iVar56++;
									}
								}
								uParam3->f_38[iVar44 /*2*/].f_1 = iVar53;
								if (func_304(iParam5))
								{
									func_303(iParam1, uParam3, iVar53, Var38, sVar36, iVar42, iVar43, iVar51, iVar50, fVar45, iVar43, iVar47, &((iParam0[iVar52 /*47*/])->f_37), &((iParam0[iVar52 /*47*/])->f_41), (iParam0[iVar52 /*47*/])->f_45, iVar48, iParam6);
								}
								else
								{
									func_303(iParam1, uParam3, iVar53, Var38, sVar36, iVar42, iVar43, iVar51, iVar50, fVar45, iVar46, iVar47, &((iParam0[iVar52 /*47*/])->f_37), &((iParam0[iVar52 /*47*/])->f_41), (iParam0[iVar52 /*47*/])->f_45, iVar48, iParam6);
								}
								gameplay::set_bit(&iVar49, iVar35);
								iVar53++;
							}
							iVar52++;
						}
						iVar52 = 0;
						while (iVar52 < 32)
						{
							iVar35 = player::int_to_playerindex(iVar52);
							if (func_694(iVar35, 0, 1) && !gameplay::is_bit_set(iVar49, iVar35))
							{
								iVar35 = player::int_to_playerindex(iVar52);
							}
							else
							{
								iVar35 = func_58();
							}
							if (func_329(iVar35))
							{
								if (func_694(player::int_to_playerindex(iVar52), 0, 1))
								{
									iVar44 = iVar35;
									iVar42 = Global_1587816[iVar44 /*444*/].f_195.f_6;
									Var38 = { func_320(iVar35) };
									*(uParam4[iVar52 /*13*/]) = { func_107(iVar35) };
									iVar37 = func_314(iVar35);
									sVar36 = "";
									if (iVar37 != 0)
									{
										sVar36 = ped::get_pedheadshot_txd_string(iVar37);
									}
									Global_1573685++;
									iVar51 = func_305(iVar35, 1);
									if (iVar34)
									{
										if (func_144(iVar35, 1))
										{
											iVar53 = iVar1[iVar52];
										}
										else
										{
											iVar53 = (iVar0 + iVar56);
											iVar56++;
										}
									}
									uParam3->f_38[iVar44 /*2*/].f_1 = iVar53;
									func_296(player::get_player_name(iVar35), iParam1, uParam3, iVar53, Var38, sVar36, iVar42, iVar51, iVar50);
									iVar53++;
								}
							}
							iVar52++;
						}
						if (gameplay::is_bit_set(uParam3->f_33, 11))
						{
							func_293(uParam3, iParam1);
						}
						func_6(&(uParam3->f_21));
						func_292();
						uParam3->f_27 = 2;
					}
					if (uParam3->f_27 == 2)
					{
						if (!gameplay::is_bit_set(uParam3->f_33, 7))
						{
							func_291(uParam3, iParam1);
							func_290(iParam1, 0, 1);
							gameplay::set_bit(&(uParam3->f_33), 7);
						}
						func_291(uParam3, iParam1);
						if (!gameplay::is_bit_set(uParam3->f_33, 11))
						{
							gameplay::set_bit(&(uParam3->f_33), 11);
						}
						if (func_286(uParam3))
						{
							Global_1573833 = 1;
						}
						func_284(uParam3);
						if (Global_1573833 == 1)
						{
							uParam3->f_27 = 0;
						}
						if (Global_1573833 == 2)
						{
							uParam3->f_27 = 0;
						}
					}
					if (graphics::has_scaleform_movie_loaded(*iParam1))
					{
						graphics::_set_2d_layer(7);
						graphics::draw_scaleform_movie(*iParam1, 0.122f, 0.3f, 0.28f, 0.6f, 255, 255, 255, 255, 0);
						graphics::_set_2d_layer(4);
					}
				}
			}
		}
		else
		{
			uParam3->f_27 = 0;
			func_292();
			func_339(0);
			if (gameplay::is_bit_set(uParam3->f_33, 7))
			{
				gameplay::clear_bit(&(uParam3->f_33), 7);
			}
			if (gameplay::is_bit_set(uParam3->f_33, 10))
			{
				gameplay::clear_bit(&(uParam3->f_33), 10);
			}
		}
	}
	graphics::_0xE3A3DB414A373DAB();
}

void func_284(var uParam0)//Position - 0x9ABB
{
	if (!func_9(&(uParam0->f_21)))
	{
		func_8(&(uParam0->f_21), 0, 0);
	}
	else if (func_7(&(uParam0->f_21), 250, 0))
	{
		func_6(&(uParam0->f_21));
		func_285(0);
	}
}

void func_285(int iParam0)//Position - 0x9AF7
{
	if (iParam0)
	{
		if (Global_1573833 != 2)
		{
			Global_1573833 = 2;
		}
	}
	else
	{
		switch (Global_1573833)
		{
			case 0:
				Global_1573833 = 1;
				break;
			
			case 1:
				break;
			
			case 2:
				break;
			}
	}
}

int func_286(var uParam0)//Position - 0x9B3D
{
	var uVar0;
	int iVar1;
	struct<13> Var2;
	int iVar15;
	int iVar16;
	
	iVar16 = 0;
	uVar0 = uParam0->f_37;
	iVar15 = player::int_to_playerindex(uParam0->f_37);
	if (iVar15 != func_58() && func_694(iVar15, 0, 1))
	{
		Var2 = { func_107(iVar15) };
		iVar1 = func_289(uParam0, uParam0->f_37);
		if (func_288(Var2))
		{
			switch (iVar1)
			{
				case 0:
					if (network::network_can_communicate_with_gamer(&Var2))
					{
						if (network::network_is_gamer_talking(&Var2))
						{
							iVar16 = 1;
							func_287(uParam0, uVar0, 2);
						}
					}
					else if (network::network_is_gamer_muted_by_me(&Var2))
					{
						iVar16 = 1;
						func_287(uParam0, uVar0, 1);
					}
					break;
				
				case 2:
					if (network::network_can_communicate_with_gamer(&Var2))
					{
						if (!network::network_is_gamer_talking(&Var2))
						{
							iVar16 = 1;
							func_287(uParam0, uVar0, 0);
						}
					}
					else
					{
						iVar16 = 1;
						func_287(uParam0, uVar0, 0);
					}
					break;
				
				case 1:
					if (network::network_can_communicate_with_gamer(&Var2))
					{
						if (!network::network_is_gamer_muted_by_me(&Var2))
						{
							iVar16 = 1;
							func_287(uParam0, uVar0, 0);
						}
					}
					else if (!network::network_is_gamer_muted_by_me(&Var2))
					{
						iVar16 = 1;
						func_287(uParam0, uVar0, 0);
					}
					break;
				}
			}
	}
	uParam0->f_37++;
	if (uParam0->f_37 >= 32)
	{
		uParam0->f_37 = 0;
	}
	return iVar16;
}

void func_287(var uParam0, var uParam1, int iParam2)//Position - 0x9C6A
{
	uParam0->f_38[uParam1 /*2*/] = iParam2;
}

int func_288(var uParam0, var uParam1, var uParam2, var uParam3, var uParam4, var uParam5, var uParam6, var uParam7, var uParam8, var uParam9, var uParam10, var uParam11, var uParam12)//Position - 0x9C7C
{
	return network::network_is_handle_valid(&uParam0, 13);
}

var func_289(var uParam0, var uParam1)//Position - 0x9C8C
{
	return uParam0->f_38[uParam1 /*2*/];
}

void func_290(int iParam0, int iParam1, int iParam2)//Position - 0x9C9C
{
	if (graphics::_push_scaleform_movie_function(*iParam0, "COLLAPSE"))
	{
		graphics::_push_scaleform_movie_function_parameter_bool(iParam1);
		graphics::_pop_scaleform_movie_function_void();
	}
	if (iParam2 == 1)
	{
		if (graphics::_push_scaleform_movie_function(*iParam0, "DISPLAY_VIEW"))
		{
			graphics::_pop_scaleform_movie_function_void();
		}
	}
}

void func_291(var uParam0, int iParam1)//Position - 0x9CD4
{
	if (!gameplay::is_bit_set(uParam0->f_33, 10))
	{
		graphics::_push_scaleform_movie_function(*iParam1, "SET_HIGHLIGHT");
		graphics::_push_scaleform_movie_function_parameter_int(uParam0->f_35);
		graphics::_pop_scaleform_movie_function_void();
		gameplay::set_bit(&(uParam0->f_33), 10);
	}
}

void func_292()//Position - 0x9D0C
{
	if (Global_1573833 != 0)
	{
		Global_1573833 = 0;
	}
}

void func_293(var uParam0, int iParam1)//Position - 0x9D21
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	iVar0 = 0;
	while (iVar0 < 32)
	{
		iVar2 = player::int_to_playerindex(iVar0);
		if (iVar2 != func_58())
		{
			if (func_694(iVar2, 0, 1))
			{
				if (uParam0->f_38[iVar0 /*2*/].f_1 != -1)
				{
					iVar1 = func_295(uParam0->f_38[iVar0 /*2*/], 0);
					func_294(iParam1, uParam0->f_38[iVar0 /*2*/].f_1, iVar1, Global_1587816[iVar0 /*444*/].f_195.f_6);
				}
			}
		}
		iVar0++;
	}
}

void func_294(var uParam0, int iParam1, int iParam2, int iParam3)//Position - 0x9D94
{
	if (graphics::has_scaleform_movie_loaded(*uParam0))
	{
		if (graphics::_push_scaleform_movie_function(*uParam0, "SET_ICON"))
		{
			graphics::_push_scaleform_movie_function_parameter_int(iParam1);
			graphics::_push_scaleform_movie_function_parameter_int(iParam2);
			if (iParam2 == 65)
			{
				graphics::_push_scaleform_movie_function_parameter_int(iParam3);
			}
			graphics::_pop_scaleform_movie_function_void();
		}
	}
}

int func_295(int iParam0, int iParam1)//Position - 0x9DD1
{
	int iVar0;
	
	iVar0 = 65;
	if (iParam1)
	{
		iVar0 = 116;
	}
	switch (iParam0)
	{
		case 2:
			return 47;
		
		case 1:
			return 49;
		
		default:
	}
	return iVar0;
}

void func_296(char* sParam0, int iParam1, var uParam2, int iParam3, char* sParam4, var uParam5, var uParam6, var uParam7, char* sParam8, int iParam9, int iParam10, int iParam11)//Position - 0x9E05
{
	int iVar0;
	char* sVar1;
	
	if (iParam3 >= func_302() && iParam3 < func_301())
	{
		iParam3 = (iParam3 % 16);
		iVar0 = iParam3 + 1;
		if (Global_1573687)
		{
			iVar0 += 16;
		}
		sVar1 = "SET_DATA_SLOT";
		if (Global_1573833 == 1)
		{
			sVar1 = "UPDATE_SLOT";
		}
		if (graphics::_push_scaleform_movie_function(*iParam1, sVar1))
		{
			graphics::_push_scaleform_movie_function_parameter_int(iParam3);
			if (gameplay::is_bit_set(uParam2->f_33, 8) || uParam2->f_108 == 6)
			{
				func_300("");
			}
			else
			{
				graphics::_push_scaleform_movie_function_parameter_int(iParam9);
			}
			func_300(sParam0);
			graphics::_push_scaleform_movie_function_parameter_int(iParam10);
			if (uParam2->f_108 == 6)
			{
				func_300("");
			}
			else
			{
				graphics::_push_scaleform_movie_function_parameter_int(65);
			}
			graphics::_push_scaleform_movie_function_parameter_int(-1);
			func_300("");
			if (uParam2->f_108 == 6)
			{
				func_300("");
			}
			else
			{
				func_300(&sParam4);
			}
			graphics::_push_scaleform_movie_function_parameter_bool(uParam2->f_36);
			graphics::_push_scaleform_movie_function_parameter_string(sParam8);
			graphics::_push_scaleform_movie_function_parameter_string(sParam8);
			if (func_299(uParam2))
			{
				func_249("DPAD_FRIEND");
			}
			else if (func_298(uParam2))
			{
				func_249("DPAD_FRIEND");
			}
			else if (func_297(uParam2))
			{
				func_249("DPAD_CREW");
			}
			else
			{
				func_249("");
			}
			graphics::_pop_scaleform_movie_function_void();
		}
	}
}

int func_297(var uParam0)//Position - 0x9F2F
{
	return gameplay::is_bit_set(uParam0->f_33, 6);
}

int func_298(var uParam0)//Position - 0x9F40
{
	return gameplay::is_bit_set(uParam0->f_33, 5);
}

bool func_299(var uParam0)//Position - 0x9F51
{
	if (func_298(uParam0) && func_297(uParam0))
	{
		return true;
	}
	return false;
}

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

int func_301()//Position - 0x9F80
{
	int iVar0;
	
	if (Global_1573687)
	{
		iVar0 = 32;
	}
	else
	{
		iVar0 = 16;
	}
	return iVar0;
}

int func_302()//Position - 0x9F9C
{
	int iVar0;
	
	iVar0 = 0;
	if (Global_1573687)
	{
		iVar0 = 16;
	}
	return iVar0;
}

void func_303(int iParam0, var uParam1, int iParam2, char* sParam3, var uParam4, var uParam5, var uParam6, char* sParam7, int iParam8, int iParam9, int iParam10, int iParam11, float fParam12, int iParam13, int iParam14, char* sParam15, char* sParam16, int iParam17, int iParam18, int iParam19)//Position - 0x9FB4
{
	int iVar0;
	char* sVar1;
	
	if (iParam2 >= func_302() && iParam2 < func_301())
	{
		iParam2 = (iParam2 % 16);
		iVar0 = iParam2 + 1;
		if (Global_1573687)
		{
			iVar0 += 16;
		}
		if (iParam19)
		{
			iVar0 = iParam18;
			if (iVar0 == -2)
			{
				iParam9 = -1;
			}
		}
		sVar1 = "SET_DATA_SLOT";
		if (Global_1573833 == 1)
		{
			sVar1 = "UPDATE_SLOT";
		}
		if (graphics::has_scaleform_movie_loaded(*iParam0))
		{
			if (graphics::_push_scaleform_movie_function(*iParam0, sVar1))
			{
				graphics::_push_scaleform_movie_function_parameter_int(iParam2);
				if (gameplay::is_bit_set(uParam1->f_33, 8) || uParam1->f_108 == 6)
				{
					func_300("");
				}
				else
				{
					graphics::_push_scaleform_movie_function_parameter_int(iParam8);
				}
				if (uParam1->f_108 == 6 && !gameplay::is_string_null_or_empty(sParam15))
				{
					func_249(sParam15);
				}
				else
				{
					func_300(&(uParam1->f_1));
				}
				graphics::_push_scaleform_movie_function_parameter_int(iParam10);
				if (uParam1->f_108 == 6)
				{
					func_300("");
				}
				else
				{
					graphics::_push_scaleform_movie_function_parameter_int(65);
				}
				if (iParam11 == 1)
				{
					graphics::_push_scaleform_movie_function_parameter_int(iVar0);
				}
				else
				{
					graphics::_push_scaleform_movie_function_parameter_int(-1);
				}
				if (func_330())
				{
					func_300("");
				}
				else if (uParam1->f_108 == 6 && !gameplay::is_string_null_or_empty(sParam15))
				{
					graphics::_begin_text_component("FM_AE_ONE_INT");
					ui::_add_text_component_item_string(sParam15);
					ui::add_text_component_integer(iParam17);
					graphics::_end_text_component();
				}
				else if (uParam1->f_108 == 5 && !gameplay::is_string_null_or_empty(sParam15))
				{
					graphics::_begin_text_component("FM_AE_ONE_INT");
					ui::_add_text_component_item_string(sParam15);
					ui::add_text_component_integer(iParam17);
					graphics::_end_text_component();
				}
				else if ((uParam1->f_108 == 7 && !gameplay::is_string_null_or_empty(sParam15)) && !gameplay::is_string_null_or_empty(sParam16))
				{
					graphics::_begin_text_component("FM_AE_TWO_INT");
					ui::_add_text_component_item_string(sParam15);
					ui::_add_text_component_item_string(sParam16);
					ui::add_text_component_integer(iParam17);
					graphics::_end_text_component();
				}
				else if (uParam1->f_108 == 8 && !gameplay::is_string_null_or_empty(&(uParam1->f_104)))
				{
					graphics::_begin_text_component("FM_AE_UNIT");
					if (fParam12 != -1f)
					{
						ui::add_text_component_float(fParam12, 1);
					}
					if (iParam9 != -1)
					{
						ui::add_text_component_integer(iParam9);
					}
					ui::_add_text_component_item_string(&(uParam1->f_104));
					graphics::_end_text_component();
				}
				else if (uParam1->f_108 == 9)
				{
					graphics::_begin_text_component("FM_AE_CASH");
					ui::_add_text_component_substring_cash(iParam9, 1);
					graphics::_end_text_component();
				}
				else if (iParam14 > -1)
				{
					if (iParam14 == 0 && !gameplay::is_string_null_or_empty(&(uParam1->f_104)))
					{
						func_249(&(uParam1->f_104));
					}
					else
					{
						func_300("");
					}
				}
				else if (iParam13 != -1)
				{
					graphics::_begin_text_component("STRING");
					ui::add_text_component_substring_time(iParam13, 6);
					graphics::_end_text_component();
				}
				else if (fParam12 != -1f)
				{
					graphics::_begin_text_component("NUMBER");
					ui::add_text_component_float(fParam12, 1);
					graphics::_end_text_component();
				}
				else if (iParam9 != -1)
				{
					graphics::_push_scaleform_movie_function_parameter_int(iParam9);
				}
				else
				{
					func_300("");
				}
				if (uParam1->f_108 == 6)
				{
					func_300("");
				}
				else
				{
					func_300(&sParam3);
				}
				graphics::_push_scaleform_movie_function_parameter_bool(uParam1->f_36);
				if (iParam11 == 1 || gameplay::is_string_null_or_empty(sParam7))
				{
					func_300("");
					func_300("");
				}
				else
				{
					graphics::_push_scaleform_movie_function_parameter_string(sParam7);
					graphics::_push_scaleform_movie_function_parameter_string(sParam7);
				}
				if (func_299(uParam1))
				{
					func_249("DPAD_FRIEND");
				}
				else if (func_298(uParam1))
				{
					func_249("DPAD_FRIEND");
				}
				else if (func_297(uParam1))
				{
					func_249("DPAD_CREW");
				}
				else
				{
					func_249("");
				}
				graphics::_pop_scaleform_movie_function_void();
			}
		}
	}
}

bool func_304(int iParam0)//Position - 0xA2E5
{
	return false;
	switch (iParam0)
	{
		case 11:
		case 12:
			return true;
		
		default:
	}
	return false;
}

int func_305(int iParam0, int iParam1)//Position - 0xA309
{
	int iVar0;
	int iVar1;
	
	iVar0 = 116;
	if ((!iParam1 && func_307(iParam0)) && !func_306(iParam0))
	{
		iVar0 = func_114();
	}
	iVar1 = func_143(iParam0);
	if (!iVar1 == -1)
	{
		return func_141(iVar1);
	}
	return iVar0;
}

int func_306(int iParam0)//Position - 0xA353
{
	return func_139(iParam0, 20);
}

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

char* func_308(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0xA383
{
	switch (iParam0)
	{
		case 0:
		case 3:
		case 4:
		case 5:
		case 1:
		case 6:
		case 9:
		case 10:
		case 13:
		case 11:
		case 12:
			if (gameplay::_0xD3D15555431AB793())
			{
				if (iParam1)
				{
					return "AMCH_M_LB";
				}
				else if (iParam2)
				{
					return "AMCH_M";
				}
				else
				{
					return "AMCH_METRES";
				}
			}
			else if (iParam1)
			{
				return "AMCH_FT_LB";
			}
			else if (iParam2)
			{
				return "AMCH_FT";
			}
			else
			{
				return "AMCH_FEET";
			}
			break;
		
		case 2:
			if (gameplay::_0xD3D15555431AB793())
			{
				if (iParam1)
				{
					return "AMCH_KMH_LB";
				}
				else if (iParam2)
				{
					return "AMCH_KMHN";
				}
				else
				{
					return "AMCH_KMH";
				}
			}
			else if (iParam1)
			{
				return "AMCH_MPH_LB";
			}
			else if (iParam2)
			{
				return "AMCH_MPHN";
			}
			else
			{
				return "AMCH_MPH";
			}
			break;
		
		case 7:
			if (iParam1 || iParam2)
			{
				return "";
			}
			else
			{
				return "AMCH_VEH";
			}
			break;
		
		case 15:
		case 16:
		case 17:
		case 18:
			if (iParam1 || iParam2)
			{
				return "";
			}
			else if (iParam3 != 1)
			{
				return "AMCH_KILLS";
			}
			else
			{
				return "AMCH_KILL";
			}
			break;
	}
	if (iParam1 || iParam2)
	{
		return "";
	}
	return "AMCH_EMPTY";
}

bool func_309(var uParam0, float fParam1, int iParam2, int iParam3)//Position - 0xA510
{
	if (func_313(iParam3))
	{
		*fParam1 = (func_310(iParam3, iParam2) / 10f);
		return true;
	}
	if (func_304(iParam3))
	{
		*fParam1 = (func_310(iParam3, iParam2) / 1000f);
		return true;
	}
	*uParam0 = iParam2;
	return false;
}

float func_310(int iParam0, int iParam1)//Position - 0xA560
{
	switch (iParam0)
	{
		case 0:
		case 3:
		case 4:
		case 5:
		case 1:
		case 6:
		case 9:
		case 10:
		case 13:
		case 11:
		case 12:
			if (gameplay::_0xD3D15555431AB793())
			{
				return system::to_float(iParam1);
			}
			else
			{
				return func_312(system::to_float(iParam1));
			}
			break;
		
		case 2:
			if (gameplay::_0xD3D15555431AB793())
			{
				return system::to_float(iParam1);
			}
			else
			{
				return func_311(system::to_float(iParam1));
			}
			break;
	}
	return system::to_float(iParam1);
}

float func_311(float fParam0)//Position - 0xA603
{
	return (fParam0 / 1.609344f);
}

float func_312(float fParam0)//Position - 0xA613
{
	return (fParam0 / 0.3048f);
}

bool func_313(int iParam0)//Position - 0xA623
{
	switch (iParam0)
	{
		case 0:
		case 2:
		case 3:
		case 5:
		case 4:
		case 1:
		case 6:
		case 9:
		case 10:
		case 13:
		case 11:
		case 12:
			return true;
		
		default:
	}
	return false;
}

int func_314(int iParam0)//Position - 0xA67F
{
	int iVar0;
	
	iVar0 = func_317(iParam0);
	if (iVar0 == -1)
	{
		func_315(iParam0, 1);
		return 0;
	}
	Global_1348612[iVar0 /*5*/].f_4 = 1;
	return Global_1348612[iVar0 /*5*/].f_2;
}

void func_315(int iParam0, int iParam1)//Position - 0xA6B5
{
	if (!func_694(iParam0, 0, 1))
	{
		return;
	}
	if (func_317(iParam0) != -1)
	{
		return;
	}
	if (Global_1348775)
	{
		if (iParam0 == Global_1348775.f_1)
		{
			return;
		}
	}
	if (func_316(iParam0))
	{
		return;
	}
	if (Global_1348813 >= 32)
	{
		return;
	}
	Global_1348780[Global_1348813] = iParam0;
	Global_1348813++;
	if (iParam1)
	{
	}
}

bool func_316(int iParam0)//Position - 0xA721
{
	int iVar0;
	
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < Global_1348813)
	{
		if (Global_1348780[iVar0] == iParam0)
		{
			return true;
		}
		iVar0++;
	}
	return false;
}

int func_317(int iParam0)//Position - 0xA753
{
	int iVar0;
	
	if (!func_694(iParam0, 0, 1))
	{
		return -1;
	}
	if (Global_1348773 == 0)
	{
		return -1;
	}
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < Global_1348773)
	{
		if (Global_1348612[iVar0 /*5*/].f_1 == iParam0)
		{
			if (ped::is_pedheadshot_valid(Global_1348612[iVar0 /*5*/].f_2) && ped::is_pedheadshot_ready(Global_1348612[iVar0 /*5*/].f_2))
			{
				return iVar0;
			}
			func_318(iVar0);
			return -1;
		}
		iVar0++;
	}
	return -1;
}

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

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

struct<4> func_320(int iParam0)//Position - 0xA8B5
{
	char cVar0[32];
	
	if (func_694(iParam0, 0, 1))
	{
		Global_2460474 = { func_107(iParam0) };
		if (gameplay::is_durango_version())
		{
			if (func_288(Global_2460474))
			{
				if (!network::_0xB57A49545BA53CE7(&Global_2460474))
				{
					return cVar0;
				}
			}
		}
		else if (!network::_0x72D918C99BCACC54(0))
		{
			return cVar0;
		}
		if (func_324(&Global_2460474))
		{
			Global_2460404 = { func_322(iParam0) };
			func_321(&Global_2460404, &cVar0);
		}
	}
	return cVar0;
}

void func_321(var uParam0, char* sParam1)//Position - 0xA936
{
	network::_0xF45352426FF3A4F0(uParam0, 35, sParam1);
}

struct<35> func_322(int iParam0)//Position - 0xA948
{
	struct<13> Var0;
	struct<35> Var13;
	
	if (func_323(iParam0))
	{
		return Global_1315947[player::player_id() /*35*/];
	}
	Var0 = { func_107(iParam0) };
	network::network_clan_player_get_desc(&Var13, 35, &Var0);
	return Var13;
}

bool func_323(int iParam0)//Position - 0xA984
{
	if (iParam0 == player::player_id())
	{
		return true;
	}
	return false;
}

bool func_324(var uParam0)//Position - 0xA99A
{
	if (player::is_player_online())
	{
		if (network::_network_player_is_in_clan() && network::network_clan_player_is_active(uParam0))
		{
			return true;
		}
	}
	return false;
}

bool func_325(int iParam0, int iParam1)//Position - 0xA9C0
{
	if (iParam1 == 23)
	{
		if ((func_51(iParam0) || func_328(iParam0)) || func_225(iParam0))
		{
			return false;
		}
	}
	if (!func_327(iParam0))
	{
		return false;
	}
	if ((!func_326(iParam0) && Global_2418529[iParam0 /*313*/].f_232 == -1) && !func_337(iParam0))
	{
		return false;
	}
	return true;
}

bool func_326(int iParam0)//Position - 0xAA2F
{
	if (func_694(iParam0, 0, 1))
	{
		if (func_694(player::player_id(), 0, 1))
		{
			if (network::_0x9DE986FC9A87C474(iParam0, player::player_id()))
			{
				return true;
			}
		}
	}
	return false;
}

int func_327(int iParam0)//Position - 0xAA61
{
	return gameplay::is_bit_set(Global_1587816[iParam0 /*444*/].f_131, 22);
}

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

bool func_329(int iParam0)//Position - 0xAAB6
{
	int iVar0;
	
	if (iParam0 == func_58())
	{
		return false;
	}
	if (func_52(iParam0, 0))
	{
		return false;
	}
	iVar0 = iParam0;
	if (iVar0 != -1)
	{
		if (gameplay::is_bit_set(Global_1587816[iVar0 /*444*/].f_131, 2))
		{
			return false;
		}
	}
	return true;
}

bool func_330()//Position - 0xAAFB
{
	switch (func_333(player::player_id()))
	{
		case 131:
		case 140:
		case 138:
		case 146:
			return true;
			break;
	}
	if (func_306(player::player_id()))
	{
		switch (func_331(player::player_id()))
		{
			case 148:
			case 151:
			case 152:
			case 153:
			case 157:
			case 159:
			case 162:
			case 164:
			case 142:
				return true;
				break;
			}
	}
	return false;
}

int func_331(int iParam0)//Position - 0xAB85
{
	if (func_332(iParam0, 0))
	{
		return Global_1610705[iParam0 /*178*/].f_10.f_28;
	}
	return -1;
}

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

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

bool func_334(int iParam0, int iParam1)//Position - 0xABFE
{
	if (Global_1610705[iParam0 /*178*/].f_10.f_28 != -1 && func_335(Global_1610705[iParam0 /*178*/].f_10.f_28))
	{
		return true;
	}
	if (iParam1 && Global_1610705[iParam0 /*178*/].f_10.f_27 != -1)
	{
		if (func_335(Global_1610705[iParam0 /*178*/].f_10.f_27))
		{
			return true;
		}
	}
	return false;
}

bool func_335(int iParam0)//Position - 0xAC60
{
	switch (iParam0)
	{
		case 155:
		case 160:
		case 153:
		case 162:
		case 154:
		case 163:
		case 171:
		case 172:
			return true;
		
		default:
	}
	return false;
}

void func_336(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0xACA4
{
	int iVar0;
	int iVar1;
	
	iVar0 = 0;
	while (iVar0 < 32)
	{
		if (func_694(player::int_to_playerindex(iVar0), 0, 1))
		{
			iVar1 = player::int_to_playerindex(iVar0);
			if (!func_52(iVar1, 0))
			{
				if ((network::_0x9DE986FC9A87C474(iVar1, player::player_id()) || Global_2418529[iVar1 /*313*/].f_232 != -1) || func_337(iVar1))
				{
					if (func_222(iVar1, iParam1, 0))
					{
						(*iParam0)[iVar0] = *iParam2;
						*iParam2++;
						*iParam3++;
					}
				}
			}
		}
		iVar0++;
	}
}

int func_337(int iParam0)//Position - 0xAD32
{
	return Global_1587816[iParam0 /*444*/].f_180 != 0;
}

void func_338(int iParam0)//Position - 0xAD47
{
	if (graphics::has_scaleform_movie_loaded(*iParam0))
	{
		graphics::_push_scaleform_movie_function(*iParam0, "SET_DATA_SLOT_EMPTY");
		graphics::_push_scaleform_movie_function_parameter_int(0);
		graphics::_pop_scaleform_movie_function_void();
	}
}

void func_339(int iParam0)//Position - 0xAD6E
{
	if (iParam0)
	{
		if (Global_1338619.f_2 == 0)
		{
			Global_1338619.f_2 = 1;
		}
	}
	else if (Global_1338619.f_2 == 1)
	{
		Global_1338619.f_2 = 0;
	}
}

void func_340()//Position - 0xADA0
{
	if (gameplay::is_bit_set(Global_2464975.f_4426, 1))
	{
		if (func_342())
		{
			func_341();
		}
	}
}

void func_341()//Position - 0xADC2
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 <= 3)
	{
		if (Global_2428549.f_2191[iVar0 /*72*/].f_2 != 0)
		{
			Global_2428549.f_2191[iVar0 /*72*/].f_2 = 5;
			gameplay::set_bit(&(Global_2428549.f_2191[iVar0 /*72*/].f_63), 0);
		}
		iVar0++;
	}
}

int func_342()//Position - 0xAE0D
{
	return Global_2428549.f_2191[0 /*72*/].f_1 != 0;
}

bool func_343()//Position - 0xAE23
{
	if (gameplay::is_bit_set(Global_2464975.f_4426, 0) && func_342())
	{
		return true;
	}
	if (gameplay::is_bit_set(Global_2464975.f_4426, 1) && func_342())
	{
		return true;
	}
	return false;
}

bool func_344()//Position - 0xAE64
{
	if (func_342())
	{
		if (func_111(Global_2428549.f_2191[0 /*72*/].f_1))
		{
			return true;
		}
	}
	return false;
}

bool func_345()//Position - 0xAE8B
{
	if (func_342())
	{
		if (func_115(Global_2428549.f_2191[0 /*72*/].f_1))
		{
			return true;
		}
	}
	return false;
}

void func_346(int iParam0)//Position - 0xAEB2
{
	Global_1338619.f_1 = Global_1338619;
	Global_1338619 = iParam0;
}

bool func_347(int iParam0, int iParam1, var uParam2, var uParam3, int iParam4, int iParam5)//Position - 0xAECA
{
	struct<4> Var0;
	char* sVar4;
	int iVar5;
	int iVar6;
	float fVar7;
	int iVar8;
	
	StringCopy(&Var0, "", 16);
	iVar6 = func_390(iParam1);
	if (iParam1 == 17)
	{
		iVar5 = true;
	}
	fVar7 = func_389();
	if (iParam1 == 23 || iParam1 == 24)
	{
		if (func_388())
		{
			if (func_387() > 0 && Global_1573687)
			{
				ui::_0x25F87B30C382FCA7();
				ui::_0x55598D21339CB998(fVar7);
				ui::hide_hud_component_this_frame(18);
				if (ui::is_help_message_being_displayed())
				{
					ui::hide_help_text_this_frame();
				}
				ui::hide_hud_component_this_frame(10);
			}
		}
	}
	if (!iParam5)
	{
		if (!func_372())
		{
			func_371(iParam0, uParam2, 1);
			return false;
		}
	}
	if (gameplay::is_bit_set(Global_2464975.f_4429, 26))
	{
		func_371(iParam0, uParam2, 1);
		return false;
	}
	if (!func_9(&(uParam2->f_19)))
	{
		if (func_387() == 1)
		{
			func_370(iVar6, iParam0, 0);
			func_8(&(uParam2->f_19), 0, 0);
			func_371(iParam0, uParam2, 0);
		}
	}
	if (func_9(&(uParam2->f_19)) || iParam5)
	{
		if (ui::is_help_message_being_displayed())
		{
			ui::hide_help_text_this_frame();
		}
		ui::hide_hud_component_this_frame(10);
		if (func_7(&(uParam2->f_19), 10000, 0) || (func_387() == 0 && !iParam5))
		{
			func_371(iParam0, uParam2, 1);
			return false;
		}
		else
		{
			if (iVar5 == 0)
			{
				func_369();
				if (iParam1 == 23 || iParam1 == 24)
				{
					ui::_0x25F87B30C382FCA7();
				}
				ui::hide_hud_component_this_frame(18);
			}
			if (gameplay::is_bit_set(uParam2->f_33, 0))
			{
				Global_1573685 = uParam3;
				Global_1573684 = 1;
				ui::_0x55598D21339CB998(fVar7);
				if (iVar5)
				{
					if (uParam2->f_34 != Global_1573686)
					{
						gameplay::clear_bit(&(uParam2->f_33), 0);
					}
				}
				return true;
			}
			else
			{
				if (iVar5 == 0)
				{
					func_369();
					if (iParam1 == 23 || iParam1 == 24)
					{
						ui::_0x25F87B30C382FCA7();
					}
					ui::hide_hud_component_this_frame(18);
				}
				ui::_0x55598D21339CB998(fVar7);
				if (func_370(iVar6, iParam0, 0))
				{
					func_338(iParam0);
					sVar4 = func_367(iParam1, &(Global_1617902.f_76925), iParam4);
					if (iParam4)
					{
						func_364(iParam0, sVar4, "", 0, -1, -1, 1);
					}
					else if (iParam1 == 23)
					{
						func_358(iParam0, func_361(uParam2), func_359(uParam2), -1);
					}
					else if (iParam1 == 24)
					{
						func_355(iParam0, func_357(), func_356(), -1);
					}
					else if (iVar5)
					{
						uParam2->f_34 = Global_1573686;
						func_364(iParam0, sVar4, "", 0, -1, Global_1573686, 1);
					}
					else
					{
						Var0 = { func_353(iParam1) };
						iVar8 = func_348(iParam1);
						func_364(iParam0, sVar4, &Var0, 1, iVar8, -1, 1);
					}
					gameplay::set_bit(&(uParam2->f_33), 0);
				}
			}
		}
	}
	return false;
}

int func_348(int iParam0)//Position - 0xB14E
{
	int iVar0;
	
	iVar0 = -1;
	if (func_352())
	{
		iVar0 = 2;
	}
	switch (iParam0)
	{
		case 0:
			iVar0 = 3;
			break;
		
		case 2:
			iVar0 = 3;
			break;
		
		case 1:
			iVar0 = 6;
			break;
		
		case 3:
			iVar0 = 5;
			break;
		
		case 22:
			iVar0 = 21;
			break;
		
		case 4:
		case 5:
		case 6:
		case 8:
			iVar0 = 4;
			break;
		
		case 7:
			iVar0 = 10;
			break;
		
		case 9:
		case 10:
		case 11:
		case 14:
			iVar0 = 2;
			break;
		
		case 12:
			iVar0 = 17;
			break;
		
		case 13:
			iVar0 = 18;
			break;
		
		case 15:
			if (func_351(player::player_id()))
			{
				iVar0 = 20;
			}
			if (func_350(player::player_id()))
			{
				iVar0 = 19;
			}
			break;
	}
	if (func_349(player::player_id()))
	{
		iVar0 = 2;
	}
	return iVar0;
}

int func_349(int iParam0)//Position - 0xB241
{
	return Global_2418529[iParam0 /*313*/].f_114 == 4;
}

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

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

int func_352()//Position - 0xB280
{
	return Global_1617902.f_1 == 0;
}

struct<4> func_353(int iParam0)//Position - 0xB290
{
	struct<4> Var0;
	
	StringCopy(&Var0, "", 16);
	if (func_354(player::player_id()) || func_349(player::player_id()))
	{
		return Var0;
	}
	switch (iParam0)
	{
		case 9:
		case 10:
		case 11:
		case 14:
		case 12:
		case 13:
		case 15:
			StringCopy(&Var0, "LBD_DIF_", 16);
			StringIntConCat(&Var0, Global_1617902.f_23, 16);
			break;
	}
	return Var0;
}

int func_354(int iParam0)//Position - 0xB309
{
	return Global_2418529[iParam0 /*313*/].f_114 == 5;
}

void func_355(int iParam0, char* sParam1, char* sParam2, int iParam3)//Position - 0xB31E
{
	if (graphics::has_scaleform_movie_loaded(*iParam0))
	{
		graphics::_push_scaleform_movie_function(*iParam0, "SET_TITLE");
		if (gameplay::is_string_null_or_empty(sParam2))
		{
			func_249(sParam1);
		}
		else
		{
			graphics::_begin_text_component("FM_AE_BRACKT");
			ui::_add_text_component_item_string(sParam1);
			ui::_add_text_component_item_string(sParam2);
			graphics::_end_text_component();
		}
		func_249("");
		if (iParam3 != -1)
		{
			graphics::_push_scaleform_movie_function_parameter_int(iParam3);
		}
		graphics::_pop_scaleform_movie_function_void();
	}
}

char* func_356()//Position - 0xB37D
{
	switch (func_331(player::player_id()))
	{
		case 163:
			return "BD_SORT_1";
			break;
		
		case 160:
			return "BD_SORT_4";
			break;
		
		case 154:
			return "BD_SORT_3";
			break;
		
		case 155:
			return "BD_SORT_3";
			break;
	}
	return "";
}

char* func_357()//Position - 0xB3D5
{
	switch (func_331(player::player_id()))
	{
		case 142:
			return "PIM_MAGM210";
			break;
		
		case 163:
			return "PIM_MAGM608";
			break;
		
		case 160:
			return "PIM_MAGM604";
			break;
		
		case 154:
			return "PIM_MAGM602";
			break;
		
		case 155:
			return "PIM_MAGM603";
			break;
		
		case 148:
			return "PIM_MAGM201";
			break;
		
		case 151:
			return "PIM_MAGM202";
			break;
		
		case 152:
			return "PIM_MAGM204";
			break;
		
		case 153:
			return "PIM_MAGM601";
			break;
		
		case 157:
			return "PIM_MAGM207";
			break;
		
		case 159:
			return "PIM_MAGM206";
			break;
		
		case 162:
			return "PIM_MAGM607";
			break;
		
		case 164:
			return "PIM_MAGM212";
			break;
		
		case 166:
			return "GB_DPAD_HEAD";
		
		case 167:
			return "GB_DPAD_BUY";
		
		case 168:
			return "GB_DPAD_SELL";
		
		case 169:
			return "GB_DPAD_DEF";
		
		case 170:
			return "GB_DPAD_AIR";
		
		case 171:
			return "GB_DPAD_CASH";
		
		case 172:
			return "GB_DPAD_SAL";
		
		case 173:
			return "GB_DPAD_FRA";
	}
	return "";
}

void func_358(int iParam0, char* sParam1, char* sParam2, int iParam3)//Position - 0xB525
{
	if (graphics::has_scaleform_movie_loaded(*iParam0))
	{
		graphics::_push_scaleform_movie_function(*iParam0, "SET_TITLE");
		if (gameplay::is_string_null_or_empty(sParam2))
		{
			func_249(sParam1);
		}
		else if (func_333(player::player_id()) == 133)
		{
			graphics::_begin_text_component("FM_AE_BRACKT_C");
			ui::_add_text_component_item_string(sParam1);
			ui::_add_text_component_item_string(sParam2);
			graphics::_end_text_component();
		}
		else
		{
			graphics::_begin_text_component("FM_AE_BRACKT");
			ui::_add_text_component_item_string(sParam1);
			ui::_add_text_component_item_string(sParam2);
			graphics::_end_text_component();
		}
		func_249("");
		if (iParam3 != -1)
		{
			graphics::_push_scaleform_movie_function_parameter_int(iParam3);
		}
		graphics::_pop_scaleform_movie_function_void();
	}
}

char* func_359(var uParam0)//Position - 0xB5AC
{
	int iVar0;
	
	iVar0 = func_333(player::player_id());
	if (func_409())
	{
		if (uParam0->f_103 != -1)
		{
			iVar0 = uParam0->f_103;
		}
	}
	switch (iVar0)
	{
		case 131:
			return "";
		
		case 132:
			return "FM_AE_SORT_5";
		
		case 133:
			switch (func_360())
			{
				case 0:
					return "FM_AE_SORT_2";
				
				case 1:
					return "FM_AE_SORT_2";
				
				case 2:
					return "FM_AE_SORT_3";
				
				case 3:
					return "FM_AE_SORT_2";
				
				case 4:
					return "FM_AE_SORT_2";
				
				case 5:
					return "FM_AE_SORT_2";
				
				case 6:
					return "FM_AE_SORT_2";
				
				case 7:
					return "FM_AE_SORT_13";
				
				case 8:
					return "FM_AE_SORT_4";
				
				case 9:
					return "FM_AE_SORT_2";
				
				case 10:
					return "FM_AE_SORT_2";
				
				case 11:
					return "FM_AE_SORT_2";
				
				case 12:
					return "FM_AE_SORT_2";
				
				case 13:
					return "FM_AE_SORT_2";
				
				case 14:
					return "FM_AE_SORT_5";
				
				case 15:
					return "FM_AE_SORT_9";
				
				case 16:
					return "FM_AE_SORT_9";
				
				case 17:
					return "FM_AE_SORT_9";
				
				case 18:
					return "FM_AE_SORT_9";
				
				default:
			}
			break;
		
		case 136:
			return "";
		
		case 138:
			return "";
		
		case 139:
			return "FM_AE_SORT_10";
		
		case 140:
			return "";
		
		case 141:
			return "FM_AE_SORT_5";
		
		case 144:
			return "FM_AE_SORT_1";
		
		case 129:
			return "FM_AE_SORT_9";
	}
	return "";
}

int func_360()//Position - 0xB757
{
	if (func_333(player::player_id()) == 133)
	{
		return Global_2464975.f_4672;
	}
	return -1;
}

char* func_361(var uParam0)//Position - 0xB77A
{
	int iVar0;
	
	iVar0 = func_333(player::player_id());
	if (func_409())
	{
		if (uParam0->f_103 != -1)
		{
			iVar0 = uParam0->f_103;
		}
	}
	switch (iVar0)
	{
		case 131:
			return "PIM_TA9";
		
		case 132:
			if (func_363() == 0)
			{
				return "CPC_TILEL";
			}
			else if (func_363() == 1)
			{
				return "CPC_TILELA";
			}
			return "PIM_TA0";
			break;
		
		case 133:
			switch (func_360())
			{
				case 0:
					return "AMCH_0SLC";
				
				case 1:
					return "AMCH_1SLC";
				
				case 2:
					return "AMCH_2SLC";
				
				case 3:
					return "AMCH_3SLC";
				
				case 4:
					return "AMCH_4SLC";
				
				case 5:
					return "AMCH_5SLC";
				
				case 6:
					return "AMCH_6SLC";
				
				case 7:
					return "AMCH_7SLC";
				
				case 8:
					return "AMCH_8SLC";
				
				case 9:
					return "AMCH_12SLC";
				
				case 10:
					return "AMCH_13SLC";
				
				case 11:
					return "AMCH_15SLC";
				
				case 12:
					return "AMCH_16SLC";
				
				case 13:
					return "AMCH_23SLC";
				
				case 14:
					return "AMCH_9SLC";
				
				case 15:
					return "AMCH_19SLC";
				
				case 16:
					return "AMCH_20SLC";
				
				case 17:
					return "AMCH_21SLC";
				
				case 18:
					return "AMCH_22SLC";
				
				default:
			}
			break;
		
		case 136:
			return "PIM_TA10";
		
		case 138:
			return "PIM_TA4";
		
		case 139:
			return "PIM_TA5";
		
		case 140:
			return "PIM_TA3";
		
		case 141:
			return "PIM_TA8";
		
		case 144:
			return "PIM_TA2";
		
		case 129:
			if (func_362() == 1)
			{
				return "FM_AE_TITL_12";
			}
			else
			{
				return "PIM_TA7";
			}
			break;
		
		case 146:
			return "PIM_TA6";
	}
	return "";
}

var func_362()//Position - 0xB96F
{
	return Global_2464975.f_4675;
}

int func_363()//Position - 0xB97E
{
	if (func_333(player::player_id()) == 132)
	{
		return Global_2464975.f_4670;
	}
	return -1;
}

void func_364(int iParam0, char* sParam1, char* sParam2, int iParam3, int iParam4, int iParam5, int iParam6)//Position - 0xB9A1
{
	int iVar0;
	int iVar1;
	
	if (graphics::has_scaleform_movie_loaded(*iParam0))
	{
		graphics::_push_scaleform_movie_function(*iParam0, "SET_TITLE");
		if (iParam3)
		{
			func_300(sParam1);
		}
		else if (iParam5 != -1)
		{
			graphics::_begin_text_component(sParam1);
			ui::add_text_component_integer(iParam5);
			graphics::_end_text_component();
		}
		else
		{
			func_249(sParam1);
		}
		if (func_388() && iParam6)
		{
			if (func_366())
			{
				iVar0 = 2;
				iVar1 = 2;
			}
			else
			{
				iVar0 = 1;
				iVar1 = 2;
			}
			graphics::_begin_text_component("LBD_DPD_CNT");
			ui::add_text_component_integer(iVar0);
			ui::add_text_component_integer(iVar1);
			graphics::_end_text_component();
		}
		else
		{
			func_249(sParam2);
		}
		if (iParam4 != -1)
		{
			graphics::_push_scaleform_movie_function_parameter_int(iParam4);
			if (func_365(player::player_id()))
			{
				graphics::_push_scaleform_movie_function_parameter_int(166);
			}
		}
		graphics::_pop_scaleform_movie_function_void();
	}
}

bool func_365(int iParam0)//Position - 0xBA52
{
	if (func_351(iParam0) || func_350(iParam0))
	{
		return true;
	}
	return false;
}

var func_366()//Position - 0xBA74
{
	return Global_1573687;
}

char* func_367(int iParam0, char* sParam1, int iParam2)//Position - 0xBA80
{
	var uVar0;
	
	if (iParam0 == 17)
	{
		uVar0 = func_368();
		return uVar0;
	}
	else if (iParam2)
	{
		return "HUD_LBD_IMP";
	}
	else if (iParam0 == 21)
	{
		if (Global_1573851 == 0)
		{
			Global_1573851 = 1;
		}
		return "HUD_LBD_OVR";
	}
	else if (!gameplay::is_string_null_or_empty(sParam1))
	{
		if (Global_1573851 == 1)
		{
			Global_1573851 = 0;
		}
		return sParam1;
	}
	else
	{
		if (Global_1573851 == 0)
		{
			Global_1573851 = 1;
		}
		switch (iParam0)
		{
			case 0:
				return "HUD_LBD_DM";
				break;
			
			case 1:
				return "HUD_LBD_TDM";
				break;
			
			case 5:
				return "HUD_LBD_GRCE";
				break;
			
			case 4:
			case 6:
			case 22:
				return "HUD_LBD_RCE";
				break;
			
			case 7:
				return "HUD_LBD_BRCE";
				break;
			
			case 15:
			case 11:
			case 14:
			case 12:
			case 10:
			case 9:
			case 13:
			case 16:
				return "HUD_TITLEMC";
				break;
			
			case 3:
				return "HUD_LBD_HRD";
				break;
			
			case 18:
				return "HUD_LBD_SHOO";
				break;
			}
	}
	return sParam1;
}

char* func_368()//Position - 0xBBB5
{
	if (network::_0xFBCFA2EA2E206890())
	{
		return "HUD_LBD_FMF";
	}
	if (network::_0x74732C6CA90DA2B4())
	{
		return "HUD_LBD_FMC";
	}
	if (network::_0xF3929C2379B60CCE())
	{
		return "HUD_LBD_FMS";
	}
	if (network::_0xCEF70AA5B3F89BA1())
	{
		return "HUD_LBD_FMI";
	}
	return "HUD_LBD_FMP";
}

void func_369()//Position - 0xBBF9
{
	Global_36642 = 1;
}

int func_370(int iParam0, int iParam1, int iParam2)//Position - 0xBC05
{
	if (iParam0)
	{
		*iParam1 = unk_0x67D02A194A2FC2BD("mp_mm_card_freemode");
	}
	else if (iParam2)
	{
		*iParam1 = unk_0x67D02A194A2FC2BD("MP_SPECTATOR_CARD");
	}
	else
	{
		*iParam1 = unk_0x67D02A194A2FC2BD("mp_matchmaking_card");
	}
	return graphics::has_scaleform_movie_loaded(*iParam1);
}

void func_371(int iParam0, var uParam1, int iParam2)//Position - 0xBC45
{
	gameplay::clear_bit(&(uParam1->f_33), 7);
	Global_1573685 = 0;
	func_292();
	Global_1573684 = 0;
	uParam1->f_27 = 0;
	if (iParam2)
	{
		if (func_9(&(uParam1->f_19)))
		{
			func_6(&(uParam1->f_19));
		}
	}
	if (graphics::has_scaleform_movie_loaded(*iParam0))
	{
		graphics::set_scaleform_movie_as_no_longer_needed(iParam0);
	}
	if (gameplay::is_bit_set(uParam1->f_33, 0))
	{
		gameplay::clear_bit(&(uParam1->f_33), 0);
	}
	ui::_0x55598D21339CB998(0f);
}

bool func_372()//Position - 0xBCAB
{
	if (func_386())
	{
		return false;
	}
	if (func_385())
	{
		return false;
	}
	if (!func_383())
	{
		return false;
	}
	if (!func_381())
	{
		return false;
	}
	if (func_380(8, -1))
	{
		return false;
	}
	if (func_387() == 2)
	{
		return false;
	}
	if (Global_2464975.f_4404)
	{
		return false;
	}
	if (func_237())
	{
		return false;
	}
	else if (!func_377(player::player_id(), 1) && Global_1311716[0 /*4*/] > 0)
	{
		return false;
	}
	if (((func_376(1) || func_374(1)) || Global_17118.f_124) || Global_17118)
	{
		return false;
	}
	if (ui::is_pause_menu_active())
	{
		return false;
	}
	if (func_132(player::player_id()))
	{
		return false;
	}
	if (Global_1722816)
	{
		return false;
	}
	if (Global_1722819)
	{
		return false;
	}
	if (func_373(0))
	{
		return false;
	}
	if (gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_250.f_7, 4))
	{
		return false;
	}
	return true;
}

int func_373(int iParam0)//Position - 0xBDB9
{
	return gameplay::is_bit_set(Global_2464975.f_4685.f_18, iParam0);
}

bool func_374(int iParam0)//Position - 0xBDD0
{
	if (controls::_0xFC859E2374407556())
	{
		if (!ped::is_ped_injured(player::player_ped_id()))
		{
			if (func_375(player::player_ped_id()))
			{
				if (controls::is_control_pressed(0, 25) || controls::is_control_pressed(0, 68))
				{
					return false;
				}
			}
		}
	}
	if (Global_17118.f_130)
	{
		return false;
	}
	if (controls::is_control_pressed(0, 19) || (!iParam0 && controls::is_disabled_control_pressed(0, 19)))
	{
		return true;
	}
	if (gameplay::is_pc_version())
	{
		if (((controls::is_control_pressed(0, 166) || controls::is_control_pressed(0, 167)) || controls::is_control_pressed(0, 168)) || controls::is_control_pressed(0, 169))
		{
			return true;
		}
		if (!iParam0)
		{
			if (((controls::is_disabled_control_pressed(0, 166) || controls::is_disabled_control_pressed(0, 167)) || controls::is_disabled_control_pressed(0, 168)) || controls::is_disabled_control_pressed(0, 169))
			{
				return true;
			}
		}
	}
	return false;
}

bool func_375(int iParam0)//Position - 0xBEBB
{
	int iVar0;
	
	if (cam::is_first_person_aim_cam_active())
	{
		if (!ped::is_ped_injured(iParam0))
		{
			weapon::get_current_ped_weapon(iParam0, &iVar0, 1);
			if ((iVar0 == joaat("weapon_sniperrifle") || iVar0 == joaat("weapon_heavysniper")) || iVar0 == joaat("weapon_marksmanrifle"))
			{
				return true;
			}
		}
	}
	return false;
}

int func_376(int iParam0)//Position - 0xBF0A
{
	if (iParam0)
	{
		return (Global_17118.f_4 && Global_17118.f_104 == 4);
	}
	return Global_17118.f_4;
}

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

int func_378(int iParam0)//Position - 0xBF5F
{
	return func_379(iParam0);
}

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

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

bool func_381()//Position - 0xBFC2
{
	if (func_382() == 0)
	{
		return true;
	}
	return false;
}

var func_382()//Position - 0xBFD7
{
	return Global_1312466.f_18;
}

bool func_383()//Position - 0xBFE5
{
	if (func_384())
	{
		return true;
	}
	if (cam::is_screen_faded_out())
	{
		return false;
	}
	if (cam::is_screen_fading_out() || cam::is_screen_fading_in())
	{
		return false;
	}
	if (gameplay::is_frontend_fading())
	{
		return false;
	}
	return true;
}

var func_384()//Position - 0xC024
{
	return Global_1312438;
}

int func_385()//Position - 0xC030
{
	return Global_1587816[player::player_id() /*444*/] == 5;
}

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

var func_387()//Position - 0xC05A
{
	return Global_1338622.f_68;
}

bool func_388()//Position - 0xC068
{
	if (Global_1573686 > 16)
	{
		return true;
	}
	return false;
}

float func_389()//Position - 0xC07E
{
	float fVar0;
	float fVar1;
	float fVar2;
	
	fVar2 = 0.6347182f;
	fVar1 = (1f - (1f - graphics::get_safe_zone_size()));
	fVar0 = (1f - (fVar1 - fVar2));
	return fVar0;
}

bool func_390(int iParam0)//Position - 0xC0A2
{
	switch (iParam0)
	{
		case 17:
		case 23:
		case 24:
			return true;
			break;
	}
	return false;
}

bool func_391()//Position - 0xC0CB
{
	if (func_410())
	{
		return true;
	}
	if (func_225(player::player_id()))
	{
		return false;
	}
	if (func_409())
	{
		return true;
	}
	if (func_307(player::player_id()))
	{
		switch (func_333(player::player_id()))
		{
			case 131:
			case 132:
			case 133:
			case 136:
			case 138:
			case 139:
			case 141:
			case 144:
			case 146:
				return true;
				break;
			
			case 140:
				if (!func_84(player::player_id()))
				{
					return true;
				}
				break;
			
			case 129:
				if (!func_84(player::player_id()))
				{
					return true;
				}
				break;
			
			case 174:
				if (!func_84(player::player_id()))
				{
					return true;
				}
				break;
			
			case 175:
				return true;
				break;
			}
	}
	return false;
}

bool func_392(int iParam0)//Position - 0xC1A6
{
	if ((iParam0 == 24 && func_307(player::player_id())) && !func_306(player::player_id()))
	{
		return true;
	}
	if (iParam0 == 23)
	{
		if (func_332(player::player_id(), 0) && func_306(player::player_id()))
		{
			return true;
		}
		if (func_393(player::player_id()) == 3)
		{
			return true;
		}
	}
	return false;
}

int func_393(int iParam0)//Position - 0xC20A
{
	int iVar0;
	int iVar1;
	int iVar2;
	var uVar3;
	var uVar4;
	
	iVar0 = 2;
	iVar1 = ((func_307(iParam0) && !func_51(iParam0)) && !gameplay::is_bit_set(Global_1610705[iParam0 /*178*/].f_1, 8));
	iVar2 = func_306(iParam0);
	uVar3 = func_406();
	uVar4 = func_398();
	if ((iVar1 && (func_397(iParam0) || func_396(iParam0))) || uVar4)
	{
		iVar0 = 0;
	}
	else if (uVar3 || ((!iVar2 && !func_395(iParam0)) && !func_394(iParam0)))
	{
		iVar0 = 2;
	}
	else
	{
		iVar0 = 3;
	}
	if (Global_2464975.f_4685.f_22 != iVar0)
	{
		Global_2464975.f_4685.f_22 = iVar0;
	}
	return iVar0;
}

int func_394(int iParam0)//Position - 0xC2C7
{
	return func_139(iParam0, 19);
}

int func_395(int iParam0)//Position - 0xC2D7
{
	int iVar0;
	
	iVar0 = iParam0;
	if (iVar0 != -1)
	{
		return func_139(iParam0, 9);
	}
	return false;
}

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

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

bool func_398()//Position - 0xC33F
{
	if ((func_139(player::player_id(), 21) || func_139(player::player_id(), 22)) || func_404())
	{
		return true;
	}
	if (func_400())
	{
		func_399(22);
		return true;
	}
	return false;
}

void func_399(int iParam0)//Position - 0xC384
{
	gameplay::set_bit(&(Global_1610705[player::player_id() /*178*/].f_10.f_4), iParam0);
}

bool func_400()//Position - 0xC3A0
{
	if (func_332(player::player_id(), 0))
	{
		if ((func_406() && !func_403()) || func_402(player::player_id(), 21))
		{
			if (!func_139(player::player_id(), 27))
			{
				return true;
			}
		}
		else
		{
			func_401(27);
		}
	}
	return false;
}

void func_401(int iParam0)//Position - 0xC3F1
{
	gameplay::clear_bit(&(Global_1610705[player::player_id() /*178*/].f_10.f_4), iParam0);
}

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

var func_403()//Position - 0xC426
{
	return Global_1312416.f_1;
}

int func_404()//Position - 0xC434
{
	return func_405(284, -1);
}

int func_405(int iParam0, int iParam1)//Position - 0xC444
{
	int iVar0;
	var uVar1;
	
	iVar0 = Global_2494881[iParam0 /*5*/][func_96(iParam1)];
	if (stats::stat_get_bool(iVar0, &uVar1, -1))
	{
		return uVar1;
	}
	return 0;
}

var func_406()//Position - 0xC470
{
	return Global_1312416;
}

void func_407(int iParam0, int iParam1)//Position - 0xC47C
{
	if (iParam0)
	{
		if (!Global_1587815)
		{
			if (!func_642(0) && !func_642(func_408(iParam1)))
			{
				Global_1587815 = 1;
			}
		}
	}
	else if (Global_1587815)
	{
		Global_1587815 = 0;
	}
}

int func_408(int iParam0)//Position - 0xC4BE
{
	switch (iParam0)
	{
		case 131:
			return 10;
		
		case 132:
			return 1;
		
		case 133:
			return 2;
		
		case 136:
			return 11;
		
		case 138:
			return 5;
		
		case 139:
			return 6;
		
		case 129:
			return 8;
		
		case 140:
			return 4;
		
		case 141:
			return 9;
		
		case 144:
			return 3;
		
		case 146:
			return 7;
		
		default:
	}
	return 12;
}

var func_409()//Position - 0xC541
{
	return Global_1587815;
}

int func_410()//Position - 0xC54D
{
	if (func_411(player::player_id()))
	{
		return Global_1318849;
	}
	return 0;
}

int func_411(int iParam0)//Position - 0xC568
{
	if (network::network_is_game_in_progress())
	{
		if (func_52(iParam0, 0))
		{
			return network::network_player_is_rockstar_dev(iParam0);
		}
	}
	return false;
}

void func_412()//Position - 0xC58B
{
	int iVar0;
	vector3 vVar1;
	int iVar4;
	int iVar5;
	
	iVar4 = true;
	iVar5 = true;
	if (iLocal_3785 == 1 && !func_237())
	{
		func_467(&vLocal_3044);
	}
	switch (iLocal_3785)
	{
		case 0:
			if (func_466())
			{
				iLocal_3785++;
			}
			break;
		
		case 1:
			iVar0 = player::get_player_ped(Local_96.f_182.f_7);
			if (entity::does_entity_exist(iVar0) && !entity::is_entity_dead(iVar0, 0))
			{
				vVar1 = { entity::get_entity_coords(iVar0, 1) };
				vLocal_3044.f_2 = { vVar1 };
			}
			else if (!func_21(vLocal_3044.f_2))
			{
				vVar1 = { vLocal_3044.f_2 };
			}
			vLocal_3044.y = network::net_to_ent(Local_96.f_182.f_2);
			if (entity::does_entity_exist(vLocal_3044.y))
			{
				if (!entity::is_entity_dead(vLocal_3044.y, 0))
				{
					if (!func_457())
					{
						if (func_21(vLocal_3780))
						{
							if (entity::does_entity_exist(player::player_ped_id()))
							{
								if (!entity::is_entity_dead(player::player_ped_id(), 0))
								{
									vLocal_3780 = { entity::get_entity_coords(player::player_ped_id(), 1) };
									fLocal_3783 = entity::get_entity_heading(player::player_ped_id());
								}
							}
						}
					}
					network::set_entity_locally_invisible(vLocal_3044.y);
					if (Global_2418529[player::player_id() /*313*/].f_220 == 99)
					{
						if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 11))
						{
							graphics::set_nightvision(false);
							if (!unk_0xC2D2AD9EAAE265B8())
							{
								unk_0xCD74233600C4EA6B(1);
							}
							network::_0x267C78C60E806B9A(vLocal_3044.y, 1);
							entity::attach_entity_to_entity(player::player_ped_id(), vLocal_3044.y, entity::get_entity_bone_index_by_name(vLocal_3044.y, "chassis"), 0f, 0f, 0f, 0f, 0f, 0f, 0, 0, 0, 0, 2, 1);
							gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 11);
							gameplay::set_bit(&(Global_2418529[player::player_id() /*313*/].f_194), 2);
							gameplay::set_bit(&(Global_1610705[player::player_id() /*178*/].f_1), 14);
							func_456(player::player_id(), 0);
							func_452();
						}
						if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 12))
						{
							func_448(player::player_id(), 0, 8192);
							entity::set_entity_invincible(player::player_ped_id(), true);
							gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 12);
						}
						func_441();
						func_439();
						if (func_457())
						{
							func_448(player::player_id(), 1, 0);
							iLocal_3785++;
						}
						else
						{
							func_422(&(Local_96.f_182), &vLocal_3044, vLocal_3044.y, vVar1, iVar5, iVar4);
							if (iVar4)
							{
								if (!gameplay::is_bit_set(iLocal_550, 18) && func_415(0, 1, 1, 0))
								{
									func_414("SCTV_HELI_HLP", 30000);
									func_413(0);
									gameplay::set_bit(&iLocal_550, 18);
								}
							}
						}
					}
				}
			}
			break;
		
		case 2:
			break;
	}
}

void func_413(int iParam0)//Position - 0xC80D
{
	unk_0xB9C362BABECDDC7A(3, 21, 200, 0, 0);
	if (iParam0 && !func_342())
	{
		audio::play_sound_frontend(-1, "Event_Message_Purple", "GTAO_FM_Events_Soundset", 0);
	}
}

void func_414(char* sParam0, int iParam1)//Position - 0xC83C
{
	ui::_set_text_component_format(sParam0);
	ui::_display_help_text_from_string_label(0, 0, false, iParam1);
}

bool func_415(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0xC853
{
	if (iParam2 && ui::is_help_message_being_displayed())
	{
		return false;
	}
	if (func_421())
	{
		return false;
	}
	if (!cam::is_screen_faded_in())
	{
		return false;
	}
	if (func_386())
	{
		return false;
	}
	if (func_420())
	{
		return false;
	}
	if (iParam1)
	{
		if (func_377(player::player_id(), 1))
		{
			return false;
		}
	}
	if (iParam0)
	{
		if (func_419(player::player_id()))
		{
			return false;
		}
	}
	if (func_418())
	{
		return false;
	}
	if (ped::is_ped_injured(player::player_ped_id()))
	{
		return false;
	}
	if (ui::is_pause_menu_active())
	{
		return false;
	}
	if (iParam3)
	{
		if (!player::is_player_control_on(player::player_id()))
		{
			return false;
		}
	}
	if (Global_1573684)
	{
		return false;
	}
	if (func_417())
	{
		return false;
	}
	if (func_416())
	{
		return false;
	}
	if (func_237())
	{
		return false;
	}
	if (Global_68089)
	{
		return false;
	}
	if (Global_2472483)
	{
		return false;
	}
	return true;
}

var func_416()//Position - 0xC940
{
	return Global_2434839.f_568;
}

var func_417()//Position - 0xC94F
{
	return Global_2434839.f_720;
}

var func_418()//Position - 0xC95E
{
	return Global_2428549.f_2482.f_585;
}

bool func_419(int iParam0)//Position - 0xC970
{
	if (Global_2418529[iParam0 /*313*/].f_206 == 0)
	{
		return false;
	}
	return true;
}

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

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

void func_422(var uParam0, var uParam1, int iParam2, vector3 vParam3, int iParam6, int iParam7)//Position - 0xC9CA
{
	switch (func_438(uParam1))
	{
		case 0:
			if (func_437() || iParam6)
			{
				func_436(uParam1, 1);
			}
			break;
		
		case 1:
			if (!cam::does_cam_exist(*uParam1))
			{
				*uParam1 = cam::create_cam("default_scripted_camera", false);
			}
			else
			{
				interior::_0x23B59D8912F94246();
				cam::attach_cam_to_entity(*uParam1, iParam2, 0f, 2.75f, -1.25f, 1);
				cam::set_cam_active(*uParam1, true);
				cam::render_script_cams(true, false, 3000, 1, 0, 0);
				func_12(1);
				func_436(uParam1, 2);
			}
			break;
		
		case 2:
			if (cam::does_cam_exist(*uParam1))
			{
				if (!cam::is_cam_active(*uParam1))
				{
					cam::attach_cam_to_entity(*uParam1, iParam2, 0f, 2.75f, -1.25f, 1);
					cam::set_cam_active(*uParam1, true);
					cam::render_script_cams(true, false, 3000, 1, 0, 0);
				}
				else
				{
					cam::point_cam_at_coord(*uParam1, vParam3);
				}
				if (iParam7)
				{
					func_423(uParam1);
				}
				if (func_437() && !iParam6)
				{
					func_275(uParam0, 1, 1, 1);
					func_436(uParam1, 0);
				}
			}
			else
			{
				func_436(uParam1, 0);
			}
			break;
		
		default:
			break;
	}
}

void func_423(var uParam0)//Position - 0xCAE4
{
	struct<9> Var0;
	
	Var0 = { func_435() };
	if (func_433(0, -1, 0))
	{
		switch (uParam0->f_694)
		{
			case 0:
				func_431(&(uParam0->f_7));
				func_430(2, 202, "HUD_QUIT", &(uParam0->f_7), 1, 345);
				uParam0->f_694++;
				break;
			
			case 1:
				func_424(&(uParam0->f_6), &Var0, &(uParam0->f_7), 0);
				break;
			}
	}
}

void func_424(var uParam0, var uParam1, var uParam2, int iParam3)//Position - 0xCB51
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	
	if (iParam3 == 1 || controls::_0x6CD79468A1E595C6(2))
	{
		*uParam2 = 0;
		if (graphics::has_scaleform_movie_loaded(*uParam0))
		{
			if (gameplay::is_pc_version())
			{
				graphics::_push_scaleform_movie_function(*uParam0, "TOGGLE_MOUSE_BUTTONS");
				graphics::_push_scaleform_movie_function_parameter_bool(false);
				graphics::_pop_scaleform_movie_function_void();
			}
			graphics::_push_scaleform_movie_function(*uParam0, "CLEAR_ALL");
			graphics::_pop_scaleform_movie_function_void();
		}
		func_429(uParam2);
	}
	if (Global_1318755 < 2)
	{
		func_428(1);
	}
	if (*uParam2 == 0)
	{
		if (!graphics::has_scaleform_movie_loaded(*uParam0))
		{
			*uParam0 = unk_0x67D02A194A2FC2BD("instructional_buttons");
		}
		if (graphics::has_scaleform_movie_loaded(*uParam0))
		{
			graphics::call_scaleform_movie_method(*uParam0, "CLEAR_ALL");
			if (gameplay::is_pc_version())
			{
				graphics::_push_scaleform_movie_function(*uParam0, "TOGGLE_MOUSE_BUTTONS");
				graphics::_push_scaleform_movie_function_parameter_bool(true);
				graphics::_pop_scaleform_movie_function_void();
			}
			iVar0 = 0;
			iVar0 = 0;
			while (iVar0 < uParam2->f_680)
			{
				if (gameplay::is_bit_set(uParam2->f_676, iVar0))
				{
					graphics::_push_scaleform_movie_function(*uParam0, "SET_DATA_SLOT");
					graphics::_push_scaleform_movie_function_parameter_int(iVar0);
					if (!gameplay::is_bit_set(uParam2->f_677, iVar0))
					{
						iVar1 = uParam2->f_1[iVar0 /*56*/].f_53;
						iVar2 = uParam2->f_1[iVar0 /*56*/].f_54;
						iVar3 = uParam2->f_1[iVar0 /*56*/].f_55;
						func_427(controls::_get_control_action_name(iVar1, iVar2, true));
						if (iVar3 < 345)
						{
							func_427(controls::_get_control_action_name(iVar1, iVar3, true));
						}
					}
					else
					{
						iVar4 = uParam2->f_1[iVar0 /*56*/].f_53;
						iVar5 = uParam2->f_1[iVar0 /*56*/].f_54;
						func_427(controls::_0x80C2FD58D720C801(iVar4, iVar5, true));
					}
					if (gameplay::is_bit_set(uParam2->f_674, iVar0))
					{
						graphics::_begin_text_component(&(uParam2->f_1[iVar0 /*56*/].f_32));
						if (uParam2->f_681 == iVar0)
						{
							ui::add_text_component_substring_time(uParam2->f_1[iVar0 /*56*/].f_36, 70);
						}
						else
						{
							ui::add_text_component_integer(uParam2->f_1[iVar0 /*56*/].f_36);
						}
						graphics::_end_text_component();
					}
					else if (gameplay::is_bit_set(uParam2->f_675, iVar0))
					{
						graphics::_begin_text_component(&(uParam2->f_1[iVar0 /*56*/].f_32));
						ui::add_text_component_substring_player_name(&(uParam2->f_1[iVar0 /*56*/].f_37));
						graphics::_end_text_component();
					}
					else
					{
						func_249(&(uParam2->f_1[iVar0 /*56*/].f_32));
					}
					if (gameplay::is_pc_version())
					{
						if (gameplay::is_bit_set(uParam2->f_678, iVar0))
						{
							graphics::_push_scaleform_movie_function_parameter_bool(true);
							graphics::_push_scaleform_movie_function_parameter_int(uParam2->f_1[iVar0 /*56*/].f_54);
						}
						else
						{
							graphics::_push_scaleform_movie_function_parameter_bool(false);
							graphics::_push_scaleform_movie_function_parameter_int(345);
						}
					}
					graphics::_pop_scaleform_movie_function_void();
				}
				else
				{
					graphics::_push_scaleform_movie_function(*uParam0, "SET_DATA_SLOT");
					graphics::_push_scaleform_movie_function_parameter_int(iVar0);
					func_427(&(uParam2->f_1[iVar0 /*56*/]));
					if (!gameplay::is_string_null_or_empty(&(uParam2->f_1[iVar0 /*56*/].f_16)))
					{
						func_427(&(uParam2->f_1[iVar0 /*56*/].f_16));
					}
					if (gameplay::is_bit_set(uParam2->f_674, iVar0))
					{
						graphics::_begin_text_component(&(uParam2->f_1[iVar0 /*56*/].f_32));
						if (uParam2->f_681 == iVar0)
						{
							ui::add_text_component_substring_time(uParam2->f_1[iVar0 /*56*/].f_36, 70);
						}
						else
						{
							ui::add_text_component_integer(uParam2->f_1[iVar0 /*56*/].f_36);
						}
						graphics::_end_text_component();
					}
					else if (gameplay::is_bit_set(uParam2->f_675, iVar0))
					{
						graphics::_begin_text_component(&(uParam2->f_1[iVar0 /*56*/].f_32));
						ui::add_text_component_substring_player_name(&(uParam2->f_1[iVar0 /*56*/].f_37));
						graphics::_end_text_component();
					}
					else
					{
						func_249(&(uParam2->f_1[iVar0 /*56*/].f_32));
					}
					if (gameplay::is_pc_version())
					{
						graphics::_push_scaleform_movie_function_parameter_bool(false);
						graphics::_push_scaleform_movie_function_parameter_int(345);
					}
					graphics::_pop_scaleform_movie_function_void();
				}
				iVar0++;
			}
			graphics::_push_scaleform_movie_function(*uParam0, "SET_MAX_WIDTH");
			graphics::_push_scaleform_movie_function_parameter_float(uParam2->f_686);
			graphics::_pop_scaleform_movie_function_void();
			graphics::_push_scaleform_movie_function(*uParam0, "DRAW_INSTRUCTIONAL_BUTTONS");
			graphics::_push_scaleform_movie_function_parameter_int(0);
			graphics::_pop_scaleform_movie_function_void();
			*uParam2 = 1;
		}
	}
	uParam2->f_682 = 0.05f;
	uParam2->f_683 = 0.045f;
	uParam2->f_684 = 0f;
	uParam2->f_685 = 0f;
	if (*uParam2 == 1)
	{
		func_426(*uParam0, uParam1);
	}
	func_425();
}

void func_425()//Position - 0xCECF
{
	ui::hide_hud_component_this_frame(7);
	ui::hide_hud_component_this_frame(6);
	ui::hide_hud_component_this_frame(8);
	ui::hide_hud_component_this_frame(9);
}

void func_426(int iParam0, var uParam1)//Position - 0xCEED
{
	graphics::draw_scaleform_movie_fullscreen(iParam0, uParam1->f_4, uParam1->f_5, uParam1->f_6, uParam1->f_7, 0);
}

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

void func_428(int iParam0)//Position - 0xCF1A
{
	Global_1318755 = iParam0;
}

void func_429(var uParam0)//Position - 0xCF28
{
	uParam0->f_679 = 0;
}

void func_430(int iParam0, int iParam1, char* sParam2, var uParam3, int iParam4, int iParam5)//Position - 0xCF36
{
	int iVar0;
	
	if (uParam3->f_680 >= 12)
	{
		return;
	}
	iVar0 = uParam3->f_680;
	StringCopy(&(uParam3->f_1[iVar0 /*56*/].f_32), sParam2, 16);
	gameplay::set_bit(&(uParam3->f_676), iVar0);
	uParam3->f_1[iVar0 /*56*/].f_53 = iParam0;
	uParam3->f_1[iVar0 /*56*/].f_54 = iParam1;
	uParam3->f_1[iVar0 /*56*/].f_55 = iParam5;
	if (iParam4)
	{
		gameplay::set_bit(&(uParam3->f_678), iVar0);
		if (iParam5 < 345)
		{
		}
	}
	uParam3->f_680++;
}

void func_431(var uParam0)//Position - 0xCFB3
{
	func_432(uParam0);
	uParam0->f_679 = 1;
}

void func_432(var uParam0)//Position - 0xCFC7
{
	int iVar0;
	
	*uParam0 = 0;
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < 12)
	{
		StringCopy(&(uParam0->f_1[iVar0 /*56*/]), "", 64);
		StringCopy(&(uParam0->f_1[iVar0 /*56*/].f_16), "", 64);
		StringCopy(&(uParam0->f_1[iVar0 /*56*/].f_32), "", 16);
		uParam0->f_1[iVar0 /*56*/].f_36 = 0;
		StringCopy(&(uParam0->f_1[iVar0 /*56*/].f_37), "", 64);
		uParam0->f_1[iVar0 /*56*/].f_53 = 2;
		uParam0->f_1[iVar0 /*56*/].f_54 = 345;
		uParam0->f_1[iVar0 /*56*/].f_55 = 345;
		iVar0++;
	}
	uParam0->f_674 = 0;
	uParam0->f_675 = 0;
	uParam0->f_676 = 0;
	uParam0->f_678 = 0;
	uParam0->f_677 = 0;
	uParam0->f_679 = 0;
	uParam0->f_680 = 0;
	uParam0->f_682 = 0f;
	uParam0->f_683 = 0f;
	uParam0->f_684 = 0f;
	uParam0->f_685 = 0f;
	uParam0->f_686 = 1f;
}

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

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

struct<9> func_435()//Position - 0xD233
{
	struct<9> Var0;
	
	Var0 = 0.5f;
	Var0.f_1 = 0.5f;
	Var0.f_2 = 1f;
	Var0.f_3 = 1f;
	Var0.f_4 = 255;
	Var0.f_5 = 255;
	Var0.f_6 = 255;
	Var0.f_7 = 200;
	Var0.f_8 = 0f;
	return Var0;
}

void func_436(var uParam0, int iParam1)//Position - 0xD277
{
	uParam0->f_5 = iParam1;
}

bool func_437()//Position - 0xD285
{
	if ((!controls::_is_input_disabled(2) && controls::is_disabled_control_just_pressed(2, 231)) || (controls::_is_input_disabled(2) && controls::is_disabled_control_just_pressed(2, 44)))
	{
		return true;
	}
	return false;
}

var func_438(var uParam0)//Position - 0xD2BE
{
	return uParam0->f_5;
}

void func_439()//Position - 0xD2CA
{
	unk1::_0xEB2D525B57F42B40();
	func_440();
}

void func_440()//Position - 0xD2DA
{
	Global_17118.f_134 = 1;
}

void func_441()//Position - 0xD2E8
{
	func_447();
	func_442();
	ui::hide_hud_and_radar_this_frame();
	ui::hide_scripted_hud_component_this_frame(19);
}

void func_442()//Position - 0xD302
{
	if (!Global_14413.f_1 == 1)
	{
		if (func_446(0))
		{
			func_443(0);
		}
		gameplay::set_bit(&Global_2284, 2);
	}
}

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

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

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

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

void func_447()//Position - 0xD48F
{
	Global_2428549.f_648.f_10 = 1;
}

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

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

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

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

void func_452()//Position - 0xD8E4
{
	if (func_455() || func_454())
	{
		func_453();
	}
}

void func_453()//Position - 0xD901
{
	Global_2434839.f_632 = 1;
}

var func_454()//Position - 0xD911
{
	return Global_2434839.f_611;
}

int func_455()//Position - 0xD920
{
	return gameplay::is_bit_set(Global_2434839.f_2, 11);
}

void func_456(int iParam0, int iParam1)//Position - 0xD934
{
	int iVar0;
	
	iVar0 = 0;
	if (decorator::decor_exist_on(player::get_player_ped_script_index(iParam0), "MPBitset"))
	{
		iVar0 = decorator::decor_get_int(player::get_player_ped_script_index(iParam0), "MPBitset");
	}
	gameplay::set_bit(&iVar0, iParam1);
	decorator::decor_set_int(player::get_player_ped_script_index(iParam0), "MPBitset", iVar0);
}

bool func_457()//Position - 0xD979
{
	if (func_465(&vLocal_3044))
	{
		return true;
	}
	if (gameplay::is_bit_set(Local_96.f_1, 3))
	{
		return true;
	}
	if (gameplay::is_bit_set(Local_96.f_1, 5))
	{
		return true;
	}
	if (func_458())
	{
		return true;
	}
	if (func_615(0))
	{
		return true;
	}
	if (func_52(player::player_id(), 0))
	{
		return true;
	}
	if (Local_96.f_182.f_7 == func_58())
	{
		return true;
	}
	return false;
}

bool func_458()//Position - 0xD9E8
{
	if (gameplay::is_bit_set(Global_2464975.f_357.f_5, 0))
	{
		return true;
	}
	if (func_460() && Global_1587816[player::player_id() /*444*/].f_87 != 3)
	{
		return true;
	}
	if (func_459() && Global_1587816[player::player_id() /*444*/].f_87 != 3)
	{
		return true;
	}
	if (Global_2394716)
	{
		return true;
	}
	if (Global_1573903.f_20)
	{
		return true;
	}
	return false;
}

int func_459()//Position - 0xDA5C
{
	return gameplay::is_bit_set(Global_2434839, 5);
}

bool func_460()//Position - 0xDA6D
{
	if (((func_464() || func_463()) || func_462()) || func_461())
	{
		return true;
	}
	return false;
}

int func_461()//Position - 0xDA9F
{
	return gameplay::is_bit_set(Global_2434839, 1);
}

int func_462()//Position - 0xDAB0
{
	return gameplay::is_bit_set(Global_2434839, 2);
}

int func_463()//Position - 0xDAC1
{
	return gameplay::is_bit_set(Global_2434839, 20);
}

var func_464()//Position - 0xDAD3
{
	return Global_2434839.f_575;
}

int func_465(var uParam0)//Position - 0xDAE2
{
	return gameplay::is_bit_set(uParam0->f_696, 2);
}

bool func_466()//Position - 0xDAF4
{
	if (!func_10(&(Local_96.f_182)))
	{
		return false;
	}
	if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 0))
	{
		return false;
	}
	if (Local_292[network::participant_id_to_int() /*8*/].f_7 < 3)
	{
		return false;
	}
	if (!func_694(player::player_id(), 1, 1))
	{
		return false;
	}
	if (gameplay::is_bit_set(Local_96.f_1, 3))
	{
		return false;
	}
	if (gameplay::is_bit_set(Local_96.f_1, 5))
	{
		return false;
	}
	if (gameplay::is_bit_set(Local_96.f_1, 12))
	{
		return false;
	}
	if (Local_96.f_182.f_7 == func_58())
	{
		return false;
	}
	if (!func_694(Local_96.f_182.f_7, 1, 1))
	{
		return false;
	}
	if (Local_96.f_182.f_7 == player::player_id())
	{
		return false;
	}
	if (!gameplay::is_bit_set(iLocal_550, 21))
	{
		return false;
	}
	if (func_237())
	{
		return false;
	}
	if (entity::is_entity_attached_to_any_vehicle(player::player_ped_id()))
	{
		return false;
	}
	if (Local_96.f_163 < 2)
	{
		return false;
	}
	return true;
}

void func_467(var uParam0)//Position - 0xDBE8
{
	if (!gameplay::is_bit_set(uParam0->f_696, 2))
	{
		switch (uParam0->f_695)
		{
			case 0:
				if (!ui::is_pause_menu_active())
				{
					if (func_470(uParam0))
					{
						func_469(uParam0);
						ui::_set_warning_message_2("SPEC_LEAVE", "SPEC_SURE", 36, 0, 0, -1, 0, 0, 1);
						if (controls::is_disabled_control_just_pressed(2, 201))
						{
							audio::play_sound_frontend(-1, "EXIT", "HUD_FRONTEND_DEFAULT_SOUNDSET", 1);
							uParam0->f_695++;
						}
					}
					else
					{
						func_468(uParam0);
					}
				}
				break;
			
			case 1:
				gameplay::set_bit(&(uParam0->f_696), 2);
				break;
			}
	}
}

void func_468(var uParam0)//Position - 0xDC7C
{
	if (network::_network_is_text_chat_active())
	{
		return;
	}
	if (controls::is_disabled_control_just_pressed(2, 202))
	{
		if (!gameplay::is_bit_set(uParam0->f_696, 0))
		{
			gameplay::set_bit(&(uParam0->f_696), 0);
		}
		if (!gameplay::is_bit_set(uParam0->f_696, 1))
		{
			audio::play_sound_frontend(-1, "BACK", "HUD_FRONTEND_DEFAULT_SOUNDSET", 1);
			gameplay::set_bit(&(uParam0->f_696), 1);
		}
	}
}

void func_469(var uParam0)//Position - 0xDCD6
{
	if (network::_network_is_text_chat_active())
	{
		return;
	}
	if (controls::is_disabled_control_just_pressed(2, 202))
	{
		if (gameplay::is_bit_set(uParam0->f_696, 0))
		{
			audio::play_sound_frontend(-1, "BACK", "HUD_FRONTEND_DEFAULT_SOUNDSET", 1);
			gameplay::clear_bit(&(uParam0->f_696), 0);
		}
	}
}

int func_470(var uParam0)//Position - 0xDD17
{
	return gameplay::is_bit_set(uParam0->f_696, 0);
}

void func_471()//Position - 0xDD29
{
	char* sVar0;
	int iVar1;
	
	if (func_52(player::player_id(), 0))
	{
		return;
	}
	switch (Local_292[network::participant_id_to_int() /*8*/].f_7)
	{
		case 0:
			if (!func_615(1))
			{
				if (gameplay::is_bit_set(iLocal_549, 31))
				{
					func_613(func_614(), 1);
					func_610();
					gameplay::clear_bit(&iLocal_549, 31);
				}
				if (Local_96.f_21 == 0)
				{
					if (!gameplay::is_bit_set(iLocal_549, 0))
					{
						if (func_415(0, 1, 1, 1))
						{
							sVar0 = func_598();
							func_414(sVar0, 30000);
							func_413(0);
							gameplay::set_bit(&iLocal_549, 0);
							audio::play_sound_frontend(-1, "Event_Start_Text", "GTAO_FM_Events_Soundset", 0);
						}
					}
				}
				if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 0))
				{
					if (func_597(1))
					{
						if (!gameplay::is_bit_set(Global_1573903.f_1, 8))
						{
							func_596();
						}
						if (gameplay::is_bit_set(iLocal_550, 3))
						{
							if (func_280("PEN_REGS"))
							{
								if (func_7(&uLocal_3765, 3000, 0))
								{
									gameplay::clear_bit(&iLocal_550, 3);
									func_6(&uLocal_3765);
									ui::clear_help(1);
								}
							}
						}
						if (iLocal_3039 < func_49())
						{
							if (!func_84(player::player_id()))
							{
								func_595(1);
							}
							if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 8))
							{
								weapon::set_current_ped_weapon(player::player_ped_id(), joaat("weapon_unarmed"), false);
								if (!func_406())
								{
									if (!ped::is_ped_sitting_in_any_vehicle(player::player_ped_id()))
									{
										network::network_set_friendly_fire_option(0);
										gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 8);
										ped::set_ped_can_be_dragged_out(player::player_ped_id(), 0);
									}
									else if (func_594(entity::get_entity_model(ped::get_vehicle_ped_is_in(player::player_ped_id(), 0))))
									{
										network::network_set_friendly_fire_option(0);
										ped::set_ped_can_be_dragged_out(player::player_ped_id(), 0);
										gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 8);
									}
								}
							}
							else if (func_406())
							{
								gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 8);
							}
							if (!gameplay::is_bit_set(iLocal_549, 18))
							{
								gameplay::set_bit(&iLocal_549, 18);
							}
							if (ped::is_ped_sitting_in_any_vehicle(player::player_ped_id()))
							{
								if (!func_406())
								{
									if (func_594(entity::get_entity_model(ped::get_vehicle_ped_is_in(player::player_ped_id(), 0))))
									{
										if (gameplay::is_bit_set(iLocal_549, 24))
										{
											gameplay::clear_bit(&iLocal_549, 24);
										}
										if (gameplay::is_bit_set(iLocal_549, 23))
										{
											gameplay::clear_bit(&iLocal_549, 23);
										}
										iVar1 = ped::get_vehicle_ped_is_in(player::player_ped_id(), 0);
										if (vehicle::is_vehicle_driveable(iVar1, 0))
										{
											ped::set_ped_config_flag(player::player_ped_id(), 398, true);
											if (vehicle::get_ped_in_vehicle_seat(iVar1, -1) == player::player_ped_id())
											{
												if (!ped::is_ped_injured(player::player_ped_id()))
												{
													if (ped::is_ped_on_any_bike(player::player_ped_id()))
													{
														if (ped::can_knock_ped_off_vehicle(player::player_ped_id()))
														{
															ped::set_ped_can_be_knocked_off_vehicle(player::player_ped_id(), 1);
														}
													}
													else if (!ped::can_knock_ped_off_vehicle(player::player_ped_id()))
													{
														ped::set_ped_can_be_knocked_off_vehicle(player::player_ped_id(), 0);
													}
												}
												if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 13))
												{
													gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 13);
												}
												if (gameplay::is_bit_set(Local_96.f_33, network::participant_id_to_int()))
												{
													if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
													{
														gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 6);
													}
													gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 0);
													iLocal_3041 = iVar1;
													if (Local_3747.f_11 == 0)
													{
														Local_3747.f_11 = network::_get_posix_time();
													}
													sVar0 = func_593();
													if (func_280(sVar0))
													{
														ui::clear_help(1);
													}
												}
											}
											else
											{
												if (!gameplay::is_bit_set(iLocal_549, 11))
												{
													if (func_415(0, 1, 1, 1))
													{
														func_414("PEN_NDRV", 30000);
														func_413(1);
														gameplay::set_bit(&iLocal_549, 11);
													}
												}
												if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
												{
													gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 6);
												}
											}
										}
									}
									else
									{
										if (!gameplay::is_bit_set(iLocal_549, 24))
										{
											if (func_415(0, 1, 1, 1))
											{
												sVar0 = func_592();
												func_414(sVar0, 30000);
												func_413(1);
												gameplay::set_bit(&iLocal_549, 24);
											}
										}
										if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 8))
										{
											func_591();
											gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 8);
											ped::set_ped_can_be_dragged_out(player::player_ped_id(), 1);
										}
									}
								}
								else if (!gameplay::is_bit_set(iLocal_549, 23))
								{
									if (func_415(0, 1, 1, 1))
									{
										gameplay::set_bit(&iLocal_549, 23);
										func_414("PEN_PASSMD", 30000);
										func_413(1);
									}
								}
							}
							else
							{
								if (!gameplay::is_bit_set(iLocal_549, 1))
								{
									if (gameplay::is_bit_set(iLocal_549, 0))
									{
										if (func_415(0, 1, 1, 1))
										{
											sVar0 = func_593();
											func_414(sVar0, 30000);
											func_413(1);
											gameplay::set_bit(&iLocal_549, 1);
										}
									}
								}
								if (vehicle::is_vehicle_driveable(iLocal_3041, 0))
								{
								}
								if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
								{
									gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 6);
								}
							}
							func_590();
						}
					}
					else if (!ped::is_ped_injured(player::player_ped_id()))
					{
						if (gameplay::is_bit_set(Global_1573903.f_1, 8))
						{
							func_587();
						}
						if (gameplay::is_bit_set(iLocal_549, 18))
						{
							gameplay::clear_bit(&iLocal_549, 18);
						}
						if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 8))
						{
							func_591();
							ped::set_ped_can_be_dragged_out(player::player_ped_id(), 1);
							gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 8);
						}
						if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
						{
							gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 6);
						}
						if (!ped::is_ped_injured(player::player_ped_id()) && !ped::can_knock_ped_off_vehicle(player::player_ped_id()))
						{
							ped::set_ped_can_be_knocked_off_vehicle(player::player_ped_id(), 0);
						}
						if (gameplay::is_bit_set(iLocal_550, 4))
						{
							if (!gameplay::is_bit_set(iLocal_550, 3))
							{
								if (func_415(0, 1, 1, 1))
								{
									gameplay::clear_bit(&iLocal_550, 4);
									gameplay::set_bit(&iLocal_550, 3);
									func_6(&uLocal_3765);
									func_8(&uLocal_3765, 0, 0);
									func_414("PEN_REGS", 30000);
									func_413(1);
								}
							}
						}
					}
				}
				else
				{
					if (!func_597(1))
					{
						if (!ped::is_ped_injured(player::player_ped_id()))
						{
							if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 8))
							{
								func_591();
								gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 8);
								ped::set_ped_can_be_dragged_out(player::player_ped_id(), 1);
							}
							gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 0);
							gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 13);
							func_610();
							if (!ped::is_ped_injured(player::player_ped_id()) && !ped::can_knock_ped_off_vehicle(player::player_ped_id()))
							{
								ped::set_ped_can_be_knocked_off_vehicle(player::player_ped_id(), 0);
							}
							if (gameplay::is_bit_set(iLocal_549, 18))
							{
								gameplay::clear_bit(&iLocal_549, 18);
							}
							if (vehicle::is_vehicle_driveable(iLocal_3041, 0))
							{
							}
							ped::set_ped_config_flag(player::player_ped_id(), 398, false);
							if (func_84(player::player_id()))
							{
								func_595(0);
							}
							gameplay::set_bit(&iLocal_550, 4);
						}
					}
					else
					{
						if (gameplay::is_bit_set(iLocal_550, 3))
						{
							if (func_280("PEN_REGS"))
							{
								if (func_7(&uLocal_3765, 3000, 0))
								{
									gameplay::clear_bit(&iLocal_550, 3);
									func_6(&uLocal_3765);
									ui::clear_help(1);
								}
							}
						}
						if (ped::is_ped_sitting_in_any_vehicle(player::player_ped_id()))
						{
						}
						if (func_406())
						{
							if (!ped::is_ped_injured(player::player_ped_id()) && !ped::can_knock_ped_off_vehicle(player::player_ped_id()))
							{
								ped::set_ped_can_be_knocked_off_vehicle(player::player_ped_id(), 0);
							}
							gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 0);
							gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 13);
						}
						else if (!gameplay::is_bit_set(iLocal_549, 25))
						{
							if (gameplay::is_bit_set(Local_96.f_1, 7))
							{
								if (func_415(0, 1, 1, 1))
								{
									func_414("PEN_QSTART", 30000);
									func_413(1);
									gameplay::set_bit(&iLocal_549, 25);
								}
							}
						}
						func_590();
					}
					if (!ped::is_ped_injured(player::player_ped_id()))
					{
						if (!ped::is_ped_sitting_in_any_vehicle(player::player_ped_id()) || (ped::is_ped_sitting_in_any_vehicle(player::player_ped_id()) && !vehicle::is_vehicle_driveable(ped::get_vehicle_ped_is_in(player::player_ped_id(), 0), 0)))
						{
							gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 0);
							gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 13);
							if (vehicle::is_vehicle_driveable(iLocal_3041, 0))
							{
							}
						}
						else if (gameplay::is_bit_set(Local_96.f_1, 1))
						{
							if (func_280("PEN_MPLAY"))
							{
								ui::clear_help(1);
							}
						}
						else if (!gameplay::is_bit_set(iLocal_549, 3))
						{
							if (func_415(0, 1, 1, 1))
							{
								func_414("PEN_MPLAY", 30000);
								func_413(1);
								gameplay::set_bit(&iLocal_549, 3);
							}
						}
					}
					if (gameplay::is_bit_set(iLocal_549, 0))
					{
						if (!gameplay::is_bit_set(iLocal_549, 2))
						{
							if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 0))
							{
								if (gameplay::is_bit_set(Local_96.f_1, 1))
								{
									if (func_415(0, 1, 1, 1))
									{
										func_414("PEN_START2", 30000);
										func_413(1);
										gameplay::set_bit(&iLocal_549, 2);
									}
								}
							}
						}
					}
				}
				func_268(1, 0);
				func_262();
				func_245();
			}
			else if (!gameplay::is_bit_set(iLocal_549, 31))
			{
				if (ui::does_blip_exist(iLocal_568))
				{
					ui::remove_blip(&iLocal_568);
				}
				func_91();
				func_79();
				gameplay::set_bit(&iLocal_549, 31);
				if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 0))
				{
					gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 0);
				}
			}
			if (Local_96.f_21 >= 1)
			{
				if (!gameplay::is_bit_set(Local_96.f_1, 12))
				{
					if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 0))
					{
						func_575(136, 0f, 0f, 1, 1, 1, 0);
						if (ui::does_blip_exist(iLocal_568))
						{
							ui::remove_blip(&iLocal_568);
						}
						func_79();
						func_574(1);
						func_571();
						if (!ped::is_ped_injured(player::player_ped_id()) && !ped::can_knock_ped_off_vehicle(player::player_ped_id()))
						{
							ped::set_ped_can_be_knocked_off_vehicle(player::player_ped_id(), 0);
						}
						iLocal_566 = ped::get_ped_relationship_group_hash(player::player_ped_id());
						ped::set_ped_relationship_group_hash(player::player_ped_id(), iLocal_564);
						func_549(1);
						func_545(0);
						player::clear_player_wanted_level(player::player_id());
						func_595(0);
						func_542(1);
						func_8(&uLocal_3767, 0, 0);
						Local_292[network::participant_id_to_int() /*8*/].f_7 = 1;
					}
					else if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
					{
						func_575(136, 0f, 0f, 1, 1, 0, 0);
						func_79();
						if (ui::does_blip_exist(iLocal_568))
						{
							ui::remove_blip(&iLocal_568);
						}
						func_574(1);
						player::clear_player_wanted_level(player::player_id());
						func_595(0);
						Local_292[network::participant_id_to_int() /*8*/].f_7 = 1;
					}
					else
					{
						if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 8))
						{
							func_591();
							ped::set_ped_can_be_dragged_out(player::player_ped_id(), 1);
							gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 8);
						}
						if (ui::does_blip_exist(iLocal_568))
						{
							ui::remove_blip(&iLocal_568);
						}
						func_595(0);
						ped::set_ped_config_flag(player::player_ped_id(), 398, false);
						func_79();
						func_541(&iLocal_3741);
						Local_292[network::participant_id_to_int() /*8*/].f_7 = 3;
					}
				}
				else
				{
					if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 8))
					{
						func_591();
						ped::set_ped_can_be_dragged_out(player::player_ped_id(), 1);
						gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 8);
					}
					func_91();
					if (ui::does_blip_exist(iLocal_568))
					{
						ui::remove_blip(&iLocal_568);
					}
					func_79();
					func_541(&iLocal_3741);
					func_595(0);
					ped::set_ped_config_flag(player::player_ped_id(), 398, false);
					Local_292[network::participant_id_to_int() /*8*/].f_7 = 3;
				}
			}
			else if (func_538(2, 0, 1, 0, 0))
			{
				func_595(0);
				Local_292[network::participant_id_to_int() /*8*/].f_7 = 5;
			}
			func_537();
			break;
		
		case 1:
			func_245();
			func_537();
			func_268(!gameplay::is_bit_set(iLocal_549, 9), 0);
			func_590();
			func_536();
			if (Local_96.f_21 >= 2)
			{
				func_8(&uLocal_598, 0, 0);
				Local_292[network::participant_id_to_int() /*8*/].f_7 = 2;
			}
			break;
		
		case 2:
			if (Local_3747.f_9 == 0)
			{
				Local_3747.f_9 = network::_get_posix_time();
			}
			func_28(1);
			func_239();
			func_268(0, 0);
			func_528();
			func_230();
			func_282(0);
			func_525();
			func_537();
			sVar0 = func_593();
			if (!gameplay::is_bit_set(iLocal_549, 13))
			{
				if (!func_615(1))
				{
					if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
					{
						if (func_415(0, 0, 1, 1))
						{
							if (!func_524(54))
							{
								func_414("PEN_NDRV2", 30000);
								func_413(1);
								gameplay::set_bit(&iLocal_549, 13);
							}
						}
					}
				}
				else if ((((((func_280("PEN_NDRV2") || func_280("PEN_REGS")) || func_280("PEN_NDRV")) || func_280(sVar0)) || func_280("PEN_QSTART")) || func_280("PEN_MPLAY")) || func_280("PEN_START2"))
				{
					ui::clear_help(1);
				}
			}
			else if (iLocal_552 != 0)
			{
				if (!gameplay::is_bit_set(iLocal_549, 5))
				{
					if (func_415(0, 0, 1, 1))
					{
						if (!func_524(54))
						{
							func_414("PEN_STILLP", 30000);
							func_413(1);
							gameplay::set_bit(&iLocal_549, 5);
						}
					}
				}
			}
			if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 1))
			{
				Local_292[network::participant_id_to_int() /*8*/].f_7 = 3;
				func_79();
				if (ui::does_blip_exist(iLocal_3042))
				{
					ui::remove_blip(&iLocal_3042);
				}
			}
			else if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
			{
				if (gameplay::is_bit_set(iLocal_549, 12))
				{
					Local_292[network::participant_id_to_int() /*8*/].f_7 = 3;
					func_79();
				}
			}
			if (Local_96.f_21 == 3)
			{
				func_91();
				func_79();
				Local_292[network::participant_id_to_int() /*8*/].f_7 = 3;
			}
			if (func_237())
			{
				if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 0))
				{
					gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 0);
				}
				if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
				{
					gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 6);
				}
				if (func_523())
				{
					func_522(0);
				}
				gameplay::set_bit(&iLocal_550, 20);
				func_91();
				func_79();
				func_591();
				gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 8);
				Local_292[network::participant_id_to_int() /*8*/].f_7 = 3;
			}
			else if (Local_96.f_21 == 4)
			{
				Local_292[network::participant_id_to_int() /*8*/].f_7 = 4;
			}
			else if (Local_96.f_21 > 4)
			{
				Local_292[network::participant_id_to_int() /*8*/].f_7 = 5;
			}
			else if (func_538(2, 0, 1, 0, 0))
			{
				Local_292[network::participant_id_to_int() /*8*/].f_7 = 5;
			}
			else if (func_269())
			{
				func_91();
				func_79();
				func_591();
				gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 8);
				Local_292[network::participant_id_to_int() /*8*/].f_7 = 3;
			}
			break;
		
		case 3:
			if (!func_615(1))
			{
				func_521();
				func_520();
				func_537();
				if ((!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 0) || gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 1)) || gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
				{
					if (Local_96.f_21 > 1)
					{
						if (!gameplay::is_bit_set(iLocal_550, 17))
						{
							if (ui::does_blip_exist(iLocal_567))
							{
								ui::set_blip_colour(iLocal_567, 55);
								gameplay::set_bit(&iLocal_550, 17);
							}
						}
						func_28(1);
						func_239();
					}
					if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 0) || gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
					{
						func_268(0, 1);
					}
				}
			}
			else if (gameplay::is_bit_set(iLocal_550, 17))
			{
				if (ui::does_blip_exist(iLocal_567))
				{
					ui::remove_blip(&iLocal_567);
				}
			}
			if (func_523())
			{
				if (func_237())
				{
					func_522(0);
				}
			}
			func_92();
			if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 0))
			{
				if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 2))
				{
					func_282(1);
				}
			}
			else
			{
				func_519();
			}
			if (gameplay::is_bit_set(iLocal_549, 6))
			{
				if (audio::is_audio_scene_active("MP_Player_Inside_Bubble_Scene"))
				{
					audio::stop_audio_scene("MP_Player_Inside_Bubble_Scene");
				}
				if (audio::is_audio_scene_active("MP_Player_Outside_Bubble_Scene"))
				{
					audio::stop_audio_scene("MP_Player_Outside_Bubble_Scene");
				}
				graphics::_stop_screen_effect("pennedIn");
				graphics::_start_screen_effect("PennedInOut", 0, 0);
				gameplay::clear_bit(&iLocal_549, 6);
			}
			if (func_307(player::player_id()))
			{
				func_549(0);
				func_574(0);
				gameplay::set_bit(&iLocal_550, 24);
				func_481(136, 0, 1);
			}
			if (!gameplay::is_bit_set(iLocal_550, 21))
			{
				if (gameplay::is_bit_set(iLocal_550, 14) || gameplay::is_bit_set(iLocal_549, 20))
				{
					gameplay::set_bit(&iLocal_550, 21);
				}
			}
			if (func_457())
			{
				if (func_472())
				{
					if (Local_96.f_21 == 4)
					{
						Local_292[network::participant_id_to_int() /*8*/].f_7 = 4;
					}
					else if (Local_96.f_21 > 4)
					{
						Local_292[network::participant_id_to_int() /*8*/].f_7 = 5;
					}
					else
					{
						func_273();
					}
				}
			}
			break;
		
		case 4:
			if (Local_96.f_21 > 4)
			{
				Local_292[network::participant_id_to_int() /*8*/].f_7 = 5;
			}
			break;
		
		case 5:
			func_677();
			break;
	}
}

bool func_472()//Position - 0xED65
{
	if ((func_272() && !func_21(vLocal_3780)) || gameplay::is_bit_set(iLocal_550, 23))
	{
		switch (iLocal_3784)
		{
			case 0:
				if (!cam::is_screen_faded_out() && !cam::is_screen_fading_out())
				{
					cam::do_screen_fade_out(500);
				}
				else
				{
					iLocal_3784++;
				}
				break;
			
			case 1:
				if (cam::is_screen_faded_out())
				{
					gameplay::set_bit(&iLocal_550, 23);
					func_480();
					func_273();
					iLocal_3784++;
				}
				break;
			
			case 2:
				if (func_473(vLocal_3780, fLocal_3783, 0, 1, 0, 0, 1, 0, 1, 0))
				{
					iLocal_3784++;
				}
				break;
			
			case 3:
				if (!cam::is_screen_fading_in() && !cam::is_screen_fading_out())
				{
					cam::do_screen_fade_in(500);
					iLocal_3784++;
				}
				break;
			
			case 4:
				if (cam::is_screen_faded_in())
				{
					iLocal_3784++;
				}
				break;
			
			case 5:
				return true;
				break;
		}
	}
	else
	{
		return true;
	}
	return false;
}

bool func_473(vector3 vParam0, float fParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8, int iParam9, int iParam10, int iParam11)//Position - 0xEE6F
{
	vector3 vVar0;
	float fVar3;
	int iVar4;
	
	Global_17118.f_6 = 1;
	if (streaming::is_player_switch_in_progress() && !iParam9)
	{
		if (Global_2428549.f_724)
		{
			func_478(0, iParam9);
		}
		return false;
	}
	if ((streaming::is_new_load_scene_active() && !iParam9) && !player::is_player_teleport_active())
	{
		return false;
	}
	if (!func_477())
	{
		if (func_476(player::player_id(), 1))
		{
			if (((iParam9 && func_694(player::player_id(), 1, 0)) && streaming::is_player_switch_in_progress()) && Global_2418529[player::player_id() /*313*/].f_220 == 1)
			{
			}
			else
			{
				return false;
			}
		}
	}
	if (fParam3 < 0f)
	{
		fParam3 = (fParam3 + 360f);
	}
	if (fParam3 >= 360f)
	{
		fParam3 = (fParam3 + -360f);
	}
	if (!Global_2428549.f_724 && !iParam11)
	{
		vVar0 = { entity::get_entity_coords(player::player_ped_id(), 0) };
		if ((gameplay::absf((vVar0.x - vParam0.x)) < 0.2f && gameplay::absf((vVar0.y - vParam0.y)) < 0.2f) && gameplay::absf((vVar0.y - vParam0.y)) < 1.2f)
		{
			fVar3 = (fParam3 - entity::get_entity_heading(player::player_ped_id()));
			if (fVar3 > 180f)
			{
				fVar3 = (fVar3 + -360f);
			}
			if (fVar3 < -180f)
			{
				fVar3 = (fVar3 + 360f);
			}
			if (gameplay::absf(fVar3) < 1f)
			{
				Global_2428549.f_724 = 0;
				Global_2428549.f_725 = 0;
				if (player::is_player_teleport_active())
				{
					player::stop_player_teleport();
				}
				return true;
			}
		}
	}
	if (((!vParam0.x == Global_2428549.f_726 || !vParam0.y == Global_2428549.f_726.f_1) || !vParam0.y == Global_2428549.f_726.f_2) || !fParam3 == Global_2428549.f_729)
	{
		if (Global_2428549.f_724 == 1)
		{
			if (network::get_time_difference(network::get_network_time(), Global_2428549.f_730) < func_475(0))
			{
				return false;
			}
			player::stop_player_teleport();
			Global_2428549.f_725 = 1;
		}
		else
		{
			Global_2428549.f_725 = 0;
		}
		Global_2428549.f_726 = { vParam0 };
		Global_2428549.f_729 = fParam3;
		Global_2428549.f_724 = 0;
	}
	if (!Global_2428549.f_724 && !player::is_player_teleport_active())
	{
		if (iParam4)
		{
			iParam5 = false;
		}
		iParam7 = iParam7;
		if (iParam7)
		{
		}
		if (iParam5)
		{
		}
		if (iParam8)
		{
		}
		if (ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
		{
			if (!gameplay::is_bit_set(Global_91362.f_1300[44], 16))
			{
				func_474();
			}
			if (!weapon::get_current_ped_vehicle_weapon(player::player_ped_id(), &(Global_2404993.f_473)))
			{
				Global_2404993.f_473 = 0;
			}
		}
		if (iParam9)
		{
			if (iParam4)
			{
				if (ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
				{
					iVar4 = ped::get_vehicle_ped_is_using(player::player_ped_id());
					entity::set_entity_coords(iVar4, vParam0, 0, true, 1, 1);
					entity::set_entity_heading(iVar4, fParam3);
				}
				else
				{
					entity::set_entity_coords(player::player_ped_id(), vParam0, 0, false, 0, 1);
					entity::set_entity_heading(player::player_ped_id(), fParam3);
				}
			}
			else
			{
				entity::set_entity_coords(player::player_ped_id(), vParam0, 0, false, 0, 1);
				entity::set_entity_heading(player::player_ped_id(), fParam3);
			}
			func_478(iParam6, iParam9);
			return true;
		}
		else
		{
			streaming::clear_focus();
			player::start_player_teleport(player::player_id(), vParam0, fParam3, iParam4, iParam10, 0);
		}
		Global_2428549.f_730 = network::get_network_time();
		Global_2428549.f_724 = 1;
	}
	if (Global_2428549.f_724)
	{
		Global_17118.f_6 = 1;
		Global_2428549.f_730 = network::get_network_time();
		if (iParam9)
		{
			if (system::vdist(entity::get_entity_coords(player::player_ped_id(), 0), Global_2428549.f_726) < 2f)
			{
				if (player::is_player_teleport_active())
				{
					player::stop_player_teleport();
				}
				func_478(iParam6, iParam9);
				return true;
			}
		}
		if (!player::is_player_teleport_active())
		{
			func_478(iParam6, iParam9);
			return true;
		}
	}
	return false;
}

void func_474()//Position - 0xF217
{
	Global_2404993.f_1677 = audio::get_player_radio_station_index();
	if (unk_0x2DD39BF3E2F9C47F())
	{
		Global_2404993.f_1677 = 255;
	}
}

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

bool func_476(int iParam0, int iParam1)//Position - 0xF25D
{
	if (Global_2418529[iParam0 /*313*/].f_220 == 99)
	{
		return false;
	}
	if (iParam1)
	{
		if (Global_2418529[iParam0 /*313*/].f_220 == 13)
		{
			return false;
		}
	}
	return true;
}

var func_477()//Position - 0xF293
{
	return Global_1315888;
}

void func_478(int iParam0, int iParam1)//Position - 0xF29F
{
	if (!iParam0)
	{
		cam::set_gameplay_cam_relative_pitch(0f, 1065353216);
		cam::set_gameplay_cam_relative_heading(0f);
	}
	if (!entity::is_entity_dead(player::player_ped_id(), 0))
	{
		ped::clear_ped_wetness(player::player_ped_id());
	}
	if (!iParam1)
	{
		streaming::clear_focus();
	}
	if (player::is_player_teleport_active())
	{
		player::stop_player_teleport();
	}
	func_449();
	if (!gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_250.f_7, 14))
	{
		func_479();
	}
}

void func_479()//Position - 0xF307
{
	Global_2471870.f_80 = 1;
}

void func_480()//Position - 0xF316
{
	if (entity::does_entity_exist(player::player_ped_id()))
	{
		if (!entity::is_entity_dead(player::player_ped_id(), 0))
		{
			if (entity::is_entity_attached(player::player_ped_id()))
			{
				entity::detach_entity(player::player_ped_id(), 1, true);
			}
		}
	}
}

void func_481(int iParam0, int iParam1, int iParam2)//Position - 0xF34B
{
	var uVar0;
	int iVar1;
	
	if (iParam0 == 0)
	{
	}
	if (player::player_id() != -1)
	{
		if (gameplay::is_bit_set(Global_1610705[player::player_id() /*178*/].f_1, 13))
		{
			gameplay::clear_bit(&(Global_1610705[player::player_id() /*178*/].f_1), 13);
		}
		if (gameplay::is_bit_set(Global_1610705[player::player_id() /*178*/].f_1, 14))
		{
			gameplay::clear_bit(&(Global_1610705[player::player_id() /*178*/].f_1), 14);
		}
	}
	if (gameplay::is_bit_set(Global_1573903.f_1, 21))
	{
		gameplay::clear_bit(&(Global_1573903.f_1), 21);
	}
	func_515();
	audio::set_audio_flag("DisableFlightMusic", 0);
	audio::set_audio_flag("WantedMusicDisabled", 0);
	if (iParam1)
	{
		uVar0 = func_514(func_333(player::player_id()));
		func_513(21, 0);
	}
	else
	{
		if ((iParam2 && player::player_id() != -1) && func_512(player::player_id()) >= 12)
		{
			func_511(2524, -1);
			iVar1 = func_95(2524, -1, 0);
			if (iVar1 == 2)
			{
				gameplay::set_bit(&Global_1573928, 0);
			}
			else if (iVar1 == 4)
			{
				gameplay::set_bit(&Global_1573928, 1);
			}
			else if (iVar1 == 6)
			{
				gameplay::set_bit(&Global_1573928, 2);
			}
			else if (iVar1 == 8)
			{
				gameplay::set_bit(&Global_1573928, 3);
			}
			else if (iVar1 == 10)
			{
				gameplay::set_bit(&Global_1573928, 4);
			}
			else if (iVar1 == 12)
			{
				gameplay::set_bit(&Global_1573928, 5);
			}
		}
		func_510();
		func_509();
		func_508();
		if ((!func_395(player::player_id()) && !func_394(player::player_id())) && !func_507())
		{
			func_496();
		}
		func_495();
		if (!gameplay::is_bit_set(Global_1734808.f_3, 0) && !gameplay::is_bit_set(Global_1734808.f_3, 1))
		{
			func_587();
		}
		func_494();
		gameplay::clear_bit(&(Global_2464975.f_1645), 2);
		func_493();
		func_492();
	}
	if (ui::_0x84698AB38D0C6636(1344549371))
	{
		ui::object_decal_toggle(1344549371);
	}
	if (!iParam1 || uVar0)
	{
		if ((player::player_id() != -1 && !func_402(player::player_id(), 21)) && !func_332(player::player_id(), 0))
		{
			func_490(0);
			func_488(0);
			func_487();
		}
	}
	if (iParam2 && !iParam1)
	{
		if (func_486(26, -1))
		{
			Global_2446396 = -1;
			func_484(26, -1);
		}
	}
	if (!func_482())
	{
		Global_2460400 = 1;
	}
}

bool func_482()//Position - 0xF599
{
	if (((!func_365(player::player_id()) && !func_349(player::player_id())) && func_333(player::player_id()) != 146) && !func_483())
	{
		return false;
	}
	return true;
}

bool func_483()//Position - 0xF5DD
{
	if ((Global_1617902 == 0 && network::network_is_activity_session()) && (((((((Global_1617902.f_5 != 0 || Global_1617902.f_95358 > 0) || gameplay::is_bit_set(Global_1617902.f_4, 15)) || gameplay::is_bit_set(Global_1617902.f_4, 18)) || gameplay::is_bit_set(Global_1617902.f_4, 19)) || gameplay::is_bit_set(Global_1617902.f_4, 28)) || gameplay::is_bit_set(Global_1617902.f_4, 27)) || gameplay::is_bit_set(Global_1617902.f_5, 23)))
	{
		return true;
	}
	return false;
}

void func_484(int iParam0, int iParam1)//Position - 0xF687
{
	int iVar0;
	int iVar1;
	
	if (iParam1 == -1)
	{
		iParam1 = func_54();
	}
	switch (iParam0)
	{
		case 0:
			stats::_0x723C1CE13FBFDB67(0, iParam1);
			break;
		
		default:
			iVar1 = func_485(iParam1);
			iVar0 = gameplay::get_profile_setting(iVar1);
			if (gameplay::is_bit_set(iVar0, iParam0))
			{
				gameplay::clear_bit(&iVar0, iParam0);
				stats::_0x723C1CE13FBFDB67(iVar0, iParam1);
			}
			break;
	}
}

int func_485(int iParam0)//Position - 0xF6E3
{
	int iVar0;
	
	if (iParam0 == -1)
	{
		iParam0 = func_54();
	}
	switch (iParam0)
	{
		case 0:
			iVar0 = 909;
			break;
		
		case 1:
			iVar0 = 910;
			break;
		
		case 2:
			iVar0 = 911;
			break;
		
		case 3:
			iVar0 = 912;
			break;
		
		case 4:
			iVar0 = 913;
			break;
	}
	return iVar0;
}

int func_486(int iParam0, int iParam1)//Position - 0xF746
{
	int iVar0;
	int iVar1;
	
	if (iParam1 == -1)
	{
		iParam1 = func_54();
	}
	iVar0 = func_485(iParam1);
	iVar1 = gameplay::get_profile_setting(iVar0);
	return gameplay::is_bit_set(iVar1, iParam0);
}

void func_487()//Position - 0xF772
{
	int iVar0;
	
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < Global_1311741)
	{
		if (gameplay::is_bit_set(Global_2359719[iVar0 /*26*/].f_12, 11))
		{
			if (gameplay::is_bit_set(Global_2359719[iVar0 /*26*/].f_13, 26))
			{
				gameplay::clear_bit(&(Global_2359719[iVar0 /*26*/].f_13), 26);
			}
		}
		iVar0++;
	}
}

void func_488(int iParam0)//Position - 0xF7C8
{
	int iVar0;
	
	if (iParam0)
	{
		Global_91362.f_8 = 1;
	}
	else
	{
		Global_91362.f_8 = 0;
	}
	iVar0 = 0;
	while (iVar0 < 45)
	{
		func_489(iVar0);
		iVar0++;
	}
}

void func_489(int iParam0)//Position - 0xF7FF
{
	Global_91362.f_156[iParam0] = 1;
	Global_91362.f_155 = 1;
}

void func_490(int iParam0)//Position - 0xF819
{
	if (func_491() && iParam0)
	{
		return;
	}
	if (iParam0 == Global_2391043)
	{
		return;
	}
	Global_2391043 = iParam0;
	Global_2391045 = 0;
	Global_2391046 = 0;
}

bool func_491()//Position - 0xF84E
{
	if ((((Global_978175 != -1 && Global_978175 != 33) && Global_978175 != 35) && Global_978175 != 37) && Global_978175 != 21)
	{
		return true;
	}
	return false;
}

void func_492()//Position - 0xF894
{
	Global_1610705[player::player_id() /*178*/].f_7 = 0;
}

void func_493()//Position - 0xF8A9
{
	if (gameplay::is_bit_set(Global_2464975.f_4588, 1))
	{
		gameplay::clear_bit(&(Global_2464975.f_4588), 1);
	}
	if (Global_2464975.f_4588 > 0)
	{
		audio::trigger_music_event("FM_COUNTDOWN_30S_KILL");
		audio::trigger_music_event("FM_COUNTDOWN_30S_FIRA");
		audio::stop_audio_scene("GTAO_FM_Events_30_Sec_Countdown_Scene");
		audio::set_user_radio_control_enabled(1);
		Global_2464975.f_4588 = 0;
		audio::set_audio_flag("DisableFlightMusic", 0);
		audio::set_audio_flag("WantedMusicDisabled", 0);
		audio::set_audio_flag("AllowScoreAndRadio", 0);
		if (!gameplay::are_strings_equal(script::get_this_script_name(), "am_pi_menu"))
		{
			if (Global_2464975.f_4598 > -1)
			{
				audio::release_sound_id(Global_2464975.f_4598);
				Global_2464975.f_4598 = -1;
			}
		}
	}
}

void func_494()//Position - 0xF947
{
	struct<24> Var0;
	
	Var0.f_3 = -1;
	Var0.f_4 = -1;
	Var0.f_5 = -1;
	Global_1573903 = { Var0 };
}

void func_495()//Position - 0xF970
{
	var uVar0;
	
	Global_1318849 = uVar0;
}

void func_496()//Position - 0xF97E
{
	Global_2404993.f_20 = { Global_2406822 };
	Global_2404993.f_22 = { Global_2406824 };
	func_505();
	func_497(1, 1);
}

void func_497(int iParam0, int iParam1)//Position - 0xF9AE
{
	if (iParam1)
	{
		Global_2404993.f_39 = { Global_2406841 };
	}
	else
	{
		Global_2404993.f_39 = { Global_2406841 };
		Global_2404993.f_39.f_49 = { Global_2406841.f_49 };
		Global_2404993.f_39.f_52 = Global_2406841.f_52;
		Global_2404993.f_39.f_53 = Global_2406841.f_53;
	}
	if (iParam0)
	{
		func_504();
	}
	func_500(0, 1, 0, 1060320051, 1086324736, 1065353216, 1088421888, 1084227584, 0, 1066192077, 0, 0);
	func_499(0);
	func_498();
}

void func_498()//Position - 0xFA48
{
	struct<4> Var0;
	
	if (Global_2404993.f_469.f_1 == script::get_id_of_this_thread())
	{
		Global_2404993.f_469 = { Var0 };
	}
}

void func_499(int iParam0)//Position - 0xFA6D
{
	if (iParam0)
	{
		Global_2404993.f_638 = 0;
	}
	else
	{
		Global_2404993.f_638 = 1;
	}
}

void func_500(int iParam0, int iParam1, int iParam2, int iParam3, int iParam4, int iParam5, int iParam6, int iParam7, int iParam8, int iParam9, int iParam10, int iParam11)//Position - 0xFA8D
{
	if (iParam0)
	{
		Global_2404993.f_1144 = iParam1;
		Global_2404993.f_1145 = iParam2;
		Global_2404993.f_1146 = iParam10;
		func_502();
		func_501(8, 0, 0);
		Global_2404993.f_639 = 1;
		Global_2404993.f_1147 = iParam11;
		Global_2404993.f_1150 = iParam3;
		Global_2404993.f_1151 = iParam4;
		Global_2404993.f_1148 = iParam5;
		Global_2404993.f_1149 = iParam6;
		Global_2404993.f_1152 = iParam7;
		Global_2404993.f_1153 = iParam8;
		Global_2404993.f_1154 = iParam9;
	}
	else
	{
		func_502();
		func_501(0, 0, 0);
		Global_2404993.f_639 = 0;
	}
}

void func_501(int iParam0, int iParam1, int iParam2)//Position - 0xFB27
{
	if (iParam0 != 18 && iParam0 != 17)
	{
		Global_2409586 = 0;
	}
	Global_2404993.f_469 = iParam0;
	Global_2404993.f_469.f_1 = script::get_id_of_this_thread();
	Global_2404993.f_469.f_2 = iParam1;
	Global_2404993.f_469.f_3 = iParam2;
}

void func_502()//Position - 0xFB72
{
	func_503();
	Global_2404993.f_640 = 0;
}

void func_503()//Position - 0xFB86
{
	int iVar0;
	struct<5> Var1;
	
	Var1.f_4 = 1065353216;
	iVar0 = 0;
	while (iVar0 < 100)
	{
		Global_2404993.f_641[iVar0 /*5*/] = { Var1 };
		iVar0++;
	}
}

void func_504()//Position - 0xFBBF
{
	Global_2404993.f_347 = { Global_2407149 };
}

void func_505()//Position - 0xFBD8
{
	func_506();
	Global_2404993.f_1285 = 0;
}

void func_506()//Position - 0xFBEC
{
	int iVar0;
	struct<4> Var1;
	
	iVar0 = 0;
	while (iVar0 < 50)
	{
		Global_2404993.f_1286[iVar0 /*4*/] = { Var1 };
		iVar0++;
	}
}

var func_507()//Position - 0xFC18
{
	return Global_1573832;
}

void func_508()//Position - 0xFC24
{
	Global_2464975.f_4589 = 0;
}

void func_509()//Position - 0xFC34
{
	if (player::player_id() != -1)
	{
		Global_1610705[player::player_id() /*178*/].f_1 = 0;
	}
}

void func_510()//Position - 0xFC51
{
	int iVar0;
	
	iVar0 = player::player_id();
	if (iVar0 != -1)
	{
		Global_1610705[iVar0 /*178*/] = -1;
	}
}

void func_511(int iParam0, int iParam1)//Position - 0xFC6E
{
	int iVar0;
	
	iVar0 = func_95(iParam0, func_96(iParam1), 0);
	iVar0++;
	if (!func_171(iParam0))
	{
		func_164(iParam0, iVar0, iParam1, 1);
	}
	else
	{
		func_165(iParam0, iVar0, iParam1, 1);
	}
}

var func_512(int iParam0)//Position - 0xFCAE
{
	return Global_1587816[iParam0 /*444*/].f_195.f_6;
}

void func_513(int iParam0, int iParam1)//Position - 0xFCC3
{
	if (iParam1)
	{
		if (!gameplay::is_bit_set(Global_2418529[player::player_id() /*313*/].f_206, iParam0))
		{
			gameplay::set_bit(&(Global_2418529[player::player_id() /*313*/].f_206), iParam0);
		}
	}
	else if (gameplay::is_bit_set(Global_2418529[player::player_id() /*313*/].f_206, iParam0))
	{
		gameplay::clear_bit(&(Global_2418529[player::player_id() /*313*/].f_206), iParam0);
	}
}

bool func_514(int iParam0)//Position - 0xFD26
{
	switch (iParam0)
	{
		case 133:
		case 132:
		case 138:
		case 144:
		case 140:
		case 139:
		case 131:
		case 141:
		case -1:
			return true;
		
		case 146:
			if (func_396(player::player_id()))
			{
				return true;
			}
			break;
	}
	return false;
}

void func_515()//Position - 0xFD88
{
	if (gameplay::is_bit_set(Global_2464975.f_1642, 3) || gameplay::is_bit_set(Global_2464975.f_1642, 4))
	{
		if (cam::is_screen_faded_out() || cam::is_screen_fading_out())
		{
			cam::do_screen_fade_in(800);
		}
	}
	if (gameplay::is_bit_set(Global_2464975.f_1642, 5))
	{
		gameplay::clear_bit(&(Global_2464975.f_1642), 5);
	}
	if (gameplay::is_bit_set(Global_2464975.f_1642, 3))
	{
		gameplay::clear_bit(&(Global_2464975.f_1642), 3);
	}
	if (gameplay::is_bit_set(Global_2464975.f_1642, 4))
	{
		gameplay::clear_bit(&(Global_2464975.f_1642), 4);
	}
	func_518(0);
	func_517(0);
	func_516(0);
}

void func_516(int iParam0)//Position - 0xFE29
{
	if (Global_2464975.f_4379 != iParam0)
	{
		Global_2464975.f_4379 = iParam0;
	}
}

void func_517(int iParam0)//Position - 0xFE46
{
	if (Global_2464975.f_4378 != iParam0)
	{
		if (iParam0)
		{
		}
		Global_2464975.f_4378 = iParam0;
	}
}

void func_518(int iParam0)//Position - 0xFE6B
{
	if (Global_2464975.f_4376 != iParam0)
	{
		Global_2464975.f_4376 = iParam0;
	}
}

void func_519()//Position - 0xFE88
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	
	if (!ped::is_ped_injured(player::player_ped_id()))
	{
		if (ped::is_ped_sitting_in_any_vehicle(player::player_ped_id()))
		{
			iVar0 = ped::get_vehicle_ped_is_in(player::player_ped_id(), 0);
			iVar1 = vehicle::get_ped_in_vehicle_seat(iVar0, -1);
			if (iVar1 != 0)
			{
				if (iVar1 != player::player_ped_id())
				{
					if (ped::is_ped_a_player(iVar1))
					{
						iVar2 = network::_network_get_ped_player(iVar1);
						if (network::network_is_player_a_participant(iVar2))
						{
							iVar3 = network::network_get_participant_index(iVar2);
							iVar4 = iVar3;
							if (gameplay::is_bit_set(Local_292[iVar4 /*8*/].f_1, 0))
							{
								if (!gameplay::is_bit_set(Local_292[iVar4 /*8*/].f_1, 1))
								{
									iVar5 = true;
								}
							}
						}
					}
				}
			}
		}
	}
	if (iVar5)
	{
		func_590();
	}
}

void func_520()//Position - 0xFF1F
{
	if (!gameplay::is_bit_set(Local_96.f_1, 12))
	{
		if (!gameplay::is_bit_set(iLocal_549, 10))
		{
			if (Local_292[network::participant_id_to_int() /*8*/].f_7 == 3)
			{
				if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 1))
				{
					if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 0))
					{
						if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
						{
							if (!gameplay::is_bit_set(iLocal_550, 20))
							{
								if (!func_269())
								{
									if (func_415(0, 1, 1, 1))
									{
										func_414("PEN_NAVAIL", 30000);
										func_413(1);
										gameplay::set_bit(&iLocal_549, 10);
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

void func_521()//Position - 0xFFC6
{
	if (!gameplay::is_bit_set(iLocal_549, 4))
	{
		if (!gameplay::is_bit_set(Local_96.f_1, 12))
		{
			if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 0))
			{
				if (func_415(0, 1, 1, 1))
				{
					if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 1))
					{
						if (gameplay::is_bit_set(iLocal_550, 5))
						{
							if (!gameplay::is_bit_set(iLocal_550, 6))
							{
								func_414("PEN_EXITP", -1);
								func_413(1);
								gameplay::set_bit(&iLocal_550, 6);
							}
						}
						else if (gameplay::is_bit_set(iLocal_550, 8))
						{
							if (!gameplay::is_bit_set(iLocal_550, 6))
							{
								func_414("PEN_EXITD", -1);
								func_413(1);
								gameplay::set_bit(&iLocal_550, 6);
							}
						}
						else if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
						{
							if (!gameplay::is_bit_set(iLocal_550, 6))
							{
								func_414("PEN_EXITD", -1);
								func_413(1);
								gameplay::set_bit(&iLocal_550, 6);
							}
						}
					}
					else if (!gameplay::is_bit_set(Local_96.f_1, 5))
					{
						func_414("PEN_NAVAIL2", 30000);
						func_413(1);
					}
					gameplay::set_bit(&iLocal_549, 4);
				}
			}
			else if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 1))
			{
				if (func_415(0, 1, 1, 1))
				{
					if (!gameplay::is_bit_set(iLocal_549, 20))
					{
						func_414("PEN_NAVAIL2", 30000);
						func_413(1);
						gameplay::set_bit(&iLocal_549, 4);
					}
				}
			}
		}
		else
		{
			func_97("PEN_EXPD", 1);
			gameplay::set_bit(&iLocal_549, 4);
		}
	}
}

void func_522(int iParam0)//Position - 0x1013A
{
	Global_2464975.f_4674 = iParam0;
}

var func_523()//Position - 0x1014B
{
	return Global_2464975.f_4674;
}

int func_524(int iParam0)//Position - 0x1015A
{
	return Global_2428549.f_2191[0 /*72*/].f_1 == iParam0;
}

void func_525()//Position - 0x10171
{
	int iVar0;
	char* sVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	
	if (!gameplay::is_bit_set(iLocal_549, 16))
	{
		if (Local_96.f_21 > 1)
		{
			if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 0))
			{
				if (!ped::is_ped_injured(player::player_ped_id()))
				{
					if (ped::is_ped_sitting_in_any_vehicle(player::player_ped_id()))
					{
						iLocal_3040 = ped::get_vehicle_ped_is_in(player::player_ped_id(), 0);
						if (vehicle::get_ped_in_vehicle_seat(iLocal_3040, -1) == player::player_ped_id())
						{
							if (network::network_has_control_of_entity(iLocal_3040))
							{
								if ((!func_527(iLocal_3040) && Global_2464975.f_280 != iLocal_3040) && !func_526(iLocal_3040))
								{
									if (func_594(entity::get_entity_model(iLocal_3040)))
									{
										entity::set_entity_as_mission_entity(iLocal_3040, false, 1);
										gameplay::set_bit(&iLocal_549, 16);
										iVar2 = 0;
										while (iVar2 < 32)
										{
											entity::set_entity_can_be_damaged_by_relationship_group(iLocal_3040, 0, Global_1574218[iVar2]);
											iVar2++;
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	if (entity::does_entity_exist(iLocal_3040))
	{
		if (!func_527(iLocal_3040) && !func_526(iLocal_3040))
		{
			if (vehicle::is_this_model_a_bike(entity::get_entity_model(iLocal_3040)))
			{
				sVar1 = "PEN_BIKE";
			}
			else
			{
				sVar1 = "PEN_VEHG";
			}
			iVar3 = true;
		}
		else
		{
			if (vehicle::is_this_model_a_bike(entity::get_entity_model(iLocal_3040)))
			{
				sVar1 = "PEN_PBIKE";
			}
			else
			{
				sVar1 = "PEN_PVEHG";
			}
			iVar3 = true;
		}
	}
	if (entity::does_entity_exist(iLocal_3040))
	{
		if (func_527(iLocal_3040) || func_526(iLocal_3040))
		{
			if (Local_96.f_21 == 2)
			{
				if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 1))
				{
					if (vehicle::is_vehicle_driveable(iLocal_3040, 0))
					{
						if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 5))
						{
							if (!ped::is_ped_injured(player::player_ped_id()))
							{
								if (!ped::is_ped_sitting_in_vehicle(player::player_ped_id(), iLocal_3040))
								{
									if (!func_80(sVar1))
									{
										func_67(sVar1, 0);
									}
								}
								else if (func_80(sVar1))
								{
									func_79();
								}
							}
						}
						else if (func_80(sVar1))
						{
							func_79();
						}
					}
					else if (iVar3)
					{
						if (func_80(sVar1))
						{
							func_79();
						}
					}
				}
			}
		}
	}
	if (gameplay::is_bit_set(iLocal_549, 16))
	{
		if (Local_96.f_21 == 2)
		{
			if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 1))
			{
				if (vehicle::is_vehicle_driveable(iLocal_3040, 0))
				{
					if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 5))
					{
						if (!ped::is_ped_injured(player::player_ped_id()))
						{
							if (!ped::is_ped_sitting_in_vehicle(player::player_ped_id(), iLocal_3040))
							{
								if (!ui::does_blip_exist(iLocal_3042))
								{
									iLocal_3042 = ui::add_blip_for_entity(iLocal_3040);
									ui::set_blip_as_friendly(iLocal_3042, true);
								}
								if (!func_80(sVar1))
								{
									func_67(sVar1, 0);
								}
							}
							else if (func_594(entity::get_entity_model(iLocal_3040)))
							{
								if (ui::does_blip_exist(iLocal_3042))
								{
									ui::remove_blip(&iLocal_3042);
								}
								if (iVar3)
								{
									if (func_80(sVar1))
									{
										func_79();
									}
								}
							}
						}
					}
					else if (iVar3)
					{
						if (func_80(sVar1))
						{
							func_79();
						}
					}
				}
				else
				{
					if (ui::does_blip_exist(iLocal_3042))
					{
						ui::remove_blip(&iLocal_3042);
					}
					if (iVar3)
					{
						if (func_80(sVar1))
						{
							func_79();
						}
					}
				}
			}
		}
	}
	if (ui::does_blip_exist(iLocal_3042) || !vehicle::is_vehicle_driveable(iLocal_3040, 0))
	{
		if (!ped::is_ped_injured(player::player_ped_id()))
		{
			if (ped::is_ped_sitting_in_any_vehicle(player::player_ped_id()))
			{
				iVar0 = ped::get_vehicle_ped_is_in(player::player_ped_id(), 0);
				if (func_594(entity::get_entity_model(iVar0)))
				{
					if (iVar0 != iLocal_3040)
					{
						if (vehicle::get_ped_in_vehicle_seat(iVar0, -1) == player::player_ped_id())
						{
							if (network::network_has_control_of_entity(iVar0))
							{
								iLocal_3040 = iVar0;
								if (iVar3)
								{
									if (func_80(sVar1))
									{
										func_79();
									}
								}
								ui::remove_blip(&iLocal_3042);
								if (!func_527(iLocal_3040))
								{
									entity::set_entity_as_mission_entity(iLocal_3040, false, 1);
								}
							}
						}
						else if (iVar3)
						{
							if (func_80(sVar1))
							{
								func_79();
							}
						}
					}
				}
			}
			else if (vehicle::is_vehicle_driveable(iLocal_3040, 0))
			{
			}
		}
	}
	if (!gameplay::is_bit_set(iLocal_550, 1))
	{
		if (!ped::is_ped_injured(player::player_ped_id()))
		{
			if (!ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
			{
				gameplay::set_bit(&iLocal_550, 1);
				gameplay::clear_bit(&iLocal_550, 2);
			}
		}
	}
	else if (!ped::is_ped_injured(player::player_ped_id()))
	{
		if (ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
		{
			if (!gameplay::is_bit_set(iLocal_550, 2))
			{
				iVar0 = ped::get_vehicle_ped_is_in(player::player_ped_id(), 0);
				if (func_594(entity::get_entity_model(iVar0)))
				{
					gameplay::clear_bit(&iLocal_550, 1);
					gameplay::clear_bit(&iLocal_550, 2);
				}
				else
				{
					gameplay::set_bit(&iLocal_550, 2);
				}
			}
		}
		else if (gameplay::is_bit_set(iLocal_550, 2))
		{
			gameplay::clear_bit(&iLocal_550, 2);
		}
	}
	if (Local_292[network::participant_id_to_int() /*8*/].f_7 == 2)
	{
		if (!gameplay::is_bit_set(iLocal_550, 5))
		{
			if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
			{
				if (!ped::is_ped_injured(player::player_ped_id()))
				{
					if (ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
					{
						iVar4 = ped::get_vehicle_ped_is_in(player::player_ped_id(), 0);
						if (vehicle::get_ped_in_vehicle_seat(iVar4, -1) == player::player_ped_id())
						{
							gameplay::set_bit(&iLocal_550, 5);
							func_79();
						}
					}
				}
			}
		}
	}
	if (!gameplay::is_bit_set(iLocal_550, 8))
	{
		if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 0))
		{
			if (!ped::is_ped_injured(player::player_ped_id()))
			{
				if (ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
				{
					iVar4 = ped::get_vehicle_ped_is_in(player::player_ped_id(), 0);
					if (vehicle::get_ped_in_vehicle_seat(iVar4, -1) != player::player_ped_id() && vehicle::get_ped_in_vehicle_seat(iVar4, -1) != 0)
					{
						gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 0);
						gameplay::set_bit(&iLocal_550, 8);
					}
				}
			}
		}
	}
}

bool func_526(int iParam0)//Position - 0x106A9
{
	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;
}

bool func_527(int iParam0)//Position - 0x106F2
{
	if (Global_69521)
	{
		if (decorator::decor_exist_on(iParam0, "Player_Vehicle"))
		{
			return true;
		}
	}
	return false;
}

void func_528()//Position - 0x10713
{
	char* sVar0;
	
	if (gameplay::is_bit_set(Local_96.f_1, 3) || gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 10))
	{
		if (gameplay::is_bit_set(iLocal_549, 6))
		{
			if (audio::is_audio_scene_active("MP_Player_Inside_Bubble_Scene"))
			{
				audio::stop_audio_scene("MP_Player_Inside_Bubble_Scene");
			}
			if (audio::is_audio_scene_active("MP_Player_Outside_Bubble_Scene"))
			{
				audio::stop_audio_scene("MP_Player_Outside_Bubble_Scene");
			}
			graphics::_stop_screen_effect("pennedIn");
			graphics::_start_screen_effect("PennedInOut", 0, 0);
			gameplay::clear_bit(&iLocal_549, 6);
		}
		if (func_80("PEN_BAREA"))
		{
			func_79();
		}
		if (func_80("PEN_BAREA"))
		{
			func_79();
		}
		if (func_80("PEN_AREA"))
		{
			func_79();
		}
		return;
	}
	if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
	{
		if (func_615(1))
		{
			if (gameplay::is_bit_set(iLocal_549, 6))
			{
				if (audio::is_audio_scene_active("MP_Player_Inside_Bubble_Scene"))
				{
					audio::stop_audio_scene("MP_Player_Inside_Bubble_Scene");
				}
				if (audio::is_audio_scene_active("MP_Player_Outside_Bubble_Scene"))
				{
					audio::stop_audio_scene("MP_Player_Outside_Bubble_Scene");
				}
				graphics::_stop_screen_effect("pennedIn");
				graphics::_start_screen_effect("PennedInOut", 0, 0);
				gameplay::clear_bit(&iLocal_549, 6);
			}
			if (func_80("PEN_BAREA"))
			{
				func_79();
			}
			if (func_80("PEN_BAREA"))
			{
				func_79();
			}
			if (func_80("PEN_AREA"))
			{
				func_79();
			}
			func_91();
			return;
		}
	}
	if ((func_597(0) && !gameplay::is_bit_set(iLocal_550, 2)) && !ped::is_ped_injured(player::player_ped_id()))
	{
		if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 9))
		{
			gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 9);
		}
		if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 10))
		{
			if (gameplay::is_bit_set(Local_96.f_1, 4))
			{
				gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 10);
			}
			else if (gameplay::is_bit_set(iLocal_550, 9))
			{
				gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 10);
			}
		}
		if (func_9(&uLocal_580))
		{
			func_6(&uLocal_580);
			controls::_0x8290252FFF36ACB5(0, 255, 255, 255);
		}
		if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 5))
		{
			gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 5);
			audio::play_sound_frontend(-1, "OOB_Cancel", "GTAO_FM_Events_Soundset", 0);
			audio::stop_sound(iLocal_3043);
			audio::release_sound_id(iLocal_3043);
			gameplay::clear_bit(&iLocal_550, 7);
		}
		if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
		{
			if (!func_524(54))
			{
				if ((entity::does_entity_exist(iLocal_3040) && !ped::is_ped_in_any_vehicle(player::player_ped_id(), 0)) && vehicle::is_vehicle_driveable(iLocal_3040, 0))
				{
					if (func_80("PEN_AREA"))
					{
						func_79();
					}
				}
				else if (!ui::does_blip_exist(iLocal_3042))
				{
					if (!func_80("PEN_AREA"))
					{
						func_67("PEN_AREA", 0);
					}
				}
			}
		}
		else if (!func_80("PEN_AREA"))
		{
			func_67("PEN_AREA", 0);
		}
		if (!gameplay::is_bit_set(iLocal_549, 6))
		{
			if (audio::is_audio_scene_active("MP_Player_Outside_Bubble_Scene"))
			{
				audio::stop_audio_scene("MP_Player_Outside_Bubble_Scene");
			}
			audio::start_audio_scene("MP_Player_Inside_Bubble_Scene");
			graphics::_start_screen_effect("pennedIn", 0, 1);
			gameplay::set_bit(&iLocal_549, 6);
		}
	}
	else
	{
		if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 9))
		{
			gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 9);
		}
		if (!ped::is_ped_injured(player::player_ped_id()))
		{
			func_534();
			if (!gameplay::is_bit_set(iLocal_550, 2))
			{
				if (!func_80("PEN_BAREA"))
				{
					func_67("PEN_BAREA", 0);
				}
			}
			else
			{
				if (!func_80("PEN_EXITV"))
				{
					func_67("PEN_EXITV", 0);
				}
				if (!gameplay::is_bit_set(iLocal_549, 24))
				{
					if (func_415(0, 1, 1, 1))
					{
						sVar0 = func_592();
						func_414(sVar0, 30000);
						func_413(1);
						gameplay::set_bit(&iLocal_549, 24);
					}
				}
			}
		}
		if (gameplay::is_bit_set(iLocal_549, 6))
		{
			if (audio::is_audio_scene_active("MP_Player_Inside_Bubble_Scene"))
			{
				audio::stop_audio_scene("MP_Player_Inside_Bubble_Scene");
			}
			audio::start_audio_scene("MP_Player_Outside_Bubble_Scene");
			graphics::_stop_screen_effect("pennedIn");
			graphics::_start_screen_effect("PennedInOut", 0, 0);
			gameplay::clear_bit(&iLocal_549, 6);
		}
		if (!func_9(&uLocal_580))
		{
			func_8(&uLocal_580, 0, 0);
		}
		if (!gameplay::is_bit_set(iLocal_550, 7))
		{
			gameplay::set_bit(&iLocal_550, 7);
			audio::play_sound_frontend(-1, "OOB_Start", "GTAO_FM_Events_Soundset", 0);
			iLocal_3043 = audio::get_sound_id();
			audio::play_sound_frontend(iLocal_3043, "OOB_Timer_Dynamic", "GTAO_FM_Events_Soundset", 0);
			audio::set_variable_on_sound(iLocal_3043, "Time", (system::to_float(func_229()) / 1000f));
		}
		if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 5))
		{
			gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 5);
		}
		if (!gameplay::is_bit_set(iLocal_549, 12))
		{
			if (func_9(&uLocal_580))
			{
				if ((func_229() - func_40(&uLocal_580, 0, 0)) >= 0)
				{
					if (!ped::is_ped_injured(player::player_ped_id()))
					{
						func_226((func_229() - func_40(&uLocal_580, 0, 0)), "PEN_ELM", 0, 1, -1, 0, 2, 0, 6, 0, 0, 0, 6, 0, 0, 0);
					}
					else
					{
						func_531();
					}
				}
				else
				{
					func_531();
				}
			}
		}
	}
	func_529();
	func_590();
}

void func_529()//Position - 0x10BEE
{
	int iVar0;
	
	if (ped::is_ped_injured(player::player_ped_id()))
	{
		return;
	}
	if (!ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
	{
		return;
	}
	iVar0 = ped::get_vehicle_ped_is_in(player::player_ped_id(), 0);
	if (vehicle::get_ped_in_vehicle_seat(iVar0, -1) != player::player_ped_id())
	{
		if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 0))
		{
			if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 1))
			{
				return;
			}
		}
	}
	if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
	{
		return;
	}
	func_530();
	func_536();
}

void func_530()//Position - 0x10C75
{
	if (!gameplay::is_bit_set(iLocal_549, 21))
	{
		if ((controls::is_control_just_pressed(0, 75) || controls::is_control_pressed(0, 75)) || controls::is_disabled_control_pressed(0, 75))
		{
			gameplay::set_bit(&iLocal_549, 21);
		}
	}
	else if (!gameplay::is_bit_set(iLocal_549, 22))
	{
		if (!ui::is_help_message_being_displayed())
		{
			func_414("PEN_EXV", 30000);
			func_413(1);
			gameplay::set_bit(&iLocal_549, 22);
		}
	}
}

void func_531()//Position - 0x10CE8
{
	int iVar0;
	
	if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 1))
	{
		return;
	}
	if (gameplay::is_bit_set(iLocal_549, 18))
	{
		gameplay::clear_bit(&iLocal_549, 18);
	}
	func_591();
	gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 8);
	controls::_0xCB0360EFEFB2580D(0);
	if (!gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
	{
		func_211();
		gameplay::set_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 1);
		Local_584.f_2 = 143;
		Local_584.f_10 = player::player_id();
		func_532(Local_584, func_533(1));
		if (!ped::is_ped_injured(player::player_ped_id()))
		{
			ped::set_ped_config_flag(player::player_ped_id(), 398, false);
		}
		if (!ped::is_ped_injured(player::player_ped_id()))
		{
			if (ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
			{
				iVar0 = ped::get_vehicle_ped_is_in(player::player_ped_id(), 0);
				if (network::network_has_control_of_entity(iVar0))
				{
				}
				if (!vehicle::is_this_model_a_bicycle(entity::get_entity_model(iVar0)))
				{
					iVar0 = ped::get_vehicle_ped_is_in(player::player_ped_id(), 0);
					entity::clear_entity_last_damage_entity(player::player_ped_id());
					entity::clear_entity_last_damage_entity(iVar0);
					if (!vehicle::is_this_model_a_heli(entity::get_entity_model(iVar0)))
					{
						network::network_explode_vehicle(iVar0, 1, 0, -1);
					}
					else
					{
						unk_0x2A5E0621DD815A9A(iVar0, 1, 0, 0);
					}
					func_522(1);
					gameplay::set_bit(&iLocal_549, 20);
				}
			}
			else
			{
				entity::clear_entity_last_damage_entity(player::player_ped_id());
				entity::set_entity_health(player::player_ped_id(), 0);
				func_522(1);
				gameplay::set_bit(&iLocal_549, 20);
			}
		}
		else
		{
			func_522(1);
			gameplay::set_bit(&iLocal_550, 14);
		}
		iLocal_3772 = func_40(&uLocal_598, 0, 0);
	}
	if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 5))
	{
		gameplay::clear_bit(&(Local_292[network::participant_id_to_int() /*8*/].f_1), 5);
		audio::stop_sound(iLocal_3043);
		audio::release_sound_id(iLocal_3043);
		gameplay::clear_bit(&iLocal_550, 7);
	}
	gameplay::set_bit(&iLocal_549, 12);
}

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

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

void func_534()//Position - 0x10F20
{
	float fVar0;
	float fVar1;
	float fVar2;
	int iVar3;
	int iVar4;
	
	fVar1 = 80f;
	fVar2 = 0f;
	iVar3 = 130;
	iVar4 = 130;
	fVar0 = ((fVar1 + fVar2) + IntToFloat(gameplay::get_random_int_in_range(0, 3)));
	if (network::get_network_time() - iLocal_3038) >= system::round((60000f / fVar0))
	{
		if (!gameplay::is_bit_set(iLocal_549, 15))
		{
			gameplay::set_bit(&iLocal_549, 15);
		}
		iLocal_3038 = network::get_network_time();
	}
	else if (gameplay::is_bit_set(iLocal_549, 15))
	{
		gameplay::clear_bit(&iLocal_549, 15);
	}
	if (func_535())
	{
		controls::set_pad_shake(0, 0, 0);
		controls::set_pad_shake(0, iVar3, iVar4);
		controls::_0x8290252FFF36ACB5(0, 255, 0, 0);
	}
	else
	{
		controls::_0x8290252FFF36ACB5(0, 255, 255, 255);
	}
}

int func_535()//Position - 0x10FC1
{
	return gameplay::is_bit_set(iLocal_549, 15);
}

void func_536()//Position - 0x10FD2
{
	if (ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
	{
		controls::disable_control_action(0, 75, 1);
	}
}

void func_537()//Position - 0x10FEE
{
	int iVar0;
	
	if (!gameplay::is_bit_set(iLocal_549, 14))
	{
		if ((Local_292[network::participant_id_to_int() /*8*/].f_7 == 1 || Local_292[network::participant_id_to_int() /*8*/].f_7 == 2) || (((func_84(player::player_id()) && func_597(0)) && gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 0)) && !func_615(1)))
		{
			if (ped::is_ped_sitting_in_any_vehicle(player::player_ped_id()))
			{
				iVar0 = ped::get_vehicle_ped_is_in(player::player_ped_id(), 0);
				if (network::network_has_control_of_entity(iVar0))
				{
					vehicle::set_vehicle_automatically_attaches(iVar0, false, 0);
					gameplay::set_bit(&iLocal_549, 14);
				}
			}
		}
	}
	else if (!ped::is_ped_injured(player::player_ped_id()))
	{
		if (ped::is_ped_sitting_in_any_vehicle(player::player_ped_id()))
		{
			if (Local_292[network::participant_id_to_int() /*8*/].f_7 >= 3 || gameplay::is_bit_set(iLocal_549, 31))
			{
				iVar0 = ped::get_vehicle_ped_is_in(player::player_ped_id(), 0);
				if (vehicle::is_vehicle_driveable(iVar0, 0))
				{
					if (network::network_has_control_of_entity(iVar0))
					{
						vehicle::set_vehicle_automatically_attaches(iVar0, true, 0);
						gameplay::clear_bit(&iLocal_549, 14);
					}
				}
			}
		}
		else
		{
			gameplay::clear_bit(&iLocal_549, 14);
		}
	}
}

bool func_538(int iParam0, int iParam1, int iParam2, char* sParam3, char* sParam4)//Position - 0x11104
{
	if (network::_0xCF61D4B4702EE9EB() < iParam0)
	{
		if (iParam2)
		{
			func_540(sParam3, sParam4, 1);
		}
		if (func_486(26, -1))
		{
			func_484(26, -1);
		}
		return true;
	}
	if (func_9(&(Global_1573903.f_18)))
	{
		if (!func_7(&(Global_1573903.f_18), 7500, 0))
		{
			return false;
		}
		func_6(&(Global_1573903.f_18));
	}
	if (func_539())
	{
		if (iParam2)
		{
			func_540(sParam3, sParam4, 0);
		}
		if (func_486(26, -1))
		{
			func_484(26, -1);
		}
		return true;
	}
	if (iParam1 && network::network_get_num_participants() < iParam0)
	{
		if (iParam2)
		{
			func_540(sParam3, sParam4, 1);
		}
		if (func_486(26, -1))
		{
			func_484(26, -1);
		}
		return true;
	}
	return false;
}

int func_539()//Position - 0x111C4
{
	return gameplay::is_bit_set(Global_1573903.f_1, 0);
}

void func_540(char* sParam0, char* sParam1, int iParam2)//Position - 0x111D7
{
	if ((!gameplay::is_bit_set(Global_1573903.f_1, 2) && !func_51(player::player_id())) && !func_225(player::player_id()))
	{
		if (gameplay::is_string_null_or_empty(sParam0))
		{
			sParam0 = "FMEVEN_NUM1";
		}
		if (gameplay::is_string_null_or_empty(sParam1))
		{
			if (iParam2)
			{
				sParam1 = "FMEVEN_NUM2";
			}
			else
			{
				sParam1 = "FMEVEN_NUM3";
			}
		}
		func_147(65, sParam0, sParam1, 1, -1, 2);
		gameplay::set_bit(&(Global_1573903.f_1), 2);
	}
}

void func_541(int iParam0)//Position - 0x1124F
{
	graphics::set_scaleform_movie_as_no_longer_needed(iParam0);
	audio::release_named_script_audio_bank("HUD_MINI_GAME_SOUNDSET");
}

void func_542(int iParam0)//Position - 0x11265
{
	var uVar0;
	
	if (iParam0)
	{
		if (func_406())
		{
			func_545(0);
			func_544();
		}
		if (func_642(0))
		{
			uVar0 = func_95(2458, -1, 0);
			gameplay::clear_bit(&uVar0, 0);
			func_544();
		}
		if (func_642(func_408(func_333(player::player_id()))))
		{
			uVar0 = func_95(2458, -1, 0);
			gameplay::clear_bit(&uVar0, func_408(func_333(player::player_id())));
			func_544();
		}
		if (func_543())
		{
			func_544();
		}
		if (func_333(player::player_id()) > -1)
		{
			gameplay::set_bit(&(Global_1610705[player::player_id() /*178*/].f_1), 7);
		}
	}
	else
	{
		gameplay::clear_bit(&(Global_1610705[player::player_id() /*178*/].f_1), 7);
	}
}

bool func_543()//Position - 0x11310
{
	if (Global_2428549.f_648.f_5 == -1)
	{
		return false;
	}
	return true;
}

void func_544()//Position - 0x1132A
{
	if (func_543())
	{
		Global_2428549.f_648.f_16 = 1;
	}
}

void func_545(int iParam0)//Position - 0x11343
{
	if (func_406())
	{
		if (iParam0 == 1)
		{
			if (Global_2464975.f_4254 == -1)
			{
				Global_2464975.f_4254 = 60000;
			}
			func_548(&(Global_2464975.f_4252), 0, 0);
			if (Global_2464975.f_4257 == -1)
			{
				Global_2464975.f_4257 = 10000;
			}
			func_548(&(Global_2464975.f_4255), 0, 0);
		}
		else
		{
			Global_1312416 = 0;
			func_591();
		}
		if ((!network::network_is_activity_session() && !func_547()) && !func_546(player::player_id()))
		{
			Global_978174 = 0;
		}
		Global_1610705[player::player_id() /*178*/].f_8 = 0;
	}
}

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

var func_547()//Position - 0x113FF
{
	return Global_2434839.f_716;
}

void func_548(var uParam0, int iParam1, int iParam2)//Position - 0x1140E
{
	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_549(int iParam0)//Position - 0x1144B
{
	int iVar0;
	var uVar1;
	
	if (iParam0)
	{
		Global_2446396 = func_333(player::player_id());
		if (Global_2446396 == -1)
		{
			Global_2446396 = Global_1573903.f_4;
		}
		if (func_570(Global_2446396) == 0)
		{
			if (func_569(1) > 0)
			{
				func_568(26, -1);
			}
		}
		if (func_406())
		{
			func_545(0);
			func_544();
		}
		if (func_642(0))
		{
			uVar1 = func_95(2458, -1, 0);
			gameplay::clear_bit(&uVar1, 0);
			func_544();
		}
		if (func_642(func_408(func_333(player::player_id()))))
		{
			uVar1 = func_95(2458, -1, 0);
			gameplay::clear_bit(&uVar1, func_408(func_333(player::player_id())));
			func_544();
		}
		if (func_543())
		{
			func_544();
		}
		gameplay::set_bit(&(Global_1610705[player::player_id() /*178*/].f_1), 0);
	}
	else
	{
		if ((!func_567() && !func_566()) && !func_565())
		{
			Global_2446396 = -1;
			func_484(26, -1);
		}
		else if (func_570(Global_2446396) == 0)
		{
			iVar0 = func_552(1);
			if (iVar0 > 0)
			{
				func_550(joaat("mpply_fmevn_cheat_end"), iVar0);
				func_170(1924, 1, -1);
				func_550(joaat("mpply_activity_ended"), 1);
			}
		}
		else if (func_486(26, -1))
		{
			Global_2446396 = -1;
			func_484(26, -1);
		}
		gameplay::clear_bit(&(Global_1610705[player::player_id() /*178*/].f_1), 0);
	}
}

void func_550(int iParam0, int iParam1)//Position - 0x115A2
{
	int iVar0;
	
	iVar0 = func_154(iParam0);
	iVar0 = (iVar0 + iParam1);
	if (!func_551(iParam0))
	{
		func_152(iParam0, iVar0);
	}
	else
	{
		func_156(iParam0, iVar0);
	}
}

bool func_551(int iParam0)//Position - 0x115D6
{
	if (Global_1347694)
	{
		switch (iParam0)
		{
			case joaat("mpply_crew_0_id"):
			case joaat("mpply_crew_1_id"):
			case joaat("mpply_crew_2_id"):
			case joaat("mpply_crew_3_id"):
			case joaat("mpply_crew_4_id"):
			case joaat("mpply_crew_local_xp_0"):
			case joaat("mpply_crew_local_xp_1"):
			case joaat("mpply_crew_local_xp_2"):
			case joaat("mpply_crew_local_xp_3"):
			case joaat("mpply_crew_local_xp_4"):
			case joaat("mpply_became_cheater_num"):
			case joaat("mpply_friendly"):
			case joaat("mpply_offensive_language"):
			case joaat("mpply_griefing"):
			case joaat("mpply_helpful"):
			case joaat("mpply_offensive_tagplate"):
			case joaat("mpply_offensive_ugc"):
				return true;
				break;
			}
	}
	return false;
}

int func_552(int iParam0)//Position - 0x1165A
{
	int iVar0;
	int iVar1;
	
	iVar0 = 2;
	iVar1 = 0;
	if (Global_2445113 == 0)
	{
		return 0;
	}
	if (func_565())
	{
		if (network::network_is_activity_session() || (func_564() || func_562()))
		{
			Global_2444099 = 1;
		}
	}
	Global_2445113 = 0;
	if (Global_1318743)
	{
		iVar0 = 1;
	}
	if (Global_2444099)
	{
		iVar0 = 1;
	}
	if (Global_2444098)
	{
		iVar0 = 1;
	}
	if (func_253(Global_100214.f_1, 32))
	{
		iVar0 = 1;
	}
	if (Global_2444024)
	{
		iVar0 = 1;
	}
	if (func_561(512))
	{
		iVar0 = 1;
	}
	if (func_560(128))
	{
		iVar0 = 1;
	}
	if (Global_1318767 == 1 && iVar1 == 0)
	{
		iVar0 = 0;
	}
	if (func_477())
	{
		iVar0 = 0;
	}
	if (Global_2444553)
	{
		iVar0 = 2;
	}
	if (iParam0 == 0)
	{
		if (!func_558())
		{
			if (Global_1617902.f_77557 == 0)
			{
				iVar0 = 0;
			}
		}
	}
	if (func_52(player::player_id(), 0))
	{
		iVar0 = 0;
	}
	if (func_557())
	{
		iVar0 = 0;
	}
	if ((Global_2444099 || Global_2444098) || Global_1318743)
	{
		if (func_562())
		{
			iVar0 = 0;
		}
	}
	Global_2444553 = 0;
	Global_2444098 = 0;
	Global_2444099 = 0;
	Global_1318743 = 0;
	Global_2444024 = 0;
	func_555(&(Global_100214.f_1), 32);
	func_554(512);
	func_553(128);
	return iVar0;
}

void func_553(int iParam0)//Position - 0x117AD
{
	Global_100271 = (Global_100271 - (Global_100271 && iParam0));
}

void func_554(int iParam0)//Position - 0x117C5
{
	Global_100272 = (Global_100272 - (Global_100272 && iParam0));
}

void func_555(var uParam0, int iParam1)//Position - 0x117DD
{
	func_556(uParam0, iParam1);
}

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

bool func_557()//Position - 0x11802
{
	if (((Global_1573854 || Global_1573825) || func_52(player::player_id(), 0)) || func_131())
	{
		return true;
	}
	return false;
}

bool func_558()//Position - 0x11839
{
	switch (func_559())
	{
		case 15:
		case 14:
		case 11:
		case 13:
		case 12:
		case 122:
			return true;
		
		default:
	}
	return false;
}

var func_559()//Position - 0x11873
{
	return Global_2435608.f_1.f_2818;
}

int func_560(int iParam0)//Position - 0x11884
{
	return (Global_100271 && iParam0) != 0;
}

int func_561(int iParam0)//Position - 0x11895
{
	return (Global_100272 && iParam0) != 0;
}

bool func_562()//Position - 0x118A6
{
	if (func_570(Global_2446396))
	{
		return false;
	}
	if (func_563(player::player_id(), 146))
	{
		return true;
	}
	return false;
}

int func_563(int iParam0, int iParam1)//Position - 0x118CF
{
	if (Global_1610705[iParam0 /*178*/] == iParam1)
	{
		return func_396(iParam0);
	}
	return false;
}

bool func_564()//Position - 0x118EE
{
	if (func_570(Global_2446396))
	{
		return false;
	}
	if (func_396(player::player_id()))
	{
		return true;
	}
	return false;
}

int func_565()//Position - 0x11915
{
	return gameplay::is_bit_set(Global_1312423, 0);
}

var func_566()//Position - 0x11926
{
	return Global_1315880;
}

var func_567()//Position - 0x11932
{
	return Global_1315913;
}

void func_568(int iParam0, int iParam1)//Position - 0x1193E
{
	int iVar0;
	int iVar1;
	
	if (iParam1 == -1)
	{
		iParam1 = func_54();
	}
	switch (iParam0)
	{
		case 0:
			stats::_0x723C1CE13FBFDB67(0, iParam1);
			break;
		
		default:
			iVar1 = func_485(iParam1);
			iVar0 = gameplay::get_profile_setting(iVar1);
			if (!gameplay::is_bit_set(iVar0, iParam0))
			{
				gameplay::set_bit(&iVar0, iParam0);
				stats::_0x723C1CE13FBFDB67(iVar0, iParam1);
			}
			break;
	}
}

int func_569(int iParam0)//Position - 0x1199B
{
	int iVar0;
	int iVar1;
	
	iVar0 = 2;
	iVar1 = 0;
	if (Global_1318767 == 1 && iVar1 == 0)
	{
		iVar0 = 0;
	}
	if (func_477())
	{
		iVar0 = 0;
	}
	if (iParam0 == 0)
	{
		if (!func_558())
		{
			if (Global_1617902.f_77557 == 0)
			{
				iVar0 = 0;
			}
		}
	}
	if (func_52(player::player_id(), 0))
	{
		iVar0 = 0;
	}
	if (func_557())
	{
		iVar0 = 0;
	}
	Global_2445113 = 1;
	return iVar0;
}

bool func_570(int iParam0)//Position - 0x11A07
{
	switch (iParam0)
	{
		case 131:
			if (Global_262145.f_9587)
			{
				return true;
			}
			break;
		
		case 132:
			if (Global_262145.f_9589)
			{
				return true;
			}
			break;
		
		case 133:
			if (Global_262145.f_9586)
			{
				return true;
			}
			break;
		
		case 136:
			if (Global_262145.f_9590)
			{
				return true;
			}
			break;
		
		case 138:
			if (Global_262145.f_9591)
			{
				return true;
			}
			break;
		
		case 139:
			if (Global_262145.f_9592)
			{
				return true;
			}
			break;
		
		case 129:
			if (Global_262145.f_9588)
			{
				return true;
			}
			break;
		
		case 140:
			if (Global_262145.f_9593)
			{
				return true;
			}
			break;
		
		case 141:
			if (Global_262145.f_9594)
			{
				return true;
			}
			break;
		
		case 144:
			if (Global_262145.f_9595)
			{
				return true;
			}
			break;
		
		case 146:
			if (Global_262145.f_9596)
			{
				return true;
			}
			break;
	}
	return false;
}

void func_571()//Position - 0x11B14
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	if (func_573(&iVar0) && decorator::decor_exist_on(iVar0, "Veh_Modded_By_Player"))
	{
		iVar1 = 0;
		while (iVar1 < 32)
		{
			iVar2 = player::int_to_playerindex(iVar1);
			if (func_694(iVar2, 0, 1))
			{
				if (decorator::decor_get_int(iVar0, "Veh_Modded_By_Player") == gameplay::get_hash_key(player::get_player_name(iVar2)))
				{
					func_572(func_201(iVar2));
				}
			}
			iVar1++;
		}
	}
}

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

bool func_573(var uParam0)//Position - 0x11BA5
{
	if (ped::is_ped_in_any_vehicle(player::player_ped_id(), 0))
	{
		*uParam0 = ped::get_vehicle_ped_is_in(player::player_ped_id(), 0);
		if (decorator::decor_is_registered_as_type("bombdec1", 3))
		{
			if (decorator::decor_exist_on(*uParam0, "bombdec1"))
			{
				return true;
			}
		}
		if (decorator::decor_is_registered_as_type("bombdec", 3))
		{
			if (decorator::decor_exist_on(*uParam0, "bombdec"))
			{
				return true;
			}
		}
		if (decorator::decor_is_registered_as_type("bombowner", 3))
		{
			if (decorator::decor_exist_on(*uParam0, "bombowner"))
			{
				return true;
			}
		}
	}
	return false;
}

void func_574(int iParam0)//Position - 0x11C20
{
	if (iParam0)
	{
		Global_1312450 = 1;
	}
	else
	{
		Global_1312450 = 0;
	}
}

void func_575(int iParam0, float fParam1, float fParam2, int iParam3, int iParam4, int iParam5, int iParam6)//Position - 0x11C3A
{
	int iVar0;
	
	audio::set_audio_flag("DisableFlightMusic", 1);
	if (iParam0 != 133)
	{
		audio::set_audio_flag("WantedMusicDisabled", 1);
	}
	Global_2464975.f_4598 = -1;
	iVar0 = (func_332(player::player_id(), 0) && func_395(player::player_id()));
	if (iParam6)
	{
		func_513(21, 1);
	}
	else
	{
		func_586(iParam0, -1);
		if (func_51(player::player_id()))
		{
			Global_1573903.f_3 = iParam0;
		}
		else
		{
			func_585(iParam0);
		}
		Global_1573903.f_4 = -1;
		if (func_51(player::player_id()))
		{
			gameplay::set_bit(&(Global_1573903.f_1), 5);
		}
		if ((func_406() && !func_403()) || func_402(player::player_id(), 21))
		{
			gameplay::set_bit(&(Global_1573903.f_1), 4);
		}
		gameplay::clear_bit(&(Global_1573903.f_1), 17);
		gameplay::set_bit(&(Global_1573903.f_1), 20);
		if (func_584(iParam0))
		{
			func_583();
		}
	}
	if (!iVar0)
	{
		if (fParam1 != 1f)
		{
			func_580(fParam1);
		}
		if (fParam2 != 1f)
		{
			player::set_wanted_level_multiplier(fParam2);
			if (iParam0 == 146)
			{
				player::set_max_wanted_level(0);
				player::set_player_wanted_level(player::player_id(), 0, 0);
				player::set_player_wanted_level_now(player::player_id(), 0);
			}
		}
		if (func_579(iParam0))
		{
			player::set_max_wanted_level(0);
			player::set_player_wanted_level(player::player_id(), 0, 0);
			player::set_player_wanted_level_now(player::player_id(), 0);
			gameplay::set_bit(&(Global_1573903.f_1), 8);
		}
		if (iParam3)
		{
			if (!Global_2391043)
			{
				func_490(1);
				if (func_94(0))
				{
					gameplay::set_bit(&(Global_1573903.f_1), 9);
				}
				gameplay::set_bit(&(Global_1573903.f_1), 14);
			}
		}
		if (iParam4)
		{
			func_488(1);
			gameplay::set_bit(&(Global_1573903.f_1), 12);
		}
		if (iParam5)
		{
			func_578();
			gameplay::set_bit(&(Global_1573903.f_1), 12);
		}
		if (!iParam6)
		{
			if (func_576(iParam0))
			{
				gameplay::set_bit(&(Global_1573903.f_1), 21);
			}
		}
	}
	Global_2460400 = 1;
}

bool func_576(int iParam0)//Position - 0x11E04
{
	switch (iParam0)
	{
		case 129:
		case 131:
		case 141:
		case 136:
		case 138:
		case 139:
		case 140:
		case 144:
		case 146:
			return true;
		
		default:
	}
	if (func_577())
	{
		return true;
	}
	return false;
}

bool func_577()//Position - 0x11E59
{
	switch (func_360())
	{
		case 15:
		case 16:
		case 17:
		case 18:
			return true;
		
		default:
	}
	return false;
}

void func_578()//Position - 0x11E87
{
	gameplay::set_bit(&(Global_2464975.f_4589), 0);
}

bool func_579(int iParam0)//Position - 0x11E9B
{
	switch (iParam0)
	{
		case 136:
		case 144:
		case 129:
			return true;
		
		case 141:
			if (func_396(player::player_id()))
			{
				return true;
			}
			break;
	}
	return false;
}

void func_580(float fParam0)//Position - 0x11ED9
{
	float fVar0;
	
	if (gameplay::get_hash_key(script::get_this_script_name()) == func_581())
	{
		return;
	}
	fVar0 = (Global_2464975.f_4680 - fParam0);
	if (script::is_thread_active(Global_2464975.f_4681))
	{
		if (!Global_2464975.f_4681 == script::get_id_of_this_thread() && gameplay::absf(fVar0) > 0.001f)
		{
			return;
		}
	}
	Global_2464975.f_4680 = fParam0;
	Global_2464975.f_4681 = script::get_id_of_this_thread();
}

int func_581()//Position - 0x11F45
{
	switch (func_582())
	{
		case 0:
			return joaat("freemode");
			break;
		
		case 2:
			return joaat("creator");
			break;
	}
	return 0;
}

var func_582()//Position - 0x11F79
{
	return Global_25152;
}

void func_583()//Position - 0x11F84
{
	Global_2418529[player::player_id() /*313*/].f_198 = 0;
	gameplay::clear_bit(&(Global_2464975.f_4420), 1);
}

bool func_584(int iParam0)//Position - 0x11FA6
{
	switch (iParam0)
	{
		case 136:
			return true;
		
		default:
	}
	return false;
}

void func_585(int iParam0)//Position - 0x11FC0
{
	Global_1610705[player::player_id() /*178*/] = iParam0;
}

void func_586(int iParam0, int iParam1)//Position - 0x11FD4
{
	int iVar0;
	
	if (iParam0 != -1 || iParam1 != -1)
	{
		iVar0 = iParam0;
		if (iVar0 == -1)
		{
			iVar0 = iParam1;
		}
		if (func_642(0) || func_642(func_408(iVar0)))
		{
			gameplay::set_bit(&(Global_1610705[player::player_id() /*178*/].f_1), 2);
		}
		else
		{
			gameplay::clear_bit(&(Global_1610705[player::player_id() /*178*/].f_1), 2);
		}
	}
}

void func_587()//Position - 0x12038
{
	player::set_max_wanted_level(5);
	func_589();
	player::set_wanted_level_multiplier(1f);
	gameplay::clear_bit(&(Global_1573903.f_1), 8);
	func_588();
}

void func_588()//Position - 0x1205E
{
	if (Global_1732289)
	{
		if (gameplay::is_bit_set(Global_1732290, 0))
		{
			gameplay::clear_bit(&Global_2471749, 0);
		}
		if (gameplay::is_bit_set(Global_1732290, 1))
		{
			gameplay::clear_bit(&Global_2471749, 1);
		}
		if (gameplay::is_bit_set(Global_1732290, 5))
		{
			gameplay::clear_bit(&Global_2471749, 5);
		}
		if (object::_does_door_exist(-355737150))
		{
			object::_set_door_acceleration_limit(-355737150, 1, 0, 0);
		}
		if (object::_does_door_exist(-580979506))
		{
			object::_set_door_acceleration_limit(-580979506, 1, 0, 0);
		}
		if (object::_does_door_exist(-1426452475))
		{
			object::_set_door_acceleration_limit(-1426452475, 1, 0, 0);
		}
		if (object::_does_door_exist(745417724))
		{
			object::_set_door_acceleration_limit(745417724, 1, 0, 0);
		}
		if (object::_does_door_exist(-1305304906))
		{
			object::_set_door_acceleration_limit(-1305304906, 1, 0, 0);
		}
		if (object::_does_door_exist(-1543175077))
		{
			object::_set_door_acceleration_limit(-1543175077, 1, 0, 0);
		}
		if (object::_does_door_exist(-811770997))
		{
			object::_set_door_acceleration_limit(-811770997, 1, 0, 0);
		}
		Global_1732290 = 0;
	}
	Global_1732289 = 0;
}

void func_589()//Position - 0x1215E
{
	if (script::is_thread_active(Global_2464975.f_4681))
	{
		if (!Global_2464975.f_4681 == script::get_id_of_this_thread() && Global_2464975.f_4680 < 1f)
		{
			return;
		}
	}
	Global_2464975.f_4681 = -1;
	Global_2464975.f_4680 = 1f;
}

void func_590()//Position - 0x121A5
{
	controls::disable_control_action(0, 69, 1);
	controls::disable_control_action(0, 70, 1);
	controls::disable_control_action(0, 68, 1);
	controls::disable_control_action(0, 114, 1);
	controls::disable_control_action(0, 115, 1);
	controls::disable_control_action(0, 116, 1);
	controls::disable_control_action(0, 91, 1);
	controls::disable_control_action(0, 92, 1);
	controls::disable_control_action(0, 99, 1);
	controls::disable_control_action(0, 100, 1);
	controls::disable_control_action(0, 24, 1);
	controls::disable_control_action(0, 257, 1);
	controls::disable_control_action(0, 37, 1);
}

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

char* func_592()//Position - 0x12307
{
	char* sVar0;
	
	switch (Local_96.f_195)
	{
		case 0:
			sVar0 = "PEN_VALVEH";
			break;
	}
	return sVar0;
}

char* func_593()//Position - 0x12329
{
	char* sVar0;
	
	switch (Local_96.f_195)
	{
		case 0:
			sVar0 = "PEN_VEH";
			break;
	}
	return sVar0;
}

int func_594(int iParam0)//Position - 0x1234B
{
	int iVar0;
	
	iVar0 = 1;
	if ((iParam0 == joaat("rhino") || iParam0 == joaat("dump")) || iParam0 == joaat("limo2"))
	{
		iVar0 = 0;
	}
	switch (Local_96.f_195)
	{
		case 0:
			break;
	}
	if (Global_1573903.f_12 != 0 && iParam0 == Global_1573903.f_12)
	{
		iVar0 = 0;
	}
	return iVar0;
}

void func_595(int iParam0)//Position - 0x123B0
{
	if (iParam0)
	{
		gameplay::set_bit(&(Global_1610705[player::player_id() /*178*/].f_1), 4);
	}
	else
	{
		gameplay::clear_bit(&(Global_1610705[player::player_id() /*178*/].f_1), 4);
	}
}

void func_596()//Position - 0x123E2
{
	if (player::get_player_wanted_level(player::player_id()) == 0)
	{
		player::set_wanted_level_multiplier(0f);
		player::set_max_wanted_level(0);
		player::set_player_wanted_level(player::player_id(), 0, 0);
		player::set_player_wanted_level_now(player::player_id(), 0);
		gameplay::set_bit(&(Global_1573903.f_1), 8);
	}
}

bool func_597(int iParam0)//Position - 0x1241F
{
	float fVar0;
	vector3 vVar1;
	vector3 vVar4;
	float fVar7;
	
	if (iParam0)
	{
		if (!ped::is_ped_injured(player::player_ped_id()))
		{
			vVar1 = { entity::get_entity_coords(player::player_ped_id(), 1) };
			vVar4 = { func_270() };
			fVar0 = gameplay::get_distance_between_coords(vVar1, vVar4, 0);
			fVar7 = (func_271() / 2f);
			if (fVar0 <= fVar7)
			{
				if (gameplay::absf((vVar4.y - vVar1.y)) <= fVar7)
				{
					return true;
				}
			}
		}
	}
	else if (!ped::is_ped_injured(player::player_ped_id()))
	{
		if (fLocal_577 < 10f)
		{
			vVar1 = { entity::get_entity_coords(player::player_ped_id(), 1) };
			fVar0 = gameplay::get_distance_between_coords(vVar1, vLocal_570, 0);
			if (fVar0 <= fLocal_577)
			{
				if (gameplay::absf((vLocal_570.y - vVar1.y)) <= 10f)
				{
					return true;
				}
			}
		}
		else
		{
			fVar0 = func_88(player::player_ped_id(), vLocal_570, 1);
			if (fVar0 <= fLocal_577)
			{
				return true;
			}
		}
	}
	return false;
}

char* func_598()//Position - 0x12500
{
	char* sVar0;
	
	switch (Local_96.f_195)
	{
		case 0:
			sVar0 = "PEN_START";
			break;
	}
	return sVar0;
}

void func_599()//Position - 0x12522
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	int iVar4;
	int iVar5;
	
	if (!gameplay::is_bit_set(iLocal_550, 9))
	{
		if (gameplay::is_bit_set(Local_96.f_1, 4))
		{
			gameplay::set_bit(&iLocal_550, 9);
		}
	}
	if (Local_96 != 4)
	{
		iVar0 = 0;
		while (iVar0 < network::_network_get_num_participants_host())
		{
			if (network::network_is_participant_active(player::int_to_participantindex(iVar0)))
			{
				iVar4 = network::network_get_player_index(player::int_to_participantindex(iVar0));
				iVar5 = player::get_player_ped(iVar4);
				if (!func_52(iVar4, 0))
				{
					if (Local_292[iVar0 /*8*/].f_7 == 0)
					{
						if (iVar0 != network::participant_id_to_int())
						{
							if (gameplay::is_bit_set(Local_292[iVar0 /*8*/].f_1, 0))
							{
								iVar1++;
							}
						}
						if (!func_51(iVar4))
						{
							iVar2++;
						}
					}
					if (!gameplay::is_bit_set(iLocal_550, 10))
					{
						if (!gameplay::is_bit_set(iLocal_550, 9))
						{
							if (gameplay::is_bit_set(Local_292[iVar0 /*8*/].f_1, 3))
							{
								gameplay::set_bit(&iLocal_550, 9);
							}
						}
					}
					if (iVar0 != network::participant_id_to_int())
					{
						if (Local_96.f_195 == 0)
						{
							if (!gameplay::is_bit_set(iLocal_3771, iVar0))
							{
								unk_0xA7C511FA1C5BDA38(iVar4, 0);
								gameplay::set_bit(&iLocal_3771, iVar0);
							}
						}
						if (Local_292[network::participant_id_to_int() /*8*/].f_7 == 2)
						{
							if (Local_292[iVar0 /*8*/].f_7 == 2)
							{
								if (!ped::is_ped_injured(player::player_ped_id()))
								{
									if (!gameplay::is_bit_set(Local_292[iVar0 /*8*/].f_1, 6) && !func_602(player::player_ped_id(), iVar5))
									{
										if (!gameplay::is_bit_set(iLocal_552, iVar0))
										{
											if (!gameplay::is_bit_set(Local_292[iVar0 /*8*/].f_1, 1))
											{
												gameplay::set_bit(&iLocal_552, iVar0);
												func_600(iVar4, 441, 1);
											}
										}
										else if (gameplay::is_bit_set(Local_292[iVar0 /*8*/].f_1, 1))
										{
											gameplay::clear_bit(&iLocal_552, iVar0);
											func_600(iVar4, 441, 0);
										}
									}
								}
							}
							else if (gameplay::is_bit_set(iLocal_552, iVar0))
							{
								gameplay::clear_bit(&iLocal_552, iVar0);
								func_600(iVar4, 441, 0);
							}
						}
						else if (gameplay::is_bit_set(iLocal_552, iVar0))
						{
							gameplay::clear_bit(&iLocal_552, iVar0);
							func_600(iVar4, 441, 0);
						}
						if (Local_292[network::participant_id_to_int() /*8*/].f_7 > 0)
						{
							if (!gameplay::is_bit_set(iLocal_553, iVar0) && !gameplay::is_bit_set(Local_96.f_1, 3))
							{
								if (gameplay::is_bit_set(Local_292[iVar0 /*8*/].f_1, 9))
								{
									audio::_0x153973AB99FE8980(iVar5, "MP_Penned_In_Vehicles_In_Bubble_Group", 0f);
									gameplay::set_bit(&iLocal_553, iVar0);
									if (ped::is_ped_in_any_vehicle(iVar5, 0))
									{
										iVar3 = ped::get_vehicle_ped_is_in(iVar5, 0);
										audio::_0x153973AB99FE8980(iVar3, "MP_Penned_In_Vehicles_In_Bubble_Group", 0f);
									}
								}
							}
							else if (!gameplay::is_bit_set(Local_292[iVar0 /*8*/].f_1, 9) || gameplay::is_bit_set(Local_96.f_1, 3))
							{
								audio::_0x18EB48CFC41F2EA0(iVar5, 0f);
								gameplay::clear_bit(&iLocal_553, iVar0);
								if (ped::is_ped_in_any_vehicle(iVar5, 0))
								{
									iVar3 = ped::get_vehicle_ped_is_in(iVar5, 0);
									audio::_0x18EB48CFC41F2EA0(iVar3, 0f);
								}
							}
						}
						if (Local_96.f_195 == 0)
						{
							if (!ped::is_ped_injured(player::player_ped_id()))
							{
								if (!ped::is_ped_injured(iVar5))
								{
									if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 8))
									{
										if (!gameplay::is_bit_set(iLocal_554, iVar0))
										{
											if (!gameplay::is_bit_set(Local_292[iVar0 /*8*/].f_1, 8))
											{
												if (!func_602(player::player_ped_id(), iVar5))
												{
													if (!gameplay::is_bit_set(Local_292[iVar0 /*8*/].f_1, 11))
													{
														gameplay::set_bit(&iLocal_554, iVar0);
														unk_0xA7C511FA1C5BDA38(iVar4, 1);
													}
												}
											}
										}
										else if (gameplay::is_bit_set(Local_292[iVar0 /*8*/].f_1, 8))
										{
											gameplay::clear_bit(&iLocal_554, iVar0);
											unk_0xA7C511FA1C5BDA38(iVar4, 0);
										}
										else if (gameplay::is_bit_set(Local_292[iVar0 /*8*/].f_1, 11))
										{
											gameplay::clear_bit(&iLocal_554, iVar0);
											unk_0xA7C511FA1C5BDA38(iVar4, 0);
										}
										else if (func_602(player::player_ped_id(), iVar5))
										{
											gameplay::clear_bit(&iLocal_554, iVar0);
											unk_0xA7C511FA1C5BDA38(iVar4, 0);
										}
									}
									else if (gameplay::is_bit_set(iLocal_554, iVar0))
									{
										unk_0xA7C511FA1C5BDA38(iVar4, 0);
										gameplay::clear_bit(&iLocal_554, iVar0);
									}
								}
							}
						}
					}
				}
			}
			iVar0++;
		}
		if (iLocal_3039 != iVar1)
		{
			iLocal_3039 = iVar1;
		}
		if (iLocal_3770 != iVar2)
		{
			iLocal_3770 = iVar2;
		}
	}
}

void func_600(int iParam0, int iParam1, int iParam2)//Position - 0x128FD
{
	int iVar0;
	var uVar1;
	
	if (iParam0 == func_58())
	{
		return;
	}
	if (gameplay::get_hash_key(script::get_this_script_name()) == func_581())
	{
		return;
	}
	iVar0 = iParam0;
	uVar1 = iParam1;
	if (!script::is_thread_active(Global_2412936.f_526[iParam0]) || Global_2412936.f_526[iParam0] == script::get_id_of_this_thread())
	{
		if (iParam2)
		{
			if (!gameplay::is_bit_set(Global_2412936.f_385, iVar0))
			{
				func_601();
			}
			gameplay::set_bit(&(Global_2412936.f_385), iVar0);
			Global_2412936.f_394[iVar0] = uVar1;
			Global_2412936.f_526[iParam0] = script::get_id_of_this_thread();
		}
		else
		{
			if (gameplay::is_bit_set(Global_2412936.f_385, iVar0))
			{
				func_601();
			}
			gameplay::clear_bit(&(Global_2412936.f_385), iVar0);
			Global_2412936.f_526[iParam0] = -1;
		}
	}
}

void func_601()//Position - 0x129CA
{
	Global_2412936.f_880 = 1;
}

int func_602(int iParam0, int iParam1)//Position - 0x129DA
{
	if (iParam0 == iParam1)
	{
		return true;
	}
	if (!ped::is_ped_in_any_vehicle(iParam0, 0) || !ped::is_ped_in_any_vehicle(iParam1, 0))
	{
		return false;
	}
	return ped::get_vehicle_ped_is_in(iParam0, 0) == ped::get_vehicle_ped_is_in(iParam1, 0);
}

void func_603(int iParam0, int iParam1, int iParam2, int iParam3)//Position - 0x12A19
{
	switch (iParam0)
	{
		case 136:
			switch (iParam1)
			{
				case 0:
					func_604("kwUfKUus6EuQyNSL8KpY-w");
					func_604("yMTOFLfO2UKwzKrmgPP7kg");
					func_604("9mGvlJ1Cxk-HxC2zkAwdQg");
					break;
				
				case 2:
					func_604("tP5HSeCA0UiHnkRzakdO2Q");
					func_604("uEkrqoerQEmQ0uZRtp4rkw");
					func_604("xIXaDwts7kKz0sbMnwYlCQ");
					break;
				
				case 3:
					func_604("UOTaXepxrUOUEU7QtfBvGQ");
					break;
			}
			break;
		
		case 139:
			switch (iParam1)
			{
				case 1:
					func_604("OZ5hEthzqUSuK_x9YuO4uw");
					break;
				
				case 2:
					func_604("uEkrqoerQEmQ0uZRtp4rkw");
					break;
			}
			break;
		
		case 138:
			switch (iParam1)
			{
				case 2:
					func_604("lyrTwqWnP0SqGuK4GdrgDg");
					break;
				
				case 3:
					func_604("uEkrqoerQEmQ0uZRtp4rkw");
					func_604("92t91kL3Wkqvl2Kc82cNSA");
					func_604("43Yoc5jfr0OwGfW9UP5TXA");
					break;
				
				case 5:
					func_604("WfnWlxu780CwC7LLUrLljw");
					break;
				
				case 6:
					func_604("lowxnyELLUCxqy_Q1uslIg");
					break;
				
				case 7:
					func_604("QmlvLMLCwkOvoZlkAstYxw");
					break;
			}
			break;
		
		case 141:
			switch (iParam1)
			{
				case 0:
					func_604("TT4ifq2kgEG6G1fCUYHXSQ");
					break;
			}
			break;
		
		case 134:
			switch (iParam1)
			{
				case 1:
					func_604("QmlvLMLCwkOvoZlkAstYxw");
					break;
				
				case 4:
					func_604("fOfm7nzMLkav0ldcSCNAzA");
					func_604("JMbOeJ2-ak-02KwNLtnOJg");
					break;
				
				case 5:
					func_604("3AAj-muvN0iHI5IMyGlboA");
					break;
				
				case 0:
					func_604("lyrTwqWnP0SqGuK4GdrgDg");
					break;
				
				case 9:
					func_604("Ma78E44OMkGfYPmCPZXUNA");
					func_604("Pqz3l_Dhg0ar0yHiz2wMqQ");
					break;
				
				case 19:
					func_604("ZmoxEY6L60WSR-7I5IUjPg");
					break;
				
				case 10:
					func_604("gxmtJHj2OUWQDt8nNMy3TQ");
					break;
			}
			break;
		
		case 140:
			switch (iParam1)
			{
				case 0:
					switch (iParam2)
					{
						case 0:
							func_604("lowxnyELLUCxqy_Q1uslIg");
							break;
					}
					break;
				
				case 1:
					switch (iParam2)
					{
						case 2:
							func_604("dCWpYaU7CU-Bxz5s2qGjaA");
							break;
					}
					break;
				
				case 2:
					func_604("QmlvLMLCwkOvoZlkAstYxw");
					break;
				
				case 3:
					switch (iParam2)
					{
						case 1:
							func_604("Cl3Gh6-LMkuZ7Z_jPqSE8g");
							break;
						
						case 2:
							func_604("TT4ifq2kgEG6G1fCUYHXSQ");
							break;
					}
					break;
				
				case 4:
					func_604("A0vXbIK2WEmiVSUNYRGpvA");
					switch (iParam2)
					{
						case 2:
							func_604("3AAj-muvN0iHI5IMyGlboA");
							break;
					}
					break;
			}
			break;
		
		case 129:
			switch (iParam1)
			{
				case 0:
					switch (iParam2)
					{
						case 0:
							func_604("kXry-nXRbEC6ktiopjDDcg");
							break;
						
						case 1:
							func_604("JCMcBpPl9UWmcdOYFza0Tg");
							break;
						
						case 2:
							func_604("ZmoxEY6L60WSR-7I5IUjPg");
							break;
						
						case 3:
							func_604("fOfm7nzMLkav0ldcSCNAzA");
							func_604("JMbOeJ2-ak-02KwNLtnOJg");
							break;
					}
					break;
				
				case 1:
					switch (iParam2)
					{
						case 0:
							func_604("OZ5hEthzqUSuK_x9YuO4uw");
							break;
						
						case 1:
							func_604("lyrTwqWnP0SqGuK4GdrgDg");
							break;
					}
					break;
				
				case 2:
					switch (iParam2)
					{
						case 0:
							func_604("QmlvLMLCwkOvoZlkAstYxw");
							break;
						
						case 2:
							func_604("yMTOFLfO2UKwzKrmgPP7kg");
							break;
					}
					break;
				
				case 3:
					switch (iParam2)
					{
						case 3:
							func_604("xIXaDwts7kKz0sbMnwYlCQ");
							break;
					}
					break;
				
				case 4:
					switch (iParam2)
					{
						case 1:
							func_604("gaJhsFMzFkyl3al5SRa6fQ");
							break;
					}
					break;
				
				case 5:
					switch (iParam2)
					{
						case 1:
							func_604("JCMcBpPl9UWmcdOYFza0Tg");
							break;
						
						case 2:
							func_604("ZmoxEY6L60WSR-7I5IUjPg");
							break;
						
						case 3:
							func_604("fOfm7nzMLkav0ldcSCNAzA");
							func_604("JMbOeJ2-ak-02KwNLtnOJg");
							break;
					}
					break;
				
				case 6:
					switch (iParam2)
					{
						case 0:
							func_604("OZ5hEthzqUSuK_x9YuO4uw");
							break;
						
						case 1:
							func_604("lyrTwqWnP0SqGuK4GdrgDg");
							break;
					}
					break;
				
				case 7:
					switch (iParam2)
					{
						case 0:
							func_604("QmlvLMLCwkOvoZlkAstYxw");
							break;
						
						case 2:
							func_604("yMTOFLfO2UKwzKrmgPP7kg");
							break;
					}
					break;
				
				case 8:
					switch (iParam2)
					{
						case 3:
							func_604("xIXaDwts7kKz0sbMnwYlCQ");
							break;
					}
					break;
			}
			break;
		
		case 131:
			switch (iParam3)
			{
				case 0:
					switch (iParam1)
					{
						case 0:
							switch (iParam2)
							{
								case 1:
									func_604("UOTaXepxrUOUEU7QtfBvGQ");
									break;
								
								case 2:
									func_604("xIXaDwts7kKz0sbMnwYlCQ");
									break;
							}
							break;
						
						case 1:
							switch (iParam2)
							{
								case 0:
									func_604("kXry-nXRbEC6ktiopjDDcg");
									break;
								
								case 2:
									func_604("QmlvLMLCwkOvoZlkAstYxw");
									break;
								
								case 3:
									func_604("gxmtJHj2OUWQDt8nNMy3TQ");
									break;
								
								case 4:
									func_604("A0vXbIK2WEmiVSUNYRGpvA");
									break;
							}
							break;
						
						case 2:
							switch (iParam2)
							{
								case 0:
									func_604("dCWpYaU7CU-Bxz5s2qGjaA");
									break;
								
								case 2:
									func_604("aGBjo2rKi0yMDLl3a2ATGA");
									func_604("yMTOFLfO2UKwzKrmgPP7kg");
									break;
								
								case 3:
									func_604("lhGatLUmgke_87surSFS5g");
									break;
							}
							break;
						
						case 3:
							switch (iParam2)
							{
								case 1:
									func_604("VmS_SI5wSE2LuL9qItQqbw");
									break;
								
								case 4:
									func_604("f2lnL6wZPkGWUowu0yLm1Q");
									func_604("ZmoxEY6L60WSR-7I5IUjPg");
									break;
							}
							break;
						
						case 4:
							switch (iParam2)
							{
								case 1:
									func_604("Ma78E44OMkGfYPmCPZXUNA");
									break;
								
								case 2:
									func_604("TT4ifq2kgEG6G1fCUYHXSQ");
									break;
							}
							break;
						
						case 5:
							switch (iParam2)
							{
								case 0:
									func_604("W-OJzHlM-0ym9PsIASYZtw");
									func_604("uEkrqoerQEmQ0uZRtp4rkw");
									break;
								
								case 1:
									func_604("3AAj-muvN0iHI5IMyGlboA");
									break;
								
								case 3:
									func_604("TjGz31AMYE6bGCjAIitu6w");
									func_604("A0vXbIK2WEmiVSUNYRGpvA");
									break;
							}
							break;
						
						case 6:
							switch (iParam2)
							{
								case 2:
									func_604("QmlvLMLCwkOvoZlkAstYxw");
									func_604("BktATxH9R0Wp2x0kWSbqjw");
									break;
								
								case 3:
									func_604("BktATxH9R0Wp2x0kWSbqjw");
									func_604("kXry-nXRbEC6ktiopjDDcg");
									break;
								
								case 4:
									func_604("f2lnL6wZPkGWUowu0yLm1Q");
									break;
							}
							break;
					}
					break;
				
				case 1:
					switch (iParam1)
					{
						case 0:
							switch (iParam2)
							{
								case 1:
									func_604("kXry-nXRbEC6ktiopjDDcg");
									break;
								
								case 3:
									func_604("PY8hdiWoAkudg9SpK8G2xQ");
									break;
							}
							break;
						
						case 1:
							switch (iParam2)
							{
								case 0:
									func_604("TT4ifq2kgEG6G1fCUYHXSQ");
									break;
								
								case 1:
									func_604("9mGvlJ1Cxk-HxC2zkAwdQg");
									break;
								
								case 2:
									func_604("tP5HSeCA0UiHnkRzakdO2Q");
									break;
								
								case 3:
									func_604("kXry-nXRbEC6ktiopjDDcg");
									break;
							}
							break;
						
						case 2:
							switch (iParam2)
							{
								case 3:
									func_604("Cl3Gh6-LMkuZ7Z_jPqSE8g");
									break;
							}
							break;
					}
					break;
				
				case 2:
					switch (iParam1)
					{
						case 0:
							switch (iParam2)
							{
								case 0:
									func_604("Pqz3l_Dhg0ar0yHiz2wMqQ");
									break;
							}
							break;
						
						case 4:
							switch (iParam2)
							{
								case 4:
									func_604("W-OJzHlM-0ym9PsIASYZtw");
									break;
							}
							break;
					}
					break;
			}
			break;
	}
}

void func_604(char* sParam0)//Position - 0x13196
{
	int iVar0;
	int iVar1;
	
	if (gameplay::is_string_null_or_empty(sParam0))
	{
		return;
	}
	iVar0 = gameplay::get_hash_key(sParam0);
	iVar1 = 0;
	iVar1 = 0;
	while (iVar1 < Global_1311741)
	{
		if (gameplay::is_bit_set(Global_2359719[iVar1 /*26*/].f_12, 11))
		{
			if (func_605(&(Global_2359719[iVar1 /*26*/].f_15)) == iVar0)
			{
				if (!gameplay::is_bit_set(Global_2359719[iVar1 /*26*/].f_13, 26))
				{
					gameplay::set_bit(&(Global_2359719[iVar1 /*26*/].f_13), 26);
				}
				return;
			}
		}
		iVar1++;
	}
}

int func_605(var uParam0)//Position - 0x1321A
{
	struct<12> Var0;
	int iVar12;
	int iVar13;
	
	Var0.f_4 = -1;
	Var0.f_5 = -1;
	Var0.f_11 = -1;
	iVar12 = 0;
	iVar13 = func_607(uParam0);
	if (iVar13 == -1)
	{
		return iVar12;
	}
	switch (uParam0->f_2)
	{
		case 63:
			Var0 = { func_606(uParam0) };
			return Var0.f_1;
		
		case 62:
			return iVar12;
		
		default:
	}
	return iVar12;
}

struct<12> func_606(var uParam0)//Position - 0x1327B
{
	struct<12> Var0;
	int iVar12;
	
	Var0.f_4 = -1;
	Var0.f_5 = -1;
	Var0.f_11 = -1;
	iVar12 = func_607(uParam0);
	if (iVar12 == -1)
	{
		return Var0;
	}
	switch (uParam0->f_2)
	{
		case 63:
			return Global_794608.f_98389[iVar12 /*12*/];
		
		case 62:
			return Global_906487.f_18805[iVar12 /*12*/];
		
		default:
	}
	return Var0;
}

int func_607(var uParam0)//Position - 0x132EC
{
	int iVar0;
	
	if (gameplay::is_string_null_or_empty(&(uParam0->f_3)))
	{
		return -1;
	}
	if (func_609(uParam0->f_1))
	{
		if (func_608(uParam0))
		{
			return 9999;
		}
		return -1;
	}
	iVar0 = 0;
	switch (uParam0->f_2)
	{
		case 63:
			if (gameplay::is_bit_set(Global_794608.f_4[uParam0->f_1 /*88*/].f_76, 13))
			{
				if (gameplay::are_strings_equal(&(Global_794608.f_4[uParam0->f_1 /*88*/]), &(uParam0->f_3)))
				{
					return uParam0->f_1;
				}
			}
			if (!gameplay::is_bit_set(Global_794608.f_4[uParam0->f_1 /*88*/].f_76, 13))
			{
				if (Global_1310987.f_5)
				{
					return -1;
				}
			}
			iVar0 = 0;
			while (iVar0 < 1118)
			{
				if (gameplay::is_bit_set(Global_794608.f_4[iVar0 /*88*/].f_76, 13))
				{
					if (gameplay::are_strings_equal(&(Global_794608.f_4[iVar0 /*88*/]), &(uParam0->f_3)))
					{
						uParam0->f_1 = iVar0;
						return iVar0;
					}
				}
				iVar0++;
			}
			return -1;
		
		case 62:
			if (gameplay::is_bit_set(Global_906487.f_1204[uParam0->f_1 /*88*/].f_76, 13))
			{
				if (gameplay::are_strings_equal(&(Global_906487.f_1204[uParam0->f_1 /*88*/]), &(uParam0->f_3)))
				{
					return uParam0->f_1;
				}
			}
			if (!gameplay::is_bit_set(Global_906487.f_1204[uParam0->f_1 /*88*/].f_76, 13))
			{
				if (Global_1310987.f_5)
				{
					return -1;
				}
			}
			iVar0 = 0;
			while (iVar0 < 200)
			{
				if (gameplay::is_bit_set(Global_906487.f_1204[iVar0 /*88*/].f_76, 13))
				{
					if (gameplay::are_strings_equal(&(Global_906487.f_1204[iVar0 /*88*/]), &(uParam0->f_3)))
					{
						uParam0->f_1 = iVar0;
						return iVar0;
					}
				}
				iVar0++;
			}
			return -1;
		
		case 40:
			return uParam0->f_1;
		
		default:
	}
	if (uParam0->f_2 == player::player_id())
	{
		if (gameplay::is_bit_set(Global_949333.f_5[uParam0->f_1 /*88*/].f_76, 13))
		{
			if (gameplay::are_strings_equal(&(Global_949333.f_5[uParam0->f_1 /*88*/]), &(uParam0->f_3)))
			{
				return uParam0->f_1;
			}
		}
		if (gameplay::is_bit_set(Global_949333.f_5[uParam0->f_1 /*88*/].f_76, 13))
		{
			if (Global_1310987.f_5)
			{
				return -1;
			}
		}
		iVar0 = 0;
		while (iVar0 < 62)
		{
			if (gameplay::is_bit_set(Global_949333.f_5[iVar0 /*88*/].f_76, 13))
			{
				if (gameplay::are_strings_equal(&(Global_949333.f_5[iVar0 /*88*/]), &(uParam0->f_3)))
				{
					uParam0->f_1 = iVar0;
					return iVar0;
				}
			}
			iVar0++;
		}
		return -1;
	}
	else if (uParam0->f_2 < 32)
	{
		return -1;
	}
	return -1;
}

bool func_608(var uParam0)//Position - 0x1355C
{
	if (Global_2398050)
	{
		if (gameplay::are_strings_equal(&(Global_2398050.f_1), &(uParam0->f_3)))
		{
			return true;
		}
	}
	return false;
}

int func_609(int iParam0)//Position - 0x13581
{
	return iParam0 == 9999;
}

void func_610()//Position - 0x1358F
{
	if (!ui::does_blip_exist(iLocal_568))
	{
		iLocal_568 = ui::add_blip_for_coord(func_270());
		ui::set_blip_sprite(iLocal_568, 441);
		ui::set_blip_flashes(iLocal_568, 1);
		ui::set_blip_flash_timer(iLocal_568, 7000);
		ui::set_blip_priority(iLocal_568, 9);
		ui::set_blip_name_from_text_file(iLocal_568, "PEN_BLIP");
		func_611(&iLocal_568, 29);
		if (!gameplay::is_bit_set(iLocal_549, 30))
		{
			ui::flash_minimap_display();
			gameplay::set_bit(&iLocal_549, 30);
		}
	}
}

void func_611(int iParam0, int iParam1)//Position - 0x13600
{
	if (ui::does_blip_exist(*iParam0))
	{
		ui::set_blip_colour(*iParam0, func_612(iParam1));
	}
}

int func_612(int iParam0)//Position - 0x13622
{
	int iVar0;
	int iVar1;
	int iVar2;
	int iVar3;
	
	switch (iParam0)
	{
		case 1:
			return 4;
		
		case 0:
			return 4;
		
		case 6:
			return 59;
		
		case 18:
			return 2;
		
		case 13:
			return 5;
		
		case 116:
			return 38;
		
		case 28:
			return 6;
		
		case 29:
			return 7;
		
		case 30:
			return 8;
		
		case 31:
			return 9;
		
		case 32:
			return 10;
		
		case 33:
			return 11;
		
		case 34:
			return 12;
		
		case 35:
			return 13;
		
		case 36:
			return 14;
		
		case 37:
			return 15;
		
		case 38:
			return 16;
		
		case 39:
			return 17;
		
		case 40:
			return 18;
		
		case 41:
			return 19;
		
		case 42:
			return 20;
		
		case 43:
			return 21;
		
		case 44:
			return 22;
		
		case 45:
			return 23;
		
		case 46:
			return 24;
		
		case 47:
			return 25;
		
		case 48:
			return 26;
		
		case 49:
			return 27;
		
		case 50:
			return 28;
		
		case 51:
			return 29;
		
		case 52:
			return 30;
		
		case 53:
			return 31;
		
		case 54:
			return 32;
		
		case 55:
			return 33;
		
		case 56:
			return 34;
		
		case 57:
			return 35;
		
		case 58:
			return 36;
		
		case 59:
			return 37;
		
		case 9:
			return 57;
		
		case 10:
			return 53;
		
		case 118:
			return 57;
		
		case 14:
			return 56;
		
		case 3:
			return 55;
		
		case 21:
			return 50;
		
		case 15:
			return 51;
		
		case 20:
			return 52;
		
		case 11:
			return 54;
		
		case 23:
			return 58;
		
		case 12:
			return 60;
		
		case 24:
			return 61;
		
		case 4:
			return 62;
		
		default:
	}
	ui::get_hud_colour(iParam0, &iVar0, &iVar1, &iVar2, &iVar3);
	return ((((iVar0 * 16777216) + (iVar1 * 65536)) + iVar2 * 256) + iVar3);
	return 0;
}

void func_613(vector3 vParam0, int iParam3)//Position - 0x1388A
{
	if (!ui::does_blip_exist(iLocal_567))
	{
		if (!iParam3)
		{
			iLocal_567 = ui::add_blip_for_radius(vParam0, fLocal_577);
			ui::set_blip_colour(iLocal_567, 5);
		}
		else
		{
			iLocal_567 = ui::add_blip_for_radius(func_270(), (func_271() / 2f));
			func_611(&iLocal_567, 29);
		}
		ui::set_blip_alpha(iLocal_567, 100);
		ui::_0x75A16C3DA34F1245(iLocal_567, false);
	}
}

Vector3 func_614()//Position - 0x138E7
{
	return vLocal_600[0 /*3*/];
}

int func_615(int iParam0)//Position - 0x138F7
{
	int iVar0;
	
	if (func_225(player::player_id()))
	{
		iVar0 = 1;
	}
	if (func_642(0))
	{
		iVar0 = 1;
	}
	if (iParam0)
	{
		if (!func_625())
		{
			iVar0 = 1;
		}
	}
	if (!func_617(136, 0, 0))
	{
		iVar0 = 1;
	}
	if (gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 6))
	{
		if (func_225(player::player_id()))
		{
			iVar0 = 1;
		}
	}
	if (Global_1722816)
	{
		iVar0 = 1;
	}
	if (func_616(player::player_id()))
	{
		iVar0 = 1;
	}
	return iVar0;
}

int func_616(int iParam0)//Position - 0x13972
{
	if (!func_694(iParam0, 0, 1))
	{
		return 0;
	}
	return Global_1587816[iParam0 /*444*/].f_35;
}

int func_617(int iParam0, int iParam1, int iParam2)//Position - 0x13995
{
	int iVar0;
	int iVar1;
	
	if (Global_262145.f_6298 == 1)
	{
		if (iParam0 == 67)
		{
			return true;
		}
		if (iParam0 == 74)
		{
			return true;
		}
		if (func_621(player::player_id(), 85))
		{
			if (((((iParam0 == 64 || iParam0 == 77) || iParam0 == 61) || iParam0 == 81) || iParam0 == 63) || iParam0 == 62)
			{
				return true;
			}
		}
		if ((((((((((iParam0 == 66 || iParam0 == 116) || iParam0 == 103) || iParam0 == 104) || iParam0 == 105) || iParam0 == 119) || iParam0 == 88) || iParam0 == 75) || iParam0 == 95) || iParam0 == 65) || iParam0 == 98)
		{
			return true;
		}
	}
	if (iParam0 < 0)
	{
		return false;
	}
	if (iParam0 == 31)
	{
		if (Global_262145.f_4870 == 1)
		{
			return true;
		}
	}
	if (func_620() || func_619())
	{
		return true;
	}
	iVar0 = iParam0;
	iVar1 = (iVar0 / 32);
	iVar0 = (iVar0 % 32);
	if (iParam1)
	{
		if (iParam0 == 3)
		{
			if (func_618())
			{
				return true;
			}
			else
			{
				return false;
			}
		}
	}
	if (iParam2)
	{
		return false;
	}
	return gameplay::is_bit_set(Global_1573893[iVar1], iVar0);
}

bool func_618()//Position - 0x13B03
{
	int iVar0;
	
	if (Global_1312446)
	{
		return true;
	}
	if (gameplay::is_bit_set(Global_2464975.f_1638, 23))
	{
		return true;
	}
	if (func_620())
	{
		return true;
	}
	if (func_619())
	{
		return true;
	}
	iVar0 = Global_1347809[func_96(-1)];
	if (gameplay::is_bit_set(iVar0, 7))
	{
		gameplay::set_bit(&(Global_2464975.f_1638), 23);
		return true;
	}
	return false;
}

var func_619()//Position - 0x13B69
{
	return Global_1315901;
}

var func_620()//Position - 0x13B75
{
	return Global_1315903;
}

int func_621(int iParam0, int iParam1)//Position - 0x13B81
{
	var uVar0;
	int iVar1;
	
	if (!func_624())
	{
		return false;
	}
	if (func_623())
	{
		return false;
	}
	if (iParam1 == 86)
	{
		return true;
	}
	uVar0 = func_622(iParam1);
	iVar1 = uVar0;
	return gameplay::is_bit_set(Global_1587816[iParam0 /*444*/].f_345, iVar1);
}

int func_622(int iParam0)//Position - 0x13BC9
{
	switch (iParam0)
	{
		case 86:
			return 0;
		
		case 19:
			return 1;
		
		case 12:
			return 2;
		
		case 31:
			return 3;
		
		case 20:
			return 4;
		
		case 18:
			return 5;
		
		case 2:
			return 6;
		
		case 76:
			return 7;
		
		default:
	}
	return 1;
}

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

int func_624()//Position - 0x13C43
{
	if (Global_1312446)
	{
		return 1;
	}
	if (func_620())
	{
		return 1;
	}
	if (func_619())
	{
		return 1;
	}
	return func_405(120, -1);
}

bool func_625()//Position - 0x13C73
{
	if (func_402(player::player_id(), 21))
	{
		return false;
	}
	if (network::network_is_in_tutorial_session())
	{
		return false;
	}
	if (network::network_is_in_mp_cutscene())
	{
		return false;
	}
	if (func_546(player::player_id()))
	{
		return false;
	}
	if (func_420())
	{
		return false;
	}
	if (func_636(player::player_id()))
	{
		return false;
	}
	if (func_385())
	{
		return false;
	}
	if (func_393(player::player_id()) == 3)
	{
		return false;
	}
	if (func_634(func_635()))
	{
		return false;
	}
	if (func_567())
	{
		return false;
	}
	if (func_237())
	{
		return false;
	}
	if (network::network_is_activity_session())
	{
		return false;
	}
	if (func_378(player::player_id()))
	{
		return false;
	}
	if (!func_381())
	{
		return false;
	}
	if (func_402(player::player_id(), 0) || func_402(player::player_id(), 3))
	{
		return false;
	}
	if ((func_402(player::player_id(), 12) || func_402(player::player_id(), 14)) || func_402(player::player_id(), 13))
	{
		return false;
	}
	if (func_631(player::player_id(), 0, 0))
	{
		return false;
	}
	if (func_630(player::player_id()))
	{
		return false;
	}
	if (func_629())
	{
		return false;
	}
	if (Global_1722816)
	{
		return false;
	}
	if (func_616(player::player_id()))
	{
		return false;
	}
	if (func_628())
	{
		return false;
	}
	if (func_626(player::player_id()) && Global_1587609.f_168)
	{
		return false;
	}
	return true;
}

bool func_626(int iParam0)//Position - 0x13DEC
{
	if (func_627(Global_1587816[iParam0 /*444*/].f_250.f_9))
	{
		return true;
	}
	return false;
}

bool func_627(int iParam0)//Position - 0x13E0D
{
	switch (iParam0)
	{
		case 87:
		case 88:
		case 89:
		case 90:
			return true;
			break;
	}
	return false;
}

bool func_628()//Position - 0x13E3C
{
	if (Global_2557205.f_797 > -1)
	{
		return true;
	}
	return false;
}

int func_629()//Position - 0x13E54
{
	return Global_91362.f_297 > 0;
}

int func_630(int iParam0)//Position - 0x13E65
{
	return gameplay::is_bit_set(Global_1587816[iParam0 /*444*/].f_250.f_7, 11);
}

bool func_631(int iParam0, int iParam1, int iParam2)//Position - 0x13E80
{
	if (Global_1587816[iParam0 /*444*/].f_250.f_9 > 0)
	{
		if (iParam1)
		{
			if (gameplay::is_bit_set(Global_1587816[iParam0 /*444*/].f_250.f_7, 0))
			{
				return true;
			}
		}
		else
		{
			return true;
		}
	}
	if (!iParam2)
	{
		if (func_632(iParam0))
		{
			return true;
		}
	}
	return false;
}

int func_632(int iParam0)//Position - 0x13ED2
{
	if (iParam0 != func_58())
	{
		if (func_694(iParam0, 1, 1))
		{
			if (Global_2418529[iParam0 /*313*/].f_305.f_1 != -1)
			{
				return func_633(Global_2418529[iParam0 /*313*/].f_305.f_1) == 0;
			}
		}
	}
	return false;
}

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

bool func_634(int iParam0)//Position - 0x13FB3
{
	switch (iParam0)
	{
		case 86:
		case 87:
		case 88:
		case 98:
			return true;
		
		default:
	}
	return false;
}

var func_635()//Position - 0x13FDF
{
	return Global_2428549.f_2191[0 /*72*/].f_1;
}

bool func_636(int iParam0)//Position - 0x13FF3
{
	if (Global_2418529[iParam0 /*313*/].f_257.f_4 != 0 || Global_2418529[iParam0 /*313*/].f_257.f_5)
	{
		return true;
	}
	return false;
}

var func_637()//Position - 0x14029
{
	return Global_262145.f_9346;
}

var func_638()//Position - 0x14038
{
	return Global_262145.f_9343;
}

void func_639()//Position - 0x14047
{
	int iVar0;
	vector3 vVar1;
	vector3 vVar4;
	
	if (!func_30(vLocal_600[0 /*3*/], 0f, 0f, 0f, 0))
	{
		return;
	}
	switch (Local_96.f_165)
	{
		case 0:
			vLocal_600[0 /*3*/] = { 1476.637f, -2436.075f, 65.2401f };
			vLocal_600[1 /*3*/] = { 1591.158f, -1980.835f, 93.9884f };
			vLocal_600[2 /*3*/] = { 1105.58f, -1734.014f, 34.7122f };
			vLocal_600[3 /*3*/] = { 674.1869f, -1733.183f, 28.3527f };
			vLocal_600[4 /*3*/] = { 276.4475f, -1857.687f, 25.8607f };
			vLocal_600[5 /*3*/] = { 241.6554f, -1713.72f, 28.1339f };
			vLocal_600[6 /*3*/] = { 276.8612f, -1670.451f, 28.3137f };
			vLocal_600[7 /*3*/] = { 158.5084f, -1512.412f, 28.1416f };
			vLocal_600[8 /*3*/] = { 154.052f, -1394.604f, 28.3049f };
			vLocal_600[9 /*3*/] = { 297.3363f, -1202.901f, 28.1848f };
			vLocal_600[10 /*3*/] = { 216.0453f, -1130.863f, 28.3051f };
			vLocal_600[11 /*3*/] = { 303.6096f, -1124.259f, 28.4586f };
			vLocal_600[12 /*3*/] = { 349.6563f, -953.8064f, 28.4776f };
			vLocal_600[13 /*3*/] = { 228.3761f, -955.8815f, 28.3232f };
			iLocal_1002 = 14;
			break;
		
		case 1:
			vLocal_600[0 /*3*/] = { -1900.185f, 2050.775f, 139.7211f };
			vLocal_600[1 /*3*/] = { -1797.919f, 1886.775f, 147.74f };
			vLocal_600[2 /*3*/] = { -1710.175f, 1885.316f, 160.217f };
			vLocal_600[3 /*3*/] = { -1610.52f, 2033.944f, 101.5237f };
			vLocal_600[4 /*3*/] = { -1517.004f, 2141.703f, 55.0511f };
			vLocal_600[5 /*3*/] = { -1337.505f, 2178.097f, 51.2807f };
			vLocal_600[6 /*3*/] = { -1147.637f, 2341.332f, 98.8094f };
			vLocal_600[7 /*3*/] = { -934.5955f, 2262.843f, 140.7183f };
			vLocal_600[8 /*3*/] = { -730.47f, 2344.86f, 68.405f };
			vLocal_600[9 /*3*/] = { -708.701f, 2426.99f, 61.1469f };
			vLocal_600[10 /*3*/] = { -573.3401f, 2500.494f, 50.3152f };
			vLocal_600[11 /*3*/] = { -545.0461f, 2672.93f, 44.4979f };
			vLocal_600[12 /*3*/] = { -436.4757f, 2756.389f, 44.6457f };
			vLocal_600[13 /*3*/] = { -322.5151f, 2775.025f, 61.0514f };
			vLocal_600[14 /*3*/] = { -149.1279f, 2737.515f, 54.9277f };
			vLocal_600[15 /*3*/] = { 222.302f, 2489.443f, 53.8394f };
			vLocal_600[16 /*3*/] = { 569.7415f, 2454.868f, 58.4488f };
			vLocal_600[17 /*3*/] = { 753.546f, 2518.788f, 72.1194f };
			vLocal_600[18 /*3*/] = { 924.3738f, 2593.375f, 60.2089f };
			vLocal_600[19 /*3*/] = { 965.1749f, 2621.371f, 45.0674f };
			vLocal_600[20 /*3*/] = { 1039.363f, 2671.289f, 38.5509f };
			iLocal_1002 = 21;
			break;
		
		case 2:
			vLocal_600[0 /*3*/] = { 2304f, 1469f, 66f };
			vLocal_600[1 /*3*/] = { 2131f, 2031f, 96f };
			vLocal_600[2 /*3*/] = { 2059f, 2868f, 52f };
			vLocal_600[3 /*3*/] = { 2707f, 3485f, 64f };
			vLocal_600[4 /*3*/] = { 2855f, 3729f, 47f };
			vLocal_600[5 /*3*/] = { 2506f, 4153f, 41f };
			vLocal_600[6 /*3*/] = { 2885f, 4472f, 51f };
			vLocal_600[7 /*3*/] = { 2786.236f, 4941.378f, 32.6857f };
			vLocal_600[8 /*3*/] = { 2890.608f, 5034.026f, 30.7725f };
			vLocal_600[9 /*3*/] = { 3058.765f, 5052.091f, 24.441f };
			vLocal_600[10 /*3*/] = { 3063.052f, 5094.116f, 23.0524f };
			vLocal_600[11 /*3*/] = { 3131.718f, 5101.371f, 20.6628f };
			vLocal_600[12 /*3*/] = { 3175.018f, 5118.771f, 16.61f };
			vLocal_600[13 /*3*/] = { 3228.467f, 5133.4f, 18.321f };
			vLocal_600[14 /*3*/] = { 3283.499f, 5150.864f, 17.6323f };
			vLocal_600[15 /*3*/] = { 3297.67f, 5150.701f, 17.3023f };
			vLocal_600[16 /*3*/] = { 3320.565f, 5151.295f, 17.3289f };
			vLocal_600[17 /*3*/] = { 3337.017f, 5151.827f, 17.4344f };
			vLocal_600[18 /*3*/] = { 3348.801f, 5152.016f, 18.4475f };
			iLocal_1002 = 19;
			break;
		
		case 3:
			func_641();
			vLocal_600[0 /*3*/] = { -1210.197f, -2437.739f, 12.9452f };
			vLocal_600[1 /*3*/] = { -1342.587f, -2667.462f, 12.9449f };
			vLocal_600[2 /*3*/] = { -1220.798f, -2861.65f, 12.9455f };
			vLocal_600[3 /*3*/] = { -1126.435f, -2699.413f, 22.00294f };
			vLocal_600[4 /*3*/] = { -1017.039f, -2713.215f, 34.56547f };
			vLocal_600[5 /*3*/] = { -936.5955f, -2585.454f, 21.38621f };
			vLocal_600[6 /*3*/] = { -841.7922f, -2569.529f, 16.83603f };
			vLocal_600[7 /*3*/] = { -723.1095f, -2396.833f, 17.03123f };
			vLocal_600[8 /*3*/] = { -616.2985f, -2279.408f, 13.04065f };
			vLocal_600[9 /*3*/] = { -677.7834f, -2181.811f, 14.21462f };
			vLocal_600[10 /*3*/] = { -613.1539f, -2109.985f, 21.81665f };
			vLocal_600[11 /*3*/] = { -475.038f, -2148f, 17.4868f };
			vLocal_600[12 /*3*/] = { -336.4597f, -2143.653f, 13.9572f };
			vLocal_600[13 /*3*/] = { -256.3312f, -2131.896f, 22.1408f };
			vLocal_600[14 /*3*/] = { -162.249f, -2084.908f, 26.85073f };
			vLocal_600[15 /*3*/] = { -161.8921f, -2043.37f, 21.8606f };
			vLocal_600[16 /*3*/] = { -154.6475f, -2009.529f, 21.8819f };
			vLocal_600[17 /*3*/] = { -186.8038f, -2005.34f, 26.6204f };
			vLocal_600[18 /*3*/] = { -216.7214f, -1999.232f, 26.7554f };
			iLocal_1002 = 19;
			break;
		
		case 4:
			vLocal_600[0 /*3*/] = { 105.443f, 7028.38f, 10.2844f };
			vLocal_600[1 /*3*/] = { 157.7284f, 6525.143f, 30.6533f };
			vLocal_600[2 /*3*/] = { -59.2422f, 6653.804f, 28.721f };
			vLocal_600[3 /*3*/] = { -168.4514f, 6476.554f, 29.0678f };
			vLocal_600[4 /*3*/] = { -111.8802f, 6419.246f, 30.4455f };
			vLocal_600[5 /*3*/] = { -154.2424f, 6339.732f, 30.6176f };
			vLocal_600[6 /*3*/] = { -93.9484f, 6279.499f, 30.3124f };
			vLocal_600[7 /*3*/] = { -182.7545f, 6195.686f, 30.1968f };
			vLocal_600[8 /*3*/] = { -260.1141f, 6185.812f, 30.4429f };
			vLocal_600[9 /*3*/] = { -304.2122f, 6227.968f, 30.4542f };
			vLocal_600[10 /*3*/] = { -473.7666f, 6066.529f, 29.34f };
			vLocal_600[11 /*3*/] = { -715.7206f, 6049.093f, -0.0726f };
			vLocal_600[12 /*3*/] = { -811.3691f, 5957.282f, 19.4103f };
			vLocal_600[13 /*3*/] = { -897.6384f, 6050.558f, 43.1834f };
			iLocal_1002 = 14;
			break;
	}
	iVar0 = 0;
	while (iVar0 < iLocal_1002)
	{
		vVar1 = { vLocal_600[iVar0 /*3*/] };
		vVar4 = { vLocal_600[iVar0 + 1 /*3*/] };
		if (!func_30(vVar4, 0f, 0f, 0f, 0))
		{
			fLocal_901[iVar0] = gameplay::get_distance_between_coords(vVar1, vVar4, 1);
			fLocal_1003 = (fLocal_1003 + fLocal_901[iVar0]);
		}
		iVar0++;
	}
	fLocal_1005 = ((fLocal_1003 * 70f) / 100f);
	func_640(vLocal_600[0 /*3*/]);
}

void func_640(vector3 vParam0)//Position - 0x14939
{
	Global_1573903.f_6 = { vParam0 };
}

void func_641()//Position - 0x1494D
{
	Global_1732289 = 1;
	if (!gameplay::is_bit_set(Global_2471749, 0))
	{
		gameplay::set_bit(&Global_2471749, 0);
		gameplay::set_bit(&Global_1732290, 0);
	}
	if (!gameplay::is_bit_set(Global_2471749, 1))
	{
		gameplay::set_bit(&Global_2471749, 1);
		gameplay::set_bit(&Global_1732290, 1);
	}
	if (!gameplay::is_bit_set(Global_2471749, 5))
	{
		gameplay::set_bit(&Global_2471749, 5);
		gameplay::set_bit(&Global_1732290, 5);
	}
	if (object::_does_door_exist(-355737150))
	{
		object::_set_door_acceleration_limit(-355737150, 0, 0, 0);
	}
	if (object::_does_door_exist(-580979506))
	{
		object::_set_door_acceleration_limit(-580979506, 0, 0, 0);
	}
	if (object::_does_door_exist(-1426452475))
	{
		object::_set_door_acceleration_limit(-1426452475, 0, 0, 0);
	}
	if (object::_does_door_exist(745417724))
	{
		object::_set_door_acceleration_limit(745417724, 0, 0, 0);
	}
	if (object::_does_door_exist(-1305304906))
	{
		object::_set_door_acceleration_limit(-1305304906, 0, 0, 0);
	}
	if (object::_does_door_exist(-1543175077))
	{
		object::_set_door_acceleration_limit(-1543175077, 0, 0, 0);
	}
	if (object::_does_door_exist(-811770997))
	{
		object::_set_door_acceleration_limit(-811770997, 0, 0, 0);
	}
}

int func_642(int iParam0)//Position - 0x14A5F
{
	int iVar0;
	
	iVar0 = func_95(2458, -1, 0);
	return gameplay::is_bit_set(iVar0, iParam0);
}

bool func_643()//Position - 0x14A7A
{
	return true;
}

int func_644()//Position - 0x14A83
{
	return Local_96;
}

var func_645(int iParam0)//Position - 0x14A8D
{
	return Local_292[iParam0 /*8*/];
}

void func_646()//Position - 0x14A9C
{
	if (gameplay::is_bit_set(Global_1573903.f_1, 6))
	{
		func_587();
		gameplay::clear_bit(&(Global_1573903.f_1), 6);
	}
	if (!gameplay::is_bit_set(Global_1573903.f_1, 7))
	{
		if (gameplay::is_bit_set(Global_1573903.f_1, 4) || gameplay::is_bit_set(Global_1573903.f_1, 16))
		{
			if (((!ui::is_radar_hidden() && !ui::is_help_message_being_displayed()) && !func_342()) && func_694(player::player_id(), 1, 1))
			{
				gameplay::set_bit(&(Global_1573903.f_1), 7);
				func_414("FME_PASINT", 30000);
				func_413(1);
			}
		}
		else if (gameplay::is_bit_set(Global_1573903.f_1, 17))
		{
			if (func_406() && !func_403())
			{
				gameplay::clear_bit(&(Global_1573903.f_1), 17);
				gameplay::set_bit(&(Global_1573903.f_1), 16);
			}
		}
	}
	if (!gameplay::is_bit_set(Global_1573903.f_1, 23))
	{
		if (((((!ui::is_radar_hidden() && !gameplay::is_bit_set(Global_2464975.f_743, 2)) && func_694(player::player_id(), 1, 1)) && !Global_68089) && !Global_52961) && !ui::is_help_message_being_displayed())
		{
			if (func_663())
			{
				func_414("AMEV_GA_RP", -1);
				func_413(1);
				gameplay::set_bit(&(Global_1573903.f_1), 23);
			}
		}
	}
	if (ui::is_pause_menu_active() && ui::get_pause_menu_state() == 15)
	{
		if (func_396(player::player_id()))
		{
			if (!ui::_0x84698AB38D0C6636(1344549371))
			{
				ui::_0xDD564BDD0472C936(1344549371);
			}
		}
		else if (ui::_0x84698AB38D0C6636(1344549371))
		{
			ui::object_decal_toggle(1344549371);
		}
	}
	if (gameplay::is_bit_set(Global_1573903.f_1, 9))
	{
		if ((((!ui::is_radar_hidden() && !ui::is_help_message_being_displayed()) && !func_342()) && func_694(player::player_id(), 1, 1)) && !func_402(player::player_id(), 21))
		{
			gameplay::clear_bit(&(Global_1573903.f_1), 9);
			func_662(0);
			func_414("FME_TBL00", -1);
			func_413(1);
		}
	}
	if (func_307(player::player_id()))
	{
		if (!gameplay::is_bit_set(Global_1573903.f_1, 18))
		{
			if ((func_402(player::player_id(), 21) && gameplay::is_bit_set(Global_1573903.f_1, 20)) && !gameplay::is_bit_set(Global_1573903.f_1, 19))
			{
				gameplay::set_bit(&(Global_1573903.f_1), 18);
			}
		}
		else if (gameplay::is_bit_set(Global_1573903.f_1, 18))
		{
			if (((((!ui::is_radar_hidden() && !ui::is_help_message_being_displayed()) && !func_342()) && func_694(player::player_id(), 1, 1)) && cam::is_screen_faded_in()) && !Global_2464975.f_4679)
			{
				gameplay::clear_bit(&(Global_1573903.f_1), 18);
				gameplay::set_bit(&(Global_1573903.f_1), 19);
				func_414("AMTT_RPAS", -1);
				func_413(1);
			}
		}
	}
	if (((((func_307(player::player_id()) && !func_51(player::player_id())) && func_333(player::player_id()) != 146) && !func_225(player::player_id())) && !func_661(player::player_id())) && !func_657())
	{
		if (func_579(func_333(player::player_id())))
		{
			unk_0xFAC75988A7D078D3(player::player_id());
		}
		if (!gameplay::is_bit_set(Global_1573903.f_1, 22))
		{
			gameplay::set_bit(&(Global_1573903.f_1), 22);
		}
		if (func_397(player::player_id()) || func_577())
		{
			if (!gameplay::is_bit_set(Global_1573903.f_1, 10))
			{
				if (func_655(func_333(player::player_id())))
				{
					if (func_94(0) && !Global_2391043)
					{
						gameplay::set_bit(&(Global_1573903.f_1), 9);
					}
					if (!Global_2391043)
					{
						func_490(1);
						gameplay::set_bit(&(Global_1573903.f_1), 14);
					}
				}
				gameplay::set_bit(&(Global_1573903.f_1), 10);
			}
		}
		if (func_396(player::player_id()))
		{
			if (!gameplay::is_bit_set(Global_1573903.f_1, 11))
			{
				if (!Global_91362.f_8)
				{
					gameplay::set_bit(&(Global_1573903.f_1), 12);
					func_488(1);
				}
				if (!func_654())
				{
					gameplay::set_bit(&(Global_1573903.f_1), 13);
					func_578();
				}
				if (!Global_2391043)
				{
					gameplay::set_bit(&(Global_1573903.f_1), 14);
					if (func_94(0) && !Global_2391043)
					{
						gameplay::set_bit(&(Global_1573903.f_1), 9);
					}
					func_490(1);
				}
				gameplay::set_bit(&(Global_1573903.f_1), 11);
			}
		}
		else
		{
			func_652(0);
		}
	}
	else
	{
		func_652(1);
	}
	func_647();
	if (func_576(func_333(player::player_id())) && !gameplay::is_bit_set(Global_1573903.f_1, 21))
	{
		gameplay::set_bit(&(Global_1573903.f_1), 21);
	}
	if ((func_406() && !func_403()) || func_402(player::player_id(), 21))
	{
		if (!gameplay::is_bit_set(Global_1610705[player::player_id() /*178*/].f_1, 10))
		{
			gameplay::set_bit(&(Global_1610705[player::player_id() /*178*/].f_1), 10);
		}
	}
	else if (gameplay::is_bit_set(Global_1610705[player::player_id() /*178*/].f_1, 10))
	{
		gameplay::clear_bit(&(Global_1610705[player::player_id() /*178*/].f_1), 10);
	}
}

void func_647()//Position - 0x14FAB
{
	int iVar0;
	int iVar1;
	int iVar2;
	
	if (func_342())
	{
		iVar2 = 62;
		iVar2 = 0;
		while (iVar2 < 82)
		{
			if (func_524(iVar2))
			{
				iVar0 = iVar2;
				if (iVar0 == 62 || iVar0 >= 80)
				{
					iVar1 = 15000;
				}
				else
				{
					iVar1 = 3000;
				}
				if (gameplay::is_bit_set(Global_1573903.f_1, 26))
				{
					gameplay::clear_bit(&(Global_1573903.f_1), 26);
				}
				func_648(iVar0, iVar1);
				iVar2 = 82;
			}
			iVar2++;
		}
	}
	else if (!gameplay::is_bit_set(Global_1573903.f_1, 26))
	{
		func_6(&(Global_1573903.f_21));
		gameplay::set_bit(&(Global_1573903.f_1), 26);
	}
}

void func_648(int iParam0, int iParam1)//Position - 0x1504E
{
	if (!func_9(&(Global_1573903.f_21)))
	{
		func_8(&(Global_1573903.f_21), 0, 0);
	}
	else if (func_7(&(Global_1573903.f_21), iParam1, 0))
	{
		if (func_387() > 0)
		{
			func_651(iParam0);
			if (func_280("AMEV_LBD_HELP"))
			{
				ui::clear_help(1);
			}
			func_6(&(Global_1573903.f_21));
		}
	}
	else
	{
		func_650(0);
		func_649();
	}
}

void func_649()//Position - 0x150B7
{
	Global_2464975.f_4391 = 0;
}

void func_650(int iParam0)//Position - 0x150C7
{
	Global_1338622.f_68 = iParam0;
}

void func_651(int iParam0)//Position - 0x150D7
{
	int iVar0;
	
	iVar0 = 0;
	while (iVar0 <= 3)
	{
		if (Global_2428549.f_2191[iVar0 /*72*/].f_1 == iParam0)
		{
			Global_2428549.f_2191[iVar0 /*72*/].f_2 = 5;
			gameplay::set_bit(&(Global_2428549.f_2191[iVar0 /*72*/].f_63), 0);
		}
		iVar0++;
	}
}

void func_652(int iParam0)//Position - 0x15123
{
	if ((gameplay::is_bit_set(Global_1573903.f_1, 11) || (gameplay::is_bit_set(Global_1573903.f_1, 10) && iParam0)) || (gameplay::is_bit_set(Global_1573903.f_1, 22) && iParam0))
	{
		if (gameplay::is_bit_set(Global_1573903.f_1, 12))
		{
			gameplay::clear_bit(&(Global_1573903.f_1), 12);
			func_488(0);
		}
		if (gameplay::is_bit_set(Global_1573903.f_1, 13))
		{
			gameplay::clear_bit(&(Global_1573903.f_1), 13);
			func_653();
		}
		if (gameplay::is_bit_set(Global_1573903.f_1, 14) && !func_332(player::player_id(), 0))
		{
			gameplay::clear_bit(&(Global_1573903.f_1), 14);
			func_490(0);
		}
		gameplay::clear_bit(&(Global_1573903.f_1), 11);
		gameplay::clear_bit(&(Global_1573903.f_1), 10);
		gameplay::clear_bit(&(Global_1573903.f_1), 22);
	}
}

void func_653()//Position - 0x151FE
{
	gameplay::clear_bit(&(Global_2464975.f_4589), 0);
}

int func_654()//Position - 0x15212
{
	return gameplay::is_bit_set(Global_2464975.f_4589, 0);
}

int func_655(int iParam0)//Position - 0x15226
{
	switch (iParam0)
	{
		case 129:
		case 132:
		case 136:
		case 138:
		case 139:
		case 140:
		case 141:
			return 1;
		
		case 131:
		case 146:
			return func_396(player::player_id());
		
		case 133:
			return (func_577() || func_656(func_360()));
		
		default:
	}
	return 0;
}

bool func_656(int iParam0)//Position - 0x15296
{
	switch (iParam0)
	{
		case 1:
		case 10:
		case 6:
		case 12:
		case 11:
		case 14:
			return true;
		
		default:
	}
	return false;
}

bool func_657()//Position - 0x152CE
{
	if (((((((((func_464() || func_463()) || func_462()) || func_237()) || (func_459() && !network::network_is_activity_session())) || (func_660() && !func_659())) || Global_2394682) || Global_2394682.f_1 != 0) || Global_2394755 != 0) || (func_658() == 2 && !network::network_is_activity_session()))
	{
		return true;
	}
	return false;
}

var func_658()//Position - 0x15362
{
	return Global_978175;
}

int func_659()//Position - 0x1536E
{
	return gameplay::is_bit_set(Global_2434839.f_2, 27);
}

int func_660()//Position - 0x15382
{
	if (func_455() || func_454())
	{
		return Global_1587816[player::player_id() /*444*/].f_87 == 8;
	}
	return false;
}

int func_661(int iParam0)//Position - 0x153AF
{
	if (iParam0 == player::player_id())
	{
		if ((func_406() && !func_403()) || func_402(player::player_id(), 21))
		{
			return true;
		}
		if (func_9(&(Global_1573903.f_13)))
		{
			if (!func_7(&(Global_1573903.f_13), Global_262145.f_14, 0))
			{
				return true;
			}
			func_6(&(Global_1573903.f_13));
		}
	}
	else if (gameplay::is_bit_set(Global_1610705[iParam0 /*178*/].f_1, 10))
	{
		return true;
	}
	return gameplay::is_bit_set(Global_1610705[iParam0 /*178*/].f_1, 9);
}

void func_662(int iParam0)//Position - 0x1543F
{
	int iVar0;
	
	iVar0 = func_95(2512, -1, 0);
	if (iParam0 == 0)
	{
		if (!gameplay::is_bit_set(iVar0, 0))
		{
			gameplay::set_bit(&iVar0, 0);
		}
		else if (!gameplay::is_bit_set(iVar0, 1))
		{
			gameplay::set_bit(&iVar0, 1);
		}
		else if (!gameplay::is_bit_set(iVar0, 2))
		{
			gameplay::set_bit(&iVar0, 2);
		}
	}
	else if (iParam0 == 1)
	{
		if (!gameplay::is_bit_set(iVar0, 3))
		{
			gameplay::set_bit(&iVar0, 3);
		}
		else if (!gameplay::is_bit_set(iVar0, 4))
		{
			gameplay::set_bit(&iVar0, 4);
		}
		else if (!gameplay::is_bit_set(iVar0, 5))
		{
			gameplay::set_bit(&iVar0, 5);
		}
	}
	else if (iParam0 == 2)
	{
		if (!gameplay::is_bit_set(iVar0, 6))
		{
			gameplay::set_bit(&iVar0, 6);
		}
		else if (!gameplay::is_bit_set(iVar0, 7))
		{
			gameplay::set_bit(&iVar0, 7);
		}
		else if (!gameplay::is_bit_set(iVar0, 8))
		{
			gameplay::set_bit(&iVar0, 8);
		}
	}
	else if (iParam0 == 3)
	{
		if (!gameplay::is_bit_set(iVar0, 9))
		{
			gameplay::set_bit(&iVar0, 9);
		}
		else if (!gameplay::is_bit_set(iVar0, 10))
		{
			gameplay::set_bit(&iVar0, 10);
		}
		else if (!gameplay::is_bit_set(iVar0, 11))
		{
			gameplay::set_bit(&iVar0, 11);
		}
	}
	func_164(2512, iVar0, -1, 1);
}

bool func_663()//Position - 0x15576
{
	int iVar0;
	
	if (!func_9(&(Global_1573903.f_15)))
	{
		func_8(&(Global_1573903.f_15), 0, 0);
		Global_1573903.f_17 = 0;
	}
	else if (func_7(&(Global_1573903.f_15), 1000, 0))
	{
		if (network::network_is_participant_active(player::int_to_participantindex(Global_1573903.f_17)))
		{
			iVar0 = network::network_get_player_index(player::int_to_participantindex(Global_1573903.f_17));
			if (network::network_is_player_active(iVar0))
			{
				if (func_694(iVar0, 1, 1) && func_664(iVar0, 6))
				{
					if (system::vdist(func_177(player::player_id()), func_177(iVar0)) < 80f)
					{
						return true;
					}
				}
			}
		}
		Global_1573903.f_17++;
		if (Global_1573903.f_17 >= 32)
		{
			Global_1573903.f_17 = 0;
			func_6(&(Global_1573903.f_15));
		}
	}
	return false;
}

bool func_664(int iParam0, int iParam1)//Position - 0x1563E
{
	int iVar0;
	
	if (Global_1312447 != 0)
	{
		return false;
	}
	if (!func_168(iParam0))
	{
		return false;
	}
	iVar0 = iParam0;
	if (Global_1587816[iVar0 /*444*/] == iParam1)
	{
		return true;
	}
	return false;
}

var func_665()//Position - 0x15677
{
	return Global_1573903.f_23;
}

int func_666(int iParam0)//Position - 0x15685
{
	return !func_667(iParam0);
}

bool func_667(int iParam0)//Position - 0x15694
{
	switch (iParam0)
	{
		case 0:
			break;
		
		case 1:
			break;
		
		case 2:
			break;
		
		case 3:
			break;
		
		case 4:
			if (Global_262145.f_5274)
			{
				return false;
			}
			if (func_402(player::player_id(), 7))
			{
				return false;
			}
			if (gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_250.f_7, 0) || gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_250.f_7, 1))
			{
				return false;
			}
			break;
		
		case 5:
			if (Global_262145.f_5275)
			{
				return false;
			}
			if (func_402(player::player_id(), 7))
			{
				return false;
			}
			if (gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_250.f_7, 0) || gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_250.f_7, 1))
			{
				return false;
			}
			break;
		
		case 6:
			if (Global_262145.f_5276)
			{
				return false;
			}
			break;
		
		case 7:
			break;
		
		case 8:
			break;
		
		case 9:
			if (Global_262145.f_5277)
			{
				return false;
			}
			if (func_402(player::player_id(), 7))
			{
				return false;
			}
			if (gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_250.f_7, 0) || gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_250.f_7, 1))
			{
				return false;
			}
			break;
		
		case 15:
			if (func_668(4))
			{
				return false;
			}
			if (func_402(player::player_id(), 7))
			{
				return false;
			}
			if (gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_250.f_7, 0) || gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_250.f_7, 1))
			{
				return false;
			}
			break;
		
		case 17:
			if (func_668(4))
			{
				return false;
			}
			if (func_402(player::player_id(), 7))
			{
				return false;
			}
			if (gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_250.f_7, 0) || gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_250.f_7, 1))
			{
				return false;
			}
			break;
		
		case 16:
			if (func_668(4))
			{
				return false;
			}
			if (func_402(player::player_id(), 7))
			{
				return false;
			}
			if (gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_250.f_7, 0) || gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_250.f_7, 1))
			{
				return false;
			}
			break;
		
		case 18:
		case 21:
		case 22:
		case 23:
			if (func_668(4))
			{
				return false;
			}
			if (func_402(player::player_id(), 7))
			{
				return false;
			}
			if (gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_250.f_7, 0) || gameplay::is_bit_set(Global_1587816[player::player_id() /*444*/].f_250.f_7, 1))
			{
				return false;
			}
			break;
		
		case 19:
			if (func_668(4))
			{
				return false;
			}
			if (func_402(player::player_id(), 7))
			{
				return false;
			}
			break;
		
		case 20:
			if (func_668(4))
			{
				return false;
			}
			if (func_402(player::player_id(), 7))
			{
				return false;
			}
			break;
		
		case 10:
			break;
		
		case 11:
			break;
		
		case 12:
			break;
	}
	return true;
}

bool func_668(int iParam0)//Position - 0x159E4
{
	int iVar0;
	
	iVar0 = 0;
	iVar0 = 0;
	while (iVar0 < 32)
	{
		if (func_694(player::int_to_playerindex(iVar0), 0, 1))
		{
			if (gameplay::is_bit_set(Global_2418529[iVar0 /*313*/].f_206, iParam0))
			{
				return true;
			}
		}
		iVar0++;
	}
	return false;
}

bool func_669()//Position - 0x15A2A
{
	int iVar0;
	
	func_673(&iVar0);
	if (iVar0)
	{
		return true;
	}
	if (Global_1315888 == 0)
	{
		if (!network::network_is_game_in_progress())
		{
			return true;
		}
	}
	if (func_672())
	{
		return true;
	}
	if (Global_2446452)
	{
		return true;
	}
	if (func_671())
	{
		return true;
	}
	if (func_670(157))
	{
		if (!func_464())
		{
			return true;
		}
	}
	if (func_670(155))
	{
		return true;
	}
	if (!network::network_is_signed_online())
	{
		return true;
	}
	if (func_581() != 0)
	{
		if (script::_get_number_of_instances_of_streamed_script(func_581()) == 0)
		{
			return true;
		}
	}
	return false;
}

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

var func_671()//Position - 0x15AD4
{
	return Global_2444095;
}

var func_672()//Position - 0x15AE0
{
	return Global_2434839.f_570;
}

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

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

bool func_675(int iParam0, var uParam1)//Position - 0x15BE0
{
	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_676()//Position - 0x15C2E
{
	system::wait(0);
}

void func_677()//Position - 0x15C3B
{
	if (gameplay::is_bit_set(Local_96.f_1, 5) || gameplay::is_bit_set(Local_96.f_1, 12))
	{
		if (network::network_does_entity_exist_with_network_id(Local_96.f_182.f_3))
		{
			if (!ped::is_ped_injured(network::net_to_ped(Local_96.f_182.f_3)))
			{
				if (network::network_has_control_of_entity(network::net_to_ped(Local_96.f_182.f_3)))
				{
					if (!entity::is_entity_dead(network::net_to_veh(Local_96.f_182.f_2), 0))
					{
						ai::clear_ped_tasks(network::net_to_ped(Local_96.f_182.f_3));
						if (entity::does_entity_exist(player::get_player_ped(Local_96.f_182.f_7)) && !entity::is_entity_dead(player::get_player_ped(Local_96.f_182.f_7), 0))
						{
							ai::task_heli_mission(network::net_to_ped(Local_96.f_182.f_3), network::net_to_veh(Local_96.f_182.f_2), 0, player::get_player_ped(Local_96.f_182.f_7), 0f, 0f, 0f, 8, 20f, 1000f, -1f, 60, 50, -1f, 0);
						}
						else
						{
							ped::set_ped_flee_attributes(network::net_to_ped(Local_96.f_182.f_3), 2048, true);
							ai::task_smart_flee_coord(network::net_to_ped(Local_96.f_182.f_3), entity::get_entity_coords(network::net_to_ped(Local_96.f_182.f_3), 1), 10000f, 999999, 0, 0);
						}
						ped::set_ped_keep_task(network::net_to_ped(Local_96.f_182.f_3), true);
					}
				}
			}
		}
	}
	if (func_272())
	{
		func_448(player::player_id(), 1, 0);
		func_273();
	}
	func_513(24, 0);
	func_683(0);
	if (!gameplay::is_bit_set(iLocal_550, 24))
	{
		if (network::participant_id_to_int() >= 0)
		{
			func_481(136, 0, gameplay::is_bit_set(Local_292[network::participant_id_to_int() /*8*/].f_1, 2));
		}
		else
		{
			func_481(136, 0, 0);
		}
	}
	if (ped::get_ped_relationship_group_hash(player::player_ped_id()) == iLocal_564)
	{
		ped::set_ped_relationship_group_hash(player::player_ped_id(), iLocal_566);
	}
	if (player::player_id() != -1)
	{
		if (Global_1587816[player::player_id() /*444*/] == 136)
		{
			Global_1587816[player::player_id() /*444*/] = -1;
		}
	}
	if (gameplay::is_bit_set(iLocal_549, 6))
	{
		graphics::_stop_screen_effect("pennedIn");
		graphics::_start_screen_effect("PennedInOut", 0, 0);
		gameplay::clear_bit(&iLocal_549, 6);
	}
	if (audio::is_audio_scene_active("MP_Player_Inside_Bubble_Scene"))
	{
		audio::stop_audio_scene("MP_Player_Inside_Bubble_Scene");
	}
	if (audio::is_audio_scene_active("MP_Player_Outside_Bubble_Scene"))
	{
		audio::stop_audio_scene("MP_Player_Outside_Bubble_Scene");
	}
	func_541(&iLocal_3741);
	func_682();
	if (network::network_is_game_in_progress())
	{
		func_537();
	}
	func_574(1);
	func_407(0, 136);
	controls::_0xCB0360EFEFB2580D(0);
	if (gameplay::is_bit_set(iLocal_550, 11))
	{
		if (!gameplay::is_bit_set(iLocal_550, 12))
		{
			audio::trigger_music_event("MP_MC_STOP");
		}
	}
	if (func_669())
	{
		Local_3747.f_5 = 5;
	}
	else if (func_538(2, 0, 1, 0, 0))
	{
		Local_3747.f_5 = 6;
	}
	else if (func_146() == player::player_id())
	{
		Local_3747.f_5 = 1;
	}
	else
	{
		Local_3747.f_5 = 2;
	}
	Local_3747 = Local_96.f_177;
	Local_3747.f_1 = Local_96.f_178;
	Local_3747.f_4 = Local_96.f_179;
	Local_3747.f_3 = Local_96.f_181;
	Local_3747.f_10 = (network::_get_posix_time() - Local_3747.f_9);
	if (!func_187())
	{
		if (Local_3747.f_6 > 0)
		{
			if (Local_3747.f_5 == 1)
			{
				func_681();
			}
		}
	}
	func_680(Local_3747, -1, -1, -1, -1, -1, -1);
	func_588();
	func_522(0);
	func_86(0);
	if (func_84(player::player_id()))
	{
		func_595(0);
	}
	if (!ped::is_ped_injured(player::player_ped_id()) && !ped::can_knock_ped_off_vehicle(player::player_ped_id()))
	{
		ped::set_ped_can_be_knocked_off_vehicle(player::player_ped_id(), 0);
	}
	if (!ped::is_ped_injured(player::player_ped_id()))
	{
		if (ped::is_ped_sitting_in_any_vehicle(player::player_ped_id()))
		{
		}
		ped::set_ped_config_flag(player::player_ped_id(), 398, false);
	}
	func_679(0);
	gameplay::clear_bit(&iLocal_549, 18);
	func_591();
	func_678();
}

void func_678()//Position - 0x15FA2
{
	script::terminate_this_thread();
}

void func_679(int iParam0)//Position - 0x15FAE
{
	if (iParam0)
	{
		gameplay::set_bit(&(Global_1610705[player::player_id() /*178*/].f_1), 6);
	}
	else
	{
		gameplay::clear_bit(&(Global_1610705[player::player_id() /*178*/].f_1), 6);
	}
}

void func_680(struct<12> Param0, int iParam12, int iParam13, int iParam14, int iParam15, int iParam16, int iParam17)//Position - 0x15FE0
{
	char* sVar0;
	struct<13> Var1;
	struct<14> Var14;
	struct<18> Var28;
	struct<14> Var52;
	struct<13> Var66;
	struct<14> Var79;
	struct<14> Var93;
	struct<16> Var107;
	struct<13> Var123;
	struct<14> Var136;
	struct<14> Var150;
	struct<13> Var164;
	
	sVar0 = script::get_this_script_name();
	if (Param0.f_9 == 0)
	{
		Param0.f_10 = 0;
	}
	if (Param0.f_8 > Param0.f_9)
	{
		Param0.f_8 = Param0.f_9;
	}
	if (Global_69521)
	{
		if (gameplay::are_strings_equal(sVar0, "am_hot_target"))
		{
			Var1 = { Param0 };
			Var1.f_12 = iParam12;
			unk_0xBFAFDB5FAAA5C5AB(&Var1);
		}
		else if (gameplay::are_strings_equal(sVar0, "freemode"))
		{
			Var14 = { Param0 };
			Var14.f_12 = iParam12;
			Var14.f_13 = iParam13;
			unk_0xBAA2F0490E146BE8(&Var14);
		}
		else if (gameplay::are_strings_equal(sVar0, "am_cp_collection"))
		{
			Var28 = { Param0 };
			Var28.f_12 = iParam12;
			Var28.f_13 = iParam13;
			Var28.f_14 = iParam14;
			Var28.f_15 = iParam15;
			Var28.f_16 = iParam16;
			Var28.f_17 = iParam17;
			unk_0x3DE3AA516FB126A4(&Var28);
		}
		else if (gameplay::are_strings_equal(sVar0, "am_challenges"))
		{
			Var52 = { Param0 };
			Var52.f_12 = iParam12;
			Var52.f_13 = system::to_float(iParam13);
			if (iParam14 == 1)
			{
				Var52.f_13 = (Var52.f_13 / 10f);
			}
			unk_0x6A60E43998228229(&Var52);
		}
		else if (gameplay::are_strings_equal(sVar0, "am_penned_in"))
		{
			unk_0x1A7CE7CD3E653485(&Param0);
		}
		else if (gameplay::are_strings_equal(sVar0, "am_pass_the_parcel"))
		{
			Var66 = { Param0 };
			Var66.f_12 = iParam12;
			unk_0x419615486BBF1956(&Var66);
		}
		else if (gameplay::are_strings_equal(sVar0, "am_hot_property"))
		{
			Var79 = { Param0 };
			Var79.f_12 = iParam12;
			Var79.f_13 = iParam13;
			unk_0x84DFC579C2FC214C(&Var79);
		}
		else if (gameplay::are_strings_equal(sVar0, "am_dead_drop"))
		{
			Var93 = { Param0 };
			Var93.f_12 = iParam12;
			Var93.f_13 = iParam13;
			unk_0x0A9C7F36E5D7B683(&Var93);
		}
		else if (gameplay::are_strings_equal(sVar0, "am_king_of_the_castle"))
		{
			Var107 = { Param0 };
			Var107.f_12 = iParam12;
			Var107.f_13 = iParam13;
			Var107.f_14 = iParam14;
			Var107.f_15 = iParam15;
			unk_0x164C5FF663790845(&Var107);
		}
		else if (gameplay::are_strings_equal(sVar0, "AM_CRIMINAL_DAMAGE"))
		{
			Var123 = { Param0 };
			Var123.f_12 = iParam12;
			unk_0xEDBF6C9B0D2C65C8(&Var123);
		}
		else if (gameplay::are_strings_equal(sVar0, "AM_KILL_LIST"))
		{
			if (iParam14 == 0)
			{
				Var136 = { Param0 };
				Var136.f_12 = iParam12;
				Var136.f_13 = iParam13;
				unk_0x8C9D11605E59D955(&Var136);
			}
			else
			{
				Var150 = { Param0 };
				Var150.f_12 = iParam12;
				Var150.f_13 = iParam13;
				unk_0x6551B1F7F6CD46EA(&Var150);
			}
		}
		else if (gameplay::are_strings_equal(sVar0, "am_hunt_the_beast"))
		{
			Var164 = { Param0 };
			Var164.f_12 = iParam12;
			unk_0x2CD90358F67D0AA8(&Var164);
		}
	}
}

void func_681()//Position - 0x16255
{
	gameplay::set_bit(&(Global_2464975.f_1641), 18);
}

void func_682()//Position - 0x1626A
{
	ped::remove_relationship_group(iLocal_565);
	ped::remove_relationship_group(iLocal_564);
}

void func_683(int iParam0)//Position - 0x16280
{
	if (iParam0)
	{
		if (!gameplay::is_bit_set(Global_2464975.f_1641, 9))
		{
			gameplay::set_bit(&(Global_2464975.f_1641), 9);
		}
	}
	else if (gameplay::is_bit_set(Global_2464975.f_1641, 9))
	{
		gameplay::clear_bit(&(Global_2464975.f_1641), 9);
	}
}

void func_684(struct<20> Param0)//Position - 0x162CB
{
	int iVar0;
	
	func_692(func_693(Param0), Param0);
	network::reserve_network_mission_vehicles(1);
	func_691(0, -1, 0);
	func_689(136);
	network::network_register_host_broadcast_variables(&Local_96, 196);
	network::network_register_player_broadcast_variables(&Local_292, 257);
	if (!func_688())
	{
		func_677();
	}
	if (network::network_is_game_in_progress())
	{
		gameplay::set_this_script_can_be_paused(0);
		if (network::network_is_host_of_this_script())
		{
			iVar0 = 0;
			while (iVar0 < 4)
			{
				Local_96.f_3[iVar0] = func_58();
				iVar0++;
			}
			stats::_0x6DEE77AFF8C21BD1(&(Local_96.f_177), &(Local_96.f_178));
		}
		Local_3747.f_2 = network::_0xCF61D4B4702EE9EB();
		Local_3747.f_8 = network::_get_posix_time();
		func_513(24, 1);
		func_685();
		if (func_615(1))
		{
		}
		Local_292[network::participant_id_to_int() /*8*/] = 0;
	}
	else
	{
		func_677();
	}
}

void func_685()//Position - 0x16387
{
	int iVar0;
	
	ped::add_relationship_group("relPennedInPlayer", &iLocal_564);
	ped::add_relationship_group("relUWAi", &iLocal_565);
	iVar0 = 0;
	while (iVar0 < 32)
	{
		ped::set_relationship_between_groups(1, Global_1574218[iVar0], iLocal_564);
		ped::set_relationship_between_groups(1, iLocal_564, Global_1574218[iVar0]);
		iVar0++;
	}
	ped::set_relationship_between_groups(5, iLocal_564, iLocal_565);
	ped::set_relationship_between_groups(5, iLocal_565, iLocal_564);
	ped::set_relationship_between_groups(1, 2017343592, iLocal_565);
	ped::set_relationship_between_groups(5, 2017343592, iLocal_564);
	func_687(1, &iLocal_565);
	func_686(&iLocal_565);
	func_686(&iLocal_564);
}

void func_686(int iParam0)//Position - 0x16420
{
	ped::set_relationship_between_groups(1, -1865950624, *iParam0);
	ped::set_relationship_between_groups(1, *iParam0, -1865950624);
	ped::set_relationship_between_groups(1, 296331235, *iParam0);
	ped::set_relationship_between_groups(1, *iParam0, 296331235);
	ped::set_relationship_between_groups(1, 1166638144, *iParam0);
	ped::set_relationship_between_groups(1, *iParam0, 1166638144);
	ped::set_relationship_between_groups(1, 2037579709, *iParam0);
	ped::set_relationship_between_groups(1, *iParam0, 2037579709);
	ped::set_relationship_between_groups(1, 2017343592, *iParam0);
	ped::set_relationship_between_groups(1, *iParam0, 2017343592);
	ped::set_relationship_between_groups(1, -1821475077, *iParam0);
	ped::set_relationship_between_groups(1, *iParam0, -1821475077);
	ped::set_relationship_between_groups(1, 1782292358, *iParam0);
	ped::set_relationship_between_groups(1, *iParam0, 1782292358);
	ped::set_relationship_between_groups(1, -1033021910, *iParam0);
	ped::set_relationship_between_groups(1, *iParam0, -1033021910);
	ped::set_relationship_between_groups(1, -1285976420, *iParam0);
	ped::set_relationship_between_groups(1, *iParam0, -1285976420);
}

void func_687(int iParam0, int iParam1)//Position - 0x16512
{
	ped::set_relationship_between_groups(iParam0, -1533126372, *iParam1);
	ped::set_relationship_between_groups(iParam0, *iParam1, -1533126372);
	ped::set_relationship_between_groups(iParam0, -472287501, *iParam1);
	ped::set_relationship_between_groups(iParam0, *iParam1, -472287501);
	ped::set_relationship_between_groups(iParam0, -183807561, *iParam1);
	ped::set_relationship_between_groups(iParam0, *iParam1, -183807561);
}

bool func_688()//Position - 0x1656E
{
	int iVar0;
	
	iVar0 = 0;
	while (true)
	{
		iVar0++;
		if (!network::network_is_game_in_progress())
		{
			return false;
		}
		if (network::_0x5D10B3795F3FC886())
		{
			return true;
		}
		if (func_672())
		{
			return false;
		}
		if (func_670(155))
		{
			return false;
		}
		if (iVar0 >= 3600)
		{
			return false;
		}
		system::wait(0);
	}
	return false;
}

void func_689(int iParam0)//Position - 0x165C7
{
	func_494();
	func_690();
	func_508();
	Global_1573903.f_4 = iParam0;
	Global_1573903.f_5 = iParam0;
	func_586(iParam0, -1);
	func_548(&(Global_1573903.f_18), 0, 0);
	Global_2464975.f_4426 = 0;
	Global_2445125[0] = func_58();
	Global_2445125[1] = func_58();
	Global_2445125[2] = func_58();
	Global_2445125[3] = func_58();
	Global_2445125[4] = func_58();
	func_492();
	func_341();
	if (func_406() && !func_403())
	{
		gameplay::set_bit(&(Global_1573903.f_1), 16);
	}
	else
	{
		gameplay::set_bit(&(Global_1573903.f_1), 17);
	}
}

void func_690()//Position - 0x16671
{
	var uVar0;
	
	Global_1573927 = uVar0;
}

bool func_691(int iParam0, int iParam1, int iParam2)//Position - 0x1667F
{
	int iVar0;
	
	iVar0 = network::network_get_script_status();
	while (iVar0 != 2)
	{
		if (((iVar0 == 3 || iVar0 == 4) || iVar0 == 5) || iVar0 == 6)
		{
			if (!iParam2)
			{
				func_678();
			}
			else
			{
				return false;
			}
		}
		if (!func_477())
		{
			if (iParam0 == 0)
			{
				if (!network::network_is_game_in_progress())
				{
					if (!iParam2)
					{
						func_678();
					}
					else
					{
						return false;
					}
				}
				if (func_672())
				{
					if (!iParam2)
					{
						func_678();
					}
					else
					{
						return false;
					}
				}
				if (func_670(155))
				{
					if (!iParam2)
					{
						func_678();
					}
					else
					{
						return false;
					}
				}
			}
			else if (!network::network_is_in_session())
			{
				if (!iParam2)
				{
					func_678();
				}
				else
				{
					return false;
				}
			}
		}
		system::wait(0);
		iVar0 = network::network_get_script_status();
	}
	if (iParam1 > -1)
	{
		Global_1312502 = iVar0;
	}
	if (iParam0 == 0)
	{
		if (!network::network_is_game_in_progress())
		{
			if (!iParam2)
			{
				func_678();
			}
			else
			{
				return false;
			}
		}
	}
	else if (!network::network_is_in_session())
	{
		if (!iParam2)
		{
			func_678();
		}
		else
		{
			return false;
		}
	}
	return true;
}

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

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

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

