renzuzu / renzu_motels

Fivem - Motel Management. Hourly Rental System. Supports MLO and Shells. ESX/QBCORE
GNU General Public License v3.0
101 stars 41 forks source link

Failed to rent #26

Open Krashcant opened 1 year ago

Krashcant commented 1 year ago

I have everything installed and works, even added "keys" in qbinventory, yet i get the error in game "failed to rent" on the server side it get: [ script:renzu_motels] SCRIPT ERROR: @renzu_motels/server/main.lua:69: attempt to index a nil value (local 'xPlayer')

I am stuck, any help is much appreciated

someone else had exact same issue on the forum but no fix answer posted, I tried to ask there and got the answer this was fixed 2 days ago.. I am so confused at this point as nothing was fixed for me and no idea how you fixed the other persons same issue. thanks

renzuzu commented 1 year ago

can you show me the file from /bridge/framework/server/qbcore.lua

Krashcant commented 1 year ago

f not QBCORE then return end

GetPlayerFromId = function(src) local self = QBCORE.Functions.GetPlayer(src) if not self then return end

if self.identifier == nil then
    self.identifier = self.PlayerData.citizenid
end

self.getMoney = function(value)
    return self.PlayerData.money['cash']
end

self.removeMoney = function(value)
    self.Functions.RemoveMoney('cash',tonumber(value))
    return true
end
self.name = self.PlayerData.charinfo.firstname

self.addMoney = function(value)
    return self.Functions.AddMoney('cash',tonumber(value))
end

self.removeAccountMoney = function(type,val)
    if type == 'money' then type = 'cash' end
    self.Functions.RemoveMoney(type,tonumber(val))
    return true
end

self.getAccount = function(type)
    if type == 'money' then type = 'cash' end
    return {money = self.PlayerData.money[type]}
end

return xPlayer

end

hoodz123 commented 1 year ago

Failed to rent only happened to me when the player/s didn’t have the correct money the only thing not working for me it’s the Keys Item apart from that all is good

Krashcant commented 1 year ago

I thought that and made sure I had cash and money in bank,, I also did create a key item and it does spawn manually through TX

renzuzu commented 1 year ago

your using old version i told from cfx i updated the resource 2 days ago was not a joke.

image

renzuzu commented 1 year ago

Failed to rent only happened to me when the player/s didn’t have the correct money the only thing not working for me it’s the Keys Item apart from that all is good

you could open an issue regarding keys?

this is tested in qbcore using qb-inv , esx ox_inventory.

Krashcant commented 1 year ago

ok that did it, the updated file, thank you and good work