Usage

Syntax: savelog2(string filepath, string text);
The file path always begins with the directory logs/*, so just having a filename in the first argument is fine.

Explanation

Creates a new text file if the one specified in the first argument does not already exist.
Appends to the file the current date and time, and on the next line after that, it appends what was specified in the second argument.

Example

function onPlayerChats()
{
	if (player.chat.starts("/summon"))
	{
		temp.t = player.chat.tokenize();
		findPlayer(temp.t[1]).setlevel2(player.level.name, player.x, player.y);
		savelog2("summonlog.txt", player.account " summoned " @ temp.t[1] @ " to " @ player.level.name @ ".");
  	}
}

... Will save everything into a text file called summonlog.txt whenever a staff member summons a player.

If you open the text file, this is what it may output:

Time: Wed May  6 00:44:38 2009
Stefan summoned unixmad to onlinestartlocal.nw. 


Categories

CategoryFunctionClientside
CategoryFunctionServerside

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki