Server exportları

Fotoğraflar ve AirDrop

Bir oyuncunun galerisine fotoğraf ekleyen, galeriyi okuyan ve AirDrop ile bir şey teklif eden server export'ları.

Medya bağlantıları, ServerConfig.Upload.AllowedHosts içinde izin verilen bir sunucuda https:// olmalıdır. Bkz. Yükleme.

#AddGalleryPhoto

Bir oyuncunun Fotoğraflar'ına bir resim ya da video ekler.

Şu adla da kullanılabilir: addGalleryPhoto

lua---@param target integer|string a server id or a character identifier
---@param data { url: string, thumbnail?: string, kind?: 'photo'|'video' }
---@return integer|false id
exports['fx-phone']:AddGalleryPhoto(target, data)
luaexports['fx-phone']:AddGalleryPhoto(source, { url = 'https://example.com/speed-camera.jpg' })
  • Bilinmeyen bir oyuncu, izin verilmeyen bir bağlantı ya da bilinmeyen bir kind için false döndürür.
  • Yalnızca rakamlardan oluşan bir string server id olarak okunur.

#GetPhotos

Bir oyuncunun en yeni fotoğraflarını ve videolarını döndürür.

Şu adla da kullanılabilir: getPhotosData

lua---@param target integer|string a server id or a character identifier
---@return table[] media up to 60 rows
exports['fx-phone']:GetPhotos(target)
lualocal photos = exports['fx-phone']:GetPhotos(source)
  • Her satır: { id, url, thumbnail, kind, duration, favorite, createdAt }.

#AirShare

Bir oyuncuya AirDrop ile bir şey teklif eder. Oyuncu bunu telefonunda kabul edebilir ya da reddedebilir.

lua---@param from integer|nil the sending player's server id, or nil for a share from the system
---@param to integer the receiving player's server id
---@param kind 'photo'|'contact'|'location'
---@param data table see the table below; `data.from` names a system sender, up to 40 characters
---@return string|false id the offer id
exports['fx-phone']:AirShare(from, to, kind, data)
luaexports['fx-phone']:AirShare(nil, source, 'location', { x = 215.3, y = -810.2, label = 'Meeting point', from = 'Dispatch' })
kind data
photo { url, thumbnail?, kind? }
contact { number, firstname, lastname?, avatar? }
location { x, y, z?, label? }, etiket en fazla 60 karakter
  • Alıcının telefonu yüklenmemişse, tür bilinmiyorsa ya da veri geçersizse false döndürür.
  • data.from verilmezse sistem paylaşımı "AirDrop"tan geliyormuş gibi gösterilir.