If the plaintiff voluntarily dismisses the action, or fails to prove the plaintiff's right to the possession, judgment for costs shall be entered in favor of the defendant.

(Source: P.A. 82-280.)