ตรวจสอบว่าผู้เล่นอยู่ในปาร์ตี้หรือไม่
local retval = exports.mrft_dungeon:IsInParty()
if retval then
-- ผู้เล่นอยู่ในปาร์ตี้
end
ตรวจสอบว่าผู้เล่นเป็นหัวหน้าปาร์ตี้หรือไม่
local retval = exports.mrft_dungeon:IsPartyOwner()
if retval then
-- ผู้เล่นเป็นหัวหน้าปาร์ตี้
end
ดึง ID ปาร์ตี้ของผู้เล่น
local retval = exports.mrft_dungeon:GetPartyID()
if retval then
-- Output: 30001
end
ตรวจสอบว่าผู้เล่นกำลังลง Dungeon อยู่หรือไม่
local retval = exports.mrft_dungeon:IsPlaying()
if retval then
-- ผู้เล่นกำลังลงดันเจี้ยน
end
ดึง Entity ของศัตรูที่อยู่ใกล้ผู้เล่นที่สุด
local entity = exports.mrft_dungeon:GetClosestEnemy()
if entity then
print(GetEntityHealth(entity))
end
ดึงตำแหน่งที่ผู้เล่นกำลังเล็งหรือมองอยู่
local coords = exports.mrft_dungeon:GetCrosshairPosition()
if coords then
-- Do Something
end
เล่นอนิเมชันภายในของระบบ Dungeon
ped (entity): Ped ที่ต้องการให้เล่นอนิเมชันanimType (string): ประเภทอนิเมชัน เช่น basic, protego, ultimatespeed (number): ความเร็วของอนิเมชัน ยิ่งค่าสูงยิ่งเร็วmetadata (table): ข้อมูลเพิ่มเติม ไม่จำเป็นต้องส่งค่าexports.mrft_dungeon:PlayInternalAnimation(PlayerPedId(), "basic", 6, {index = 1})
-- basic จะมี index 1-6
exports.mrft_dungeon:PlayInternalAnimation(PlayerPedId(), "protego", 10)
exports.mrft_dungeon:PlayInternalAnimation(PlayerPedId(), "ultimate", 2)
ดึง Config ของ Dungeon จาก ID ที่กำหนด
dungeonId (number): ID Dungeon จาก config.dungeonMaplocal dungeon = exports.mrft_dungeon:GetDungeonFromID(1)
if dungeon then
print(dungeon.name) -- Output: Underground
end
ดึงข้อมูล Dungeon ที่เปิดให้เข้าใช้งานอยู่ในปัจจุบัน
local dungeons = exports.mrft_dungeon:GetCurrentAvaliableDungeons()
for dungeonId, v in pairs(dungeons) do
print(v.coords)
end