esx_drp_garage icon indicating copy to clipboard operation
esx_drp_garage copied to clipboard

Error while impounding a vehicle

Open ajaygavde99 opened this issue 4 years ago • 5 comments

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

ajaygavde99 avatar Mar 11 '20 05:03 ajaygavde99

Got same issue researching it

Unitrise avatar Apr 09 '20 23:04 Unitrise

same, anyone know how to resolve it?

martimmpr avatar May 28 '20 16:05 martimmpr

same here

ThatGuyJacobee avatar Jun 10 '20 00:06 ThatGuyJacobee

replace line 124 with

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

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

peperonikiller avatar Jun 23 '20 16:06 peperonikiller

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

mascotte-scripts avatar Sep 16 '20 13:09 mascotte-scripts