local _source = source
local rawNumber = args[1] <--- line 8
local xPlayer = ESX.GetPlayerFromId(_source)
local numFirstThree = string.sub(rawNumber, 1, 3)
local numLastFour = string.sub(rawNumber, 4, 7)
local numFinal = numFirstThree .. '-' .. numLastFour
local result = MySQL.Sync.fetchAll("SELECT * FROM users WHERE phone_number = @phone_number", {['@phone_number'] = numFinal})
if result[1] ~= nil then
TriggerClientEvent('esx:showNotification', _source, '~r~That number is already in use')
else
TriggerClientEvent('matriarch_simcards:startNumChange', _source, numFinal)
end
when u buy a simcard from shop it will be blank and when u use the simcard it will generate a random number and set it permanently on that simcard, so when a player “insert” in phone will be set as the player phone_number.
use case:
lets say that police do a body search and find used simcards (they contain numbers) and later read thru secret gang messages or find some other incriminating info like calls/messages linking suspects to a crime.
its late and im brainstorming a little, might be to much out of scope
Hello guys!I have a prolem with the script.The problem is when I going to a shop and i buy a SIM card and i go in my inventory there is no option to use it. I inserted everything into the database.