Exports

coachHint is based on exports. Here are all of them.

ShowHint - Used to display simple Hint

-- title: string
-- description: string
-- color: string
exports['coachHint']:ShowHint(title, description, color)

-- EXAMPLE
exports['coachHint']:ShowHint('Delivery Job', 'Go to Los Santos Airport to pickup delivery package', 'red')

ShowHintCoords - Used to display Hint that shows distance to coords

-- title: string
-- description: string
-- coords: vector3
-- distance: float
-- autoClose: boolean
-- color: string
-- returns: 'y' or 'c' | 'y' when player reached destination coords (playerCoords - coords < distance) | 'c' when Hint was closed
local result = exports['coachHint']:ShowHintCoords(title, description, coords, distance, autoClose, color)

-- EXAMPLE
local result = exports['coachHint']:ShowHintCoords('Taxi Job', 'Pickup client from Groove Street', vector3(157.05, 670.72, 49.50), 4.0, true, 'green')
if result == 'y' then
    print('you reached your destination')
elseif result == 'c' then
    print('you cancelled your task')
end

ShowHintWithPoints - Used to display Hint with points for example: 0/15

-- title: string
-- description: string
-- maxPoints: number
-- startingPoints: number
-- autoClose: boolean
-- customIcon: string
-- color: string
-- returns: 'y' or 'c' | 'y' when player reached destination coords (playerCoords - coords < distance) | 'c' when Hint was closed
local result = exports['coachHint']:ShowHintWithPoints(title, description, maxPoints, startingPoints, autoClose, customIcon, color)

-- EXAMPLE
local result = exports['coachHint']:ShowHintWithPoints('Delivery', 'Deliver 15 packages to marked locations', 15, 0, true, 'inventory')
if result == 'y' then
    print('you delivered 15 packages')
elseif result == 'c' then
    print('you cancelled your task')
end

HideHint - Used to close current Hint

-- EXAMPLE
exports['coachHint']:HideHint()

IsHintVisible - Used to check if Hint is currently visible on screen

-- returns: boolean | 'true' if Hint is visible, 'false' if Hint is not visible
exports['coachHint']:IsHintVisible()

-- EXAMPLE
if exports['coachHint']:IsHintVisible() then
    print('Hint is currently visible')
else
    print('His is currently not visible')
end

GetHintPoints - Used to get current Hint points progress

-- returns: number | number of current Hint points
exports['coachHint']:GetHintPoints()

-- EXAMPLE
local points = exports['coachHint']:GetHintPoints()
print('Player has currently ' .. points .. ' points')

GetHintMaxPoints - Used to get maximum Hint points

-- returns: number | number of current Hint max points
exports['coachHint']:GetHintMaxPoints()

-- EXAMPLE
local maxpoints = exports['coachHint']:GetHintMaxPoints()
print('Player has currently ' .. maxpoints .. ' max points')

GetHintDistance - Used to get current player distance to Hint destination coords

-- returns: float | distance (in kilometers) from player to his current Hint destination
exports['coachHint']:GetHintDistance()

-- EXAMPLE
local distance = exports['coachHint']:GetHintDistance()
print('player is now ' .. distance .. ' km from his Hint destination')

ChangeHintTitle - Used to change current Hint title

-- title: string
exports['coachHint']:ChangeHintTitle(title)

-- EXAMPLE
exports['coachHint']:ChangeHintTitle('New Title')

ChangeHintDescription - Used to change current Hint description

-- title: string
exports['coachHint']:ChangeHintDescription(description)

-- EXAMPLE
exports['coachHint']:ChangeHintDescription('This is new Hint description')

ChangeHintColor - Used to change Hint color

-- newColor: string
exports['coachHint']:ChangeHintColor(newColor)

-- EXAMPLE
exports['coachHint']:ChangeHintColor('orange')

Supported colors:

  • purple

  • green

  • blue

  • orange

  • red

UpdateHintPoints - Used to set new Hint points

-- points: number
exports['coachHint']:UpdateHintPoints(points)

-- EXAMPLE
local maxPoints = exports['coachHint']:GetHintMaxPoints()
local newPoints = maxPoints - 1
exports['coachHint']:UpdateHintPoints(newPoints)
print('Hint points changed to maxPoints - 1')

AddHintPoints - Used to add points to Hint points

-- points: number
exports['coachHint']:AddHintPoints(points)

-- EXAMPLE
exports['coachHint']:AddHintPoints(1)
print('Added 1 Hint point')

Last updated