AWAY FROM US - Documentation
  • 📄คู่มือการใช้งาน ( Document )
  • 🌍การใช้งานเว็บไซต์
    • วิธีการสมัครสมาชิก
    • ลืมรหัสผ่านทำยังไง ?
    • เปลี่ยน IP ที่ผูกยังไง ?
    • สถานะของทรัพยากรณ์ดูยังไง ?
  • ☄️AFUCore
    • ⚙️Configuration (ตั้งค่า)
      • Events ของอาชีพ
      • เฟรมเวิร์ค (Framework)
      • คลังไอเทม (Inventory)
      • การแจ้งเตือน (Notifications)
      • ผู้เล่น (Players)
      • อาวุธ (Weapons)
      • ดีบัค (Debug)
      • ทึกฐานข้อมูล (Queries)
    • Client
      • PlayerData
        • ข้อมูลผู้เล่น (PlayerData)
      • Functions
        • ระบบบัญชี (Accounts)
        • ระบบไอเทม (Item System)
        • ระบบอาชีพ (Job System)
        • ระบบการแจ้งเตือน (Notification System)
      • Game
    • Common
      • Faker
      • Math
      • Logger
      • String
      • Table System
      • Config
      • Timeout
    • Shared
    • Server
      • Command
      • OneSync
      • Item
      • Job
      • Player
      • xPlayer
  • 📂ทรัพยากรณ์
    • 📄วิธีการใส่ License
    • 🛍️AFU Enhanced Shop
      • คู่มือการตั้งค่า
    • 💞AFU.Status
      • exports ที่มีให้ใช้
    • 📧AFU.Mailbox
    • 🔮AFU.Gasha
      • Config.lua
      • Config.OpenZone.lua
      • ปัญหาที่พบบ่อยใน AFU.Gasha
  • ⚠️ข้อตกลงการให้บริการ
    • Terms & Conditions
    • ❓ปัญหาที่พบบ่อย
Powered by GitBook
On this page
  • ภาพรวม
  • ที่อยู่ไฟล์
  • ฟังก์ชัน
  • GetAccount
  • GetMoney
  • GetAccountMoney
  1. AFUCore
  2. Client
  3. Functions

ระบบบัญชี (Accounts)

ภาพรวม

ฟังก์ชันสำหรับจัดการบัญชีเงินของผู้เล่น

ที่อยู่ไฟล์

source/client/services/accounts.lua

ฟังก์ชัน

GetAccount

ดึงข้อมูลบัญชีตามชื่อที่ระบุ

พารามิเตอร์
ประเภท
คำอธิบาย

name

string|string[]

ชื่อบัญชีเดี่ยว หรือ array ของชื่อบัญชี

ค่าที่ส่งกลับ:

  • ClientAccount - ถ้าส่ง name เป็น string

  • table<string, ClientAccount> - ถ้าส่ง name เป็น array

  • nil - ถ้าไม่พบบัญชี

-- ตัวอย่างการดึงบัญชีเดียว
local bankAccount = AFUCore.GetAccount('bank')
if bankAccount then
    print(string.format('%s: $%d', bankAccount.label, bankAccount.money))
end

-- ตัวอย่างการดึงหลายบัญชี
local accounts = AFUCore.GetAccount({'bank', 'black_money'})
for name, account in pairs(accounts) do
    print(string.format('%s: $%d', account.label, account.money))
end

GetMoney

ดึงจำนวนเงินสดของผู้เล่น

ค่าที่ส่งกลับ: number - จำนวนเงินสด

-- ตัวอย่างการใช้งาน
local cash = AFUCore.GetMoney()
print('เงินสด: $' .. cash)

GetAccountMoney

ดึงจำนวนเงินในบัญชีที่ระบุ

พารามิเตอร์
ประเภท
คำอธิบาย

name

string|string[]

ชื่อบัญชีเดี่ยว หรือ array ของชื่อบัญชี

ค่าที่ส่งกลับ:

  • number - จำนวนเงินในบัญชี (ถ้าส่ง name เป็น string)

  • table<string, number> - ตารางของจำนวนเงินในแต่ละบัญชี (ถ้าส่ง name เป็น array)

  • nil - ถ้าไม่พบบัญชี

-- ตัวอย่างการดึงเงินบัญชีเดียว
local bankMoney = AFUCore.GetAccountMoney('bank')
print('เงินในธนาคาร: $' .. bankMoney)

-- ตัวอย่างการดึงเงินหลายบัญชี
local moneyTable = AFUCore.GetAccountMoney({'bank', 'black_money'})
for account, money in pairs(moneyTable) do
    print(string.format('%s: $%d', account, money))
end
PreviousFunctionsNextระบบไอเทม (Item System)
☄️