Fix bug when using commando from server console
This commit is contained in:
parent
4b85500257
commit
dbf6adfadc
1 changed files with 2 additions and 2 deletions
|
@ -88,13 +88,13 @@ events.on('player.PlayerCommandPreprocessEvent', function(l,e){
|
||||||
var msg = "" + e.message;
|
var msg = "" + e.message;
|
||||||
var command = msg.match(/^\/([^\s]+)/)[1];
|
var command = msg.match(/^\/([^\s]+)/)[1];
|
||||||
if (commands[command]){
|
if (commands[command]){
|
||||||
e.message = "/jsp " + msg.substring(1);
|
e.message = "/jsp " + msg.replace(/^\//,"");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
events.on('server.ServerCommandEvent', function(l,e){
|
events.on('server.ServerCommandEvent', function(l,e){
|
||||||
var msg = "" + e.command;
|
var msg = "" + e.command;
|
||||||
var command = msg.match(/^\/*([^\s]+)/)[1];
|
var command = msg.match(/^\/*([^\s]+)/)[1];
|
||||||
if (commands[command]){
|
if (commands[command]){
|
||||||
e.command = "/jsp " + msg.substring(1);
|
e.command = "jsp " + msg.replace(/^\//,"");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Reference in a new issue