Hotspot Script Active User Problem

Hello, since i cant make work out the script that i found on the forum, i am asking for help.
Im using FreeRadius and i have to guarantee only one simultaneous user in Hotspot Active Users with a script that runs every minute on the router.
My RB1100 is using RouterOS V7

Scipt:

:local uname $user;
:local usercount 0;
:local usertime "00:00:00";
:local kickable;
:local maxuser 1;

:foreach i in=[/ip hotspot active find user=$uname] do= {
  :local curup [/ip hotspot active get $i uptime];
  :if ( $curup > $usertime ) do={
        :set usertime $curup
        :set kickable $i
   }
  :set usercount ($usercount+1)
}
:if ($usercount >= $maxuser) do={
  :log info "Login user: $uname ($usercount/$maxuser) - Oldest $usertime will be logout!"
  /ip hotspot active remove numbers=$kickable
} else {
   :log info "Login user: $uname ($usercount/$maxuser)"
}

Did you solve the problem?

what FreeRadius module you used?
Basicaly, your FreeRadius have to include ‘reply:Port-Limit’ in it’s response to the radius client.

reff: https://wiki.mikrotik.com/wiki/Manual:RADIUS_Client#Access-Accept

-bino-