Add a field to the login table that holds number of logins. Make it 0 by default. Add AfterSuccessfullLogin event where you increment this column by one. Add BeforeLogin Event when you can check current number of attempts and only allow to login if number of attemps is NULL or 0.