fetchHotel
exports["RiP-Hotels"]:fetchHotel(hotelID)
This function fetches the hotel object with all availabel data and rooms. Only use this if really necessary due to large data objects
Arguments
Name | Type | Optional | Explenation |
---|---|---|---|
hotelID | Integer | Yes | Hotel id or all hotels if nil |
Returned Object
Returns the whole hotel object (and business data) with all registered rooms
Name | Type | Explenation |
---|---|---|
owner | String | Nil |
balance | Integer | Business account balance |
name | String | Nil |
booking | Boolean | Only manual booking if disabled |
minibar | Table | Business minibar prices |
logs | Object | Business webhooks for room and business |
upgrades | Object | Hotel upgrades (security ) |
rooms | Table | All registered hotel rooms (findHotelRoom) |
Example
local hotelData = exports["RiP-Hotels"]:fetchHotel(1)
if hotelData then
print(json.encode(hotelData))
print(json.encode(hotelData.rooms))
end