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
Name | Type | Optional | Explenation |
---|---|---|---|
hotelID | Integer | No | Hotel id |
roomID | Integer | No | Hotel room id |
updateData | Object | Yes | Object 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.
Name | Type | Optional | Explenation |
---|---|---|---|
guest | Object | Yes | Object with guest data (identifier , duration in days, start as timestamp, code for safe) |
visitor | Integer | Yes | Player source of visitor (automatic detected if add or remove from access list) |
storage | Object | Yes | Object with storage/safe action data (name for item, count for amount, action with add/remove) |
code | String | Yes | Safe 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