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