Server exportları

Mesajlar ve posta

Metin mesajı, konum, e-posta ve şirket hattı mesajı gönderen server export'ları.

Bu export'lar sistem adına çalışır. Kontrolleri çalıştırmaz ve yetki kontrol etmezler.

#SendMessage

Bir telefon numarasına metin mesajı gönderir.

Şu adla da kullanılabilir: sendMessage

lua---@param from string a phone number, or any sender name such as 'Dispatch'
---@param to string a phone number
---@param text? string cut at Config.Limits.MessageLength
---@param attachments? table one attachment, or a list of which the first is used
---@return boolean sent
exports['fx-phone']:SendMessage(from, to, text, attachments)
luaexports['fx-phone']:SendMessage('Dispatch', '5551234', 'Unit 12, respond to Vinewood Bowl.')
  • from bilinen bir telefonun numarasıysa mesaj, o oyuncunun to ile olan sohbetinde görünür. Başka herhangi bir değer, o adla (en fazla 40 karakter) salt okunur bir sohbet açar.
  • to bilinen bir telefon numarası değilse ya da ne metin ne de geçerli bir ek varsa false döndürür.
Ek Alanlar
{ type = 'image' } (ayrıca 'video', 'gif') url, thumbnail?
{ type = 'audio' } url, duration
{ type = 'location' } x, y, z?, label?
{ type = 'contact' } number, name, avatar?

#SendCoords

Mesajda bir konum gönderir.

Şu adla da kullanılabilir: sendLocation

lua---@param from string a phone number or a sender name
---@param to string a phone number
---@param coords vector3|vector4|{ x: number, y: number, z?: number }
---@return boolean sent
exports['fx-phone']:SendCoords(from, to, coords)
luaexports['fx-phone']:SendCoords('Dispatch', '5551234', vector3(215.3, -810.2, 30.7))

#SentMoney

Sohbette "para gönderildi" baloncuğu gösterir. Para hareket etmez; ödemeyi kendin yap.

lua---@param from string a phone number or a sender name
---@param to string a phone number
---@param amount number rounded down; must be above 0
---@return boolean sent
exports['fx-phone']:SentMoney(from, to, amount)
luaexports['fx-phone']:SentMoney('5550001', '5551234', 250)

#SendMail

Bir karaktere e-posta gönderir.

lua---@class PhoneMail
---@field identifier? string the recipient's character identifier
---@field number? string or the recipient's phone number (`to` is accepted too)
---@field sender? string
---@field subject? string
---@field message? string
---@field attachments? table
---@field seen? boolean true stores it as read and sends no notification

---@param mail PhoneMail
---@return integer|false id
exports['fx-phone']:SendMail(mail)
luaexports['fx-phone']:SendMail({ identifier = citizenid, sender = 'Los Santos Customs', subject = 'Invoice', message = 'Your repair is ready.' })
  • mail tablo değilse ya da alıcı bilinmiyorsa false döndürür.
  • cylex_phone biçimi sendMail(identifier, src, data) da kayıtlıdır: bkz. cylex_phone uyumluluğu.

#SendCompanyMessage

Hizmetler uygulamasında bir şirketin hattına, o numaraya sahip oyuncu olarak yazar.

lua---@param job string a company listed in the Services config
---@param fromNumber string a phone number
---@param text string
---@return boolean sent
exports['fx-phone']:SendCompanyMessage(job, fromNumber, text)
luaexports['fx-phone']:SendCompanyMessage('mechanic', '5551234', 'My car broke down at Legion Square.')
  • Bilinmeyen bir şirket, geçersiz bir numara ya da boş bir metin için false döndürür. Bkz. Hizmetler.

#GetOnDutyWorkers

Bir şirketin hattını şu anda yanıtlayan oyuncuları döndürür.

lua---@param job string
---@return integer[] sources server ids, sorted; empty for an unknown company
exports['fx-phone']:GetOnDutyWorkers(job)
lualocal workers = exports['fx-phone']:GetOnDutyWorkers('police')