aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/banPlayer.ts
blob: f122a1b39ab5afa3a59ab2cb54610bd67c5df4ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { client } from '../client'

/**
 * Tries to ban a player from the playerlist
 * @param {Number} id the players id
 */
export function banPlayer(id: number) {
    let reason;
    let length;
    reason = prompt("Please enter the reason", "Being annoying");
    length = Number(prompt("Please enter the ban length in minutes", "60"));

    client.sender.sendMA(id, length, reason);
}
window.banPlayer = banPlayer;

/**
 * Tries to kick a player from the playerlist
 * @param {Number} id the players id
 */
export function kickPlayer(id: number) {
    let reason;
    reason = prompt("Please enter the reason", "Being annoying");

    client.sender.sendMA(id, 0, reason);
}
window.kickPlayer = kickPlayer;