Events
Our phone also has events! You can either listen to them or trigger them.
Listenable events
high_phone:openPhone
AddEventHandler("high_phone:openPhone", function()
print("Phone has been opened")
end)
Client-sided event. Triggers when the phone is opened.
high_phone:closePhone
AddEventHandler("high_phone:closePhone", function()
print("Phone has been closed")
end)
Client-sided event. Triggers when the phone is closed.
Triggerable events
high_phone:sendMailFromServer
-- Client-sided code:
TriggerServerEvent("high_phone:sendMailFromServer", senderData, subject, content, attachments)
-- Server-sided code:
TriggerEvent("high_phone:sendMailFromServer", senderData, subject, content, attachments, source)
Server-sided event. Sends a mail into your/player's phone if he has a mail account logged.
Can't be empty - *
Argument number | Argument name | Example value |
---|
| | { address = "bank@gmail.com", name = "Bank",
photo = "" } |
| | |
| | "You have received $ 100" |
| | { {image = "https://image.link/image.png"}
} |
| | |
high_phone:sendOfflineMailFromServerToAddress
-- Server-sided code:
TriggerEvent("high_phone:sendOfflineMailFromServerToAddress", address, senderData, subject, content, attachments)
Server-sided event. Sends a mail into an offline player's mail account.
Can't be empty - *
Argument number | Argument name | Example value |
---|
| | |
| | { address = "bank@gmail.com", name = "Bank",
photo = "" } |
| | |
| | "You have received $ 100" |
| | { {image = "https://image.link/image.png"} } |
high_phone:sendOfflineMailFromServer
-- Server-sided code:
TriggerEvent("high_phone:sendMailFromServer", identifier, senderData, subject, content, attachments)
Server-sided event. Sends a mail into an offline player's phone if he has a mail account logged.
Can't be empty - *
Argument number | Argument name | Example value |
---|
| | Steam/Rockstar/IP/Discord |
| | { address = "bank@gmail.com", name = "Bank",
photo = "" } |
| | |
| | "You have received $ 100" |
| | { {image = "https://image.link/image.png"} } |
high_phone:shareContactDetails
TriggerEvent("high_phone:shareContactDetails")
Client-sided event. Shares your own contact details to the nearest player. Max distance can be configured in high_phone/config.lua
high_phone:updateData
TriggerEvent("high_phone:updateData") -- Client-side
TriggerClientEvent("high_phone:updateData", source) -- Server-side
Client-sided event. Updates the player's phone data.abs
high_phone:receivedMessage
-- Client-sided code
TriggerEvent("high_phone:receivedMessage", number, content, attachments)
-- Server-sided code
TriggerClientEvent("high_phone:receivedMessage", source, number, content, attachments)
Client-sided event. Manipulates a receival of a message (sends a message to your phone from a specified number)
Can't be empty - *
Argument number | Argument name | Example value |
---|
| | |
| | |
| | json.encode({ {image = "https://imagelink.com/image.png"}}) |
high_phone:sendMessage
TriggerServerEvent("high_phone:sendMessage", number, content, attachments)
Server-sided event. Sends a message to a specified number.
Can't be empty - *
Argument number | Argument name | Example value |
---|
| | |
| | |
| | json.encode({image = "https://imagelink.com/image.png"}) |
This is different from other phones, here you have to send the location in the content with this code:
string.format("(GPS:%s,%s)", x, y) -- x,y being the coordinates of the location
For example if you want to send the location, an example of the code would be:
TriggerServerEvent(
"high_phone:sendMessage",
"02",
"Person dead at" .. string.format("(GPS:%s,%s)", 123.0, 123.0)
)
Make sure you replace 123.0, 123.0
with the actual coordinates!
Lets say you want to attach an image to the message, use this table to add messages:
json.encode({
{image = "https://imagelink.com/image.png"}
})
A whole event example:
TriggerServerEvent(
"high_phone:sendMessage",
"111-11111",
"Here's an attachment",
json.encode({
{image = "https://imagelink.com/image.png"}
})
)
TriggerServerEvent("high_phone:postTweet", title, content, image)
Server-sided event. Posts a tweet from player's phone in twitter app.
Can't be empty - *
Argument number | Argument name | Example value |
---|
| | |
| | |
| | "https://imagelink.com/image.png" or "" |