mirror of
https://github.com/danbulant/flying-squid
synced 2026-07-05 03:00:46 +00:00
Add /op and /deop
This commit is contained in:
parent
f17f54fe92
commit
b4b90c01ed
1 changed files with 34 additions and 0 deletions
|
|
@ -139,4 +139,38 @@ module.exports.player=function(player,serv)
|
||||||
.catch(err => player.chat(nick + " is not banned"));
|
.catch(err => player.chat(nick + " is not banned"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
player.commands.add({
|
||||||
|
base: 'op',
|
||||||
|
info: 'op any player',
|
||||||
|
usage: '/op <player>',
|
||||||
|
op: true,
|
||||||
|
parse(str) {
|
||||||
|
if (!str.match(/([a-zA-Z0-9_]+)/)) return false;
|
||||||
|
return str;
|
||||||
|
},
|
||||||
|
action(username) {
|
||||||
|
var user = serv.getPlayer(username);
|
||||||
|
if (!user) return 'That player is not on the server.'
|
||||||
|
user.op = true;
|
||||||
|
player.chat(username + ' is opped');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
player.commands.add({
|
||||||
|
base: 'deop',
|
||||||
|
info: 'deop any player',
|
||||||
|
usage: '/deop <player>',
|
||||||
|
op: true,
|
||||||
|
parse(str) {
|
||||||
|
if (!str.match(/([a-zA-Z0-9_]+)/)) return false;
|
||||||
|
return str;
|
||||||
|
},
|
||||||
|
action(username) {
|
||||||
|
var user = serv.getPlayer(username);
|
||||||
|
if (!user) return 'That player is not on the server.'
|
||||||
|
user.op = false;
|
||||||
|
player.chat(username + ' is deopped');
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
Loading…
Reference in a new issue