AI Core
Araçlarai-vehicleshop

Geliştiriciler için ai-vehicleshop

ai-vehicleshop’un server export’u.

@aicore-fivem/shared içinde (exports.ts) AiVehicleshopServerExports olarak tiplenmiştir.

TypeScript
import { resourceExport } from "@aicore-fivem/lib/server";
const shop = resourceExport("ai-vehicleshop");

Server export’ları

GetCatalogPrice

Bir modelin paneldeki katalogda fiyatı. Bir aracın değerini biçmek için kullan (geri alım, sigorta, vergi). ai-vehiclesales bunu bayinin teklifi için kullanır.

Taraf: Server · Bekler: hayır

Signature
GetCatalogPrice(model: string): number | null
Lua
local price = exports['ai-vehicleshop']:GetCatalogPrice(model) -- number ya da nil

Parametreler

Prop

Type

Dönüş değeri

Dolar cinsinden fiyat. Katalogda o modele sahip araç yoksa ya da model metin değilse null.

Örnek

import { resourceExport } from "@aicore-fivem/lib/server";

const shop = resourceExport("ai-vehicleshop");

// Sigorta katalog fiyatının %40’ını öder.
export function insurancePayout(model: string): number {
  const price = shop.GetCatalogPrice(model);
  return price === null ? 0 : Math.floor(price * 0.4);
}

Event’ler

ai-vehicleshop’un satın alma callback’i iç kullanım içindir (kendi client’ından kendi server’ına); başka script’lerden çağırma. Server’da galeriyi, mesafeyi, erişimi ve kataloğu kontrol eder.

Bu sayfada