Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Searches and returns the number of matches that had a banned player in them
- *
- * @param filtered Whether the search to be filtered or not, false or true
- * @return int
- */
- function cMatches(filtered = false) {
- // The number of matches that had cheaters in them
- var nMatches = 0;
- // For each game
- $J('.banchecker-withcolumn').each(function(n, target) {
- foundCheater = false;
- // Iterate trough all the players
- $J('.banchecker-bans[style]', $J(target)).each(function(x, child) {
- // Get the player's status
- var status = $J(child).attr('style');
- if(filtered == true) {
- var searchType = "red";
- } else {
- var searchType = "color";
- }
- if(status.indexOf(searchType) >= 0) {
- foundCheater = true;
- return true;
- }
- });
- // If a cheater was found in the match
- if(foundCheater == true) {
- // Increase the number of matches with cheaters in them
- nMatches = nMatches + 1;
- }
- });
- return nMatches;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement