hObj = {
[1495] = true, [3089] = true, [1557] = true, [1808] = true, [19857] = true, [19302] = true, [2634] = true, [19303] = true, [968] = true,
[975] = true, [1374] = true, [19912] = true, [19313] = true, [988] = true,
[11327] = true, [19384] = true,
}
function AutoDoor()
local tbl = getAllObjects()
for i = 1, #tbl do
if doesObjectExist(tbl[i]) and hObj[getObjectModel(tbl[i])] then
if isCharInAnyCar(PLAYER_PED) then
local veh = storeCarCharIsInNoSave(PLAYER_PED)
if isVehicleTouchingObject(veh, tbl[i]) then
sampSendChat("/opengate")
wait(3000)
end
else
if isCharTouchingObject(PLAYER_PED, tbl[i]) then
sampSendChat("/opengate")
wait(3000)
end
end
end
end
end