Client exportları
Bildirimler
Oyuncunun kendi telefonunda bildirim gösteren client export'ları.
Client'tan gönderilen bildirim yalnızca gösterilir. Kaydedilmez; bu yüzden çevrimdışı bir oyuncu onu hiçbir zaman görmez. Bir telefon için bildirim kaydetmek istiyorsan server export'larını kullan.
#SendNotification
Bu oyuncunun telefonunda bir bildirim gösterir.
lua---@class PhoneNotificationData
---@field app? string app id; decides the icon and follows that app's notification switch. Default 'system'
---@field title? string up to 100 characters
---@field content? string up to 500 characters (`text` and `description` are accepted too)
---@field icon? string icon name or image link, up to 512 characters
---@field thumbnail? string image link, up to 512 characters
---@field timeout? number banner time in milliseconds, 0 to 600000. Default 5000
---@field sound? boolean false for a silent notification
---@field data? table passed through to the app
---@param data PhoneNotificationData
exports['fx-phone']:SendNotification(data)
luaexports['fx-phone']:SendNotification({ app = 'garage', title = 'Garage', content = 'Your car is ready.' })
- Daha uzun metinler yukarıdaki sınırlara göre kesilir.
- Dış bir sunucuyu gösteren
iconya dathumbnail, sunucuServerConfig.Upload.AllowedHostsiçinde izinli değilse atılır. Bir resource'un dosyaları (nui://my-resource/logo.png) her zaman yüklenir. Bkz. Yükleme. - Aynı bildirim server'dan
fx-phone:client:notificationnet event'iyle de gönderilebilir: bkz. Tetikleyebileceğin event'ler.
#PhoneNotification
Eski script'lerin kullandığı kısa, sıralı argüman biçimiyle bir bildirim gösterir.
lua---@param title string|PhoneNotificationData a title, or one table as for SendNotification
---@param text? string
---@param icon? string
---@param timeout? number milliseconds
exports['fx-phone']:PhoneNotification(title, text, icon, timeout)
luaexports['fx-phone']:PhoneNotification('Dispatch', '10-31 at Legion Square', 'siren', 6000)