Inventory
ฟังก์ชันฝั่ง Server สำหรับจัดการ Item, น้ำหนักกระเป๋า, และข้อจำกัดการถือของของผู้เล่น ผ่าน xPlayer
Inventory (xPlayer)
ก่อนเริ่ม (แนะนำ)
local xPlayer = ESX.GetPlayerFromId(source)โครงสร้างข้อมูล Item (Item Object)
xPlayer.getInventory
รูปแบบการใช้งาน (Syntax)
พารามิเตอร์ (Parameters)
Name
Type
Description
ค่าที่ส่งคืน (Returns)
Type
Description
ตัวอย่างการใช้งาน (Example)
กรณีการใช้งาน (Use cases)
xPlayer.getInventoryItem
รูปแบบการใช้งาน (Syntax)
พารามิเตอร์ (Parameters)
Name
Type
Description
ค่าที่ส่งคืน (Returns)
Type
Description
ตัวอย่างการใช้งาน (Example)
กรณีการใช้งาน (Use cases)
xPlayer.addInventoryItem
รูปแบบการใช้งาน (Syntax)
พารามิเตอร์ (Parameters)
Name
Type
Description
ค่าที่ส่งคืน (Returns)
Type
Description
ตัวอย่างการใช้งาน (Example)
กรณีการใช้งาน (Use cases)
xPlayer.removeInventoryItem
รูปแบบการใช้งาน (Syntax)
พารามิเตอร์ (Parameters)
Name
Type
Description
ค่าที่ส่งคืน (Returns)
Type
Description
ตัวอย่างการใช้งาน (Example)
กรณีการใช้งาน (Use cases)
xPlayer.setInventoryItem
รูปแบบการใช้งาน (Syntax)
พารามิเตอร์ (Parameters)
Name
Type
Description
ค่าที่ส่งคืน (Returns)
Type
Description
ตัวอย่างการใช้งาน (Example)
กรณีการใช้งาน (Use cases)
xPlayer.hasItem
รูปแบบการใช้งาน (Syntax)
พารามิเตอร์ (Parameters)
Name
Type
Description
ค่าที่ส่งคืน (Returns)
Type
Description
ตัวอย่างการใช้งาน (Example)
กรณีการใช้งาน (Use cases)
xPlayer.canCarryItem
รูปแบบการใช้งาน (Syntax)
พารามิเตอร์ (Parameters)
Name
Type
Description
ค่าที่ส่งคืน (Returns)
Type
Description
ตัวอย่างการใช้งาน (Example)
กรณีการใช้งาน (Use cases)
xPlayer.canSwapItem
รูปแบบการใช้งาน (Syntax)
พารามิเตอร์ (Parameters)
Name
Type
Description
ค่าที่ส่งคืน (Returns)
Type
Description
ตัวอย่างการใช้งาน (Example)
กรณีการใช้งาน (Use cases)
xPlayer.clearInventory
รูปแบบการใช้งาน (Syntax)
พารามิเตอร์ (Parameters)
Name
Type
Description
ค่าที่ส่งคืน (Returns)
Type
Description
ตัวอย่างการใช้งาน (Example)
กรณีการใช้งาน (Use cases)
xPlayer.getWeight
รูปแบบการใช้งาน (Syntax)
ค่าที่ส่งคืน (Returns)
Type
Description
ตัวอย่างการใช้งาน (Example)
กรณีการใช้งาน (Use cases)
xPlayer.getMaxWeight
รูปแบบการใช้งาน (Syntax)
ค่าที่ส่งคืน (Returns)
Type
Description
ตัวอย่างการใช้งาน (Example)
กรณีการใช้งาน (Use cases)
xPlayer.setMaxWeight
รูปแบบการใช้งาน (Syntax)
พารามิเตอร์ (Parameters)
Name
Type
Description
ค่าที่ส่งคืน (Returns)
Type
Description
ตัวอย่างการใช้งาน (Example)
กรณีการใช้งาน (Use cases)
สรุปฟังก์ชันใน Inventory
Function
Description
Use Case
1
2
3
4
5
6
Last updated