OhTanoshi / esx_drp_garage

Garage system for esx
17 stars 26 forks source link

Error while impounding a vehicle #56

Open ajaygavde99 opened 4 years ago

ajaygavde99 commented 4 years ago

Script Error : @esx_drp_garage/server/server.lua:124: attempt to compare number with table

TriggerServerCallback (@es_extendeed/server/functions.lua:152) handler (@es_extended/server/common.lua:83)

how to solve this issue store and spawn work fine impound is giving this error

Unitrise commented 4 years ago

Got same issue researching it

martimmpr commented 4 years ago

same, anyone know how to resolve it?

ThatGuyJacobee commented 4 years ago

same here

peperonikiller commented 4 years ago

replace line 124 with

if xPlayer.getMoney() >= Config.Price then

worked for me. It's using the wrong command to get player cash

mascotte-scripts commented 4 years ago

I've a fix:

Anywhere in the server.lua file you see:

 if xPlayer.get('money') >= Config.Price then
        cb(true)
    else
        cb(false)

Replace it with:

local hasEnoughMoney = nil
local moneyonplayer = xPlayer.get('money')
 if moneyonplayer >= Config.Price then

     hasEnoughMoney = true
        cb(true)
    else
      hasEnoughMoney = false
        cb(false)

Basically the problem is down to us trying to compare a value with a function as opposed to comparing the value of a function with another value