MSK Scripts
Search…
⌃K

Installation

ESX Framework
QBCore Framework
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'},
Add the following code in qb-core/server/player.lua
Include it after "function self.Functions.SetPlayerData(key, val)" in Line 257
It should look like this: https://prnt.sc/LvrrFHP47VkI
qb-core/server/player.lua
function self.Functions.SetPhoneNumber(val)
self.PlayerData.charinfo.phone = val
self.Functions.UpdatePlayerData()
end
Chezza Phone
GKS Phone
NPWD Phone
  • 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
1
RegisterNetEvent('phone:changeNumber')
2
AddEventHandler('phone:changeNumber', function(src, newNumber)
3
if Phones[src] then
4
Phones[src].number = newNumber
5
print("[^4Phone^0] Updatet Phonenumber to ^3" .. newNumber .. "^0 for ^5" .. GetPlayerName(src) .. "^0")
6
end
7
end)
If your phonenumber is not updating Ingame then please try this solution!
Add in /client/clientAPI.lua
1
RegisterNetEvent("gksphone:changePhoneNumber")
2
AddEventHandler("gksphone:changePhoneNumber", function(newNumber)
3
SendNUIMessage({event = 'updateMyPhoneNumber', myPhoneNumber = newNumber})
4
end)
Replace this in msk_simcard/config.lua
TriggerEvent('gksphone:gkssc:playerLoad', src)
with this:
TriggerClientEvent('gksphone:changePhoneNumber', newNumber)
  • 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://prnt.sc/XCsf_1Wd47mg