Deleting Player |
Removing Kill Matrix Entries: | ';
$q_match = mysqli_query($GLOBALS["___mysqli_link"], "SELECT matchid, playerid FROM uts_player WHERE pid = '$pid'") or die(mysqli_error($GLOBALS["___mysqli_link"]));
while ($r_match = mysqli_fetch_array($q_match)) {
mysqli_query($GLOBALS["___mysqli_link"], "DELETE FROM uts_killsmatrix WHERE matchid = '${r_match['matchid']}' AND (killer = '${r_match['playerid']}' OR victim = '${r_match['playerid']}')") or die(mysqli_error($GLOBALS["___mysqli_link"]));
}
echo'Done |
Removing Player Info: | ';
$r_pinfo = small_query("SELECT banned FROM uts_pinfo WHERE id = $playerid");
if ($r_pinfo['banned'] != 'Y') {
mysqli_query($GLOBALS["___mysqli_link"], "DELETE FROM uts_pinfo WHERE id = $playerid") or die(mysqli_error($GLOBALS["___mysqli_link"]));
echo'Done | ';
} else {
echo'No (player banned) | ';
}
echo '
Removing Player Match Events: | ';
mysqli_query($GLOBALS["___mysqli_link"], "DELETE e.* FROM uts_player as p, uts_events as e WHERE p.pid = $playerid AND p.playerid = e.playerid AND p.matchid = e.matchid") or die(mysqli_error($GLOBALS["___mysqli_link"]));
echo'Done |
Removing Player Match Records: | ';
mysqli_query($GLOBALS["___mysqli_link"], "DELETE FROM uts_player WHERE pid = $playerid") or die(mysqli_error($GLOBALS["___mysqli_link"]));
echo'Done |
Removing Player Rank: | ';
mysqli_query($GLOBALS["___mysqli_link"], "DELETE FROM uts_rank WHERE pid = $playerid") or die(mysqli_error($GLOBALS["___mysqli_link"]));
echo'Done |
Removing Player Weapon Stats: | ';
mysqli_query($GLOBALS["___mysqli_link"], "DELETE FROM uts_weaponstats WHERE pid = $playerid") or die(mysqli_error($GLOBALS["___mysqli_link"]));
echo'Done |
Amending Global Weapon Stats: | ';
mysqli_query($GLOBALS["___mysqli_link"], "DELETE FROM uts_weaponstats WHERE matchid='0' AND pid='0'") or die(mysqli_error($GLOBALS["___mysqli_link"]));
$q_weaponstats = mysqli_query($GLOBALS["___mysqli_link"], "SELECT weapon, SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE matchid = '0' GROUP BY weapon") or die(mysqli_error($GLOBALS["___mysqli_link"]));
while ($r_weaponstats = mysqli_fetch_array($q_weaponstats)) {
mysqli_query($GLOBALS["___mysqli_link"], "INSERT INTO uts_weaponstats SET matchid='0', pid='0', weapon='${r_weaponstats['weapon']}', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysqli_error($GLOBALS["___mysqli_link"]));
}
echo'Done |
Player Deleted - Go Back To Admin Page |
';
?>