MSK Scripts
TebexGithubDiscordMusiker15
  • MSK Scripts
    • Welcome
  • Common Issues
    • Keymaster
  • Miscellaneous
    • Change Notifications
  • Scripts
    • MSK Core
      • Installation
      • Functions
        • Client
          • Ace Permission
          • Commands
          • Coords
          • Player
          • Points
          • Request
          • Scaleform
          • UI
            • Input
            • Numpad
            • Progressbar
            • TextUI
          • Vehicle
        • Shared
          • String
          • Math
          • Table
          • Timeout
          • Vector
        • Server
          • Ace Permission
          • Ban System
          • Commands
          • Player
          • Scaleform
          • UI
            • Input
            • Numpad
            • Progressbar
            • TextUI
    • MSK Banking
      • Installation
        • Paycheck Transaction
      • Config
      • Exports
        • Client
        • Server
      • Events
        • Client
        • Server
      • Server Callbacks
    • MSK EngineToggle
      • Guides
      • Exports
        • Client
      • Event Handler
        • Client
        • Server
    • MSK Fuel
      • Config
      • Exports
        • Client
    • MSK Garage
      • Config
      • Exports
        • Client
    • MSK Handcuffs
      • Guides
        • General Edits for Jobs
        • Jaksam Job Creator
        • Multichar
        • ox_inventory
      • Config
      • Admin Commands
      • Exports
        • Client
        • Server
      • Events
        • Client
        • Server
      • Event Handlers
    • MSK Radio
      • Config
      • Exports
        • Client
        • Server
      • Events
        • Server
    • MSK Simcard
      • Installation
        • Config.Database
      • Config
    • MSK VehicleKeys
      • Guides
        • Installation
        • Integrations
      • Config
      • Admin Commands
      • Exports
        • Client
        • Server
    • MSK Whitelist
      • Config
      • Exports
        • Client
        • Server
    • MSK Weaponammo
Powered by GitBook
On this page
  1. Scripts
  2. MSK Simcard

Installation

Last updated 11 months ago

CFX Forum Post:

Run this SQL command in your database

INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
	('simcard', 'Simcard', 1, 0, 1),
	('simcard_wish', 'Simcard', 1, 0, 1)
;

Add the items to your qb-core/shared/items.lua f.e. like this:

['simcard'] = {['name'] = 'simcard', ['label'] = 'Simcard', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'simcard.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Simcard that will change your phone number'},
['simcard_wish'] = {['name'] = 'simcard_wish', ['label'] = 'Simcard', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'simcard.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Set the phone number you desire'},
  • Create a new folder in phone/apps/ and name it changenumber

  • Create a new file and name it sv_changenumber.lua

Add in /sv_changenumber.lua
RegisterNetEvent('phone:changeNumber')
AddEventHandler('phone:changeNumber', function(src, newNumber)
    if Phones[src] then
        Phones[src].number = newNumber
        print("[^4Phone^0] Updatet Phonenumber to ^3" .. newNumber .. "^0 for ^5" .. GetPlayerName(src) .. "^0")
    end
end)
  • Go to /npwd/resources/dist/server/server.js

  • Then go to line 52764 and add the following Code

exp4("setPhoneNumber", (src, newNumber) => {
  let player = player_service_default.getPlayer(src);
  player._phoneNumber = newNumber;
  console.log(`[msk_simcard]: Phonenumber was set to ${player._phoneNumber}`);
});

It should look like this:

https://forum.cfx.re/t/esx-qbcore-msk-simcard-change-your-phonenumber/4847008
https://prnt.sc/XCsf_1Wd47mg