Raised This Month: $75 Target: $400
 18% 

[INC] loghelper (updated 2010-05-27)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
psychonic

BAFFLED
Join Date: May 2008
Old 08-12-2009 , 09:27   [INC] loghelper (updated 2010-05-27)
Reply With Quote #1

This is an include I wrote for use with my SuperLogs plugin set. It has stocks for many HL Standard log line formats, and also gets around the current limitations of Sourcemod's %L format operator and FormatUserLogText() function (not including team name on log line). This makes it very easy to add HLstatsX(:CE) or Psychostats support to a plugin.

All included functions are stocks so they are only compiled in with the plugin if uses, or feel free to copy individual functions so as to not create a dependency on the include.

Note: you must call the GetTeams() function during OnMapStart() to correctly cache team names.

PHP Code:
// Caches team names. Run during OnMapStart()
stock GetTeams(bool:insmod false)

// Player Event (Ex. "player<userid><steamid><team>" triggered "something" (position "55 -23 0") (property1 "value1")
stock LogPlayerEvent(client, const String:verb[], const String:event[], bool:display_location false, const String:properties[] = "")

// Player-Player Event (similar to player event, ex. "player" triggered "something" against "player2")
stock LogPlyrPlyrEvent(clientvictim, const String:verb[], const String:event[], bool:display_location false, const String:properties[] = "")

// Kill (logs a kills in regular format, ex. "player1" killed "player2" with "weapon")
stock LogKill(attackervictim, const String:weapon[], bool:display_location false, const String:properties[] = "")

// Suicide (logs a suicide in regular format, ex. "player" commited suicide with "weapon")
stock LogSuicide(victim, const String:weapon[], bool:display_location false, const String:properties[] = "")

// Team Event (Ex. Team "teamname" triggered "something")
stock LogTeamEvent(team, const String:verb[], const String:event[], const String:properties[] = "")

// Team change (Ex. "player" joined team "teamname")
stock LogTeamChange(clientnewteam, const String:properties[] = "")

// Role/Class change (Ex. "player" changed role to "class1")
stock LogRoleChange(client, const String:role[], const String:properties[] = "")

// Psychostats "KTRAJ" location log line
stock LogPSKillTraj(attackervictim, const String:weapon[])

