Re: [wizs] 讀取資料
看板mud_sanc (Sanctuary - 聖殿)作者laechan (小太保)時間14年前 (2011/07/01 15:30)推噓1(1推 0噓 0→)留言1則, 1人參與討論串4/4 (看更多)
※ 引述《justinj (黑旋風)》之銘言:
: 某檔案A有寫 return notify_fail(MSG);
: 某檔案B要抓檔案A(但不是inherit)出來,那我要怎麼讓MSG給使用的人看
: 例如 檔案A..
: cmd_aaa(string str)
: {
: if(!str||str=="") return notify_fail(MSG);
: .
: .
: }
: 檔案B
: void init()
: {
: add_action("cmd_xxx","aaa");
: }
: int cmd_xxx(string str)
: {
: call_other("檔案A",({"cmd_aaa",str}));
: return 1;
: }
: 這招是沒法子的...看看有沒有別招...amem
方法是有的。
return notify_fail 你把它想成跟 tell_object 是一樣
的即可,它一定會有一個接收的主體物件。
inherit ROOM;
void create()
{
.
.
}
void init()
{
add_action("testcmds","testcmds");
}
int testcmds(string str)
{
return "/cmds/std/_blarket"->cmd_blarker(str);
}
上面的意思就是你在這個房間下 testcmds, 等於你直接下
指令 blarket 的意思。
然後來測試一下..
> blarket -xxx
blarket: 沒有這個指令格式喔.
> testcmds -xxx
blarket: 沒有這個指令格式喔.
belldandy.
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 115.81.16.93
推
07/01 16:47, , 1F
07/01 16:47, 1F
討論串 (同標題文章)
mud_sanc 近期熱門文章
PTT遊戲區 即時熱門文章
21
49