Skip to content

🎮 AFU Battle Suite

AFU Battle Suite เป็นชุดคอมโพเนนต์สำหรับจัดระบบ PvP gang battle rooms บน FiveM (ESX) — ครอบคลุมตั้งแต่การสร้างห้อง การแข่งขัน บันทึก kill clips จนถึงการโพสต์ผลลง Discord

ข้อมูลสคริปต์

รายการรายละเอียด
FrameworkESX (es_extended)
ComponentsAFU.Battle v1.1.2 (FiveM resource) · Screencapture v0.13.0-beta.5 (FiveM resource, MIT) · AFU.Recserver (standalone Node.js server)
Databaseไม่ต้อง import SQL — ข้อมูลแก๊งดึงจาก xcore-gang
Licenseต้องมี token ที่ซื้อจาก awayfromus.store

🧩 Components

text
┌──────────────────────────────────────────────────────────────────────────────┐
│                            AFU Battle Suite                                  │
│                                                                              │
│  ┌────────────────────┐  ┌────────────────────┐  ┌────────────────────────┐  │
│  │     AFU.Battle     │  │   Screencapture    │  │     AFU.Recserver      │  │
│  │  (FiveM resource)  │  │  (FiveM resource)  │  │   (Node.js server)     │  │
│  ├────────────────────┤  ├────────────────────┤  ├────────────────────────┤  │
│  │ Battle rooms       │  │ บันทึกวิดีโอจาก   │  │ รับ kill events +      │  │
│  │ จัดทีมตามแก๊ง      │  │ มุมมองผู้เล่น     │  │ ไฟล์ .webm ผ่าน HTTP  │  │
│  │ Match flow         │  │ (WebM 1280x720,    │  │ ตัดคลิปด้วย ffmpeg    │  │
│  │ Spectator + NUI    │  │ ไม่ใช้ ffmpeg)     │  │ (bundled) โพสต์ลง     │  │
│  │ Kill clips         │  │                    │  │ Discord webhook        │  │
│  └────────────────────┘  └────────────────────┘  └────────────────────────┘  │
└──────────────────────────────────────────────────────────────────────────────┘
Componentประเภทหน้าที่
AFU.BattleFiveM resource (ESX)ระบบหลัก — PvP gang battle rooms: สร้างห้อง (จากไฟล์ Config/Room หรือผ่าน UI), จัดทีมตามแก๊ง (xcore-gang), match flow แบบ round-based (best of maxRound), spectator mode, kill clips, Svelte NUI (prebuilt ใน Interface/dist — ไม่ต้อง build)
ScreencaptureFiveM resourceบันทึกภาพ/วิดีโอจากมุมมองผู้เล่น (WebGL hook + WebCodecs VP9 in-browser — ไม่ใช้ ffmpeg) — ใช้งานโดย AFU.Battle อยู่แล้ว
AFU.RecserverStandalone Node.js server (ไม่ใช่ FiveM resource — ไม่ใส่ resources/)รับ kill events + ไฟล์วิดีโอ .webm ผ่าน HTTP, ตัดคลิปด้วย ffmpeg (bundled ในโฟลเดอร์ ffmpeg/ — Windows build), โพสต์ลง Discord webhook

วิธีใช้งานด่วน

บทบาทการใช้งาน
ผู้เล่นเข้าห้องผ่าน NPC battle (กด E ใกล้ NPC) หรือคำสั่ง /+battleMenu (F6) · ออกด้วย /battle.quit · ดู K/D score ขณะ spectate ด้วย /+kdscore (F5)
Adminสร้างห้อง / เริ่ม / หยุด / kick ผ่าน NUI — สิทธิ์จาก Permission.AllowControl (job หรือ Steam ID) หรือ ACE permission

การทำงานร่วมกัน (Kill Clip Flow)

  1. เมื่อรอบเริ่ม — AFU.Battle เริ่มอัดวิดีโอผู้เล่นทุกคนในห้องผ่าน Screencapture (WebM 1280x720)
  2. เมื่อเกิด kill — AFU.Battle ส่ง kill event (พร้อม timestamp) ไปยัง AFU.Recserver
  3. เมื่อรอบจบ — client ของผู้เล่น upload ไฟล์ .webm ทั้งรอบไปยัง AFU.Recserver โดยตรง (ไม่ผ่าน FiveM server)
  4. AFU.Recserver ตัดคลิป 20 วินาที (15 วินาทีก่อน + 5 วินาทีหลัง kill) และโพสต์ลง Discord

Reconnect

ผู้เล่นที่หลุดออกมีเวลา 60 วินาที ในการ reconnect — กลับเข้าห้องเดิม ทีมเดิม สถิติเดิม

🚀 Quick Start

  1. ติดตั้ง dependencieses_extended, oxmysql, sentry, xcore-gang, screencapture, LTS_Ambulance (default revive — เปลี่ยนผ่าน Routers ได้) · แนะนำ: AFU.Notify + AFU.Toastify (UI notification/toast)
  2. วาง AFU.Battle — ใส่โฟลเดอร์ AFU.Battle ใน resources/ แล้วเพิ่ม ensure ใน server.cfg ตามลำดับ — screencapture ต้องมาก่อน AFU.Battle
  3. ตั้งค่า Config — เปลี่ยน Recorder.RecserverUrl ใน Config/ ให้ชี้มาที่ AFU.Recserver ของคุณ และตั้ง Discord webhook ใน .env ของ Recserver
  4. รัน AFU.Recservernpm install → กรอก .env (PORT default 3000, DISCORD_WEBHOOK_URL) → npm start (Node 18.11+ — แนะนำ 20 LTS) บนเครื่องที่ทั้ง FiveM server และผู้เล่นเข้าถึงได้ทาง HTTP
  5. ทดสอบ — เข้าใกล้ NPC battle แล้วกด E เพื่อเข้าห้อง หรือกด F6 (/+battleMenu) เพื่อเปิดเมนู

📚 Documentation

เอกสารคำอธิบาย
AFU.Battleคู่มือการติดตั้งและปรับแต่ง Config ระบบ Battle Room (ESX) — rooms, teams, match flow, NUI, kill clips
AFU.Recserverคู่มือการติดตั้งและตั้งค่า AFU.Recserver (Node server) — รับไฟล์วิดีโอ, ตัดคลิป, โพสต์ Discord
Screencaptureคู่มือการติดตั้ง Screencapture — บันทึกรูป/วิดีโอจากมุมมองผู้เล่น (ต้อง FiveM build ใหม่ที่รองรับ node_version 22)

🔑 License

WARNING

AFU.Battle ต้องการ token ที่ซื้อมาจาก awayfromus.store — หากไม่มี token ที่ถูกต้อง ระบบจะไม่ทำงาน