getRoomAccess
exports["RiP-Hotels"]:getRoomAccess(xPlayer, hotelID, roomID)
This function checks if a player has access to a certain room. This is the case if the player:
- owns the business and unlocked the room
- owns the room as a guest
- was invited to the room
- raided the room successfully
Arguments
Name | Type | Optional | Explenation |
---|---|---|---|
xPlayer | ESX Player | No | The ESX xPlayer object from ESX.GetPlayerFromId |
hotelID | Integer | No | Hotel id |
roomID | Integer | No | Hotel room id |
Returned Boolean
Returns true
if player can access the room, otherwise it'll return false
Example
local xPlayer = ESX.GetPlayerFromId(1)
local xAccess = exports["RiP-Hotels"]:getRoomAccess(xPlayer, 1, 101)
print("player 1 has "..(xAccess and "access" or "no access").." to room 101")