kasuganosoras / esx_realparking

🅿️ A real car parking script for FiveM
GNU General Public License v3.0
51 stars 31 forks source link

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

Open ghost opened 4 years ago

ghost commented 4 years ago

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.

Dokman commented 4 years ago

me too XD

WizzDex commented 2 years ago

This error is still there, fix? anyone?