Remove ulx checklua

This commit is contained in:
Redox 2024-05-23 02:19:58 +02:00 committed by GitHub
parent 391e11acbb
commit de8fe386eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,41 +0,0 @@
CFCUlxCommands.checklua = CFCUlxCommands.checklua or {}
local cmd = CFCUlxCommands.checklua
local CATEGORY_NAME = "Utility"
if SERVER then
util.AddNetworkString( "CFC_ULX_StatCheckCL" )
util.AddNetworkString( "CFC_ULX_StatCheckSV" )
end
local awaitingResponse = {}
net.Receive( "CFC_ULX_StatCheckSV", function( _, ply )
if not awaitingResponse[ply] then return end
local convar = net.ReadBool()
ulx.fancyLogAdmin( awaitingResponse[ply], true, "#T's sv_allowcslua value is " .. tostring( convar ), ply )
awaitingResponse[ply] = nil
end )
function cmd.checkluaPlayers( callingPlayer, targetPlayers )
for _, ply in ipairs( targetPlayers ) do
awaitingResponse[ply] = callingPlayer
net.Start( "CFC_ULX_StatCheckCL" )
net.Send( ply )
end
end
if CLIENT then
net.Receive( "CFC_ULX_StatCheckCL", function()
local convarBool = GetConVar( "sv_allowcslua" ):GetBool()
net.Start( "CFC_ULX_StatCheckSV" )
net.WriteBool( convarBool )
net.SendToServer()
end )
end
local checkluaCommand = ulx.command( CATEGORY_NAME, "ulx checklua", cmd.checkluaPlayers, "!checklua" )
checkluaCommand:addParam{ type = ULib.cmds.PlayersArg }
checkluaCommand:defaultAccess( ULib.ACCESS_ADMIN )
checkluaCommand:help( "Checks target(s) sv_allowcslua, true means they modified their client value." )