And Crazy its unnecessary to check if entity is valid...
Since find ent returns a vaild entities id if its above 0
And as craxor said it would be better if you looped throw get players instead of get maxplayers , it would better to loop throw all maxplayers if you wanted to reset players arrays.... And not execute .actions on them