Statlog

From EventScripts Community Encyclopedia

Contents

Overview

Syntax: statlog <identifier> <event>
Note: Command parameters are described inside the < and > characters. Optional parameters are contained within [ and ] characters.

Description

Trigger an event that can be parsed by stat programs such as HLstatsX.

by Wonder


Note: It doesn't expand server variables. Prefix the command with es to expand variables (es statlog).

Parameters

  • identifier - the identifier of who will trigger the event
  • event - the event that should be triggered

<userComments></userComments>

Identifiers

In Counter-Strike Source: userid, #t or #ct
In Day of Defeat: Source: userid, #a or #x
In Half-Life 2: Deathmatch: userid, #c or #r (only userid is available in non-team deathmatch!)
In Half-Life 2: CTF: userid, #c or #r
In SourceForts: userid, #b or #r

Examples

es statlog event_var(userid) User_Wants_Points
// this would trigger the event:
// L 11/18/2006 - 09:50:26: "Team iNet | Wonder<2><STEAM_0:0:10468772><TERRORIST>" triggered "User_Wants_Points"
 
statlog #t Won_NodeRunner
// this would trigger the event:
// L 11/18/2006 - 09:50:26: Team "TERRORIST" triggered "Won_NodeRunner"
 
block _statlog
{
  // when an event is triggered with statlog all _statlog blocks in scripts are called.
  // _statlog_event = holds the event triggered
  // _statlog_userid = holds the userid or identifier
  if (server_var(_statlog_event) == gg_win) do
  {
    // make sure a player won and not a team.
    // use in/notin to check for #. if # is found then it is an identifier
    if (# notin server_var(_statlog_userid)) do
    {
      // kill the winner!
      es_sexec server_var(_statlog_userid) kill
    }
  }
}

Notes

  • Included in EventScripts v1.3.
  • When an event is triggered with statlog all _statlog blocks found in scripts are called.
  • You should use in/notin against the # character to check if a team/player triggered the event.

See Also

blog comments powered by Disqus