Modifications

Remember that this resource has verified DMCA protection, and its illegal use or distribution could imply a claim for protection of Title 17 of Chapter 512 (c) (3) of the Digital Millennium Copyright Act

App cache and updates

In each update that we carry out or each change that we make in our smartphone, such as... deleting an application or changing the name of a certain application, we will have to use a command in the console of our server to clean the application cache, the command is as follows:
deleteallapps
If you update your asset or if you have any problems with apps or app downloads, feel free to use this command and then restart the asset or server
This will not affect the accounts already created in applications, it will simply return the default applications to clear the cache

Ambulance dispatch

As all phones had one, Quasar Smartphone should have it too. Quasar Smartphone, will allow the "ambulance" to receive distress messages via Message, so that they are always alert when saving lives
To execute this function we will only have to apply a small change in our esx_ambulancejob
To modify this part we just have to find the function SendDistressSignal() and modify it by the following
You can translate the message where it says Injured person
Choose one of the two options, Messages or Business, but we recommend Business as it is more complete and functional
BUSINESS (BETTER)
MESSAGE
../client/main.lua
1
function SendDistressSignal()
2
local playerPed = PlayerPedId()
3
local coords = GetEntityCoords(playerPed)
4
local message = "Injured person" -- The message that will be received.
5
local alert = {
6
message = message,
7
-- img = "img url", -- You can add image here (OPTIONAL).
8
location = coords,
9
}
10
11
TriggerServerEvent('qs-smartphone:server:sendJobAlert', alert, "ambulance") -- "Your ambulance job"
12
TriggerServerEvent('qs-smartphone:server:AddNotifies', {
13
head = "Google My Business", -- Message name.
14
msg = message,
15
app = 'business'
16
})
17
end
../client/main.lua
1
function SendDistressSignal()
2
local playerPed = PlayerPedId()
3
local coords = GetEntityCoords(playerPed)
4
5
TriggerEvent('qs-smartphone:sendJobMessage', {
6
phone = 'ambulance',
7
type = 'message',
8
message = 'Injured person'
9
})
10
Wait(300)
11
TriggerEvent('qs-smartphone:sendJobMessage', {
12
phone = 'ambulance',
13
type = 'location'
14
})
15
end

Job contacts and calls

Quasar Smartphone has a system of contacts that will come automatically in your call application when entering the server, these contacts cannot be deleted unless you do it from config.lua
Inside config.lua we can add the jobs we want so that the players can call them or send them a text message
Workers will only be able to receive messages and calls, but not respond to said chat, to provide an answer they can double click on the received message and they will be able to call or message the subject

Call workers

To call the workers they must first be on duty, that is, they will have to activate the function of receiving calls using its corresponding command
In the case of police, you can use the /911 command to go on duty and you will be able to receive calls
This system will not change, because if we remove the services system, then there will be a lot of spam to many players causing damage to the server

Messages to workers

As mentioned above, the jobs you add in config.lua will have their own contact on each phone, so we can send a text message to them, but they can't reply to us
In order to serve customers, they can click twice on the received message and the phone number of the person who sent the message will appear

Battery system

Quasar Smartphone has a rechargeable battery system as long as you want to enable it in config.lua
The battery will be depleted progressively, according to the configuration that we have set by default, and in case you want it, some apps may be heavier and drain your battery faster

Powerbank

To recharge your battery we have an item called powerbank, which will allow you to use it and progressively increase the battery of your phone until it reaches 100%
You can add the item in your database or qs-core to be able to sell it in a store or give it to a player

Administrator command

Admins will be able to give players battery with a simple configurable command in config_battery.lua, there you will be able to give permissions to certain types of admin and you can even configure the name of the command

qs-housing plugs

As expected, qs-housing is once again part of qs-smartphone support
If you have our Housing system, you can enable the option of adding plugs in your house to charge the phone whenever you want. To enable this function we must set this configuration to true in config.lua
Within qs-housing we will also need to enable menu permissions to create plug-ins in config.lua in the Config.MenuOptions setting

Phone signal

Quasar Smartphone has an advanced signal system, which will allow us to block certain applications when it comes to being in an area without a signal.
You can remove this option with Config.Signal
Dead zones will be configured within config.lua thanks to PolyZone, the mandatory dependency of qs-smartphone

Phone notifications

