isReachable

function

General

The isReachable function checks whether the player with the telephone number passed in the parameter can currently be located. If it can be located, the function should return the coordinate in vec3 format, if not, the function should return false

Sourcecode

function isReachable(pPhoneNumber)
    local response = MySQL.query.await('SELECT `id` FROM `phone_phones` WHERE `phone_number` = ?', {pPhoneNumber})
    if response[1] then
        local xTarget = ESX.GetPlayerFromIdentifier(response[1].id)
        if xTarget then
            if xTarget.getInventoryItem('phone').count > 0 then
                if lib.callback.await("handyortung:client:isInAirplaneMode", xTarget.source) then
                    return nil
                else
                    return xTarget.getCoords()
                end
            end
        end
    end
end

Arguments

ArgumentData TypeOptionalDefault ValueExplanation

pPhoneNumber

string

No

-

Last updated