[ESX / QBCore] MSK Simcard - Change your phonenumber

Tebex [4.59€ incl. VAT] - Source Code, 5% encrypted
Documentation

Description

  • With this Script you can cahnge your current phonenumber to a new number
  • With the simcard item you get a random number
  • With the simcard_wish item you can set the number you want to have yourself
  • Discord Logs

Compatible Phones

Config

Config = {}
----------------------------------------------------------------
Config.Locale = 'de'
Config.Debug = true
Config.VersionChecker = true
----------------------------------------------------------------
-- Add the Webhook Link in server_discordlog.lua
Config.DiscordLog = true
Config.botColor = "6205745"
Config.botName = "MSK Simcard"
Config.botAvatar = "https://i.imgur.com/PizJGsh.png"
----------------------------------------------------------------
Config.Framework = 'ESX' -- 'ESX' or 'QBCore'

Config.Phone = 'chezza' -- 'chezza', 'gcphone', 'dphone', 'gksphone', 'gksphone_v2', 'highphone', 'roadphone', 'qbphone', 'npwd', 'yphone'

-- If false you need NativeUI installed
Config.dialogBox = true -- If true then you need an_dialogBox (https://github.com/notaymanTV/an_dialogBox)
----------------------------------------------------------------
Config.needPhone = true -- Player has to have a phone in inventory
Config.phoneItem = {'phone'} -- {'phone', 'phone2'} // This should be your phone item // You can set multiple items
Config.usableItem = 'simcard' -- Item to generate a random Number // Add this to your items table in database
Config.removeItem = true -- Set to false if you dont want the item to be deleted after use
Config.StartingDigit = {
    enable = true, -- Set false to disable StartingDigit
    value = "097" -- the starting digits for phone number
}
----------------------------------------------------------------
-- If 'number' then the number would be 094XXXXXX if StartingDigit enabled or XXXXXXXXX if StartingDigit disabled
-- If 'gc' then the number would be 094-XXXX if StartingDigit enabled or XXX-XXXX if StartingDigit disabled
-- If 'canada' then the number would be 094-XXX-XXXX if StartingDigit enabled or XXX-XXX-XXXX if StartingDigit disabled
Config.numberFormat = 'number' -- 'number', 'gc' or 'canada'
----------------------------------------------------------------
-- Config.numberLength is only for Config.wishItem
Config.wishItem = 'simcard_wish' -- Item to insert a Number by yourself // Add this to your items table in database
Config.numberLength = 9 -- max numbers // default: 9 - Number would be 094XXXXXX // numberLength doesn't work for 'gc' and 'canada' option!
----------------------------------------------------------------
Config.changeDefault = true -- Should the Script change the default value? Usefull for some MDT Systems // ESX: users, phone_number // QBCore: players, charinfo
Config.changeDatabase = true -- Set false to deactivate changes in database (Config.Database) // recommended: set true

-- Read the README.md for more information
Config.Database = {
    usersDB = 'users', -- Users Table // ESX default: 'users' // QBCore default: 'players'
    usersIdentifierTB = 'identifier', -- identifier for users table // ESX default: 'identifier' // QBCore default: citizenid

    numberDB = 'users', -- In which table is the phonenumber located // ESX default: 'users' // QBCore default: 'players'
    numberTB = 'phone_number', -- Column for phonenumber // ESX default: 'phone_number'  // QBCore default: 'charinfo'
    identifierTB = 'identifier' -- identifier for numberDB table // ESX default: 'identifier'  // QBCore default: 'citizenid'
}
----------------------------------------------------------------
-- Change the Event in this function to the Event that changes the Number in your Phone.
-- You can add your own Events here

-- !!! This function is serverside !!!
Config.updateNumber = function(source, newNumber)
    if Config.Phone == 'chezza' then -- Chezza Phone V2
        TriggerEvent('phone:changeNumber', source, newNumber)
    elseif Config.Phone == 'gcphone' then -- GcPhone
        TriggerClientEvent("gcPhone:myPhoneNumber", source, newNumber)
    elseif Config.Phone == 'dphone' then -- D-Phone
        TriggerClientEvent("d-phone:client:changenumber", source, newNumber)
    elseif Config.Phone == 'gksphone' then -- GKSphone
        exports['gksphone']:NumberChange(source, tostring(newNumber))
    elseif Config.Phone == 'gksphone_v2' then -- GKSphone
        local phoneData = exports["gksphone"]:GetPhoneDataBySource(source)
        exports["gksphone"]:NewNumber(source, phoneData.uniqID or nil, tostring(newNumber))
    elseif Config.Phone == 'highphone' then -- HighPhone
        exports['high_phone']:setPlayerPhoneNumber(source, tostring(newNumber))
    elseif Config.Phone == 'roadphone' then -- RoadPhone
        TriggerEvent("roadphone:playerLoad", source)
    elseif Config.Phone == 'qbphone' then -- QBCore Phone
        -- Add your own Events here
    elseif Config.Phone == 'npwd' then -- NPWD Phone
        exports['npwd']:setPhoneNumber(source, newNumber)
    elseif Config.Phone == 'yphone' then -- yFlip/ySeries Phone
        local imei = exports['yseries']:GetPhoneImeiBySourceId(source)
        exports['yseries']:ChangePhoneNumber(imei, newNumber)
    end
    
    Config.Notification(source, Translation[Config.Locale]['updateNumber']:format(newNumber), newNumber)
end
----------------------------------------------------------------
-- !!! This function is clientside AND serverside !!!
Config.Notification = function(source, message, newNumber)
    if IsDuplicityVersion() then -- serverside
        if Config.Framework == 'ESX' then
            TriggerClientEvent('esx:showNotification', source, message)
        elseif Config.Framework == 'QBCore' then
            TriggerClientEvent('QBCore:Notify', source, message, 'primary', 5000)
        end
    else -- clientside
        if Config.Framework == 'ESX' then
            ESX.ShowNotification(message)
        elseif Config.Framework == 'QBCore' then
            QBCore.Functions.Notify(message, 'primary', 5000)
        end
    end
end

Installation

Please read the Readme.md and the Documentation: Installation | MSK Scripts

Optional Requirements

You’ll need one of these!

Code accessible Yes, 5% encrypted so that the script cannot be copied
Subscription based No
Lines (approximately) ~ 200
Requirements ESX or QBCore, oxmysql, one of the optional requirements
Support Yes

Latest Update

My other Scripts

Paid

Free

8 Likes

so nice

2 Likes

if use phone from gksphone is work ?

You have to change the Event in updateNumber function that changes the Phonenumber.
It is all discribed in config.lua

Update v1.1

  • Added support for GcPhone and D-Phone
3 Likes

thank you sir!

1 Like

no working sir …


any one know how to work for gksphone

If you get this notification, the number that was generated by the script already exist on database.
Do what it says and try again.

so what i can do now sir

Link not working

Now working again

1 Like

Update v1.2

  • Fixed Error with ServerCallback and Notification 'SIM card was not recognized. Try again!'
  • Fixed Config.needPhone = false
1 Like

Update v1.3

  • Added Support for QBCore
  • Some Minor Bugfixes
2 Likes

Update v1.3.1

  • [QBCore] Fixed Callback for generate new Number
1 Like

The notification issue is already fixed with latest version. For GKSphone I need the Event that is changing the phonenumber like the other Events in config.lua. I cant find that in the documentation of gksphone.

i pm you , give script gks

Update v1.4

  • Added Support for GKS Phone
  • Changed updateNumber function
1 Like

Update v1.5

  • Added Support for HighPhone
  • Changed Notification function
1 Like

Hi nice worrk!
Can you add for qb-phone? Thanks again.

I can take a look but I can’t promise anything

1 Like