Codigo Bem util para servidores serios =]
Codigo do PHP:
<span style="color: rgb(0, 0, 187);"><?
$self </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">basename</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$_SERVER</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'PHP_SELF'</span><span style="color: rgb(0, 119, 0);">]);
</span><span style="color: rgb(0, 0, 187);">?>
</span><html><title>Character Deletion!</title>
<body>
<form name="form" method="POST" action="<span style="color: rgb(0, 0, 187);"><? </span><span style="color: rgb(0, 119, 0);">echo </span><span style="color: rgb(0, 0, 187);">$self</span><span style="color: rgb(0, 119, 0);">; </span><span style="color: rgb(0, 0, 187);">?></span>">
<p align="left"><b>Configurations</b>
<input name="source" type="radio" value="XML"> XML (mark this if you use xml, and leave all sql configuration <b>blank!</b>)
<input name="source" type="radio" value="SQL"> SQL (mark this if you use sql)
<p><b>SQL Part</b>
Host: <input name="host" type="text" id="host" value="" size="15">
User: <input name="user" type="text" id="user" value="" size="15">
Pass: <input name="pass" type="password" value="" id="pass" size="15">
Data: <input name="data" type="text" id="data" value="" size="15"> (name of your database)
</p>
<p align="left"><b>Script Config</b>
Days: <input name="days" type="text" id="days" value="" size="2"><input name="never" type="radio" value="0"> <i><font size=2>(Select if you just want to delete never loggedin players)</font></i>
Delete player with level below: <input name="level" type="text" id="level" value="" size="2"><i><font size=2> (You can leave it <b>blank</b> if you don't want to use this feature)</font></i>
<p>
<input type="submit" value="Submit">
</form>
<span style="color: rgb(0, 0, 187);"><?php
</span><span style="color: rgb(0, 119, 0);">include(</span><span style="color: rgb(221, 0, 0);">'config.php'</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$source </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">$_POST</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'source'</span><span style="color: rgb(0, 119, 0);">];
</span><span style="color: rgb(0, 0, 187);">$host </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">$_POST</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'host'</span><span style="color: rgb(0, 119, 0);">];
</span><span style="color: rgb(0, 0, 187);">$user </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">$_POST</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'user'</span><span style="color: rgb(0, 119, 0);">];
</span><span style="color: rgb(0, 0, 187);">$pass </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">$_POST</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'pass'</span><span style="color: rgb(0, 119, 0);">];
</span><span style="color: rgb(0, 0, 187);">$data </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">$_POST</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'data'</span><span style="color: rgb(0, 119, 0);">];
</span><span style="color: rgb(0, 0, 187);">$level </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">$_POST</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'level'</span><span style="color: rgb(0, 119, 0);">];
</span><span style="color: rgb(0, 0, 187);">$days </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">$_POST</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'days'</span><span style="color: rgb(0, 119, 0);">];
</span><span style="color: rgb(0, 0, 187);">$dels </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">$_POST</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'never'</span><span style="color: rgb(0, 119, 0);">];
</span><span style="color: rgb(0, 0, 187);">$dir </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">$pasta</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(221, 0, 0);">'players/'</span><span style="color: rgb(0, 119, 0);">;
</span><span style="color: rgb(0, 0, 187);">$xmlfile </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">$dir</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(221, 0, 0);">'players.xml'</span><span style="color: rgb(0, 119, 0);">;
if(</span><span style="color: rgb(0, 0, 187);">$dels </span><span style="color: rgb(0, 119, 0);">== </span><span style="color: rgb(0, 0, 187);">NULL </span><span style="color: rgb(0, 119, 0);">&& </span><span style="color: rgb(0, 0, 187);">$days </span><span style="color: rgb(0, 119, 0);">!= </span><span style="color: rgb(0, 0, 187);">NULL</span><span style="color: rgb(0, 119, 0);">){
</span><span style="color: rgb(0, 0, 187);">$manydays </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">$days </span><span style="color: rgb(0, 119, 0);">* </span><span style="color: rgb(0, 0, 187);">86400</span><span style="color: rgb(0, 119, 0);">;
</span><span style="color: rgb(0, 0, 187);">$time </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">time</span><span style="color: rgb(0, 119, 0);">() - </span><span style="color: rgb(0, 0, 187);">$manydays</span><span style="color: rgb(0, 119, 0);">;
}elseif(</span><span style="color: rgb(0, 0, 187);">$dels </span><span style="color: rgb(0, 119, 0);">== </span><span style="color: rgb(221, 0, 0);">'0' </span><span style="color: rgb(0, 119, 0);">&& </span><span style="color: rgb(0, 0, 187);">$days </span><span style="color: rgb(0, 119, 0);">== </span><span style="color: rgb(0, 0, 187);">NULL</span><span style="color: rgb(0, 119, 0);">){
</span><span style="color: rgb(0, 0, 187);">$time </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">$dels</span><span style="color: rgb(0, 119, 0);">;
}
elseif(</span><span style="color: rgb(0, 0, 187);">$dels </span><span style="color: rgb(0, 119, 0);">== </span><span style="color: rgb(0, 0, 187);">NULL </span><span style="color: rgb(0, 119, 0);">&& </span><span style="color: rgb(0, 0, 187);">$days </span><span style="color: rgb(0, 119, 0);">== </span><span style="color: rgb(0, 0, 187);">NULL</span><span style="color: rgb(0, 119, 0);">){
</span><span style="color: rgb(0, 0, 187);">$time </span><span style="color: rgb(0, 119, 0);">= -</span><span style="color: rgb(0, 0, 187);">1</span><span style="color: rgb(0, 119, 0);">;
}
if(</span><span style="color: rgb(0, 0, 187);">$days </span><span style="color: rgb(0, 119, 0);">!= </span><span style="color: rgb(0, 0, 187);">NULL </span><span style="color: rgb(0, 119, 0);">or </span><span style="color: rgb(0, 0, 187);">$dels </span><span style="color: rgb(0, 119, 0);">!= </span><span style="color: rgb(0, 0, 187);">NULL </span><span style="color: rgb(0, 119, 0);">or </span><span style="color: rgb(0, 0, 187);">$level </span><span style="color: rgb(0, 119, 0);">!= </span><span style="color: rgb(0, 0, 187);">NULL</span><span style="color: rgb(0, 119, 0);">){
</span><span style="color: rgb(0, 0, 187);">$x </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">0</span><span style="color: rgb(0, 119, 0);">;
</span><span style="color: rgb(0, 0, 187);">$y </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">0</span><span style="color: rgb(0, 119, 0);">;
</span><span style="color: rgb(0, 0, 187);">$z </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">0</span><span style="color: rgb(0, 119, 0);">;
if(</span><span style="color: rgb(0, 0, 187);">$source </span><span style="color: rgb(0, 119, 0);">== </span><span style="color: rgb(221, 0, 0);">"SQL" </span><span style="color: rgb(0, 119, 0);">&& </span><span style="color: rgb(0, 0, 187);">$pass </span><span style="color: rgb(0, 119, 0);">!= </span><span style="color: rgb(0, 0, 187);">NULL</span><span style="color: rgb(0, 119, 0);">){
</span><span style="color: rgb(0, 0, 187);">mysql_connect</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$host</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(0, 0, 187);">$user</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(0, 0, 187);">$pass</span><span style="color: rgb(0, 119, 0);">) or die(</span><span style="color: rgb(221, 0, 0);">"Unable to connect with the SQL Server!"</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">mysql_select_db</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$data</span><span style="color: rgb(0, 119, 0);">) or die(</span><span style="color: rgb(221, 0, 0);">"Unable to select the SQL Database!"</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$result </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">mysql_query</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">"SELECT * FROM players"</span><span style="color: rgb(0, 119, 0);">);
while(</span><span style="color: rgb(0, 0, 187);">$player </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">mysql_fetch_object</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$result</span><span style="color: rgb(0, 119, 0);">)){
if(</span><span style="color: rgb(0, 0, 187);">$level </span><span style="color: rgb(0, 119, 0);">!= </span><span style="color: rgb(0, 0, 187);">NULL </span><span style="color: rgb(0, 119, 0);">&& </span><span style="color: rgb(0, 0, 187);">$player</span><span style="color: rgb(0, 119, 0);">-></span><span style="color: rgb(0, 0, 187);">level </span><span style="color: rgb(0, 119, 0);">< </span><span style="color: rgb(0, 0, 187);">$level</span><span style="color: rgb(0, 119, 0);">){
</span><span style="color: rgb(0, 0, 187);">$sql_ </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(221, 0, 0);">"SELECT * FROM players WHERE account='$player->account'"</span><span style="color: rgb(0, 119, 0);">;
</span><span style="color: rgb(0, 0, 187);">$res </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">mysql_query</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$sql_</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$rows </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">mysql_fetch_object</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$res</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$numrows </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">mysql_num_rows</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$res</span><span style="color: rgb(0, 119, 0);">);
if(</span><span style="color: rgb(0, 0, 187);">$numrows </span><span style="color: rgb(0, 119, 0);">== </span><span style="color: rgb(221, 0, 0);">'1'</span><span style="color: rgb(0, 119, 0);">){
</span><span style="color: rgb(0, 0, 187);">$_sql </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">mysql_query</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">"DELETE FROM accounts WHERE accno='$player->account'"</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$y</span><span style="color: rgb(0, 119, 0);">++;
}
</span><span style="color: rgb(0, 0, 187);">$delplayer </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">mysql_query</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">"DELETE FROM players WHERE name='$player->name'"</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$delskills </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">mysql_query</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">"DELETE FROM skills WHERE player='$player->id'"</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$dellitems </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">mysql_query</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">"DELETE FROM items WHERE player='$player->id'"</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$z</span><span style="color: rgb(0, 119, 0);">++;
}
if(</span><span style="color: rgb(0, 0, 187);">$player</span><span style="color: rgb(0, 119, 0);">-></span><span style="color: rgb(0, 0, 187);">lastlogin </span><span style="color: rgb(0, 119, 0);"><= </span><span style="color: rgb(0, 0, 187);">$time</span><span style="color: rgb(0, 119, 0);">){
</span><span style="color: rgb(0, 0, 187);">$sql_ </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(221, 0, 0);">"SELECT * FROM players WHERE account='$player->account'"</span><span style="color: rgb(0, 119, 0);">;
</span><span style="color: rgb(0, 0, 187);">$res </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">mysql_query</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$sql_</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$rows </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">mysql_fetch_object</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$res</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$numrows </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">mysql_num_rows</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$res</span><span style="color: rgb(0, 119, 0);">);
if(</span><span style="color: rgb(0, 0, 187);">$numrows </span><span style="color: rgb(0, 119, 0);">== </span><span style="color: rgb(221, 0, 0);">'1'</span><span style="color: rgb(0, 119, 0);">){
</span><span style="color: rgb(0, 0, 187);">$_sql </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">mysql_query</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">"DELETE FROM accounts WHERE accno='$player->account'"</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$y</span><span style="color: rgb(0, 119, 0);">++;
}
</span><span style="color: rgb(0, 0, 187);">$delplayer </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">mysql_query</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">"DELETE FROM players WHERE name='$player->name'"</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$delskills </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">mysql_query</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">"DELETE FROM skills WHERE player='$player->id'"</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$dellitems </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">mysql_query</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">"DELETE FROM items WHERE player='$player->id'"</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$x</span><span style="color: rgb(0, 119, 0);">++;
}
}
print(</span><span style="color: rgb(0, 0, 187);">$x</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(221, 0, 0);">' players were deleted
'</span><span style="color: rgb(0, 119, 0);">);
print(</span><span style="color: rgb(0, 0, 187);">$y</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(221, 0, 0);">' accounts were deleted
'</span><span style="color: rgb(0, 119, 0);">);
if(</span><span style="color: rgb(0, 0, 187);">$z </span><span style="color: rgb(0, 119, 0);">!= </span><span style="color: rgb(0, 0, 187);">NULL</span><span style="color: rgb(0, 119, 0);">){
print(</span><span style="color: rgb(0, 0, 187);">$z</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(221, 0, 0);">' players were deleted because of low level
'</span><span style="color: rgb(0, 119, 0);">);
}
}
elseif(</span><span style="color: rgb(0, 0, 187);">$source </span><span style="color: rgb(0, 119, 0);">== </span><span style="color: rgb(221, 0, 0);">"XML" </span><span style="color: rgb(0, 119, 0);">&& </span><span style="color: rgb(0, 0, 187);">$pass </span><span style="color: rgb(0, 119, 0);">== </span><span style="color: rgb(0, 0, 187);">NULL</span><span style="color: rgb(0, 119, 0);">){
if (</span><span style="color: rgb(0, 0, 187);">$dh </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">opendir</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$dir</span><span style="color: rgb(0, 119, 0);">)) {
while ((</span><span style="color: rgb(0, 0, 187);">$file </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">readdir</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$dh</span><span style="color: rgb(0, 119, 0);">)) !== </span><span style="color: rgb(0, 0, 187);">false</span><span style="color: rgb(0, 119, 0);">) {
</span><span style="color: rgb(0, 0, 187);">$path_parts </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">pathinfo</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$file</span><span style="color: rgb(0, 119, 0);">);
if(</span><span style="color: rgb(0, 0, 187);">filetype</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$dir </span><span style="color: rgb(0, 119, 0);">. </span><span style="color: rgb(0, 0, 187);">$file</span><span style="color: rgb(0, 119, 0);">) == </span><span style="color: rgb(221, 0, 0);">'file' </span><span style="color: rgb(0, 119, 0);">&& </span><span style="color: rgb(0, 0, 187);">$file </span><span style="color: rgb(0, 119, 0);">!= </span><span style="color: rgb(221, 0, 0);">'players.xml' </span><span style="color: rgb(0, 119, 0);">&& </span><span style="color: rgb(0, 0, 187);">$path_parts</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'extension'</span><span style="color: rgb(0, 119, 0);">] == </span><span style="color: rgb(221, 0, 0);">'xml'</span><span style="color: rgb(0, 119, 0);">){
</span><span style="color: rgb(0, 0, 187);">$playersxml </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">file_get_contents</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$xmlfile</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$player </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">file_get_contents</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$dir</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$file</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$xml </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">simplexml_load_string</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$player</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$accgetcont </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">file_get_contents</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$pasta</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(221, 0, 0);">"accounts/"</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'account'</span><span style="color: rgb(0, 119, 0);">].</span><span style="color: rgb(221, 0, 0);">".xml"</span><span style="color: rgb(0, 119, 0);">);
if(isset(</span><span style="color: rgb(0, 0, 187);">$level</span><span style="color: rgb(0, 119, 0);">) && isset(</span><span style="color: rgb(0, 0, 187);">$time</span><span style="color: rgb(0, 119, 0);">)){
if(</span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'lastlogin'</span><span style="color: rgb(0, 119, 0);">] <= </span><span style="color: rgb(0, 0, 187);">$time </span><span style="color: rgb(0, 119, 0);">&& </span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'level'</span><span style="color: rgb(0, 119, 0);">] < </span><span style="color: rgb(0, 0, 187);">$level</span><span style="color: rgb(0, 119, 0);">){
</span><span style="color: rgb(0, 0, 187);">$str_replace </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">str_replace</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">'<player guid="'</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'id'</span><span style="color: rgb(0, 119, 0);">].</span><span style="color: rgb(221, 0, 0);">'" name="'</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'name'</span><span style="color: rgb(0, 119, 0);">].</span><span style="color: rgb(221, 0, 0);">'"/>'</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(221, 0, 0);">''</span><span style="color: rgb(0, 119, 0);">, </span><span style="color: rgb(0, 0, 187);">$playersxml</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$replace_acc </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">str_replace</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">'<character name="'</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'name'</span><span style="color: rgb(0, 119, 0);">].</span><span style="color: rgb(221, 0, 0);">'"/>'</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(221, 0, 0);">''</span><span style="color: rgb(0, 119, 0);">, </span><span style="color: rgb(0, 0, 187);">$accgetcont</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$fopen </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">fopen</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$xmlfile</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(221, 0, 0);">"w+"</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$fwrite </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">fwrite</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$fopen</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(0, 0, 187);">$str_replace</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$fopen </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">fopen</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$pasta</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(221, 0, 0);">"accounts/"</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'account'</span><span style="color: rgb(0, 119, 0);">].</span><span style="color: rgb(221, 0, 0);">".xml"</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(221, 0, 0);">"w+"</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$fwrite </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">fwrite</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$fopen</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(0, 0, 187);">$replace_acc</span><span style="color: rgb(0, 119, 0);">);
if(</span><span style="color: rgb(0, 0, 187);">unlink</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$dir </span><span style="color: rgb(0, 119, 0);">. </span><span style="color: rgb(0, 0, 187);">$file</span><span style="color: rgb(0, 119, 0);">)){
</span><span style="color: rgb(0, 0, 187);">$x</span><span style="color: rgb(0, 119, 0);">++;
}
}
}else{
if(</span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'lastlogin'</span><span style="color: rgb(0, 119, 0);">] <= </span><span style="color: rgb(0, 0, 187);">$time</span><span style="color: rgb(0, 119, 0);">){
</span><span style="color: rgb(0, 0, 187);">$str_replace </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">str_replace</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">'<player guid="'</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'id'</span><span style="color: rgb(0, 119, 0);">].</span><span style="color: rgb(221, 0, 0);">'" name="'</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'name'</span><span style="color: rgb(0, 119, 0);">].</span><span style="color: rgb(221, 0, 0);">'"/>'</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(221, 0, 0);">''</span><span style="color: rgb(0, 119, 0);">, </span><span style="color: rgb(0, 0, 187);">$playersxml</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$replace_acc </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">str_replace</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">'<character name="'</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'name'</span><span style="color: rgb(0, 119, 0);">].</span><span style="color: rgb(221, 0, 0);">'"/>'</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(221, 0, 0);">''</span><span style="color: rgb(0, 119, 0);">, </span><span style="color: rgb(0, 0, 187);">$accgetcont</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$fopen </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">fopen</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$xmlfile</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(221, 0, 0);">"w+"</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$fwrite </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">fwrite</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$fopen</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(0, 0, 187);">$str_replace</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$fopen </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">fopen</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$pasta</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(221, 0, 0);">"accounts/"</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'account'</span><span style="color: rgb(0, 119, 0);">].</span><span style="color: rgb(221, 0, 0);">".xml"</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(221, 0, 0);">"w+"</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$fwrite </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">fwrite</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$fopen</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(0, 0, 187);">$replace_acc</span><span style="color: rgb(0, 119, 0);">);
if(</span><span style="color: rgb(0, 0, 187);">unlink</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$dir </span><span style="color: rgb(0, 119, 0);">. </span><span style="color: rgb(0, 0, 187);">$file</span><span style="color: rgb(0, 119, 0);">)){
</span><span style="color: rgb(0, 0, 187);">$x</span><span style="color: rgb(0, 119, 0);">++;
}
}
elseif(</span><span style="color: rgb(0, 0, 187);">$level </span><span style="color: rgb(0, 119, 0);">!= </span><span style="color: rgb(0, 0, 187);">NULL </span><span style="color: rgb(0, 119, 0);">&& </span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'level'</span><span style="color: rgb(0, 119, 0);">] < </span><span style="color: rgb(0, 0, 187);">$level</span><span style="color: rgb(0, 119, 0);">){
</span><span style="color: rgb(0, 0, 187);">$str_replace </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">str_replace</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">'<player guid="'</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'id'</span><span style="color: rgb(0, 119, 0);">].</span><span style="color: rgb(221, 0, 0);">'" name="'</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'name'</span><span style="color: rgb(0, 119, 0);">].</span><span style="color: rgb(221, 0, 0);">'"/>'</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(221, 0, 0);">''</span><span style="color: rgb(0, 119, 0);">, </span><span style="color: rgb(0, 0, 187);">$playersxml</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$replace_acc </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">str_replace</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">'<character name="'</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'name'</span><span style="color: rgb(0, 119, 0);">].</span><span style="color: rgb(221, 0, 0);">'"/>'</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(221, 0, 0);">''</span><span style="color: rgb(0, 119, 0);">, </span><span style="color: rgb(0, 0, 187);">$accgetcont</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$fopen </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">fopen</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$xmlfile</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(221, 0, 0);">"w+"</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$fwrite </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">fwrite</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$fopen</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(0, 0, 187);">$str_replace</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$fopen </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">fopen</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$pasta</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(221, 0, 0);">"accounts/"</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'account'</span><span style="color: rgb(0, 119, 0);">].</span><span style="color: rgb(221, 0, 0);">".xml"</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(221, 0, 0);">"w+"</span><span style="color: rgb(0, 119, 0);">);
</span><span style="color: rgb(0, 0, 187);">$fwrite </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">fwrite</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$fopen</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(0, 0, 187);">$replace_acc</span><span style="color: rgb(0, 119, 0);">);
if(</span><span style="color: rgb(0, 0, 187);">unlink</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$dir </span><span style="color: rgb(0, 119, 0);">. </span><span style="color: rgb(0, 0, 187);">$xml</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'name'</span><span style="color: rgb(0, 119, 0);">] . </span><span style="color: rgb(221, 0, 0);">".xml"</span><span style="color: rgb(0, 119, 0);">)){
</span><span style="color: rgb(0, 0, 187);">$z</span><span style="color: rgb(0, 119, 0);">++;
}
}
}
}
}
print(</span><span style="color: rgb(0, 0, 187);">$x</span><span style="color: rgb(0, 119, 0);">+</span><span style="color: rgb(0, 0, 187);">$z</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(221, 0, 0);">' players were deleted
'</span><span style="color: rgb(0, 119, 0);">);
if(</span><span style="color: rgb(0, 0, 187);">$z </span><span style="color: rgb(0, 119, 0);">!= </span><span style="color: rgb(0, 0, 187);">NULL</span><span style="color: rgb(0, 119, 0);">){
print(</span><span style="color: rgb(0, 0, 187);">$z</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(221, 0, 0);">' of them because of low level
'</span><span style="color: rgb(0, 119, 0);">);
}
}
}
}
</span><span style="color: rgb(0, 0, 187);">?></span>
Adicionar no Config.php
<span style="color: rgb(0, 0, 187);">$pasta </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(221, 0, 0);">"C:/whatever/data/"</span><span style="color: rgb(0, 119, 0);">; </span>
Espero ter ajudado ![]()










