Beispiel #1
0
        private bool CanCreateTicket()
        {
            if (FunctionsLSPDFR.IsPlayerPerformingPullover() || null != FunctionsLSPDFR.GetActivePursuit())
            {
                Game.DisplayHelp("You must finish current pullover or pursuit !", 5000);
                return(false);
            }
            Vehicle vehicle = VehicleManager.GetNearbyVehicle();

            if ((null == vehicle || vehicle.IsPoliceVehicle || PedsManager.Distance(vehicle.Position) > MAXIMUM_DIST_VEH))
            {
                return(false);
            }
            if (ParkingTicketsEventHandler.AlreadyGivedTicketsLicencePlateCollection.Contains(vehicle.LicensePlate))
            {
                Game.DisplayNotification("You have ~o~already given that vehicle a ~b~parking ticket");
                FunctionsLSPDFR.PlayScannerAudio("BEEP");
                return(false);
            }
            return(true);
        }
Beispiel #2
0
        public void OnSelectMenuItem(UIMenu sender, UIMenuItem selectedItem, int index)
        {
            if (sender != Menu)
            {
                return;
            }

            if (selectedItem == _DangerousParkedVehicle || selectedItem == _MissingTicketsParkedVehicle)
            {
                ParkingTicketsOffences offenceType            = (selectedItem == _DangerousParkedVehicle) ? ParkingTicketsOffences.DANGEROUS : ParkingTicketsOffences.AWKWARD;
                GiveParkingTicketEvent giveParkingTicketEvent = new GiveParkingTicketEvent(VehicleManager.GetNearbyVehicle(), offenceType);
                this.OnEventHandler(giveParkingTicketEvent);
                UICustomMenuManager.MenuPool.CloseAllMenus();
            }
        }