As Henry says, that doesn't make a lot of sense.
However, I think there is enough there to tell what your problem is:
You are using a for loop, when you want an if statement.
If you set up a for loop, it will do the same code several times: that is not what your description says.
When a user wants to log in, check the "number of users". If this exceeds or equals the maximum, then refuse the login. Otherwise, increase the number of users, and log them in.
if (count >= noofusers)
{
...
}
else
{
count++;
...
}
Note that you will need something to cope with logout, and with "dead" users: for example if the PC gets re-booted without a log out you need to kill the user login and reduce the count somehow.