mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-15 12:31:09 +00:00
19 lines
No EOL
439 B
JavaScript
19 lines
No EOL
439 B
JavaScript
module.exports=inject;
|
|
|
|
function inject(serv, player, options)
|
|
{
|
|
function handleCommand(command)
|
|
{
|
|
var results;
|
|
if(options.commands[command])
|
|
player.chat("" + options.commands[command]);
|
|
else if(results=command.match(/^gamemode ([0-3])$/)) {
|
|
var gameMode=parseInt(results[1]);
|
|
player.setGameMode(gameMode);
|
|
}
|
|
else
|
|
player.chat("Invalid command.");
|
|
}
|
|
|
|
player.handleCommand=handleCommand;
|
|
} |