示例#1
0
 public BritishPersona(Ped _ped, LicenceTypes _LicenceType, LicenceStatuses _LicenceStatus, int _PenaltyPoints, bool _CarryingLicence) : this(_ped)
 {
     if (!_ped.Exists())
     {
         AllBritishPersona.Remove(this); return;
     }
     foreach (BritishPersona pers in AllBritishPersona.ToArray())
     {
         if (pers.ped == _ped && pers != this)
         {
             AllBritishPersona.Remove(pers);
         }
     }
     ped = _ped;
     if (ped.Exists())
     {
         _LSPDFRPersona = Functions.GetPersonaForPed(ped);
         if (ped.IsInAnyVehicle(false))
         {
             VehicleRecords.VerifyVehicleRecordsExist(ped.CurrentVehicle);
         }
         foreach (BritishPersona pers in AllBritishPersona.ToArray())
         {
             if (pers.ped == ped && pers != this)
             {
                 AllBritishPersona.Remove(pers);
             }
         }
     }
     LicenceType     = _LicenceType;
     LicenceStatus   = _LicenceStatus;
     PenaltyPoints   = _PenaltyPoints;
     CarryingLicence = _CarryingLicence;
 }
示例#2
0
 public bool IsInsuredToDriveVehicle(VehicleRecords vehrecs)
 {
     if (FullyCompInsured || VehiclesInsuredToDrive.Contains(vehrecs))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#3
0
 public void SetIsInsuredToDriveVehicle(VehicleRecords vehrecs, bool Insured)
 {
     if (Insured)
     {
         if (!VehiclesInsuredToDrive.Contains(vehrecs))
         {
             VehiclesInsuredToDrive.Add(vehrecs);
         }
     }
     else
     {
         if (VehiclesInsuredToDrive.Contains(vehrecs))
         {
             VehiclesInsuredToDrive.Remove(vehrecs);
         }
     }
 }
        public static void DisplayKeyboard_RunCheckOnName()
        {
            if (!IsKeyboardActive)
            {
                GameFiber.StartNew(delegate
                {
                    IsKeyboardActive = true;
                    Traffic_Policer.API.Functions.SetAutomaticVehicleDeatilsChecksEnabled(false);
                    NativeFunction.Natives.DISPLAY_ONSCREEN_KEYBOARD(0, "FMMC_KEY_TIP", "", "", "", "", "", 20);
                    Game.LocalPlayer.Character.Tasks.PlayAnimation("random@arrests", "generic_radio_chatter", 1.5f, AnimationFlags.UpperBodyOnly | AnimationFlags.SecondaryTask | AnimationFlags.Loop);
                    while (NativeFunction.Natives.UPDATE_ONSCREEN_KEYBOARD <int>() == 0)
                    {
                        GameFiber.Yield();
                        //Game.LogTrivial("UPDATEONSCREENKEYBOARD: " + NativeFunction.Natives.UPDATE_ONSCREEN_KEYBOARD<int>().ToString());
                        if (Functions.IsPlayerPerformingPullover())
                        {
                            Game.DisplaySubtitle("~h~Stopped Vehicle: " + Functions.GetPulloverSuspect(Functions.GetCurrentPullover()).CurrentVehicle.LicensePlate, 50);
                        }
                    }

                    IsKeyboardActive = false;
                    if (NativeFunction.Natives.UPDATE_ONSCREEN_KEYBOARD <int>() == 1)
                    {
                        string input = NativeFunction.Natives.GET_ONSCREEN_KEYBOARD_RESULT <string>();
                        input        = input.ToLower();
                        //Game.LogTrivial("INPUT: " + input);
                        if (input.Any(char.IsDigit))
                        {
                            VehicleRecords.RunPlateCheckOnPlate(input);
                        }
                        else
                        {
                            BritishPersona.RunLicenceCheckOnName(input);
                        }
                    }
                    GameFiber.Wait(1000);
                    Game.LocalPlayer.Character.Tasks.Clear();
                    Traffic_Policer.API.Functions.SetAutomaticVehicleDeatilsChecksEnabled(true);
                });
            }
        }
示例#5
0
        /// <summary>
        /// Constructor that sets values based off the LSPDFR API
        /// </summary>
        /// <param name="_ped"></param>
        public BritishPersona(Ped _ped) : this(Functions.GetPersonaForPed(_ped))
        {
            if (!_ped.Exists())
            {
                Game.LogTrivial("PED DOESNT EXIST"); AllBritishPersona.Remove(this); return;
            }

            foreach (BritishPersona pers in AllBritishPersona.ToArray())
            {
                if (pers.ped == _ped && pers != this)
                {
                    AllBritishPersona.Remove(pers);
                }
            }
            ped = _ped;
            if (ped.Exists())
            {
                _LSPDFRPersona = Functions.GetPersonaForPed(ped);
                if (ped.IsInAnyVehicle(false))
                {
                    VehicleRecords.VerifyVehicleRecordsExist(ped.CurrentVehicle);
                }
                foreach (BritishPersona pers in AllBritishPersona.ToArray())
                {
                    if (pers.ped == ped && pers != this)
                    {
                        AllBritishPersona.Remove(pers);
                    }
                }
            }
            int roll = EntryPoint.rnd.Next(10);

            if (roll < 6)
            {
                LicenceType = LicenceTypes.Full;
            }
            else
            {
                //If ped is driving a vehicle with a passenger
                if (_ped.IsInAnyVehicle(false))
                {
                    if (_ped.CurrentVehicle.Driver == _ped)
                    {
                        if (!_ped.CurrentVehicle.IsSeatFree(0))
                        {
                            if (EntryPoint.rnd.Next(4) < 3)
                            {
                                LicenceType = LicenceTypes.Provisional;
                            }
                            else
                            {
                                LicenceType = LicenceTypes.None;
                            }
                        }
                    }
                }
                else
                {
                    roll = EntryPoint.rnd.Next(4);
                    if (roll < 2)
                    {
                        LicenceType = LicenceTypes.Provisional;
                    }
                    else
                    {
                        LicenceType = LicenceTypes.None;
                    }
                }
            }
            FullyCompInsured = EntryPoint.rnd.Next(8) == 0;
            int Citations = LSPDFRPersona.Citations;

            PenaltyPoints = Citations * 3;

            if (LSPDFRPersona.ELicenseState == ELicenseState.Valid)
            {
                LicenceStatus = LicenceStatuses.Valid;
            }
            else if (LSPDFRPersona.ELicenseState == ELicenseState.Suspended)
            {
                if (EntryPoint.rnd.Next(6) < 4)
                {
                    LicenceStatus = LicenceStatuses.Disqualified;
                }
                else
                {
                    LicenceStatus = LicenceStatuses.Revoked;
                }
            }
            else if (LSPDFRPersona.ELicenseState == ELicenseState.Expired)
            {
                LicenceStatus = LicenceStatuses.Expired;
            }
            else
            {
                LicenceStatus = LicenceStatuses.Valid;
            }

            if (LicenceStatus == LicenceStatuses.Disqualified || LicenceStatus == LicenceStatuses.Revoked || LicenceType == LicenceTypes.None)
            {
                CarryingLicence = false;
            }
            else
            {
                CarryingLicence = EntryPoint.rnd.Next(6) < 4;
            }
        }
示例#6
0
 public bool HasSpecificInsuranceForVehicle(VehicleRecords vehrecs)
 {
     return(VehiclesInsuredToDrive.Contains(vehrecs));
 }