public static void DisplayKeyboard_RunInsuranceCheckOnName() { 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()); Game.DisplaySubtitle("~h~Enter a name", 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); BritishPersona.RunInsuranceCheckOnName(input); } GameFiber.Wait(1000); Game.LocalPlayer.Character.Tasks.Clear(); Traffic_Policer.API.Functions.SetAutomaticVehicleDeatilsChecksEnabled(true); }); } }
public VehicleRecords(Vehicle _veh, bool _HasMOT, bool _IsTaxed, BritishPersona _RegisteredOwner) : this() { if (!_veh.Exists()) { AllVehicleRecords.Remove(this); return; } foreach (VehicleRecords recs in AllVehicleRecords.ToArray()) { if (recs.veh == _veh && recs != this) { AllVehicleRecords.Remove(recs); } } veh = _veh; foreach (VehicleRecords vehrecs in AllVehicleRecords.ToArray()) { if (vehrecs.LicencePlate == LicencePlate && vehrecs != this) { AllVehicleRecords.Remove(vehrecs); } } HasMOT = _HasMOT; IsTaxed = _IsTaxed; HasSORN = (!IsTaxed && EntryPoint.rnd.Next(6) < 2); RegisteredOwner = _RegisteredOwner; if (Insured) { RegisteredOwner.SetIsInsuredToDriveVehicle(this, true); } }
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); }); } }
/// <summary> /// Constructor that set values based off the LSPDFR API. /// </summary> /// <param name="_veh"></param> public VehicleRecords(Vehicle _veh) : this() { if (!_veh.Exists()) { AllVehicleRecords.Remove(this); return; } foreach (VehicleRecords recs in AllVehicleRecords.ToArray()) { if (recs.veh == _veh && recs != this) { AllVehicleRecords.Remove(recs); } } veh = _veh; foreach (VehicleRecords vehrecs in AllVehicleRecords.ToArray()) { if (vehrecs.LicencePlate == LicencePlate && vehrecs != this) { AllVehicleRecords.Remove(vehrecs); } } HasMOT = EntryPoint.rnd.Next(8) != 0; IsTaxed = EntryPoint.rnd.Next(8) != 0; HasSORN = (!IsTaxed && EntryPoint.rnd.Next(6) < 2); if (veh.HasDriver && !Stolen) { RegisteredOwner = BritishPersona.GetBritishPersona(veh.Driver); } else { RegisteredOwner = BritishPersona.GetRandomBritishPersona(); } if (Insured) { RegisteredOwner.SetIsInsuredToDriveVehicle(this, true); } }
public static void CreateNewCourtCase(BritishPersona Defendant, string Crime, int GuiltyChance, string CourtVerdict) { CreateNewCourtCase(Defendant.FullName, Defendant.LSPDFRPersona.Birthday, Crime, DateTime.Now, GuiltyChance, CourtVerdict, DetermineCourtHearingDate(), false); }