High Scripts
Search…
Javascript API

ESX.Phone.functions.addButton(query, callback)

Code example:
ESX.Phone.functions.addButton("#myelement", function(element, event) {
console.log($(element).attr("id") + " was clicked on.")
})

Arguments

Argument number
Argument name
Example value
1
query
"#myelement"
2
callback
function(element, event)

ESX.Phone.functions.addDynamicButton(query, callback)

Code example:
ESX.Phone.functions.addDynamicButton("#myelement", function(element, event) {
console.log($(element).attr("id") + " was clicked on.")
})

Arguments

Argument number
Argument name
Example value
1
query
"#myelement"
2
callback
function(element, event)
How is this different from addButton?
This function adds a click event to the document, not to the element.

ESX.Phone.functions.hasApp(app)

Code example:
function raceCreated() {
let hasRacingApp = ESX.Phone.functions.hasApp("Races");
if(hasRacingApp) {
// Do something here
}
})

Arguments

Argument number
Argument name
Example value
1
app
"Bank"

ESX.Phone.functions.sendNotification(icon, iconcolor, title, description, length)

Code example:
function raceCreated() {
// Do something here
ESX.Phone.functions.sendNotification("fas fa-flag-checkered", "#fff", "Races", "A new race has been created!", 3000)
})

Arguments

Argument number
Argument name
Example value
1
icon
"fas fa-flag-checkered"
2
iconcolor
"#ffffff"
3
title
"Hello"
4
description
"I'm highrider#2873"
5
length (in miliseconds)
2000
Copy link
On this page
ESX.Phone.functions.addButton(query, callback)
Arguments
ESX.Phone.functions.addDynamicButton(query, callback)
Arguments
ESX.Phone.functions.hasApp(app)
Arguments
ESX.Phone.functions.sendNotification(icon, iconcolor, title, description, length)
Arguments