【Lv:1】
- 注册
- 2022/11/29
- 消息
- 63
- 金粒
- 2,039金粒
https://github.com/Development-studio/global-local-chat
要和这个功能相同,进服弹出,但是LLBDS,并且可以换行
要和这个功能相同,进服弹出,但是LLBDS,并且可以换行
【Lv:1】
"use strict";
const path = "plugins/Notice/notice.txt";
if (!File.exists(path)) File.writeTo(path, "");
mc.listen("onJoin", (pl) => {
const fm = mc.newSimpleForm();
fm.setTitle("公告");
const notice = File.readFrom(path);
fm.setContent(notice);
pl.sendForm(fm, (_pl, _arg) => {});
});
"use strict";
const path = "plugins/Notice/notice.txt";
if (!File.exists(path)) File.writeTo(path, "");
mc.listen("onJoin", (pl) => {
const fm = mc.newSimpleForm();
fm.setTitle("公告");
const notice = File.readFrom(path);
fm.setContent(notice);
pl.sendForm(fm, (_pl, _arg) => {});
});
【Lv:1】
大佬太牛逼了吧??JavaScript:"use strict"; const path = "plugins/Notice/notice.txt"; if (!File.exists(path)) File.writeTo(path, ""); mc.listen("onJoin", (pl) => { const fm = mc.newSimpleForm(); fm.setTitle("公告"); const notice = File.readFrom(path); fm.setContent(notice); pl.sendForm(fm, (_pl, _arg) => {}); });
【Lv:1】
怎么换行呢?JavaScript:"use strict"; const path = "plugins/Notice/notice.txt"; if (!File.exists(path)) File.writeTo(path, ""); mc.listen("onJoin", (pl) => { const fm = mc.newSimpleForm(); fm.setTitle("公告"); const notice = File.readFrom(path); fm.setContent(notice); pl.sendForm(fm, (_pl, _arg) => {}); });
大佬能不能加一个游戏时输入指令,比如/g时也会弹出公告?我需要配合一个菜单插件使用,谢谢大佬!?
"use strict";
const path = "plugins/Notice/notice.txt";
if (!File.exists(path)) File.writeTo(path, "");
mc.listen("onJoin", sendNotice);
mc.listen("onServerStarted", () => {
const cmd = mc.newCommand("notice", "查看公告。", PermType.Any);
cmd.overload();
cmd.setCallback((_cmd, ori, out, _res) => {
if (!ori.player) return out.error("commands.generic.noTargetMatch");
sendNotice(ori.player);
});
cmd.setup();
});
function sendNotice(pl) {
const notice = File.readFrom(path);
pl.sendForm(
mc.newSimpleForm().setTitle("公告").setContent(notice),
(_pl, _arg) => {}
);
}