> For the complete documentation index, see [llms.txt](https://docs.gkshop.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gkshop.org/gksphone-v1/esx/developers/client-event.md).

# Client Event

### Flight Mode

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

### Player Phone Number

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

### Phone turned on or not?

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

### Turn off the phone

```lua
exports["gksphone"]:ClosePhone()
```

### Turn on the phone

```lua
exports["gksphone"]:OpenPhone()
```

### Prevent the phone from turning on

```lua
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

```lua
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

```lua
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

```lua
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.

```lua
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

```lua
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)

```lua
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

<pre class="language-lua"><code class="lang-lua">exports["gksphone"]:JobDispatch(message, image, job, anonymous)
-- Example
<strong>exports["gksphone"]:JobDispatch('A notice text', '', '["police", "sheriff"]', false)
</strong></code></pre>

### IsCall

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

```lua
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

```lua
exports["gksphone"]:StartingCall(number)
```

### Specific Number

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

```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

<pre class="language-lua"><code class="lang-lua"><strong>local status = true -- true/false 
</strong><strong>exports["gksphone"]:InputChange(status) 
</strong></code></pre>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gkshop.org/gksphone-v1/esx/developers/client-event.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
