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
