Skip to main content

updateHotelRoom

exports["RiP-Hotels"]:updateHotelRoom(hotelID, roomID, updateData) 

This function updates a hotel's room data. Please notice that this function is used for all internal updates and is very complex

Arguments

NameTypeOptionalExplenation
hotelIDIntegerNoHotel id
roomIDIntegerNoHotel room id
updateDataObjectYesObject with all data to update, if nil the room will be "unregistered"

Update Table

If the room is not created before, it will be in this function, so only use it if the room or business is owned.

NameTypeOptionalExplenation
guestObjectYesObject with guest data (identifier, duration in days, start as timestamp, code for safe)
visitorIntegerYesPlayer source of visitor (automatic detected if add or remove from access list)
storageObjectYesObject with storage/safe action data (name for item, count for amount, action with add/remove)
codeStringYesSafe code

Returned Boolean

Returns true on success of false with possible error message

Example

local updateStatus = exports["RiP-Hotels"]:updateHotelRoom(1, 101, {
guest = {
ifentifier = 'xyz',
duration = 2,
start = 123456789,
code = '1234'
},
visitor = 1,
storage = {
name = 'bread',
count = 9,
action 'add'
}
})

if updateStatus then
print("update successful")
end