Попробуй это, но я не уверен, что код правильный
function createObj(id, model, pos, rot, draw, scale, colision, heading, attachedVehicle, attachOffset, attachRot)
-- Проверяем существование автомобиля
if not sampIsCarValid(attachedVehicle) then
print("Error: Vehicle"...