Procházet zdrojové kódy

Add help command

tags/v0.4.3^2
Vildravn před 4 roky
rodič
revize
65b9f50bab
1 změnil soubory, kde provedl 11 přidání a 1 odebrání
  1. +11
    -1
      src/server/components/extensions/socialCommands.js

+ 11
- 1
src/server/components/extensions/socialCommands.js Zobrazit soubor

@@ -17,6 +17,7 @@ let commandRoles = {
roll: 0,
block: 0,
unblock: 0,
help: 0,

//Mods
ban: 5,
@@ -59,7 +60,8 @@ const localCommands = [
'unblock',
'broadcast',
'saveAll',
'ban'
'ban',
'help'
];

//Actions that should appear when a player is right clicked
@@ -284,6 +286,14 @@ module.exports = {
});
},

help: function () {
this.sendMessage('You can use the following commands:', 'color-yellowB');
Object.keys(commandRoles).forEach(function (command) {
if (this.roleLevel >= commandRoles[command])
this.sendMessage(`/${command}`, 'color-yellowB');
}, this);
},

isInChannel: function (character, channel) {
return character.auth.customChannels.some(c => (c === channel));
},


Načítá se…
Zrušit
Uložit