[SOLVED] Preventing certain vehicles from teleporting inside the chop shop garage

I made a chop shop script and I was wondering how do I prevent a certain vehicle from teleporting inside for example if a player is inside a bus and he goes to the entry spot and presses [E] instead of teleporting i want it to say you cannot enter the garage with this vehicle? if someone can help me out that would be great!

this is the teleporting bit of the script:

        --[Allowes the player to teleport inside the garage if player is close enough to the entrance.]--
        --[Enter Garage Part]--
        if Vdist(GetEntityCoords(GetPlayerPed(-1), false), v1) < distance_to_enter and IsControlJustReleased(0, e_key) then
            --[Checks if player is in a vehicle.]--
            if IsPedInAnyVehicle(GetPlayerPed(-1), false) then
                --[Triggers the Click Animation.]--
                TaskPlayAnim(GetPlayerPed(-1), clickanim, "fob_click", 8.0, 8.0, -1, 48, 1, false, false, false)
                Citizen.Wait(300)
                --[Plays the garage sound.]--
                TriggerServerEvent('hr-scrapgarage_SV:PlayWithinDistance', 25, 'housedoorunlock', 0.3)
                Citizen.Wait(1050)
                --[Teleports player and vehicle inside the garage.]--
                SetEntityCoordsNoOffset(GetVehiclePedIsIn(GetPlayerPed(-1), false), v2.x, v2.y, v2.z, true, true, true, false)
                --[Sets the heading of the player and vehicle.]--
                SetEntityHeading(GetVehiclePedIsIn(GetPlayerPed(-1), false), 359.33)
            else
                --[Triggers the Click Animation.]--
                TaskPlayAnim(GetPlayerPed(-1), clickanim, "fob_click", 8.0, 8.0, -1, 48, 1, false, false, false)
                Citizen.Wait(300)
                --[Plays the garage sound.]--
                TriggerServerEvent('hr-scrapgarage_SV:PlayWithinDistance', 25, 'housedoorunlock', 0.3)
                Citizen.Wait(1050)
                --[Teleports player inside the garage.]--
                SetEntityCoords(GetPlayerPed(-1), v2.x, v2.y, v2.z, true, true, true, false)
            end
        end

So you want certain cars to be blocked out?
Or all cars ?

only certain cars like bus, semi-trucks basically any big vehicle that wont fit in the garage, i can always go through the list of vehicles myself but i just need how to figure out how to check if the vehicle im in is in the list of vehicles blocked out so if its not it teleports me and the vehicle but if its in the list then it displays a message that says “You cannot enter with this vehicle.”

Try using the IS_PED_IN_VEHICLE NATIVE, and specify which vehicle you want to block out.
link for the native: https://runtime.fivem.net/doc/natives/#_0xA3EE4A07279BB9DB

Good luck :slight_smile:

would this work with a list of vehicles so more than one

You would have to define the value of the vehicle for each one, for example police maverick helicopter is going to be written like this:

local ped = GetPlayerPed(-1)

IsPedInVehicle(ped, polmav, false)

thats going to me one long list of if statements

it doesnt work btw

Well yeah, I just gave u an example of the native in use, you’ll have to code it yourself ?

Yeah i figured it out all I did was use a piece of code from the blacklist script

can you share your chop shop? please