break; /** * Kick a player */ /** * Kick a player */ case 'kickPlayer': if (isset($_POST['vars']['player']) && isset($_POST['vars']['index']) && isset($_POST['vars']['reason'])) { if ($userInfo['rights_server'] == 'yes') { // Connect to server $rc->connect($cn, $cs); $cn = $rc->init(); if ($cn) { // We use the index instead of the playername, or else playernames with numbers only won't be kicked $pl->kick($_POST['vars']['index'], $_POST['vars']['reason']); $response['status'] = 'OK'; $response['msg'] = $lang['tool_server_kickpl_msg']; $log->insertActionLog($userInfo['user_id'], 'Kicked player: ' . $_POST['vars']['player'] . ' for: ' . $_POST['vars']['reason']); } else { $response['msg'] = $lang['msg_serverdown'] . ' ' . date($settings['cp_date_format_full'], $settings['server_last_stream']); } } else { $response['msg'] = $lang['msg_cmd_noaccess']; } } else { $response['msg'] = $lang['msg_cmd_missingvars']; } break; /** * Enable/Disable a tool
***************/ if ($decision['kick'] !== true && $configs['classLimiter.script_enabled'] === true) { $team = $player->team; if ($kit != "none") { $kit = $kit . "s"; ++$classCounter[$team][$kit]; } // You are too boring! if ($kit !== "none" && $classCounter[$team][$kit] > $configs['classLimiter.max_' . $kit]) { $configs['cstMessage'] = $configs['classLimiter.custom_message']; $decision['kick'] = true; $decision['type'] = ""; $decision['reason'] = "Class Limiter: " . $decision['class']; $decision['script'] = "Class Limiter"; } } /* Bai! ******/ if ($decision['kick'] === true) { $reason = preg_replace('/%player%/', $player->name, $configs['cstMessage']); $reason = preg_replace('/%weapon%/', $sup->weaponGetName($decision['weapon_id']), $reason); $reason = preg_replace('/%type%/', $decision['type'], $reason); $reason = preg_replace('/%kit%/', $decision['class'], $reason); $reason = preg_replace('/%script%/', $decision['script'], $reason); $reason = preg_replace('/%level%/', $decision['level'], $reason); $rcp->kick($player->name, $reason); $db->insertIntoLogs($configs['colLogs'], (string) $player->nucleusId, $player->cdKeyHash, $player->name, $decision['reason']); } } // Notice to stdout echo "Completed. " . date("Y-m-d H:i:s") . PHP_EOL;
} /** * BLACKLIST * * Checks if the player is in the blacklist, if yes: kick */ /** * Delete all the expired bans */ $bl->deleteExpired(); $ban = $bl->checkPlayer($player->nucleusId); if ($ban['code'] == 'OK') { $reason = replace($settings['tool_bl_msg'], array('%reason%' => $ban['info']['reason'], '%until%' => !$ban['info']['until'] ? 'PERMANENTLY' : date("d-m-Y H:i", strtotime($ban['info']['until'])))); // Kick the player // We use the index instead of the playername, or else playernames with numbers only won't be kicked $pl->kick($player->index, $reason); // Log the kick $log->insertKickLog($player->nucleusId, $player->cdKeyHash, $player->name, $reason); // Skip, don't check for other limiters and stuff continue; } /** * Get the class of the player * * - UPDATE v0.6.0: More simple and efficient way */ $kit = $player->kit == 'none' ? 'Dead' : str_replace(array('_', 'kit', 'US', 'RU'), '', $player->kit); // Count +1 // Classes if ($kit != 'Dead') { $counter[$player->team][$kit . 's']++;