Помогите переписать под SAM пожалуйста)

Помогите переписать функцию логов с ULX под SAM админку)

SLogs:Hook( "ULibPostTranslatedCommand", function( ply, command, args )

	local target
	if istable( args[ 2 ] ) and IsValid( args[ 2 ][ 1 ] ) and args[ 2 ][ 1 ]:IsPlayer( ) then
		target = args[ 2 ][ 1 ]
	end

	local args_str = nil
	for k,v in next, args, target and 2 or 1 do
		if isbool( v ) then continue end
		args_str = (args_str or "") .. (args_str and ", " or "") .. tostring( v )
	end

	if target then
		return {
			T = ULXID,
			I = Either( args_str, 0, 2 ),
			E = {
				ply1 = SLogs:ValidCall( ply, "GetName" ) or "КОНСОЛЬ",
				ply2 = SLogs:ValidCall( target, "GetName" ),

				sid1 = SLogs:ValidCall( ply, "SteamID" ),
				sid2 = SLogs:ValidCall( target, "SteamID" ),

				str1 = command,
				str2 = args_str,
			}
		}
	else
		return {
			T = ULXID,
			I = Either( args_str, 1, 3 ),
			E = {
				ply1 = SLogs:ValidCall( ply, "GetName" ) or "КОНСОЛЬ",

				sid1 = SLogs:ValidCall( ply, "SteamID" ),

				str1 = command,
				str2 = args_str,
			}
		}
	end

end )