In this short tutorial you will learn how to add customizable Notify, which are useful for other scripts like missions, illegal sales, or even in your vehicleshop
To customize the notification icon, we will add the .png images in the corresponding directories of qs-smartphone
CLIENT
SERVER
1
TriggerEvent('qs-smartphone:client:notify', {
2
title = 'Title',
3
text = 'Description',
4
icon = "./img/apps/whatsapp.png",
5
timeout = 1500
6
})
1
TriggerClientEvent('qs-smartphone:client:notify', source, {
2
title = 'Title',
3
text = 'Description',
4
icon = "./img/apps/whatsapp.png",
5
timeout = 1500
6
})
We also have a notification system inside the lockscreen, this will not give an alert, it will just appear, but it sounds great if you put it together with the first notification
This event will work only in CLIENT
1
TriggerServerEvent('qs-smartphone:server:AddNotifies', {
2
head = 'Title',
3
msg = 'Description',
4
app = 'image name' -- qs-smartphone/html/img/app/imagename.png.
5
})

Phone mails

You can completely modify the command from config_commands.lua.
Administrators can send Mails to all players using the command sendmail as in the example that we will give here
1
/sendmail Subject Message
Here is a brief example
1
/sendmail "Important" "Players please disconnect from the server for brief maintenance."

Basic integration

With this system, you can also add Mails in other scripts, such as when making a drug sale or when buying an item
Basic integration only for Clientside
1
TriggerServerEvent('qs-smartphone:server:sendNewMail', {
2
sender = 'Robby Williams',
3
subject = 'Hey bro, how are you?',
4
message = 'Soon we will launch more versions and this will be more complete, what are you waiting for to get this great phone brother?',
5
button = {}
6
})

Advanced integration

This event is already more advanced, since it will work with online and offline players. It will serve for projects that require more information
CLIENT
SERVER
1
RegisterCommand("emailexample", function(source, args)
2
local identifier = args[1]
3
local data = {}
4
data.sender = args[2] -- Sender
5
data.subject = args[3] -- Subject
6
data.message = args[4] -- Message
7
data.button = args[5] -- Button, not neccesary
8
TriggerServerEvent('qs-smartphone:server:sendNewMailToOffline', identifier, data)
9
end, false)
1
RegisterCommand("emailexample", function(source, args)
2
local identifier = args[1]
3
local data = {}
4
data.sender = args[2] -- Sender
5
data.subject = args[3] -- Subject
6
data.message = args[4] -- Message
7
data.button = args[5] -- Button, not neccesary
8
TriggerEvent('qs-smartphone:server:sendNewMailToOffline', identifier, data)
9
end, false)

Police dispatch

Police alerts for the "Police" application of qs-smartphone
If you are Police, by default, you will have an exclusive application in your App Store. In it you will find MDT functions and also a dispatch system, where you can eliminate or go to the crime scene
For the alerts to appear, you will have to add each event to your robberies yourself
To run this correctly, you need to add it server-side as follows
1
local alertData = {
2
title = "Store Robbery",
3
coords = {x = GetEntityCoords(GetPlayerPed(1)).x, y = GetEntityCoords(GetPlayerPed(1)).y, z = GetEntityCoords(GetPlayerPed(1)).z},
4
description = "A robbery started at the store!"
5
}
6
TriggerClientEvent("qs-smartphone:client:addPoliceAlert", -1, alertData)

Phone booths

The phone booth system is a very useful invention, since it allows you to communicate directly with the most common jobs or even communicate with another player from any booth on the map, by the way... you can also add more booths using the example of it setting
You can configure all booths in config.lua

Phone technician

In case your phone has been broken or perhaps you forgot your password, you can count on the Telephone Technician
This only allows one point on the map, but it will charge you some money to repair your wet phone or to change the password
Your complete configuration will be inside config.lua

Welcome screen

All our new players will have a welcome screen when they open their phone for the first time, and how can we customize it?
The translations of all these tabs are found in the html file!

Change keybinds

Once you have started the resource on your server for the first time, even if you change the key in the config.lua, it will not change for the players who have already joined. Although it will change for the players who join after you have changed it

Option 1:

  • To unbind keys for your client only you can type unbind keyboard input_parameter in F8

Option 2:

  • Go to C:\Users[USERNAME]\AppData\Roaming\CitizenFX
  • Open fivem.cfg
  • Remove the lines with this resource name
  • Restart Fivem. Keybinds will be set back to default values set in the config

How to Disable KeyMapping

  • Firstly unbind the keys using the method above, disable the key in the config.lua and then you can rewrite the code to use the regular method of while loops checking for key presses IsControlJustReleased or other methods to trigger the events we provide to you in our docs

Notes

  • There is no way to mass unbind keys for all of your server's player's
  • The full list of available keys can be found here
Credits original docs : Codesing.