gpScripts Docs
StoreDiscordYoutube
  • 📔gpScripts
  • Clothingshop
    • Installation
    • Developers
      • Client
  • 💰InsuranceSystem
    • Installation
    • Developers
      • Client
      • Server
  • 📲Businesscards
    • Installation
    • Developers
      • Events
  • 🛡️visumsystem
    • Installation
    • Developers
      • Commands
      • Exports
      • Events
    • Code Snippets
      • QB-Garages
  • ☎️Emergencyphone
    • Installation
    • Common mistakes
      • Common mistakes
    • Developer
      • Events
  • 💵Tax-System
    • Installation
      • Step 1 - SQL-File
      • Step 2 - [QB-Core] Changes
      • Step 3 - [ESX] Changes
      • Step 4 - Restart your server
      • Step 5 - Set first deduction date
    • Exclude inactive vehicles
    • Common mistakes
      • Common mistakes
    • Developer
      • Events
Powered by GitBook
On this page
  • 1. Insert the .sql file to your database
  • 2. Install dependencys
  • 3. Framework changes
  • 4. Restart your server
  • 5. Smartphone changes

Was this helpful?

  1. Emergencyphone

Installation

PreviousQB-GaragesNextCommon mistakes

Last updated 8 months ago

Was this helpful?

Please go through each step carefully and allow enough time. Support tickets opened due to simple errors will be forwarded to the documentation.

1. Insert the .sql file to your database


2. Install dependencys


3. Framework changes

QB-Framework

To make everything work with QB-Core you have to add a function to qb-core. Include it after "function self.Functions.SetPlayerData(key, val)" in Line 257.

qb-core/server/player.lua
function self.Functions.SetPhoneNumber(val)
    self.PlayerData.charinfo.phone = val
    self.Functions.UpdatePlayerData()
end

Nothing needs to be changes for ESX. 😄👍

4. Restart your server

In order for your new asset to be recognized and the database changes to be applied, you must restart the server!


5. Smartphone changes

Create a new folder in phone/apps/emergencyphone and copy the file sv_changenumber.lua into it which can be found in the emergencyphone folder.

In /client/clientAPI.lua add
RegisterNetEvent("gksphone:changePhoneNumber")
AddEventHandler("gksphone:changePhoneNumber", function(newNumber)
  SendNUIMessage({event = 'updateMyPhoneNumber', myPhoneNumber = newNumber})
end)

Please use only one of the 2 variants!

Variant one:

In this variant, we used Quasar's workcalls. The advantage in this variant is that players can keep their private numbers and thus still receive private calls and messages.

So you have to set the corresponding numbers in the config of the qs-smartphone and set the Config.useQuasarWorkCalls to true in the emergencyphone.

Variant two:

In this variant, the number of a player is replaced by the control center number. Thus, no private messages or calls can be received!

  • Download qs-base and qs-fakenumber DLC for qs-smartphone and install it If you have problems installing them, please ask the support of Quasar. Those are not my scripts and I won't help you with it!

  • Config.useQuasarWorkCalls = false

  • Remove any existing workcall from the config of qs-smartphone

Add this code in npwd\dist\game\server after line 57577.

exp5('setPhoneNumber', (src, newNumber) => {
    player_service_default.getPlayer(src).setPhoneNumber(newNumber)
    console.log(`Phonenumber was set to ${player._phoneNumber}`)
})

IMPORTANT!

Due to the current limitation of ySeries phone, the control center numbers MUST have exactly the same format as all other numbers. If you have a prefix of 855 and a length (excluding prefix) of 6, every control center number must also be in this format.

So for 911 -> 855000911 or any other number in this format!

☎️
NativeUI