Client Event

You will find client events of our phone that you can use in this page.

Flight Mode

local FlightMode = exports["gksphone"]:CheckFlightMode()
print(FlightMode) => as true or false

Player Phone Number

local PhoneNumber = exports["gksphone"]:PhoneNumber()
print(PhoneNumber) => You can reach the player's phone number

Phone turned on or not?

local CheckOpenPhone = exports["gksphone"]:CheckOpenPhone()
print(CheckOpenPhone) => as true or false

Turn off the phone

exports["gksphone"]:ClosePhone()

Turn on the phone

exports["gksphone"]:OpenPhone()

Prevent the phone from turning on

exports["gksphone"]:BlockOpenPhone(true)  -- Prevents the phone from turning on
exports["gksphone"]:BlockOpenPhone(false) -- Turns off prevention

How to use phone notification?

title => Notification title message => Notification message img => You can use icons from the phone or use .png or .jpg in a photo duration => To set how long the notification stays (You must type the millisecond value) - default duration 5000

local NotifData = {
    title = "Notification header", 
    message = "Notification Message", 
    img= '/html/static/img/icons/messages.png', 
    duration = 5000
}
exports["gksphone"]:SendNotification(NotifData)

If you want a button with notification

buttonactive : Set to true to enable button button : buttonEvent : Which client will be triggered button : buttonData : data to add to button

local NotifData = {
    title = "Notification header", 
    message = "Notification Message", 
    img= '/html/static/img/icons/messages.png', 
    duration = 5000,
    buttonactive = true, 
    button = {
        buttonEvent = "clientevent", 
        buttonData = "Test"
    }
}
exports["gksphone"]:SendNotification(NotifData)

Sending a Message

Number => Phone number to send message

TriggerServerEvent('gksphone:gksc:sendMessage', Number, "Message")

Mail Sending Process

If you are going to make a function in the mail you will send, you can use the Button option.

local MailData = {
    sender = 'GKSHOP',
    image = '/html/static/img/icons/mail.png',
    subject = "GKSPHONE",
    message = 'TEST',
    button = {
      buttonEvent = "qb-drugs:client:setLocation",
      buttonData = "test",
      buttonname = "test"
    }
exports["gksphone"]:SendNewMail(MailData)

If you just send a text

local MailData = {
  sender = 'GKSHOP',
  image = '/html/static/img/icons/mail.png',
  subject = "GKSPHONE",
  message = 'TEST'
}
exports["gksphone"]:SendNewMail(MailData)

If you want to send an mail to someone offline identifier => player's identifier information (ESX)

local MailData = {
  sender = 'GKSHOP',
  image = '/html/static/img/icons/mail.png',
  subject = "GKSPHONE",
  message = 'TEST'
}

exports["gksphone"]:SendNewMailOffline(identifier, MailData)

JOB App Send Message

Set false at the end to true if you want to send it anonymous.

message => message to be sent in notification image => photo to be sent in notification (if you are not going to send photos => '') (img link) job => Job code (if you want to submit more than one profession, you can do as shown in the example) example => '["police", "sheriff"]' or '["police"]' anonymous => true to send a confidential report false if not a confidential report

exports["gksphone"]:JobDispatch(message, image, job, anonymous)
-- Example
exports["gksphone"]:JobDispatch('A notice text', '', '["police", "sheriff"]', false)

IsCall

You can detect whether the person is talking on the phone or not.

local IsCall = exports["gksphone"]:IsCall()
print(IsCall) -- true or false

Starting Call

An export method that can be used to initiate a call number => phone number to call

exports["gksphone"]:StartingCall(number)

Specific Number

This function is an event that works for the phone numbers you specify "Config.SpecificNumber" in config.lua.

RegisterNetEvent('gksphone:client:specificNumber', function(source, phoneNumber)
    ---- You can add the function you want to do to this part
end)

Exports for Custom APP

Preventing Character Walk

Prevent the character from walking while typing in the text field

local status = true -- true/false 
exports["gksphone"]:InputChange(status) 

Last updated