SA:MP Lua [LUA] ChatLog

Niourozi

Новичок
Автор темы
11
8
Версия SA-MP
  1. 0.3.7 (R1)
  2. 0.3.7-R3
  3. Любая
Logs every line that appears in the SA-MP chat and lets you browse, search, and copy it from a clean ImGui window — including local messages added by other scripts and plugins, not just server messages.


The hook attaches directly to CChat::RenderEntry inside samp.dll so it catches everything that actually gets rendered on screen: server messages, chat messages, system messages from scripts, colored lines from plugins, all of it. On versions where the hook isn't available it falls back gracefully to samp.events + a chat buffer poll, so it still works, just without the render-level capture.


Usage
/chatlog — opens and closes the window.


Features
  • Captures all chat lines including those injected by local scripts and plugins, not just what samp.events sees
  • Full text selection with mouse drag — click and drag across any line or across multiple lines, just like a text editor. Ctrl+C copies the current selection to clipboard
  • Real-time filter bar — type anything and the log instantly narrows down to matching lines
  • Sessions: each game session gets its own folder under moonloader\config\chatlogs, with raw.log (color tags included) and clean.log (plain text), plus a meta.txt with server name, player name, start and end time
  • Session browser on the right panel — switch between past sessions and inspect their info without leaving the window
  • If a session was interrupted (game crash, etc.) it resumes into the same session on next launch instead of creating a new one
  • Black minimal theme, animated background particles, Font Awesome icons

Compatibility
Works on SA-MP R1 and R3 with the full render hook. On any other version the hook step is skipped and a message is shown in chat — logging still works through events and buffer polling.


Notes
Text selection works per-character, handles horizontal scroll, and auto-scrolls when you drag near the edges. The SA-MP color tags ({RRGGBB}) are stripped for the clean log and for copying, but rendered with their actual colors inside the window. Color conversion handles the ABGR to ARGB to ImU32 difference that trips up a lot of chat scripts.

If you have ideas for improvements or run into issues on a specific server setup, I'm open to feedback.


Author:
Niourozi

Demo:

sa-mp-005.png
 

Вложения

  • ChatLog.lua
    41.8 KB · Просмотры: 12
  • Нравится
Реакции: Mr_kaneki и Deps