• สินค้าทั้งหมด
  • Studio
  • คู่มือการใช้งาน
  • Client Exports
  • Server Exports
Docs > Admin System > Server Exports

mrft_admin:GetCachedPlayers()#

ดึงข้อมูลผู้เล่นที่ระบบแอดมินเก็บไว้ใน Cache

ตัวอย่าง#

local players = exports.mrft_admin:GetCachedPlayers()
if players then
   for playerId, data in pairs(players) do
        print(playerId, data.name)
   end
end

mrft_admin:GetCachedAdmins()#

ดึงข้อมูลแอดมินที่ออนไลน์อยู่ในขณะนั้น

ตัวอย่าง#

local admins = exports.mrft_admin:GetCachedAdmins()
for playerId, group in pairs(admins) do
    print(playerId, group)
end

mrft_admin:GetReports()#

ดึงรายการรายงานผู้เล่นทั้งหมด

ตัวอย่าง#

local reports = exports.mrft_admin:GetReports()
for i, report in pairs(reports) do
   print(report.caseId)
end

mrft_admin:Ban()#

แบนผู้เล่นจาก Server สามารถแบนผู้เล่นที่ออนไลน์อยู่ด้วย targetId หรือแบนผู้เล่นออฟไลน์ด้วย identifier

Parameters#

  • targetId (number): ID ผู้เล่น ใช้เมื่อผู้เล่นออนไลน์อยู่
  • identifier (string): Steam Hex ของผู้เล่น ใช้เมื่อไม่มี targetId
  • reason (string): เหตุผลในการแบน
  • duration (number หรือ string): ระยะเวลาแบน หน่วยเป็นชั่วโมง หรือใช้ค่า "forever" สำหรับแบนถาวร

ตัวอย่าง#

exports.mrft_admin:Ban(playerId, nil, "ชนมั่ว", 10) -- แบนผู้เล่นขณะออนไลน์
exports.mrft_admin:Ban(nil, "steam:11000012345678", "โปร", "forever") -- แบนขณะออฟไลน์

mrft_admin:WatchScreen()#

สั่งให้ผู้เล่นหนึ่งคนดูหน้าจอของผู้เล่นเป้าหมาย

Parameters#

  • watcherId (number): ID ผู้เล่นที่เป็นผู้ดูจอ
  • targetId (number): ID ผู้เล่นเป้าหมาย

ตัวอย่าง#

local watcherId = source
local targetId = 12

exports.mrft_admin:WatchScreen(watcherId, targetId)

mrft_admin:StopWatchScreen()#

หยุดสถานะการดูจอของผู้เล่น

Parameters#

  • playerId (number): ID ผู้เล่นที่กำลังดูจออยู่

ตัวอย่าง#

local playerId = source

exports.mrft_admin:StopWatchScreen(playerId)

mrft_admin:IsWatchingScreen()#

ตรวจสอบว่าผู้เล่นกำลังดูจออยู่หรือไม่

Parameters#

  • playerId (number): ID ผู้เล่นที่ต้องการตรวจสอบ

ตัวอย่าง#

local playerId = source
local isWatching = exports.mrft_admin:IsWatchingScreen(playerId)

print(isWatching)
On this page
  • mrftadmin:GetCachedPlayers()
  • mrftadmin:GetCachedAdmins()
  • mrftadmin:GetReports()
  • mrftadmin:Ban()
  • mrftadmin:WatchScreen()
  • mrftadmin:StopWatchScreen()
  • mrftadmin:IsWatchingScreen()