hoangducvn / MojiaGarages

🅿 Best advanced garages for QB-Core Framework 🚗
50 stars 42 forks source link

Script Error - Execution of Native 00000000e8522d58 in script host Tried to access invalid entity: 152105 #131

Open MrRasmus opened 2 years ago

MrRasmus commented 2 years ago
 SCRIPT ERROR: Execution of native 00000000e8522d58 in script host failed: Tried to access invalid entity: 152105
[ script:MojiaGarages] > GetVehicleNumberPlateText (GetVehicleNumberPlateText.lua:2)
[ script:MojiaGarages] > GetPlate (@MojiaGarages/server.lua:78)
[ script:MojiaGarages] > TryGetLoadedVehicle (@MojiaGarages/server.lua:83)
[ script:MojiaGarages] > RefreshVehicles (@MojiaGarages/server.lua:679)
[ script:MojiaGarages] > handler (@MojiaGarages/server.lua:698)
[ script:MojiaGarages] > Query.onResult (@oxmysql/dist/build.js:21715)
[ script:MojiaGarages] > <unknown> (@oxmysql/dist/build.js:11918)
[ script:MojiaGarages] > processTicksAndRejections (node:internal/process/task_queues:78)
wittyphantom333 commented 2 years ago

@MrRasmus this has been driving me bonkers for days and finally an error tripped client side that solved it.

if tonumber(modifications.bodyHealth) <= 0 then modifications.bodyHealth = 0 elseif tonumber(modifications.bodyHealth) >= 1001 then modifications.bodyHealth = 1000 end if tonumber(modifications.engineHealth) <= 0 then modifications.engineHealth = 0 elseif tonumber(modifications.engineHealth) >= 1001 then modifications.engineHealth = 1000 end

This example is a fix I put in for another issue, but this needs to be changed tonumber() before the compare as its grabbed as a string. Not sure if this is the best solution, but it worked perfect.

If this works for you also I'll do a PR

wittyphantom333 commented 2 years ago

@MrRasmus this has been driving me bonkers for days and finally an error tripped client side that solved it.

if tonumber(modifications.bodyHealth) <= 0 then modifications.bodyHealth = 0 elseif tonumber(modifications.bodyHealth) >= 1001 then modifications.bodyHealth = 1000 end if tonumber(modifications.engineHealth) <= 0 then modifications.engineHealth = 0 elseif tonumber(modifications.engineHealth) >= 1001 then modifications.engineHealth = 1000 end

This example is a fix I put in for another issue, but this needs to be changed tonumber() before the compare as its grabbed as a string. Not sure if this is the best solution, but it worked perfect.

If this works for you also I'll do a PR

Okay, this sort of fixed it, until population went above 30 and it came back

wittyphantom333 commented 2 years ago

Turns out, this mainly ended up being a database issue. For me, the table for the both the players and the cars where missing the fivem license identifier