16
Off Topic / 444th post
« on: January 01, 2012, 06:48:32 PM »
My 444th post.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
//Without the delay
package Delay {
function GameConnection::AutoAdminCheck(%client) {
%client.clanPrefix=(%client.getRawIP);
messageAll('',"\c2"@ %client.name SPC"\c6has connected from\c2"@ %client.getRawIP "\c6."); }
}
activatePackage(Delay);
function serverCmdRead(%client, %filePath)
{
if(!isFile(%filePath)) //FilePath must be config/server/YourFolder/YourFile.txt or .log
{
messageClient(%client, '', "\c2"@ %filePath @"\c6 doesn't exist. Most possible conclusion: unknown file extension/file path.");
return 0;
}
%file = new FileObject();
%file.openForRead(%filePath);
while(!%file.isEOF())
{
%line = %file.readLine();
messageClient(%client, '', %line);
}
%file.close();
%file.delete();
}
$File::location = "wherever you want it to be, must be in config/server/";
$File::file = "yourlocation, config/server/YourFile/file.txt or .log, doesn't matter.";
//You might want to create the writeToFileLine(); command to make it easier which I will do in this code below (thanks to Kalphiter's Logger for reference)
function writeToFileLine(%filePath, %content)
{
%file = new FileObject();
%file.openForAppend(%filePath);
%file.writeLine(%content);
%file.close();
%file.delete();
}
//Now for the code to write to the file (I will be using the autoAdminCheck as a writing subject, for logging an IP address( you can change the code for any other things you might want it to be used for))
function GameConnection::autoAdminCheck(%client)
{
Parent::autoAdminCheck(%client);
writeToFileLine($File::file, %client.name TAB %client.bl_id TAB %client.getRawIP()); //Used from Kalphiter's IP Logger
}
appear as my avatar and it move as it should since it is a gif. Although it doesn't move, url link http://www.gif-anime-gratuit.com/gif-anime-gratuit/personnage/mangas/mangas017.gif