Raised This Month: $51 Target: $400
 12% 

[TF2] Healing and Teleports logging.


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ColdFire
Member
Join Date: Jan 2008
Plugin ID:
724
Plugin Version:
1.0
Plugin Category:
Statistical
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Since TF2 doesn't log healing and teleports, this plugin writes this data at player disconnection.
    Unapprover:
    Reason for Unapproving:
    Unfixed errors for a year. Also, teleports and medic heals are now logged by the game as of a few months ago.
    Old 01-16-2009 , 04:23   [TF2] Healing and Teleports logging.
    Reply With Quote #1

    Since TF2 does not log healing done by medics and engies (with their dispenser) and the teleports, I wrote some monthes ago this plugin who writes this data at player disconnection (and there's a disconnect event at each map change) so no stat can be lost.

    It's written as "triggers" events because I wrote this plugin to parse that data with Psychostats to give skill bonus to medics and engies.

    Examples:
    Code:
    Healing:
    L 01/15/2009 - 23:44:06: "player1<109><STEAM_0:0:xxxx><Blue>" triggered "healed" (heal "17050")
    L 01/15/2009 - 23:44:06: "player2<95><STEAM_0:0:xxxxx><Red>" triggered "healed" (heal "0")
    L 01/15/2009 - 23:44:08: "player3<105><STEAM_0:0:xxxx><Red>" triggered "healed" (heal "0")
    
    or for Teleports:
    
    L 01/15/2009 - 22:35:09: "player1<80><STEAM_0:0:xxxxxx><Blue>" triggered "teleported" (teleport "1")
    L 01/15/2009 - 22:35:09: "player2<87><STEAM_0:0:xxxxxx><Red>" triggered "teleported" (teleport "34")
    L 01/15/2009 - 22:35:09: "player3<58><STEAM_0:0:xxxxxx><Blue>" triggered "teleported" (teleport "0")
    Guess I could skip the log line when teleport or healing is 0.
    sdktools needed.

    For Psychostats: perhaps you can do cleaner, but here is how I did. Edit the file lib/Game/halflife/tf2.pm
    Find this line in the sub event_plrtrigger:
    Code:
            } elsif ($trigger eq 'revenge') {
    and insert above it:
    Code:
            } elsif ($trigger eq 'healed') {
                    my $props = $self->parseprops($propstr);
                    my $compteur ;
                    for ($compteur=0, $compteur <= int($props->{heal} / 150), $compteur++)
                    {
                            $self->plrbonus('healing', 'enactor', $p1) ;
                    }
            } elsif ($trigger eq 'teleported') {
                    my $props = $self->parseprops($propstr);
                    my $compteur ;
                    for ($compteur=0, $compteur <= int($props->{teleport} / 5), $compteur++)
                    {
                            $self->plrbonus('teleport', 'enactor', $p1) ;
                    }
    With this example code, a medic or an engy will get 1 skill point per 150 hp healing, and engies will get 1 skill point for 5 teleportations. Change the numbers in bold to edit the ratio.
    I was using 200hp for healing and 10 teleports but thought it was not enough, adjust as you wish.
    Attached Files
    File Type: sp Get Plugin or Get Source (tf2moreinfo.sp - 1259 views - 1.2 KB)
    File Type: smx tf2moreinfo.smx (2.4 KB, 404 views)
    __________________

    Last edited by ColdFire; 01-17-2009 at 10:02. Reason: adding Psychostats code
    ColdFire is offline
    flubber
    Senior Member
    Join Date: Oct 2007
    Old 01-16-2009 , 13:08   Re: [TF2] Healing and Teleports logging.
    Reply With Quote #2

    Nice one Coldfire, can you explain how to modify psychostats to enable those new logs?
    flubber is offline
    BrutalGoerge
    AlliedModders Donor
    Join Date: Jul 2007
    Old 01-16-2009 , 15:29   Re: [TF2] Healing and Teleports logging.
    Reply With Quote #3

    Quote:
    Originally Posted by flubber View Post
    Nice one Coldfire, can you explain how to modify psychostats to enable those new logs?
    you just going into your psychostats admin, manage, and bonuses, and add those events as bonuses.
    __________________
    My Pluggies If you like, consider to me.
    BrutalGoerge is offline
    ColdFire
    Member
    Join Date: Jan 2008
    Old 01-17-2009 , 12:46   Re: [TF2] Healing and Teleports logging.
    Reply With Quote #4

    Explanations done! Don't hesitate to reply if you need more info
    __________________
    ColdFire is offline
    urus
    Senior Member
    Join Date: Jan 2007
    Old 02-09-2009 , 09:51   Re: [TF2] Healing and Teleports logging.
    Reply With Quote #5

    Thanks. Good plugin.
    So we need to add this bonuses in acp on bonuses page?

    Event Name: healed / teleported
    Enactor: 1
    Game Type: halflife
    MOD Type: tf2
    __________________
    urus is offline
    mata
    Junior Member
    Join Date: Jun 2008
    Old 02-11-2009 , 08:45   Re: [TF2] Healing and Teleports logging.
    Reply With Quote #6

    Is it possible to get it to print when/after it happens instead of on disconnect?
    mata is offline
    Cadav0r
    Senior Member
    Join Date: Jan 2006
    Location: France
    Old 02-22-2009 , 13:45   Re: [TF2] Healing and Teleports logging.
    Reply With Quote #7

    I have some errors with this plugin
    Code:
    L 02/22/2009 - 00:32:40: [SM] Native "GetEntProp" reported: Entity 17 is invalid
    L 02/22/2009 - 00:32:40: [SM] Displaying call stack trace for plugin "tf2moreinfo.smx":
    L 02/22/2009 - 00:32:40: [SM]   [0]  Line 29, /home/groups/sourcemod/upload_tmp/phpG7aOzD.sp::OnClientDisconnect()
    L 02/22/2009 - 00:35:52: [SM] Native "GetEntProp" reported: Entity 5 is invalid
    L 02/22/2009 - 00:35:52: [SM] Displaying call stack trace for plugin "tf2moreinfo.smx":
    L 02/22/2009 - 00:35:52: [SM]   [0]  Line 29, /home/groups/sourcemod/upload_tmp/phpG7aOzD.sp::OnClientDisconnect()
    L 02/22/2009 - 00:41:32: [SM] Native "GetEntProp" reported: Entity 17 is invalid
    L 02/22/2009 - 00:41:32: [SM] Displaying call stack trace for plugin "tf2moreinfo.smx":
    L 02/22/2009 - 00:41:32: [SM]   [0]  Line 29, /home/groups/sourcemod/upload_tmp/phpG7aOzD.sp::OnClientDisconnect()
    L 02/22/2009 - 00:46:59: [SM] Native "GetEntProp" reported: Entity 26 is invalid
    L 02/22/2009 - 00:46:59: [SM] Displaying call stack trace for plugin "tf2moreinfo.smx":
    L 02/22/2009 - 00:46:59: [SM]   [0]  Line 29, /home/groups/sourcemod/upload_tmp/phpG7aOzD.sp::OnClientDisconnect()
    TF2 Linux
    SM 1.1
    MM:S 1.7
    __________________
    P.S : Sorry for my english but I'm French

    My plugins : Admin Sounds




    Cadav0r is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 23:55.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode