mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-31 10:22:36 +01:00
Add IsOwnerOfFloorFurniture
This commit is contained in:
parent
8be3c6fff0
commit
2955149200
16
src/api/nitro/session/IsOwnerOfFloorFurniture.ts
Normal file
16
src/api/nitro/session/IsOwnerOfFloorFurniture.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { RoomObjectCategory, RoomObjectVariable } from '@nitrots/nitro-renderer';
|
||||
import { GetRoomSession } from '.';
|
||||
import { GetRoomEngine } from '..';
|
||||
import { GetSessionDataManager } from '../../../api';
|
||||
|
||||
export function IsOwnerOfFloorFurniture(id: number): boolean
|
||||
{
|
||||
const roomObject = GetRoomEngine().getRoomObject(GetRoomSession().roomId, id, RoomObjectCategory.FLOOR);
|
||||
|
||||
if(!roomObject || !roomObject.model) return false;
|
||||
|
||||
const userId = GetSessionDataManager().userId;
|
||||
const objectOwnerId = roomObject.model.getValue<number>(RoomObjectVariable.FURNITURE_OWNER_ID);
|
||||
|
||||
return (userId === objectOwnerId);
|
||||
}
|
@ -14,6 +14,7 @@ export * from './GetSessionDataManager';
|
||||
export * from './GoToDesktop';
|
||||
export * from './HasHabboClub';
|
||||
export * from './HasHabboVip';
|
||||
export * from './IsOwnerOfFloorFurniture';
|
||||
export * from './IsOwnerOfFurniture';
|
||||
export * from './IsRidingHorse';
|
||||
export * from './StartRoomSession';
|
||||
|
Loading…
x
Reference in New Issue
Block a user