Skip to content

Commit

Permalink
Plugins: Add more custom plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishaan0132 committed Jan 7, 2025
1 parent cd259be commit 4f3f18a
Show file tree
Hide file tree
Showing 4 changed files with 811 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server/custom-plugins/dice.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ class Dice {
exports.commands = {
startdice: 'dicegame',
dicegame: function (target, room, user) {
if (room.id === 'lobby') return this.errorReply("This command cannot be used in the Lobby.");
if (!user.can('broadcast', null, room) && room.id !== 'casino') return this.errorReply("You must be ranked + or higher in this room to start a game of dice outside the Casino.");
if (room.roomid === 'lobby') return this.errorReply("This command cannot be used in the Lobby.");
if (!user.can('broadcast', null, room) && room.roomid !== 'casino') return this.errorReply("You must be ranked + or higher in this room to start a game of dice outside the Casino.");
if (!this.canTalk()) return;
if (room.dice) return this.errorReply("There is already a game of dice going on in this room.");

Expand All @@ -142,7 +142,7 @@ exports.commands = {

dicejoin: 'joindice',
joindice: function (target, room, user) {
if (room.id === 'lobby') return this.errorReply("This command cannot be used in the Lobby.");
if (room.roomid === 'lobby') return this.errorReply("This command cannot be used in the Lobby.");
if (!this.canTalk()) return;
if (!room.dice) return this.errorReply('There is no game of dice going on in this room.');

Expand All @@ -151,15 +151,15 @@ exports.commands = {

diceleave: 'leavedice',
leavedice: function (target, room, user) {
if (room.id === 'lobby') return this.errorReply("This command cannot be used in the Lobby.");
if (room.roomid === 'lobby') return this.errorReply("This command cannot be used in the Lobby.");
if (!room.dice) return this.errorReply('There is no game of dice going on in this room.');

room.dice.leave(user, this);
},

diceend: 'enddice',
enddice: function (target, room, user) {
if (room.id === 'lobby') return this.errorReply("This command cannot be used in the Lobby.");
if (room.roomid === 'lobby') return this.errorReply("This command cannot be used in the Lobby.");
if (!this.canTalk()) return;
if (!room.dice) return this.errorReply('There is no game of dice going on in this room.');
if (!user.can('broadcast', null, room) && !room.dice.players.includes(user)) return this.errorReply("You must be ranked + or higher in this room to end a game of dice.");
Expand Down
5 changes: 5 additions & 0 deletions server/custom-plugins/economy.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ const Economy = global.Economy = {
if (!message) return false;
FS("logs/transactions.log").append(`[${new Date().toUTCString()}] ${message}\n`);
},

logDice: function (message) {
if (!message) return false;
FS("logs/dice.log").append(`[${new Date().toUTCString()}] ${message}\n`);
},
};

function findItem(item, money) {
Expand Down
Loading

0 comments on commit 4f3f18a

Please sign in to comment.