PDA

View Full Version : Player tracker?


ChaosSlayerZ
07-13-2009, 10:46 PM
I want to set up a little quest which would track when a player levels up and write that information into a text file on server side.

The practical usage for this is for example to give award to say first warrior to reach level 50

Could you guys help me out?

Kayen
07-14-2009, 06:36 PM
quest::write(file,string)

Can save any info you want to a txt file this way.

ChaosSlayerZ
07-14-2009, 08:32 PM
ok this is what I have put together for player.pl




sub EVENT_LEVEL_UP
{

if($ulevel==50)
{

$client->Message(15, "You've achieved level 50!");

my $string=" $name the $class has achieved level $ulevel ";

quest::write("50.txt", $string);

}




does this looks right?

Also does quest::write includes some sort of time stamp when it makes an entry into a file?

thanks!

trevius
09-18-2009, 07:26 AM
Try this:

$timestamp = localtime(time);
quest::write("LevelTrack.txt","[$timestamp] : $name the $class has achieved level $ulevel.");

ChaosSlayerZ
09-18-2009, 11:23 AM
thanks Trev! I will try this out today!