Tooting horn unreasonably

While driving I tooted horn to alert the driver in front of me who was driving slowly to speed up. A traffic police who was also in front of me stopped me and alleged that it was wrong for me to toot. Is it an offence to toot?
FM, Dar

Section 39B(1)(2) of the Road Traffic Act [Cap.168 R.E 2002] and regulation 39(3) of the Traffic Regulations allow tooting in very exceptional circumstances. Tooting horn is allowed only where it is necessary to do so in order to attract the attention of other road users to avoid or prevent a danger or giving a warning to another road user to avoid the dangerous approach or position which he or she is trying to take. Even where a driver toots horn to avoid or prevent danger, the tooting should not be excessive that is likely to be a nuisance or causing annoyance to other road users or people who live near the road.

In short it is an offence to toot horn unreasonably. What is unreasonable and what is not varies on the circumstances. Tooting horn to force a driver in front of you to speed up is an offence because the intention is not avoid or prevent an accident, unless you can prove otherwise.