Problem with multi simcard


Mar 28, 2022
Hello !

I'm on ESX Legacy and i have problème with this script :

When i use simcard its ok, but when i want to use my phone it say " you don't have simcard used"

i have this error on my server :
Sans titre2.png

And its the code line :

Server side :

ESX.RegisterServerCallback('gcphone:getItemAmount', function(source, cb, item) local xPlayer = ESX.GetPlayerFromId(source) local qtty = xPlayer.getInventoryItem(item).count cb(qtty) end)

and client side :

if index == 1 then ESX.TriggerServerCallback('gcphone:getItemAmount', function(qtty) if qtty >= 0 then TriggerServerEvent("dqP:SetNumber", number[index565].number) else ESX.ShowNotification("~r~Pas de téléphone ! ") end end, 'tel') _menuPool:CloseAllMenus() end if index == 2 then
Citizen.CreateThread(function() while true do Citizen.Wait(0) _menuPool:ProcessMenus() if IsControlJustPressed(0, 40) then ESX.TriggerServerCallback("dqP:getSim", function(result2) SimTab = result2 OpenMenu() end) end if IsControlJustPressed(0, 288) then ESX.TriggerServerCallback('gcphone:getItemAmount', function(qtty) --print(myPhoneNumber) if tonumber(myPhoneNumber) ~= nil then if qtty > 0 then TooglePhone() TriggerServerEvent("gcPhone:allUpdate") menuIsOpen = true k = ESX.GetPlayerData().accounts[1].money SendNUIMessage({event = 'updateBankbalance', banking = k}) else UpMiniMapNotification("Pas de ~r~téléphone~s~") end else UpMiniMapNotification("Pas de ~r~carte sim lié~s~") end end, 'tel') end

Someone can help me ? :)