Export Functions (Server-side)
ส่งออกฟังก์ชันเพื่อให้สามารถเรียกใช้จากทรัพยากรอื่นได้ทางฝั่ง Server
executeCommand
เรียกใช้งาน คำสั่งต่างๆ ของทรัพยากรนี้
- Usage
- Example
exports.azael_playpass:executeCommand(subCommandKey, args)
local success, response = exports.azael_playpass:executeCommand('getUser', { '443334508020891658' })
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- subCommandKey:
string- คีย์ของ คำสั่งย่อย (ดูคีย์ได้ที่ Subcommand List)
- args:
table<{ [index]: any }>|nil- ข้อมูลที่คำสั่งต้องการ
Returns
- success:
boolean- สถานะการใช้งานคำสั่ง
- response:
table<{ [key]: any }>- ข้อมูลตอบกลับของคำสั่ง
รายละเอียดข้อมูลตอบกลับของคำสั่ง
ข้อมูลตอบกลับเมื่อใช้คำสั่งสำเร็จ คุณสามารถดูรายละเอียดได้ที่ respHandler
ข้อมูลตอบกลับเมื่อใช้คำสั่งล้มเหลว
| Field | Type | Description |
|---|---|---|
type | string | ประเภทของข้อผิดพลาด |
message | string | ข้อความของข้อผิดพลาด |
Subcommand List
| Key | Label |
|---|---|
getUser | รับข้อมูลผู้ใช้ |
addUser | เพิ่มข้อมูลผู้ใช้ |
deleteUser | ลบข้อมูลผู้ใช้ |
getBanInfo | รับข้อมูลแบนผู้ใช้ |
banUser | แบนผู้ใช้ (ชั่วคราว/ถาวร) |
unbanUser | ยกเลิกแบนผู้ใช้ |
setUserRole | กำหนดบทบาทผู้ใช้ |
deactivateUser | ปิดใช้งานบัญชีผู้ใช้ |
reactivateUser | เปิดใช้งานบัญชีผู้ใช้ (ไม่เล่นนานเกินกำหนด) |
setNewIdentifier | กำหนดตัวระบุใหม่ให้ผู้ใช้ |
resetBindIdentifier | รีเซ็ตตัวระบุที่ผูกไว้ของผู้ใช้ |
resetHwids | รีเซ็ต HWIDs ผู้ใช้ |
getPoints | รับข้อมูลคิวพอยท์ผู้ใช้ |
addPoints | เพิ่มคิวพอยท์ผู้ใช้ |
setPermanentPoints | กำหนดคิวพ้อยท์ถาวรผู้ใช้ |
deleteTemporaryPoints | ลบคิวพ้อยท์ชั่วคราวผู้ใช้ |
purgePoints | ลบคิวพ้อยท์ทั้งหมดของผู้ใช้ |
getAirtime | รับแอร์ไทม์คงเหลือผู้ใช้ |
setAirtime | กำหนดแอร์ไทม์ผู้ใช้ |
addAirtime | เพิ่มแอร์ไทม์ผู้ใช้ |
removeAirtime | ลบแอร์ไทม์ผู้ใช้ |
clearPlayerCache | ล้างแคชข้อมูลผู้เล่น |
purgeQueue | ล้างคิวทั้งหมด |
addQueueBypass | เพิ่มสิทธิ์การข้ามคิว |
getQueueInfo | รับข้อมูลระบบคิว |
getUser
รับข้อมูลผู้ใช้งาน
- Usage
- Example
exports.azael_playpass:getUser(identifier)
local success, response = exports.azael_playpass:getUser('443334508020891658')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลผู้ใช้งาน หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
addUser
เพิ่มข้อมูลผู้ใช้
- Usage
- Example
exports.azael_playpass:addUser(identifier, boundId|nil)
local success, response = exports.azael_playpass:addUser('discord:443334508020891658', 'steam:11000013d071520')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
- boundId:
string|nil- ตัวระบุที่จะถูกผูก เอาไว้กับ ตัวระบุหลัก ของผู้ใช้
- ⚠️ ไม่จำเป็นที่จะต้องระบุในส่วนนี้ เนื่องจากระบบจะอัปเดตไปยังฐานข้อมูลโดยอัตโนมัติเมื่อผู้เล่นเชื่อมต่อกับเซิร์ฟเวอร์
- ตัวระบุที่จะถูกผูก เอาไว้กับ ตัวระบุหลัก ของผู้ใช้
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลผู้ใช้งาน หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
deleteUser
ลบข้อมูลผู้ใช้
- Usage
- Example
exports.azael_playpass:deleteUser(identifier)
local success, response = exports.azael_playpass:deleteUser('443334508020891658')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลผู้ใช้งาน หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
getBanInfo
รับข้อมูลแบนผู้ใช้
- Usage
- Example
exports.azael_playpass:getBanInfo(identifier|banRefId)
Ban Ref ID
local success, response = exports.azael_playpass:getBanInfo('66555-568s5-26075')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
Identifier
local success, response = exports.azael_playpass:getBanInfo('443334508020891658')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier | banRefId:
string- ตัวระบุหลัก ของผู้ใช้ หรือ รหัสอ้างอิงการถูกแบน
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลการถูกแบน หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
banUser
แบนผู้ใช้ ชั่วคราว หรือ ถาวร
- Usage
- Example
exports.azael_playpass:banUser(identifier, numDays|0=permanent, reason)
Permanent Ban (แบนถาวร)
local success, response = exports.azael_playpass:banUser('443334508020891658', 0, 'Banned for repeatedly stealing the last slice of pizza.')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
Temporary Ban (แบนชั่วคราว)
local success, response = exports.azael_playpass:banUser('443334508020891658', 90, 'Banned for repeatedly stealing the last slice of pizza.')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
- numDays:
integer- จำนวนวันที่ต้องการแบนผู้ใช้ หรือระบุ
0เพื่อแบนผู้ใช้ถาวร
- จำนวนวันที่ต้องการแบนผู้ใช้ หรือระบุ
- reason:
string- เหตุผลที่แบนผู้ใช้
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลการถูกแบน หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
unbanUser
ยกเลิกแบนผู้ใช้
- Usage
- Example
exports.azael_playpass:unbanUser(identifier)
local success, response = exports.azael_playpass:unbanUser('443334508020891658')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลการถูกแบน หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
setUserRole
กำหนดบทบาทผู้ใช้
- Usage
- Example
exports.azael_playpass:setUserRole(identifier, roleId)
local success, response = exports.azael_playpass:setUserRole('443334508020891658', 5)
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
- roleId:
integer- รหัสของบทบาท ที่ต้องการกำหนดให้ผู้ใช้
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลบทบาทผู้ใช้ หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
deactivateUser
ปิดใช้งานบัญชีผู้ใช้ ในกรณีกำลังตรวจสอบหรือดำเนินการเกี่ยวกับบัญชีของผู้ใช้อยู่ เพื่อไม่ให้ผู้ใช้สามารถเชื่อมต่อกับเซิร์ฟเวอร์ได้
- Usage
- Example
exports.azael_playpass:deactivateUser(identifier)
local success, response = exports.azael_playpass:deactivateUser('443334508020891658')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลสถานะผู้ใช้ หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
reactivateUser
เปิดใช้งานบัญชีผู้ใช้อีกครั้ง หรือ ยกเลิกสถานะการถูกระงับของผู้ใช้ จากสาเหตุไม่เข้าร่วมเซิร์ฟเวอร์นานเกินที่กำหนดใน inactivePlayers
- Usage
- Example
exports.azael_playpass:reactivateUser(identifier)
local success, response = exports.azael_playpass:reactivateUser('443334508020891658')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลสถานะผู้ใช้ หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
setNewIdentifier
กำหนดตัวระบุใหม่ให้ผู้ใช้
- Usage
- Example
exports.azael_playpass:setNewIdentifier(identifier, newIdentifier)
local success, response = exports.azael_playpass:setNewIdentifier('443334508020891658', '845951838691393546')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุเก่า ของผู้ใช้
- newIdentifier:
string- ตัวระบุใหม่ ของผู้ใช้
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลตัวระบุผู้ใช้ หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
resetBindIdentifier
รีเซ็ตตัวระบุที่ผูกไว้ของผู้ใช้
- Usage
- Example
exports.azael_playpass:resetBindIdentifier(identifier)
local success, response = exports.azael_playpass:resetBindIdentifier('443334508020891658')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลตัวระบุผู้ใช้ หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
resetHwids
รีเซ็ต HWIDs ของผู้ใช้
- Usage
- Example
exports.azael_playpass:resetHwids(identifier)
local success, response = exports.azael_playpass:resetHwids('443334508020891658')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูล HWIDs ผู้ใช้ หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
getPoints
รับข้อมูลคิวพอยท์ผู้ใช้
- Usage
- Example
exports.azael_playpass:getPoints(identifier)
local success, response = exports.azael_playpass:getPoints('443334508020891658')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลคิวพอยท์ผู้ใช้ หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
addPoints
เพิ่มคิวพอยท์ผู้ใช้
- Usage
- Example
exports.azael_playpass:addPoints(identifier, numPoints, expirationDays|nil)
Permanent Q-Points (คิวพ้อยท์ถาวร ไม่มีวันหมดอายุ)
local success, response = exports.azael_playpass:addPoints('443334508020891658', 1000)
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
Temporary Q-Points (คิวพ้อยท์ชั่วคราว มีวันหมดอายุ)
local success, response = exports.azael_playpass:addPoints('443334508020891658', 1000, 30)
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
- numPoints:
integer- จำนวนคิวพ้อยท์ที่ต้องการเพิ่มให้ผู้ใช้
- expirationDays:
integer|nil- จำนวนวันที่คิวพ้อยท์จะหมดอายุ หรือ ไม่ระบุหากเป็นคิวพ้อยท์แบบถาวร (ไม่มีวันหมดอายุ)
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลคิวพอยท์ผู้ใช้ หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
setPermanentPoints
กำหนดคิวพ้อยท์ถาวรผู้ใช้
- Usage
- Example
exports.azael_playpass:setPermanentPoints(identifier, numPoints)
local success, response = exports.azael_playpass:setPermanentPoints('443334508020891658', 2000)
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
- numPoints:
integer- จำนวนคิวพ้อยท์ที่ต้องการกำหนดให้ผู้ใช้
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลคิวพอยท์ผู้ใช้ หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
deleteTemporaryPoints
ลบคิวพ้อยท์ชั่วคราวของผู้ใช้ (คิวพ้อยท์แบบมีวันหมดอายุ)
- Usage
- Example
exports.azael_playpass:deleteTemporaryPoints(identifier, numIndex)
local success, response = exports.azael_playpass:deleteTemporaryPoints('443334508020891658', 2)
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
- numIndex:
integer- หมายเลข Index ของข้อมูลคิวพ้อยท์ชั่วคราวที่ต้องการลบ
- 💡 แนะนำให้ใช้ รับข้อมูลคิวพอยท์ผู้ใช้ เพื่อรับหมายเลข Index ที่ต้องการลบข้อมูล
- หมายเลข Index ของข้อมูลคิวพ้อยท์ชั่วคราวที่ต้องการลบ
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลคิวพอยท์ผู้ใช้ หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
purgePoints
ลบคิวพ้อยท์ทั้งหมดของผู้ใช้
- Usage
- Example
exports.azael_playpass:purgePoints(identifier)
local success, response = exports.azael_playpass:purgePoints('443334508020891658')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลคิวพอยท์ผู้ใช้ หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
getAirtime
รับแอร์ไทม์คงเหลือผู้ใช้
- Usage
- Example
exports.azael_playpass:getAirtime(identifier)
local success, response = exports.azael_playpass:getAirtime('443334508020891658')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลแอร์ไทม์ผู้ใช้ หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
setAirtime
กำหนดแอร์ไทม์ผู้ใช้
- Usage
- Example
exports.azael_playpass:setAirtime(identifier, numSeconds)
local success, response = exports.azael_playpass:setAirtime('443334508020891658', 18144000)
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
- numSeconds:
integer- จำนวนแอร์ไทม์ที่ต้องการกำหนดให้ผู้ใช้ โดยมีหน่วยเป็น วินาที
3600วินาที = 1 ชั่วโมง86400วินาที = 1 วัน604800วินาที = 7 วัน18144000วินาที = 30 วัน
- จำนวนแอร์ไทม์ที่ต้องการกำหนดให้ผู้ใช้ โดยมีหน่วยเป็น วินาที
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลแอร์ไทม์ผู้ใช้ หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
addAirtime
เพิ่มแอร์ไทม์ผู้ใช้
- Usage
- Example
exports.azael_playpass:addAirtime(identifier, numSeconds)
local success, response = exports.azael_playpass:addAirtime('443334508020891658', 604800)
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
- numSeconds:
integer- จำนวนแอร์ไทม์ที่ต้องการเพิ่มให้ผู้ใช้ โดยมีหน่วยเป็น วินาที
3600วินาที = 1 ชั่วโมง86400วินาที = 1 วัน604800วินาที = 7 วัน18144000วินาที = 30 วัน
- จำนวนแอร์ไทม์ที่ต้องการเพิ่มให้ผู้ใช้ โดยมีหน่วยเป็น วินาที
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลแอร์ไทม์ผู้ใช้ หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
removeAirtime
ลบแอร์ไทม์ผู้ใช้
- Usage
- Example
exports.azael_playpass:removeAirtime(identifier, numSeconds)
local success, response = exports.azael_playpass:removeAirtime('443334508020891658', 86400)
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
- numSeconds:
integer- จำนวนแอร์ไทม์ที่ต้องการเพิ่มให้ผู้ใช้ โดยมีหน่วยเป็น วินาที
3600วินาที = 1 ชั่วโมง86400วินาที = 1 วัน604800วินาที = 7 วัน18144000วินาที = 30 วัน
- จำนวนแอร์ไทม์ที่ต้องการเพิ่มให้ผู้ใช้ โดยมีหน่วยเป็น วินาที
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลแอร์ไทม์ผู้ใช้ หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
clearPlayerCache
ล้างแคชข้อมูลผู้เล่น
- Usage
- Example
exports.azael_playpass:clearPlayerCache(identifier)
local success, response = exports.azael_playpass:clearPlayerCache('443334508020891658')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลตัวระบุของผู้ใช้ หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
purgeQueue
ล้างคิวทั้งหมดที่กำลังรอเข้าร่วมกับเซิร์ฟเวอร์อยู่
- Usage
- Example
exports.azael_playpass:purgeQueue()
local success, response = exports.azael_playpass:purgeQueue()
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลผู้เล่นที่ถูกลบออกจากคิว หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
addQueueBypass
เพิ่มสิทธิ์การข้ามคิวเพื่อให้ผู้เล่นสามารถเข้าเซิร์ฟเวอร์ได้ทันที
- Usage
- Example
exports.azael_playpass:addQueueBypass(identifier, timeoutMinutes|nil)
local success, response = exports.azael_playpass:addQueueBypass('443334508020891658')
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
- timeoutMinutes:
integer|nil- ระยะเวลาสูงสุดที่ผู้เล่นต้องเข้าร่วมเซิร์ฟเวอร์ก่อนที่ระบบจะถือว่าหมดเวลา (หน่วยเป็นนาที)
- กำหนดค่าได้ตั้งแต่ 1 ถึง 30 นาที (หากไม่กำหนด ค่าเริ่มต้นจะหมดเวลาใน 2 นาที)
- ระยะเวลาสูงสุดที่ผู้เล่นต้องเข้าร่วมเซิร์ฟเวอร์ก่อนที่ระบบจะถือว่าหมดเวลา (หน่วยเป็นนาที)
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลการหมดเวลา หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
หากเซิร์ฟเวอร์ไม่มี Slot ว่าง (เต็ม) ผู้เล่นจะเข้าร่วมคิวและอยู่ลำดับแรกของคิวโดยไม่สนใจ Points ใช้ในกรณีผู้เล่นหลุดออกจากเซิร์ฟแต่มี Story อยู่ และต้องการเข้าร่วมเซิร์ฟเวอร์ใหม่อีกครั้งแบบเร่งด่วน
getQueueInfo
รับข้อมูลระบบคิวรอเข้าร่วมเซิร์ฟเวอร์
- Usage
- Example
exports.azael_playpass:getQueueInfo()
local success, response = exports.azael_playpass:getQueueInfo()
if not success then
return print('Error type:', response.type, 'Error message:', response.message)
end
print(json.encode(response, { indent = true }))
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Returns
- success:
boolean- สถานะการเรียกใช้
- response:
table<{ [key]: any }>- ข้อมูลเกี่ยวกับระบบคิว หากการเรียกใช้สำเร็จ
- ข้อมูลข้อผิดพลาด หากการเรียกใช้ล้มเหลว
hasInactiveRecord
ผู้ใช้เคยถูกระงับจากสาเหตุไม่เข้าร่วมเซิร์ฟเวอร์นานเกินที่กำหนดใน inactivePlayers หรือไม่?
- Usage
- Example
exports.azael_playpass:hasInactiveRecord(identifier)
local wasInactive, rejoinData = exports.azael_playpass:hasInactiveRecord('443334508020891658')
if wasInactive then
print(json.encode(rejoinData, { indent = true }))
end
คุณสามารถระบุตัวระบุได้ทั้งแบบที่มีหรือไม่มีคำนำหน้า เช่น discord:443334508020891658 หรือ 443334508020891658
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้
Returns
- wasInactive:
boolean- สถานะเคยถูกระงับ
- rejoinData:
table<{ timestamp: integer, secondsAgo: integer }>|nil- ข้อมูลการเข้าร่วมเซิร์ฟเวอร์หลังถูกยกเลิกสถานะจาก reactivateUser หรือใช้คำสั่ง ยกเลิกระงับผู้ใช้ (ไม่เล่นนานเกินกำหนด)
- timestamp:
integer- เวลาที่เข้าร่วมกับเซิร์ฟเวอร์หรือถูกยกเลิกสถานะครั้งล่าสุด (Unix time)
- secondsAgo:
integer- เข้าร่วมกับเซิร์ฟเวอร์หรือถูกยกเลิกสถานะมาแล้วกี่วินาที
- timestamp:
- ข้อมูลการเข้าร่วมเซิร์ฟเวอร์หลังถูกยกเลิกสถานะจาก reactivateUser หรือใช้คำสั่ง ยกเลิกระงับผู้ใช้ (ไม่เล่นนานเกินกำหนด)
signalDeferredDone
เรียกใช้เพื่อแจ้งให้ทรัพยากร azael_playpass ทราบว่าการเลื่อนเวลาจากทรัพยากรที่กำหนดใน awaitedResources ดำเนินการเสร็จแล้ว และให้ดำเนินการขั้นถัดไปต่อได้
- Usage
- Example
exports.azael_playpass:signalDeferredDone(tempPlayerId)
AddEventHandler('playerConnecting', function OnPlayerConnecting(name, setKickReason, deferrals)
local tempPlayerId = source
...
deferrals.done()
exports.azael_playpass:signalDeferredDone(tempPlayerId)
end)
Arguments
- tempPlayerId:
integer- Temp ID ของผู้เล่น (ไอดีแบบชั่วคราวเมื่อกำลังเชื่อมต่อ)
หากไม่มีการเรียกใช้ฟังก์ชันนี้ ก่อน หรือ หลัง การเรียกใช้ deferrals.done จะรอจนกว่าจะครบเวลา timeout ที่กำหนดไว้ใน awaitedResources ระบบจึงจะดำเนินการขั้นถัดไปต่อ
getCachedUserProfile
ดึงข้อมูลโปรไฟล์ผู้ใช้ที่ถูกแคชไว้ในระบบ
จำเป็นที่จะต้องเปิดใช้งาน userProfileCard จึงจะสามารถใช้งานฟังก์ชันส่งออกนี้ได้
- Usage
- Example
exports.azael_playpass:getCachedUserProfile(identifier)
local userData = exports.azael_playpass:getCachedUserProfile('steam:110000112345678')
if not userData then
print('[^1ERROR^7] User profile not found or not cached.')
return
end
print(json.encode(userData, { indent = true }))
Arguments
- identifier:
string- ตัวระบุหลัก ของผู้ใช้ (ต้องมีคำนำหน้า เช่น
steam:110000112345678หรือdiscord:443334508020891658)
- ตัวระบุหลัก ของผู้ใช้ (ต้องมีคำนำหน้า เช่น
Returns
-
userData:
table?- ข้อมูลโปรไฟล์ผู้ใช้ที่ถูกแคชไว้ หรือ
nilหากไม่พบ Provider ที่กำหนดหรือข้อมูลยังไม่ถูกแคช
Steam
Key Type Description idstringSteam ID ของผู้ใช้ hexIdstringSteam Hex ID ของผู้ใช้ namestringชื่อผู้ใช้ avatarUrlstringURL รูปโปรไฟล์ผู้ใช้ Discord
Key Type Description idstringDiscord ID ของผู้ใช้ usernamestringDiscord Username ของผู้ใช้ namestringชื่อผู้ใช้ avatarUrlstringURL รูปโปรไฟล์ผู้ใช้ - ข้อมูลโปรไฟล์ผู้ใช้ที่ถูกแคชไว้ หรือ