Esse script deleta todos os characters que estão inativos por 7 dias.
<?/* +------------------------------------------+ | Script by: P!NGU3L4 | +------------------------------------------+*/$playersDir = 'otserv/data/players'; // Put in this variable the directory of players$accountsDir = 'otserv/data/accounts'; // Put in this variable the directory of accounts$dir = dir($playersDir);while($file = $dir -> read()) { if(ereg('.xml$', $file)) { $playerFile = $playersDir.'/'.$player; $playerFgc = file_get_contents($playerFile); $whereQuotes = explode('"', $playerFgc); $atributeName = $whereQuotes[3]; $atributeAccount = $whereQuotes[5]; $atributeLastLogin = $whereQuotes[23]; if((time() - $atributeLastLogin) >= 604800) { $accountFile = $accountsDir.'/'.$atributeAccount.'.xml'; $accountFgc = file_get_contents($accountFile); $xmlArrayToReplace = array('<character name="'.$atributeName.'" />' => ''); $xmlString = strtr($accountFgc, $xmlArrayToReplace); $accountFp = fopen($accountFile, 'w'); fwrite($accountFp, $xmlString); fclose($accountFp); unlink($playerFile); } }}?>