Possible to log PvP kills?
Locked
Freelancer Discussion
-
plugin_register { name => 'pvplogger', author => 'Fenris_Wolf', version => '1.0', date => '12/27/2009', description => 'logs pvp kills to a file' }, undef, { 'kill' => sub{ my $e = shift; my $system = psystem plid('char',$e->{victim}); my $t = localtime(); open FILE, '>>', $Options->{pvplog}{logfile} or return undef; if ($e->{type} eq 'player') { print FILE "$t - System: $system Killer: $$e{killer} \tVictim: $$e{victim}\n"; } else { print FILE "$t - System: $system Killer: $$e{type} \tVictim: $$e{victim}\n"; } close FILE; } }; 1;
I made a small change so it would log both PvP and PvE kills without giving an error. Also, the system had to be changed to the victim’s instead of the killer’s.