public async Task LSPDAppSearchVehiclePlate(IPlayer player, string targetPlate) { try { if (player == null || !player.Exists || targetPlate == "") { return; } int charId = User.GetPlayerOnline(player); if (charId <= 0) { return; } if (player.HasPlayerHandcuffs() || player.HasPlayerRopeCuffs()) { HUDHandler.SendNotification(player, 4, 5000, "Wie willst du das mit Handschellen/Fesseln machen?"); return; } if (!ServerFactions.IsCharacterInAnyFaction(charId)) { HUDHandler.SendNotification(player, 4, 5000, "Fehler: Du bist in keiner Fraktion."); return; } if (ServerFactions.GetCharacterFactionId(charId) != 2 && ServerFactions.GetCharacterFactionId(charId) != 1) { HUDHandler.SendNotification(player, 4, 5000, "Fehler: Du bist nicht im L.S.P.D. oder der Justiz angestellt."); return; } if (!ServerFactions.IsCharacterInFactionDuty(charId)) { HUDHandler.SendNotification(player, 4, 5000, "Fehler: Du bist nicht im Dienst."); return; } if (!ServerVehicles.ExistServerVehiclePlate(targetPlate)) { HUDHandler.SendNotification(player, 3, 5000, "Fehler: Das angegebene Kennzeichen wurde nicht gefunden."); return; } int vehicleId = ServerVehicles.GetVehicleIdByPlate(targetPlate); if (vehicleId <= 0) { return; } int ownerId = ServerVehicles.GetVehicleOwnerById(vehicleId); if (ownerId <= 0) { return; } string owner = Characters.GetCharacterName(ownerId); string vehName = ServerVehicles.GetVehicleNameOnHash(ServerVehicles.GetVehicleHashById(vehicleId)); string manufactor = ServerVehicles.GetVehicleManufactorOnHash(ServerVehicles.GetVehicleHashById(vehicleId)); string buyDate = $"{ServerVehicles.GetVehicleBuyDate(vehicleId).ToString("d", CultureInfo.CreateSpecificCulture("de-DE"))}"; string trunk = $"{ServerVehicles.GetVehicleTrunkCapacityOnHash(ServerVehicles.GetVehicleHashById(vehicleId))}kg"; string tax = $"{ServerAllVehicles.GetVehicleTaxes(ServerVehicles.GetVehicleHashById(vehicleId))}$"; string maxfuel = $"{ServerVehicles.GetVehicleFuelLimitOnHash(ServerVehicles.GetVehicleHashById(vehicleId))}"; string fuelType = ServerVehicles.GetVehicleFuelTypeOnHash(ServerVehicles.GetVehicleHashById(vehicleId)); player.EmitLocked("Client:Tablet:SetLSPDAppSearchVehiclePlateData", owner, vehName, manufactor, buyDate, trunk, maxfuel, tax, fuelType); HUDHandler.SendNotification(player, 2, 1500, $"Fahrzeugabfrage durchgeführt: {targetPlate}"); } catch (Exception e) { Alt.Log($"{e}"); } }
public static string GetTabletVehicleStoreItems() { var items = ServerVehicleShopsItems_.Where(x => x.isOnlyOnlineAvailable == true).Select(x => new { x.shopId, name = ServerVehicles.GetVehicleNameOnHash(x.hash), manufactor = ServerVehicles.GetVehicleManufactorOnHash(x.hash), fueltype = ServerVehicles.GetVehicleFuelTypeOnHash(x.hash), fuellimit = ServerVehicles.GetVehicleFuelLimitOnHash(x.hash), storage = ServerVehicles.GetVehicleTrunkCapacityOnHash(x.hash), seats = ServerVehicles.GetVehicleMaxSeatsOnHash(x.hash), hash = x.hash.ToString(), x.price, }).OrderBy(x => x.name).ToList(); return(JsonConvert.SerializeObject(items)); }
public static string GetVehicleShopItems(int vehShopId) { if (vehShopId <= 0) { return("undefined"); } var items = ServerVehicleShopsItems_.Where(x => x.shopId == vehShopId && x.isOnlyOnlineAvailable == false).Select(x => new { name = ServerVehicles.GetVehicleNameOnHash(x.hash), manufactor = ServerVehicles.GetVehicleManufactorOnHash(x.hash), fueltype = ServerVehicles.GetVehicleFuelTypeOnHash(x.hash), maxfuel = ServerVehicles.GetVehicleFuelLimitOnHash(x.hash), trunkcapacity = ServerVehicles.GetVehicleTrunkCapacityOnHash(x.hash), seats = ServerVehicles.GetVehicleMaxSeatsOnHash(x.hash), hash = x.hash.ToString(), price = x.price, }).ToList(); return(JsonConvert.SerializeObject(items)); }