esx_realparking icon indicating copy to clipboard operation
esx_realparking copied to clipboard

attempt to index a nil value (field '?')

Open ghost opened this issue 4 years ago • 2 comments

There is something wrong with this.

function DeleteLocalVehicle(vehicle) for i = 1, #LocalVehicles do if type(vehicle.plate) ~= 'nil' and type(LocalVehicles[i].plate) ~= 'nil' then if vehicle.plate == LocalVehicles[i].plate then local tmpModel = GetEntityModel(veh) SetModelAsNoLongerNeeded(tmpModel) DeleteEntity(LocalVehicles[i].entity) table.remove(LocalVehicles, i) end end end end

The line that is causing that problem is: if type(vehicle.plate) ~= 'nil' and type(LocalVehicles[i].plate) ~= 'nil' then

This function is called on SpawnVehicle / SpawnVehicles, and this is when it gives me the error in the console.

ghost avatar Aug 27 '20 12:08 ghost

me too XD

Dokman avatar Sep 04 '20 20:09 Dokman

This error is still there, fix? anyone?

WizzDex avatar Nov 29 '21 13:11 WizzDex