ดึงข้อมูลผู้เล่นที่ระบบแอดมินเก็บไว้ใน Cache
local players = exports.mrft_admin:GetCachedPlayers()
if players then
for playerId, data in pairs(players) do
print(playerId, data.name)
end
end
ดึงข้อมูลแอดมินที่ออนไลน์อยู่ในขณะนั้น
local admins = exports.mrft_admin:GetCachedAdmins()
for playerId, group in pairs(admins) do
print(playerId, group)
end
ดึงรายการรายงานผู้เล่นทั้งหมด
local reports = exports.mrft_admin:GetReports()
for i, report in pairs(reports) do
print(report.caseId)
end
แบนผู้เล่นจาก Server สามารถแบนผู้เล่นที่ออนไลน์อยู่ด้วย targetId หรือแบนผู้เล่นออฟไลน์ด้วย identifier
targetId (number): ID ผู้เล่น ใช้เมื่อผู้เล่นออนไลน์อยู่identifier (string): Steam Hex ของผู้เล่น ใช้เมื่อไม่มี targetIdreason (string): เหตุผลในการแบนduration (number หรือ string): ระยะเวลาแบน หน่วยเป็นชั่วโมง หรือใช้ค่า "forever" สำหรับแบนถาวรexports.mrft_admin:Ban(playerId, nil, "ชนมั่ว", 10) -- แบนผู้เล่นขณะออนไลน์
exports.mrft_admin:Ban(nil, "steam:11000012345678", "โปร", "forever") -- แบนขณะออฟไลน์
สั่งให้ผู้เล่นหนึ่งคนดูหน้าจอของผู้เล่นเป้าหมาย
watcherId (number): ID ผู้เล่นที่เป็นผู้ดูจอtargetId (number): ID ผู้เล่นเป้าหมายlocal watcherId = source
local targetId = 12
exports.mrft_admin:WatchScreen(watcherId, targetId)
หยุดสถานะการดูจอของผู้เล่น
playerId (number): ID ผู้เล่นที่กำลังดูจออยู่local playerId = source
exports.mrft_admin:StopWatchScreen(playerId)
ตรวจสอบว่าผู้เล่นกำลังดูจออยู่หรือไม่
playerId (number): ID ผู้เล่นที่ต้องการตรวจสอบlocal playerId = source
local isWatching = exports.mrft_admin:IsWatchingScreen(playerId)
print(isWatching)