# Installation

## Before Starting

Installation and download processes are straightforward and fixed. After following the specified steps, you can easily complete the installation. <mark style="color:purple;">**Skipping a small step can lead to significant errors in the future!**</mark>

{% hint style="success" %}
If you dont know, how to phone use check [this link](/lquens/ls-phone/configurations-exports-and-events.md#basics) for how to usage!
{% endhint %}

{% hint style="danger" %}
**If you get an error, and if the error located in errors page, support it will take much longer for you to get a reply.**

\
**If you don't modify configurations file, support it will take much longer for you to get a reply.**
{% endhint %}

## Installation

If you dont have knowledge, you can use this video for installation process

{% embed url="<https://youtu.be/kClEkRiiOes?si=1jQbsog9vs-_AMYm>" %}
Installation video
{% endembed %}

Extract **ls-phone** from the downloaded folder and install it on your server.

{% hint style="warning" %}
If the downloaded file has a different name than <mark style="color:yellow;">ls-phone</mark>, rename it to <mark style="color:yellow;">ls-phone</mark> or it will not work and errors will occur!
{% endhint %}

After installing it on your server, import the SQL database named <mark style="color:yellow;">**"phone.sql"**</mark> into your server's database.

{% hint style="warning" %}
*Before starting, make sure you're started <mark style="color:yellow;">ls-phone</mark> after <mark style="color:yellow;">ls-core</mark> start. If you dont, start <mark style="color:yellow;">ls-phone</mark> after <mark style="color:yellow;">ls-core</mark>.*
{% endhint %}

## Requirements

{% hint style="danger" %}
Do not skip any requirements. It's will errors in future!
{% endhint %}

First, make sure that the specified resources have been downloaded and installed on your server;

<table><thead><tr><th width="228">Script</th><th>Download</th></tr></thead><tbody><tr><td>ls-core</td><td><a href="https://github.com/LquenS/ls-core">https://github.com/LquenS/ls-core</a></td></tr><tr><td>ls-crypto</td><td><a href="https://github.com/LquenS/ls-crypto">https://github.com/LquenS/ls-crypto</a></td></tr><tr><td>xsound</td><td><a href="https://github.com/Xogy/xsound">https://github.com/Xogy/xsound</a></td></tr><tr><td>screenshot-basic</td><td><a href="https://github.com/citizenfx/screenshot-basic">https://github.com/citizenfx/screenshot-basic</a></td></tr></tbody></table>

## Image Capture

You need to webhooks for take an photo in this section you'll learn how to add webhooks.\
\
First locate **`configs/config_server.lua`** and scroll to end find **`Config.Server.Webhook`** and modify.

{% code title="configs/config\_server.lua" %}

```lua
Config.Server.Webhook = "your webhook link"
```

{% endcode %}

{% embed url="<https://youtu.be/fKksxz2Gdnc>" %}
How to create an webhook
{% endembed %}

{% hint style="danger" %}
If you skip, these step you cant capture images/videos.
{% endhint %}

## Key Configuring

Phone mainly works as item instead key, but you can use keys too! You can change keybinding from <mark style="color:yellow;">Settings > Key Bindings > FiveM > Phone Shortcut</mark> this only affects you, if you want change for everyone, <mark style="color:yellow;">ls-phone/client/otherc.lua</mark> and find <mark style="color:yellow;">RegisterKeyMapping</mark> after that change <mark style="color:yellow;">M</mark> key whatever you want!

{% hint style="warning" %} <mark style="color:yellow;">RegisterKeyMapping</mark> does not affect who joined after ls-phone start. They need to change in <mark style="color:yellow;">Settings > Key Bindings > FiveM > Phone Shortcut</mark>
{% endhint %}

{% hint style="danger" %}
Key not  working at every inventory, like ox\_inventory because <mark style="color:yellow;">ls-core GetItem</mark> function not working as expected for ox\_inventory. If you want to use by key, try to modify <mark style="color:yellow;">ls-core/server/main.lua</mark>, locate <mark style="color:yellow;">self.Functions.GetItem</mark> and try to modify
{% endhint %}

## Executing Non-Included SQL

{% hint style="info" %}
Some features not included with <mark style="color:yellow;">phone.sql</mark>, because they released with updates. You can check these step if you want to use these features.
{% endhint %}

Verified profiles can be used in some apps, if you want to add verified profiles to your phone execute this SQL,

```sql
ALTER TABLE twitter_users add verified int DEFAULT "0";
ALTER TABLE instagram_users add verified int DEFAULT "0";
```

## Impementing Inventories

Some inventories doesn't uses metadata, and if you're using non metadata inventory execute this sql,

Process time depends your inventory script, most and common inventories added to this step.

{% hint style="danger" %}
Some inventory does not support metadata usage, for reason best choice is closing metadata.\
You can locate [this section](/lquens/ls-phone/configurations-exports-and-events.md#disabling-metadata) for disable metadata.
{% endhint %}

{% hint style="success" %}
Implementing to <mark style="color:yellow;">no more required</mark>, but in some inventories it doesnt working, you can use these steps.
{% endhint %}

### qb-inventory

<details>

<summary>Expand these section if you're using this inventory</summary>

Before starting, locate your *<mark style="color:purple;">**qb-inventory/server/main.lua**</mark>* after that find [line 153](https://github.com/qbcore-framework/qb-inventory/blob/main/server/main.lua#L153), if your line 153 not the AddItem search **`function AddItem`** locate **`infoType["weapon"]`** and replace whole line with this code snippet,

```lua
	if itemInfo['type'] == 'weapon' then
		info.serie = info.serie or tostring(QBCore.Shared.RandomInt(2) .. QBCore.Shared.RandomStr(3) .. QBCore.Shared.RandomInt(1) .. QBCore.Shared.RandomStr(2) .. QBCore.Shared.RandomInt(3) .. QBCore.Shared.RandomStr(4))
		info.quality = info.quality or 100
	elseif itemInfo["name"] == "phone" then
		local PhoneData = {
            MetaData = {
                phonenumber = math.random(11111111, 99999999),
                owner = "Unknown",
                serialnumber = tostring(QBCore.Shared.RandomInt(3) .. QBCore.Shared.RandomStr(3) .. QBCore.Shared.RandomInt(3)):upper(),

                profilepicture = "img/default.png",
                background = "img/backgrounds/iphone.png",
                wallpapers = {
					["img/backgrounds/iphone.png"] = true,
					["img/backgrounds/blue.png"] = true,
					["img/backgrounds/deeppurple.png"] = true,
					["img/backgrounds/gold.png"] = true,
					["img/backgrounds/midnight.png"] = true,
					["img/backgrounds/purple.png"] = true,
					["img/backgrounds/red.png"] = true,
					["img/backgrounds/silver.png"] = true,
					["img/backgrounds/spaceblack.png"] = true,
					["img/backgrounds/starlight.png"] = true,
				},
                brightness = 100.0,
                volumeprogress = 100.0,
                layout = "4-6",
                widgetApp ={},
                phonePages = { [1] = true },
                phonePage = 1,
                notifications = {},
                oldConnections = {},
                Password = 1234,
    
                instagramUser = false,
                twitterUser = false,
                snapchatUser = false,
                darkchatUser = false,
    
                snapchatFriendRequests = { },
    
                phoneLocation = { x = 100, y = 100},
                phoneZoom = 100,
                bluetooth = false,
                LockScreen = false,

                beforeApps = {},
            },

            Notification = true,
            DarkMode = false,
            Airplane = false,
            MobileData = false,
            Wifi = false,
            WifiData = nil,
            DND = false,
            PhoneLocked = false,
            Battery = 100,
            PhoneClosed = false,

            gallery = {},
            clock = { alarms = {} },

            notes = {},
            mails = {},
            contacts = {},

            applications = {
                settings = {
                    app = "settings",
                    color = "transparent",
                    
                    photo = "settings.png",
                    label = "Settings",
                    style = "padding-right = .08vh; font-size = 2.3vh",
                    
                    slot = 1,
                    page = 0,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                gallery = {
                    app = "gallery",
                    color = "transparent",
                    
                    photo = "gallery.png",
                    label = "Gallery",
                    
                    slot = 4,
                    page = 0,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                appstore = {
                    app = "appstore",
                    color = "transparent",
                    
                    photo = "appstore.png",
                    label = "App Store",
                    
                    slot = 5,
                    page = 1,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                camera = {
                    app = "camera",
                    color = "transparent",
                    
                    photo = "camera.png",
                    label = "Camera",
                    
                    slot = 6,
                    page = 1,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                clock = {
                    app = "clock",
                    color = "transparent",
                    
                    photo = "clock.png",
                    label = "Clock",
                    
                    slot = 7,
                    page = 1,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                messages = {
                    app = "messages",
                    color = "transparent",
                    
                    photo = "messages.png",
                    label = "Messages",
                    
                    slot = 2,
                    page = 0,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                contacts = {
                    app = "contacts",
                    color = "transparent",
                    
                    photo = "contacts2.png",
                    label = "Phone",
                    
                    slot = 3,
                    page = 0,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                phonecontacts = {
                    app = "phonecontacts",
                    color = "transparent",
                    
                    photo = "contacts.png",
                    label = "Contacts",
                    
                    slot = 9,
                    page = 1,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                calculator = {
                    app = "calculator",
                    color = "transparent",
                    
                    photo = "calculator.png",
                    label = "Calculator",
                    
                    slot = 8,
                    page = 1,
                    
                    currentPage = nil,
                    pageDetails = {},
            
                    rating = 3.2,        
                    downloadsize = 15,
                    apptype = "app",
                    appbuild = "LOS",
                },  
            }
        }
		if info.MetaData == nil then info = PhoneData end
	end
```

</details>

<figure><img src="/files/MiRLQBSzBpLxpkxaB66K" alt=""><figcaption><p>The final result needs to be looks like,</p></figcaption></figure>

### lj-inventory

<details>

<summary>Expand these section if you're using this inventory</summary>

Before starting, locate your *<mark style="color:purple;">**lj-inventory/server/main.lua**</mark>* after that find [line 139](https://github.com/loljoshie/lj-inventory/blob/main/server/main.lua#L139), if your line 139 not the AddItem search **`function AddItem`** locate **`infoType["weapon"]`** and replace whole line with this code snippet,

```lua
	if itemInfo['type'] == 'weapon' then
		info.serie = info.serie or tostring(QBCore.Shared.RandomInt(2) .. QBCore.Shared.RandomStr(3) .. QBCore.Shared.RandomInt(1) .. QBCore.Shared.RandomStr(2) .. QBCore.Shared.RandomInt(3) .. QBCore.Shared.RandomStr(4))
		info.quality = info.quality or 100
	elseif itemInfo["name"] == "phone" then
		local PhoneData = {
            MetaData = {
                phonenumber = math.random(11111111, 99999999),
                owner = "Unknown",
                serialnumber = tostring(QBCore.Shared.RandomInt(3) .. QBCore.Shared.RandomStr(3) .. QBCore.Shared.RandomInt(3)):upper(),

                profilepicture = "img/default.png",
                background = "img/backgrounds/iphone.png",
                wallpapers = {
					["img/backgrounds/iphone.png"] = true,
					["img/backgrounds/blue.png"] = true,
					["img/backgrounds/deeppurple.png"] = true,
					["img/backgrounds/gold.png"] = true,
					["img/backgrounds/midnight.png"] = true,
					["img/backgrounds/purple.png"] = true,
					["img/backgrounds/red.png"] = true,
					["img/backgrounds/silver.png"] = true,
					["img/backgrounds/spaceblack.png"] = true,
					["img/backgrounds/starlight.png"] = true,
				},
                brightness = 100.0,
                volumeprogress = 100.0,
                layout = "4-6",
                widgetApp ={},
                phonePages = { [1] = true },
                phonePage = 1,
                notifications = {},
                oldConnections = {},
                Password = 1234,
    
                instagramUser = false,
                twitterUser = false,
                snapchatUser = false,
                darkchatUser = false,
    
                snapchatFriendRequests = { },
    
                phoneLocation = { x = 100, y = 100},
                phoneZoom = 100,
                bluetooth = false,
                LockScreen = false,

                beforeApps = {},
            },

            Notification = true,
            DarkMode = false,
            Airplane = false,
            MobileData = false,
            Wifi = false,
            WifiData = nil,
            DND = false,
            PhoneLocked = false,
            Battery = 100,
            PhoneClosed = false,

            gallery = {},
            clock = { alarms = {} },

            notes = {},
            mails = {},
            contacts = {},

            applications = {
                settings = {
                    app = "settings",
                    color = "transparent",
                    
                    photo = "settings.png",
                    label = "Settings",
                    style = "padding-right = .08vh; font-size = 2.3vh",
                    
                    slot = 1,
                    page = 0,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                gallery = {
                    app = "gallery",
                    color = "transparent",
                    
                    photo = "gallery.png",
                    label = "Gallery",
                    
                    slot = 4,
                    page = 0,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                appstore = {
                    app = "appstore",
                    color = "transparent",
                    
                    photo = "appstore.png",
                    label = "App Store",
                    
                    slot = 5,
                    page = 1,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                camera = {
                    app = "camera",
                    color = "transparent",
                    
                    photo = "camera.png",
                    label = "Camera",
                    
                    slot = 6,
                    page = 1,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                clock = {
                    app = "clock",
                    color = "transparent",
                    
                    photo = "clock.png",
                    label = "Clock",
                    
                    slot = 7,
                    page = 1,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                messages = {
                    app = "messages",
                    color = "transparent",
                    
                    photo = "messages.png",
                    label = "Messages",
                    
                    slot = 2,
                    page = 0,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                contacts = {
                    app = "contacts",
                    color = "transparent",
                    
                    photo = "contacts2.png",
                    label = "Phone",
                    
                    slot = 3,
                    page = 0,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                phonecontacts = {
                    app = "phonecontacts",
                    color = "transparent",
                    
                    photo = "contacts.png",
                    label = "Contacts",
                    
                    slot = 9,
                    page = 1,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                calculator = {
                    app = "calculator",
                    color = "transparent",
                    
                    photo = "calculator.png",
                    label = "Calculator",
                    
                    slot = 8,
                    page = 1,
                    
                    currentPage = nil,
                    pageDetails = {},
            
                    rating = 3.2,        
                    downloadsize = 15,
                    apptype = "app",
                    appbuild = "LOS",
                },  
            }
        }
		if info.MetaData == nil then info = PhoneData end
	end
```

###

</details>

<figure><img src="/files/MiRLQBSzBpLxpkxaB66K" alt=""><figcaption><p>The final result needs to be looks like, (Photo taken from qb-inventory because same process)</p></figcaption></figure>

### ox\_inventory

<details>

<summary>Expand these section if you're using this inventory</summary>

Before starting, locate your *<mark style="color:purple;">**ox\_inventory/modules/items/server.lua**</mark>* after that find [line 279](https://github.com/overextended/ox_inventory/blob/main/modules/items/server.lua#LL279), if your line 279 not the Items.Metadata search **`function Items.Metadata`** locate **`elseif item.name == 'garbage' then`** and replace whole line with this code snippet,

```lua
			if item.name == 'identification' then
				count = 1
				metadata = {
					type = inv.player.name,
					description = locale('identification', (inv.player.sex) and locale('male') or locale('female'), inv.player.dateofbirth)
				}
			elseif item.name == 'garbage' then
				local trashType = trash[math.random(1, #trash)]
				metadata.image = trashType.image
				metadata.weight = trashType.weight
				metadata.description = trashType.description
			elseif item.name == 'phone' then
				local PhoneData = {
					MetaData = {
						phonenumber = math.random(11111111, 99999999),
						owner = "Unknown",
						serialnumber = tostring(GenerateText(9)):upper(),
		
						profilepicture = "img/default.png",
						background = "img/backgrounds/iphone.png",
						wallpapers = {
							["img/backgrounds/iphone.png"] = true,
							["img/backgrounds/blue.png"] = true,
							["img/backgrounds/deeppurple.png"] = true,
							["img/backgrounds/gold.png"] = true,
							["img/backgrounds/midnight.png"] = true,
							["img/backgrounds/purple.png"] = true,
							["img/backgrounds/red.png"] = true,
							["img/backgrounds/silver.png"] = true,
							["img/backgrounds/spaceblack.png"] = true,
							["img/backgrounds/starlight.png"] = true,
						},
						brightness = 100.0,
						volumeprogress = 100.0,
						layout = "4-6",
						widgetApp ={},
						phonePages = { [1] = true },
						phonePage = 1,
						notifications = {},
						oldConnections = {},
						Password = 1234,
			
						instagramUser = false,
						twitterUser = false,
						snapchatUser = false,
						darkchatUser = false,
			
						snapchatFriendRequests = { },
			
						phoneLocation = { x = 100, y = 100},
						phoneZoom = 100,
						bluetooth = false,
						LockScreen = false,
		
						beforeApps = {},
					},
		
					Notification = true,
					DarkMode = false,
					Airplane = false,
					MobileData = false,
					Wifi = false,
					WifiData = nil,
					DND = false,
					PhoneLocked = false,
					Battery = 100,
					PhoneClosed = false,
		
					gallery = {},
					clock = { alarms = {} },
		
					notes = {},
					mails = {},
					contacts = {},
		
					applications = {
						settings = {
							app = "settings",
							color = "transparent",
							
							photo = "settings.png",
							label = "Settings",
							style = "padding-right = .08vh; font-size = 2.3vh",
							
							slot = 1,
							page = 0,
							
							currentPage = nil,
							pageDetails = {},
						},
						gallery = {
							app = "gallery",
							color = "transparent",
							
							photo = "gallery.png",
							label = "Gallery",
							
							slot = 4,
							page = 0,
							
							currentPage = nil,
							pageDetails = {},
						},
						appstore = {
							app = "appstore",
							color = "transparent",
							
							photo = "appstore.png",
							label = "App Store",
							
							slot = 5,
							page = 1,
							
							currentPage = nil,
							pageDetails = {},
						},
						camera = {
							app = "camera",
							color = "transparent",
							
							photo = "camera.png",
							label = "Camera",
							
							slot = 6,
							page = 1,
							
							currentPage = nil,
							pageDetails = {},
						},
						clock = {
							app = "clock",
							color = "transparent",
							
							photo = "clock.png",
							label = "Clock",
							
							slot = 7,
							page = 1,
							
							currentPage = nil,
							pageDetails = {},
						},
						messages = {
							app = "messages",
							color = "transparent",
							
							photo = "messages.png",
							label = "Messages",
							
							slot = 2,
							page = 0,
							
							currentPage = nil,
							pageDetails = {},
						},
						contacts = {
							app = "contacts",
							color = "transparent",
							
							photo = "contacts2.png",
							label = "Phone",
							
							slot = 3,
							page = 0,
							
							currentPage = nil,
							pageDetails = {},
						},
						phonecontacts = {
							app = "phonecontacts",
							color = "transparent",
							
							photo = "contacts.png",
							label = "Contacts",
							
							slot = 9,
							page = 1,
							
							currentPage = nil,
							pageDetails = {},
						},
						calculator = {
							app = "calculator",
							color = "transparent",
							
							photo = "calculator.png",
							label = "Calculator",
							
							slot = 8,
							page = 1,
							
							currentPage = nil,
							pageDetails = {},
					
							rating = 3.2,        
							downloadsize = 15,
							apptype = "app",
							appbuild = "LOS",
						},  
					}
				}
				metadata = PhoneData
			end
```

###

</details>

<figure><img src="/files/ZYP0BpL46RxuZISs0C1e" alt=""><figcaption><p>The final result needs to be looks like,</p></figcaption></figure>

### ls-inventoryhud

<details>

<summary>Expand these section if you're using this inventory</summary>

Before starting, locate your *<mark style="color:purple;">**ls-inventory/resources/server/classes.lua**</mark>* after that find line 20, if your line 20 not the CreateItemData search **`function CreateItemData`**  locate **`elseif createdItem._name == "scope" then`** and replace whole line with this code snippet,

```
    if createdItem._data.Type == "Weapon" then
        itemData.serie = tostring(randomString(15))
        itemData.ammo = 0
        itemData.quality = 100
        itemData.info = {}
    elseif createdItem._name == "suppressor" then
        itemData.attach_component = "suppressor"
        itemData.component = "suppressor"

    elseif createdItem._name == "flashlight" then
        itemData.attach_component = "flashlight"
        itemData.component = "flashlight"

    elseif createdItem._name == "clip_extended" then
        itemData.attach_component = "clip"
        itemData.component = "clip_extended"
    elseif createdItem._name == "clip_drum" then
        itemData.attach_component = "clip"
        itemData.component = "clip_drum"
        
    elseif createdItem._name == "scope" then
        itemData.attach_component = "scope"
        itemData.component = "scope"
    elseif createdItem._name == "phone" then
        local PhoneData = {
            MetaData = {
                phonenumber = math.random(11111111, 99999999),
                owner = "Unknown",
                serialnumber = tostring(LS_CORE.Config.RandomInt(3) .. LS_CORE.Config.RandomStr(3) .. LS_CORE.Config.RandomInt(3)):upper(),

                profilepicture = "img/default.png",
                background = "img/backgrounds/iphone.png",
                wallpapers = {
					["img/backgrounds/iphone.png"] = true,
					["img/backgrounds/blue.png"] = true,
					["img/backgrounds/deeppurple.png"] = true,
					["img/backgrounds/gold.png"] = true,
					["img/backgrounds/midnight.png"] = true,
					["img/backgrounds/purple.png"] = true,
					["img/backgrounds/red.png"] = true,
					["img/backgrounds/silver.png"] = true,
					["img/backgrounds/spaceblack.png"] = true,
					["img/backgrounds/starlight.png"] = true,
				},
                brightness = 100.0,
                volumeprogress = 100.0,
                layout = "4-6",
                widgetApp ={},
                phonePages = { [1] = true },
                phonePage = 1,
                notifications = {},
                oldConnections = {},
                Password = 1234,
    
                instagramUser = false,
                twitterUser = false,
                snapchatUser = false,
                darkchatUser = false,
    
                snapchatFriendRequests = { },
    
                phoneLocation = { x = 100, y = 100},
                phoneZoom = 100,
                bluetooth = false,
                LockScreen = false,

                beforeApps = {},
            },

            Notification = true,
            DarkMode = false,
            Airplane = false,
            MobileData = false,
            Wifi = false,
            WifiData = nil,
            DND = false,
            PhoneLocked = false,
            Battery = 100,
            PhoneClosed = false,

            gallery = {},
            clock = { alarms = {} },

            notes = {},
            mails = {},
            contacts = {},

            applications = {
                settings = {
                    app = "settings",
                    color = "transparent",
                    
                    photo = "settings.png",
                    label = "Settings",
                    style = "padding-right = .08vh; font-size = 2.3vh",
                    
                    slot = 1,
                    page = 0,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                gallery = {
                    app = "gallery",
                    color = "transparent",
                    
                    photo = "gallery.png",
                    label = "Gallery",
                    
                    slot = 4,
                    page = 0,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                appstore = {
                    app = "appstore",
                    color = "transparent",
                    
                    photo = "appstore.png",
                    label = "App Store",
                    
                    slot = 5,
                    page = 1,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                camera = {
                    app = "camera",
                    color = "transparent",
                    
                    photo = "camera.png",
                    label = "Camera",
                    
                    slot = 6,
                    page = 1,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                clock = {
                    app = "clock",
                    color = "transparent",
                    
                    photo = "clock.png",
                    label = "Clock",
                    
                    slot = 7,
                    page = 1,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                messages = {
                    app = "messages",
                    color = "transparent",
                    
                    photo = "messages.png",
                    label = "Messages",
                    
                    slot = 2,
                    page = 0,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                contacts = {
                    app = "contacts",
                    color = "transparent",
                    
                    photo = "contacts2.png",
                    label = "Phone",
                    
                    slot = 3,
                    page = 0,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                phonecontacts = {
                    app = "phonecontacts",
                    color = "transparent",
                    
                    photo = "contacts.png",
                    label = "Contacts",
                    
                    slot = 9,
                    page = 1,
                    
                    currentPage = nil,
                    pageDetails = {},
                },
                calculator = {
                    app = "calculator",
                    color = "transparent",
                    
                    photo = "calculator.png",
                    label = "Calculator",
                    
                    slot = 8,
                    page = 1,
                    
                    currentPage = nil,
                    pageDetails = {},
            
                    rating = 3.2,        
                    downloadsize = 15,
                    apptype = "app",
                    appbuild = "LOS",
                },  
            }
        }
		if info.MetaData == nil then info = PhoneData end
    -- elseif createdItem._tpl == "bag1" then
        -- itemData.clothData = {
            -- drawable = 5,
            -- Male = {id= 45, texture=1},
            -- Female = {id= 45, texture=1},
        -- }
    -- elseif createdItem._tpl == "rig1" then
        -- itemData.clothData = {
            -- drawable = 9,
            -- Male = {id= 5, texture=1},
            -- Female = {id= 5, texture=1},
        -- }
    end
```

</details>

<figure><img src="/files/EmnAGqXPIy7d5th13511" alt=""><figcaption><p>The final result needs to be looks like,</p></figcaption></figure>

### More Inventories Added In Future

## Configuration

***Phone Configuration is important, if you dont configure probably will get an error.***

### Webhook (Images)

You need to webhooks for take an photo in this section you'll learn how to add webhooks.\
\
First locate **`configs/config_server.lua`** and scroll to end find **`Config.Server.Webhook`** and modify.

{% code title="configs/config\_server.lua" %}

```lua
Config.Server.Webhook = "your webhook link"
```

{% endcode %}

{% embed url="<https://www.youtube.com/watch?ab_channel=NoIntroTutorials&v=fKksxz2Gdnc>" fullWidth="false" %}
How to create an webhook
{% endembed %}

### Custom Billing

If you're using custom billing script, locate **`configs/config_server.lua`** and find **`Config.Server.Paybilling`** after that you can modify the whole code,

{% code title="configs/config\_server.lua" %}

```lua
Config.Server.PayBilling = function(Ply, society, amount, invoiceId, sendercitizenid) 
    local Invoices = {}
    -- Your code
    return Invoices
end
```

{% endcode %}

After that locate **`server/others.lua`** and find **`ls-phone:s:getAllBilling`** modify the whole code,

{% code title="server/others.lua" %}

```lua
LS_CORE.Callback.Functions.CreateCallback("ls-phone:s:getAllBilling", function(source, cb)
    local invoices = LS_CORE.Config.DATABASE(LS_CORE.Config.DATABASE_NAME, 'fetchAll', 'SELECT * FROM phone_invoices WHERE citizenid = ?', {Config.Server.GetPlayerIdentifier(source)})
    if invoices[1] ~= nil then
        cb(invoices)
    end
end)
```

{% endcode %}

If you're using client side paid function, locate **`client/others.lua`** and find **`PayInvoice`** modify the whole code,

{% code title="client/others.lua" %}

```lua
RegisterNUICallback('PayInvoice', function(data, cb)
    local senderCitizenId = data.senderCitizenId
    local society = data.society
    local amount = data.amount
    local invoiceId = data.invoiceId
    -- Your code
end)
```

{% endcode %}

### Custom Garage

If you're using custom garage script, locate **`server/others.lua`** and find these code snippet and edit whole code,

{% code title="server/others.lua" %}

```lua
Framework.Functions.CreateCallback("ls-phone:s:getCars", function(source, cb)
    local Player = Config.Server.GetPlayer(source)
    if not Player then return end
    local result = LS_CORE.Config.DATABASE(LS_CORE.Config.DATABASE_NAME, 'fetchAll', 'SELECT * FROM player_vehicles WHERE citizenid = ?', { Config.Server.GetPlayerIdentifier(source) })

    local results = {} 
    for key, value in ipairs(result) do
        table.insert(results, {["garage"] = value["garage"], ["plate"] = value["plate"], ["model"] = value["vehicle"]})
    end
    cb(results)
end)

RegisterNetEvent("ls-phone:s:deletePed", function()
    local src = source
    Config.Server.GetPlayer(src, true).Functions.RemoveMoney("bank", Config.ValetCost, "Money taken from bank")

    TriggerClientEvent("ls-phone:c:sendNotification", src, {
        app = "garage",
        message = "VALET_COST",
    })
end)

RegisterNetEvent("ls-phone:s:changeVehicleDatabaseStatus", function(plate)
    LS_CORE.Config.DATABASE( LS_CORE.Config.DATABASE_NAME, 'execute', 'UPDATE `player_vehicles` SET `garage` = @garage WHERE `plate` = @plate', {
        ["@plate"] = plate,
        ["@garage"] = nil,
    })
end)

Framework.Functions.CreateCallback("ls-phone:s:getVehicleFromPlate", function(source, cb, plate)
    cb(LS_CORE.Config.DATABASE(LS_CORE.Config.DATABASE_NAME, 'fetchAll', 'SELECT * FROM player_vehicles WHERE plate = ?', { plate })[1])
end)
```

{% endcode %}

### Disabling Metadata

{% hint style="warning" %}
Some inventory does not support metadata usage, for reason best choice is closing metadata.
{% endhint %}

For changing metadata, `configs/config_server.lua`

<div align="left"><figure><img src="/files/BDyUSKPVkQpj8wW4D57A" alt=""><figcaption></figcaption></figure></div>

{% hint style="danger" %}
If you close the metadata, you need to add metadata sql to your own server.

```sql
CREATE TABLE IF NOT EXISTS `phone_metadata` (
  `identifier` varchar(255) NOT NULL,
  `data` longtext NOT NULL,
  PRIMARY KEY (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
```

{% endhint %}

### Battery

{% hint style="info" %}
Only way to charge your phone is powerbank. If you dont have "powerbank" item in your database, create one.
{% endhint %}

When holding phone, using battery will charge phone.

For changing battery, `configs/config.js`

<div align="left"><figure><img src="/files/l59AwiJhpL5S6vetDXmH" alt=""><figcaption></figcaption></figure></div>

### Internet

There is 2 way to use internet, mobile data or wi-fi. Some apps requires internet for use.\
\
For disabling Internet,  `configs/config.js`

<div align="left"><figure><img src="/files/xYuRkSsuYl0mMUu7sbOq" alt=""><figcaption></figcaption></figure></div>


---

# Agent Instructions: 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:

```
GET https://lquensdocs.gitbook.io/lquens/ls-phone/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