stock LogKillLoc(attackervictim)
stock LogMapLoad()
stock IsValidPlayer(client
Updated 2015-12-21
- Replaced instances of deprecated GetClientAuthString
- Converted to use SourcePawn 1.7 Transitional Syntax
- Changed IsValidPlayer function to be static to avoid conflict when included in a plugin with function of same name.

Updated 2009-11-09
- Fixed formatting of position logging for plyrplyr events
- Added version define (starting with "#define LOGHELPER_VERSION 2")

Updated 2010-2-13
- Added Psychostats KTRAJ logging
Attached Files
File Type: inc loghelper.inc (9.3 KB, 1522 views)

Last edited by psychonic; 12-21-2015 at 11:27.
psychonic is offline
nightrider
SourceMod Donor
Join Date: Dec 2008
Old 09-23-2009 , 20:36   Re: [INC] loghelper
Reply With Quote #2

I can't wait to try this and the SuperLogs plugin

Thank You
__________________
[SIGPIC][/SIGPIC] the pantless
I am the Night Rider!, I'm a fuel-injected suicide machine.
I am a rocker! I am a roller!, I am an out-of-controller!


nightrider is offline
Nicolayka
Member
Join Date: Nov 2010
Old 10-12-2011 , 14:53   Re: [INC] loghelper (updated 2010-05-27)
Reply With Quote #3

Thank You
Nicolayka is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 12-22-2011 , 02:20   Re: [INC] loghelper (updated 2010-05-27)
Reply With Quote #4

Seeing lots of error spam like that lately in css.
Code:
L 12/22/2011 - 03:17:50: [SM] Native "GetTeamName" reported: Team index 0 is invalid
L 12/22/2011 - 03:17:50: [SM] Displaying call stack trace for plugin "superlogs-css.smx":
L 12/22/2011 - 03:17:50: [SM]   [0]  Line 18, C:\Users\nshastings\Desktop\sm\11scripting\13scripting\include\loghelper.inc::GetTeams()
L 12/22/2011 - 03:17:50: [SM]   [1]  Line 160, superlogs-css.sp::OnMapStart()
__________________
Peace-Maker is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 08-18-2013 , 13:22   Re: [INC] loghelper (updated 2010-05-27)
Reply With Quote #5

Quote:
Originally Posted by Peace-Maker View Post
Seeing lots of error spam like that lately in css.
Code:
L 12/22/2011 - 03:17:50: [SM] Native "GetTeamName" reported: Team index 0 is invalid
L 12/22/2011 - 03:17:50: [SM] Displaying call stack trace for plugin "superlogs-css.smx":
L 12/22/2011 - 03:17:50: [SM]   [0]  Line 18,  C:\Users\nshastings\Desktop\sm\11scripting\13scripting\include\loghelper.inc::GetTeams()
L 12/22/2011 - 03:17:50: [SM]   [1]  Line 160, superlogs-css.sp::OnMapStart()
Here's a version, which doesn't call GetTeamName on index 0 and just statically names team 0 "Unassigned".
Attached Files
File Type: inc loghelper.inc (9.0 KB, 355 views)
__________________
Peace-Maker is offline
psychonic

BAFFLED
Join Date: May 2008
Old 08-18-2013 , 13:23   Re: [INC] loghelper (updated 2010-05-27)
Reply With Quote #6

Quote:
Originally Posted by Peace-Maker View Post
Here's a version, which doesn't call GetTeamName on index 0 and just statically names team 0 "Unassigned".
That sounds like a regression in SDKTools. GetTeamName with an index of 0 should be fine.
psychonic is offline
Rippii
New Member
Join Date: Jan 2015
Old 01-21-2015 , 18:03   Re: [INC] loghelper (updated 2010-05-27)
Reply With Quote #7

where do i put the .inc file
Rippii is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 01-21-2015 , 18:05   Re: [INC] loghelper (updated 2010-05-27)
Reply With Quote #8

Quote:
Originally Posted by Rippii View Post
where do i put the .inc file
...Inside of the include folder under scripting?
__________________
Not Taking Commissions, Discord: Drixevel#5049 | Dev Site
Drixevel is offline
Sunnych
New Member
Join Date: Mar 2015
Old 03-10-2015 , 20:21   [INC] loghelper (updated 2010-05-27) ? Help!
Reply With Quote #9

CS:GO server version 171, instance idx 1
sm version
SourceMod Version Information:
SourceMod Version: 1.6.3-dev+4577
SourcePawn Engine: SourcePawn 1.2, jit-x86 (build 1.6.3-dev+4577)
SourcePawn API: v1 = 4, v2 = 6
Compiled on: Sep 20 2014 106:45
Built from: https://github.com/alliedmodders/sou...commit/5c13a0b
Build ID: 4577:5c13a0b
http://www.sourcemod.net/
meta list
Listing 4 plugins:
[01] SourceMod (1.6.3-dev+4577) by AlliedModders LLC
[02] CS Tools (1.6.3-dev+4577) by AlliedModders LLC
[03] SDK Tools (1.6.3-dev+4577) by AlliedModders LLC
[04] SDK Hooks (1.6.3-dev+4577) by AlliedModders LLC
sm exts list
[SM] Displaying 14 extensions:
[01] Automatic Updater (1.6.3-dev+4577): Updates SourceMod gamedata files
[02] Webternet (1.6.3-dev+4577): Extension for interacting with URLs
[03] CS Tools (1.6.3-dev+4577): CS extended functionality
[04] BinTools (1.6.3-dev+4577): Low-level C/C++ Calling API
[05] SDK Tools (1.6.3-dev+4577): Source SDK Tools
[06] Top Menus (1.6.3-dev+4577): Creates sorted nested menus
[07] GeoIP (1.6.3-dev+4577): Geographical IP information
[08] Client Preferences (1.6.3-dev+4577): Saves client preference settings
[09] SQLite (1.6.3-dev+4577): SQLite Driver
[10] SDK Hooks (1.6.3-dev+4577): Source SDK Hooks
[11] cURL Extension (1.3.0.0): cURL Extension
[12] Regex (1.6.3-dev+4577): Provides regex natives for plugins
[13] Socket (3.0.1): Socket extension for SourceMod
[14] <FAILED> file "steamtools.ext.dll": ═х эрщфхэ єърчрээ√щ ьюфєы№.
sm plugins list
[SM] Listing 31 plugins:
01 "Admin File Reader" (1.6.3-dev+4577) by AlliedModders LLC
02 "Admin Help" (1.6.3-dev+4577) by AlliedModders LLC
03 "Admin Menu" (1.6.3-dev+4577) by AlliedModders LLC
04 "Advertisements" (0.6 CSGO-1.1) by Tsunami (CSGO FIX ╨д╨╡╨╜╨╕╨║╤Б)
05 "Anti-Flood" (1.6.3-dev+4577) by AlliedModders LLC
06 "Basic Ban Commands" (1.6.3-dev+4577) by AlliedModders LLC
07 "Basic Chat" (1.6.3-dev+4577) by AlliedModders LLC
08 "Basic Comm Control" (1.6.3-dev+4577) by AlliedModders LLC
09 "Basic Commands" (1.6.3-dev+4577) by AlliedModders LLC
10 "Basic Info Triggers" (1.6.3-dev+4577) by AlliedModders LLC
11 "Basic Votes" (1.6.3-dev+4577) by AlliedModders LLC
12 "CD Announcer" (2.9) by Fredd, gH0sTy, MOPO3KO
13 "Client Preferences" (1.6.3-dev+4577) by AlliedModders LLC
14 "CS:GO Admin ESP" (2.1) by Root
15 "cURL self test" (1.1.0.0) by Raydan
16 "Custom Player Skins (Core)" (1.2.0) by Mitchell, Root
17 "Fun Commands" (1.6.3-dev+4577) by AlliedModders LLC
18 "Fun Votes" (1.6.3-dev+4577) by AlliedModders LLC
19 "HLstatsX CE Ingame Plugin" (1.6.19) by psychonic
20 <Error> "[INS] Logger" (1.2.0) by Jared Ballou
21 "listen socket example" (1.0.1) by Player
22 "Player Commands" (1.6.3-dev+4577) by AlliedModders LLC
23 "Reserved Slots" (1.6.3-dev+4577) by AlliedModders LLC
24 "Resetscore+" (1.4.1) by AlmazON
25 "socket extension selftest" (1.1.0) by Player
26 "Knife Upgrade" (2.5.2) by Klexen
27 "socket example" (1.1.0) by Player
28 "Sound Commands" (1.6.3-dev+4577) by AlliedModders LLC
29 "SuperLogs: CSS" (1.2.4) by psychonic
30 "SwapTeam" (1.2.6) by Rogue - Originally by MistaGee
31 "Updater" (1.2.1) by GoD-Tony
Load Errors:
[INS] Logger: Error detected in plugin startup (see error logs)
how to fix it

Last edited by Sunnych; 03-10-2015 at 20:38.
Sunnych is offline
psychonic

BAFFLED
Join Date: May 2008
Old 03-10-2015 , 20:59   Re: [INC] loghelper (updated 2010-05-27) ? Help!
Reply With Quote #10

Quote:
Originally Posted by Sunnych View Post
Load Errors:
[INS] Logger: Error detected in plugin startup (see error logs)
how to fix it
Try posting in the thread of that [INS] Logger plugin.
psychonic is offline
Reply


Thread Tools
Display Modes

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 05:35.


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