Server exportları
Aramalar ve kişiler
Arama başlatan, bitiren ve inceleyen, bir telefona kişi ekleyen server export'ları.
Bu export'lar sistem adına çalışır: createCall kontrolü arama servisinin içinde yine çalışır, ama export'u çağıran için hiçbir yetki kontrol edilmez.
#CreateCall
Bir oyuncunun telefonundan arama başlatır.
lua---@param src integer the calling player
---@param number string a phone number, or 'job:<name>' to ring a company line
---@param opts? { hideNumber?: boolean, video?: boolean }
---@return { id: integer }|nil call
---@return string|nil err
exports['fx-phone']:CreateCall(src, number, opts)
lualocal call, err = exports['fx-phone']:CreateCall(source, '5551234')
- Hatalar arasında
not_found(oyuncunun telefonu yüklenmemiş),busy,unavailable,airplanevedeniedvardır. Bkz. Hata kodları.
#StartVideoCall
Bir oyuncunun telefonundan görüntülü arama başlatır.
lua---@param src integer
---@param number string
---@param opts? { hideNumber?: boolean }
---@return { id: integer }|nil call
---@return string|nil err
exports['fx-phone']:StartVideoCall(src, number, opts)
luaexports['fx-phone']:StartVideoCall(source, '5551234')
#EndCall
Bir oyuncunun içinde olduğu aramayı bitirir.
lua---@param src integer
---@return boolean ended false when the player is not in a call
exports['fx-phone']:EndCall(src)
luaexports['fx-phone']:EndCall(source)
#IsInCall
Bir oyuncunun aramada olup olmadığını döndürür.
lua---@param src integer
---@return boolean inCall
exports['fx-phone']:IsInCall(src)
luaif exports['fx-phone']:IsInCall(source) then return end
#GetCall
Bir aramanın ayrıntılarını id'sine göre döndürür.
lua---@param id integer
---@return { id: integer, caller: integer, callee: integer, callerNumber: string, calleeNumber: string, state: string, anonymous: boolean, startedAt: integer, answeredAt: integer|nil }|nil call
exports['fx-phone']:GetCall(id)
lualocal call = exports['fx-phone']:GetCall(id)
callervecalleeserver id'leridir. Yalnızca hâlâ süren aramalar döndürülür.
#AddContact
Bu numaraya sahip telefona bir kişi ekler.
lua---@param number string the number of the phone that receives the contact
---@param data { number: string, firstname: string, lastname?: string, avatar?: string }
---@return boolean ok
---@return string|nil err
exports['fx-phone']:AddContact(number, data)
luaexports['fx-phone']:AddContact(exports['fx-phone']:GetPhoneNumber(source), { number = '5550100', firstname = 'Lawyer' })
- Yüklü hiçbir telefon o numaraya sahip değilse
false, 'not_found'döndürür.