-
Notifications
You must be signed in to change notification settings - Fork 7
User
Leonid Pospelov edited this page Jul 27, 2019
·
4 revisions
All methods of User
return promises or promise-like objects. It's recommended to use them with await
keyword:
await someUser.showBrowserWindow(someWindow);
String property representing the unique id of the User
.
console.log(user.id); // no await
Attached Actor or null
.
let actor = await user.actor;
if (actor) {
await actor.disable();
await user.setActor(null);
}
Makes BrowserWindow
visible for this user.
await user.showBrowserWindow(someWindow);
Makes BrowserWindow
invisible for this user.
await user.hideBrowserWindow(someWindow);
Sends a custom packet to this user.
-
targetSystem
- String. Should represent one of the systems in your gamemode. -
data
- A serializable object with the information you want to be sent to the client.
// Frontend JS code has access to passed targetSystem and data
await user.sendCustomPacket('Auth', { error: 'Wrong pass' });
Changes the Actor
controlled by this user.
-
actor
- An instance ofActor
ornull
(Null value forces Skyrim to exit to the main menu).
if (someCondition) {
await user.setActor(someActor);
}
else {
await user.setActor(null);
}