This line of code dosent work?

Citizen.CreateThread(function ()
    car = GetVehiclePedIsIn(GetPlayerPed(-1), false)

    if not car then
        TriggerEvent("chatMessage", "ERROR", {255, 0, 0}, "You have to be sitting in a vehicle.")
    elseif car then

Ive tried this in my server and it literally does nothing, can someone help me get this vehicle to delete when sitting in it.

How would this ever run? Like you need to assign a hotkey or a command.

@kanersps It has a way to run, i dont want to post it all this is just the part that isnt working… it gives me an error (which is in the code and is supposed to happen) when im not in a vehicle but once i get in it does nothing…

That is the native to set the entity as no longer needed, not the one to directly remove it.

This is the native you need

Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(car))

this does not work either. thank you for the post.