Skip to main content

findHotelRoom

exports["RiP-Hotels"]:findHotelRoom(hotelID, roomID, extendedData) 

This function returns all registered rooms. If the hotel (business) is owned all unlocked rooms are registered, otherwise all booked rooms

Arguments

NameTypeOptionalExplenation
hotelIDIntegerNoHotel id
roomIDIntegerNoHotel room id
extendedDataBooleanYesReturns the whole room data object if enabled (not room config object)

Returned Object

If the room is not registered it will return the room's config object. If extendedData is not enabled it will return the room's table index which is not useful for you since this is an internal table

NameTypeExplenation
priceInteger|NilPrice per night (nil if business is not owned)
guestTableNil
storageTableStorage objects (name, count)
safeTableSafe (money) objects (name, count)
ratingObjectNil
upgradesObjectUpgrade table with name as key and level as value

Example

local roomData = exports["RiP-Hotels"]:findHotelRoom(1, 101, true) 

print(json.encode(roomData))
print("room 101 is "..(roomData.upgrades and "registered" or "not registered"))