MaDHouSe79 / mh-cashasitem

The best cash/blackmoney/crypto item script for your qbcore server created by MaDHouSe79.
GNU General Public License v3.0
34 stars 6 forks source link

everything works besides the opening of the inventory #15

Closed Mohtrion closed 6 months ago

Mohtrion commented 6 months ago

hello i am trying to use this script and everything works except for it doesn't open the inventory when i do /inventory it instead writes this error server sided:

[ c-scripting-core] InvokeNative: execution failed: Argument at index 1 was null. [ script:ps-inventory] SCRIPT ERROR: Execution of native 000000002f7a49e6 in script host failed: Argument at index 1 was null.

when i add back the default files for ps-inventory it shows that i have my cash in my inventory the only error is that when i am using the code that you provide it cannot open the inventory

Mohtrion commented 6 months ago

i would appreciate help as this is something i would love to implement into my server

MaDHouSe79 commented 6 months ago

I forgot to add this in the readme file, thank for notice.

Add in ps-inventory/client/main.lua from around line 136

local function OpenTrunk()
    local vehicle = QBCore.Functions.GetClosestVehicle()
    LoadAnimDict("amb@prop_human_bum_bin@idle_b")
    TaskPlayAnim(PlayerPedId(), "amb@prop_human_bum_bin@idle_b", "idle_d", 4.0, 4.0, -1, 50, 0, false, false, false)
    if IsBackEngine(GetEntityModel(vehicle)) then
        SetVehicleDoorOpen(vehicle, 4, false, false)
    else
        SetVehicleDoorOpen(vehicle, 5, false, false)
    end
end

local function isAllowToOpen(vehicle)
    if GetVehicleClass(vehicle) == 18 then
        if PlayerData.job.name == 'police' or PlayerData.job.name == 'ambulance' then
            return true
        end
    else 
        return true
    end
end
Mohtrion commented 6 months ago

i appreciate the quick response but unfortunately it still is not working. still writing the same error

[ c-scripting-core] InvokeNative: execution failed: Argument at index 1 was null. [ script:ps-inventory] SCRIPT ERROR: Execution of native 000000002f7a49e6 in script host failed: Argument at index 1 was null.

Lonleyx commented 6 months ago

Im haveing the same issue where my inventory wont open when i press tab

Lonleyx commented 6 months ago

Im useing ps inventory

MaDHouSe79 commented 6 months ago

Ok I looked to see what it could be, but I can't reproduce this error, I don't know how you installed it but I think you forgot something or didn't do something right, because when I install it it just works , this script doesn't work if you only download ps inventory, you have to modify it to make it work with chasasitem. I have an example inventory of ps-inventory and qb-inventory, I also created an mh-inventory because that is the ps-inventory that should work with this script, but it looks like you just dowmload a ps-inventory or uses your old inventory, and then not edit everything that needs to be edited.

maby here is the issue why it's not opening?

fivemNoobDev commented 6 months ago

image cant figure it out image inventory wont open

MaDHouSe79 commented 6 months ago

image cant figure it out image inventory wont open

do you have an Config.UseTarget in your config?

fivemNoobDev commented 6 months ago

i have no idea this is my first server

fivemNoobDev commented 6 months ago

where would that be?

MaDHouSe79 commented 6 months ago

in resources\[qb]\qb-inventory/config.lua

fivemNoobDev commented 6 months ago

i had it as false in server.config i changed it to true let me see if that wored

fivemNoobDev commented 6 months ago

no did not work same error

fivemNoobDev commented 6 months ago

image now this image

fivemNoobDev commented 6 months ago

i just want this to work. if it dont imma have to replace all my files i changed for this to work or replace the whole core

fivemNoobDev commented 6 months ago

could i swap out the inventory system?

MaDHouSe79 commented 6 months ago

your config.lua file is not load in, cause the erro Global Config = nil means that it does not exsist, i think your config.lua from your inventory is not load in the fxmanifest.lua file.

Example:

shared_scripts {
    '@qb-core/shared/locale.lua',
    'locales/en.lua',
    'config.lua',
}
fivemNoobDev commented 6 months ago

thank you got it all to work properly i really appreciate you reply fast with the right information!!!