作者justinj (黑旋风)
看板mud_sanc
标题[wizs] input_to的指令用法?
时间Fri May 20 16:55:38 2011
north
guard道:想要进入请缴交入城税一万影特币。(y/n)
n
玩家(justinj /std/user)
money=10000
north
guard道:想要进入请缴交入城税一万影特币。(y/n)
y
玩家(justinj /std/user)
money=10000
(你缴交了入城费了!!)
於是你往前走了过去
north
guard道:想要进入请缴交入城税一万影特币。(y/n)
a
玩家(justinj /std/user)
money=10000
你觉得这个问题值得思考,於是再想了一想。
y
玩家(justinj /std/user)
money=a
(你缴交了入城费了!!)
於是你往前走了过去
执行时段错误: *Bad argument to unary minus
程式: u/j/justinj/area/darky/room/001.c:62
物件: /u/j/justinj/area/darky/room/001
/u/j/justinj/area/darky/room/001 "pay_xxx"
u/j/justinj/area/darky/room/001.c:62
------------------------------------------------------
以上因为input_to变的怪怪的...
我设定了一个check_north的函数...里面有input_to("pay_xxx",choice,10000)
pay_xxx(string choice,int money)
但pay_xxx里面设定一个input_to()後就变得很其怪了...出现以上的问题...
也就是说第一次出现input_to...玩家输入的变数是函数第一个变数
第二次以後出现input_to....玩家输入的变数是函数的第二个变数
如果函数变数多一点会不会有变化我就不知道了...
--
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.129.140.197
※ 编辑: justinj 来自: 220.129.140.197 (05/20 17:01)
1F:→ justinj :我有试过将pay_xxx的变数顺序做调整..一样出问题.. 05/20 17:04
2F:→ laechan :改成 pay_xxx(string str,string choice,int money) 05/20 17:10
我将check_enter里的改成
-----------------------------------------------------------------
write(ob->query("name")+"道:想要进入请缴交入城税一万影特币。
"HIR"(y/n)\n"NOR);
input_to("pay_xxx",choice,10000);
return 1;
------------------------------------------------
pay_xxx里的改成
--------------------------------------------------
write("你觉得这个问题值得思考,於是再想了一想。\n");
input_to("pay_xxx",str,choice,money);
------------------------------------------------
结果
-----------------------------------------
n
guard道:想要进入请缴交入城税一万影特币。(y/n)
y
玩家(justinj /std/user)
money=0
你觉得这个问题值得思考,於是再想了一想。
a
玩家(justinj /std/user)
money=10000
(你缴交了入城费了!!)
於是你往前走了过去
guard道:想要进入请缴交入城税一万影特币。(y/n)
a
玩家(justinj /std/user)
money=0
你觉得这个问题值得思考,於是再想了一想。
a
玩家(justinj /std/user)
money=10000
你觉得这个问题值得思考,於是再想了一想。
n
玩家(justinj /std/user)
money=a
你觉得这个问题值得思考,於是再想了一想。
n
玩家(justinj /std/user)
money=a
(你发现你身上没那麽多钱,於是离开了)
------------------------------------------------
第一个好像会delay...
※ 编辑: justinj 来自: 220.129.140.197 (05/20 17:30)