For starters, why do you have this commented out? You need it. Your plugin is probably throwing errors without this check. There's more stuff that can be fixed/improved.
You should instead use get_players() instead of looping through all slots and doing these checks.
PHP Code:
//if(!is_user_bot(id) && is_user_connected(id))
//{
__________________