CityRP Documentation Repository

core.plugins.billboards.cl.zad_imageloader

Zeros AdvertKit Image Loader (Client). Client-side image loading and caching functions.

Functions

zad.f.ImageLoader.GetCacheFilename(id) → stringSource ☍

Generate a safe filename from an ID or URL.

Parameters

  • idstringThe ID or URL to convert.

Returns

  1. stringsafe filename for caching.
zad.f.ImageLoader.GetContentType(headers) → string|nilSource ☍

Read the media type from a response's headers. Header names are matched case-insensitively: Steam's legacy CDN answers over HTTP/2, which sends them lowercase.

Parameters

  • headerstable<string, string>The response headers from http.Fetch.

Returns

  1. string|nilThe lowercased media type without parameters, or nil if absent.
zad.f.ImageLoader.GetMaterial(id, callback)Source ☍

Load and cache a material from a URL.

Parameters

  • idstringThe image URL or ID.
  • callbackfunctionThe callback function to receive the material or false on failure.

Tables

zad.f.ImageLoaderSource ☍
zad.f.ImageLoader.CachedMaterialsSource ☍

Fields