The meaning is totally clear! Grammatically, the beginning should either be "When...visited" or "While...was visiting" - which one depends on how the rest of the sentence is phrased. I've never heard "people living there" before, and shouting isn't really done "to" someone. Keeping the quotation as a direct translation is probably fine, even though it sounds awkward (maybe replace "served" with "sold"). So overall, I would write "When a senior official visited [local place, insert name here], (s)he was met by residents (or "members of the community") shouting "(quotation)".