引用 | 編輯
lichen
2011-03-12 15:12 |
樓主
▼ |
||
x0
L 03/12/2011 - 15:28:15: [AMXX] Displaying debug trace (plugin "zombie_plague40.amxx") L 03/12/2011 - 15:28:15: [AMXX] Run time error 4: index out of bounds L 03/12/2011 - 15:28:15: [AMXX] [0] zombie_plague40.sma::allowed_survivor (line 8730) L 03/12/2011 - 15:28:15: [AMXX] [1] zombie_plague40.sma::native_make_user_survivor (line 9252) L 03/12/2011 - 15:28:15: Unhandled dynamic native error L 03/12/2011 - 15:28:15: [AMXX] Displaying debug trace (plugin "zp_AppearHero.amxx") L 03/12/2011 - 15:28:15: [AMXX] Run time error 10: native error (native "zp_make_user_survivor") L 03/12/2011 - 15:28:15: [AMXX] [0] zp_AppearHero.sma::task_make_vip (line 33) x0
|
引用 | 編輯
a7811311622
2011-03-12 15:19 |
1樓
▲ ▼ |
下面是引用 lichen 於 2011-03-12 15:12 發表的 幫忙看一下 感謝..,|zombie_plague40.amxx debug: 呃…你只有貼錯誤行數…卻沒貼錯誤內容…這要人怎麼了解錯誤何在…? x0 |
引用 | 編輯
lichen
2011-03-12 15:34 |
3樓
▲ ▼ |
zp_AppearHero.amxx错误就是
强制感染模式每局出幸存者 如果 只有一位玩家 则玩家变为僵尸 服务器名称会被选定为英雄... x0 |
引用 | 編輯
i-c0112
2011-03-12 16:40 |
4樓
▲ ▼ |
可能要加個條件吧
複製程式 ...... randoms = fnGetRandomAliveHuman(random_num(1, fnGetAliveHuman())) if (randoms <= 0) return; ...... x0 |
引用 | 編輯
a7811311622
2011-03-12 16:46 |
5樓
▲ ▼ |
我無言了…
無言中…ZP 4.3 主插件都不會在這種地方判斷ID值是不是僵屍…這寫的人在自作主張什麼…? 一開始的「fnGetAliveHuman」就是問題… 後面的「fnGetRandomAliveHuman」則是讓判斷出來的ID值偏差更大… 估計ZP主插件會錯誤的原因就是「fnGetRandomAliveHuman」回傳了ID值「-1」… 偏激的舉例: 剛好只剩下ID值=31和32的是人類…而「random_num(1, fnGetAliveHuman())」跑出來的是32… 然後「fnGetRandomAliveHuman」在ID值=31之前「iAlive」一直是0…而 ID值=31→iAlive = 1 ID值=32→iAlive = 2 兩個結果沒一個滿足「if (iAlive == n)」…既然沒法「return id」…當然只能回傳「return -1」了… 我的寫法: 複製程式 do{ randoms = random_num(1, get_playersnum()) }while(!is_user_alive(randoms) || zp_get_user_zombie(randoms)) x0 |
引用 | 編輯
lichen
2011-03-12 19:57 |
6樓
▲ ▼ |
下面是引用 a7811311622 於 2011-03-12 16:46 發表的 : so zp_make_user_survivor(randoms) 改为 do{ randoms = random_num(1, get_playersnum()) }while(!is_user_alive(randoms) || zp_get_user_zombie(randoms)) [/pre][/pre]即可?[/pre] x0 |
引用 | 編輯
lichen
2011-03-12 20:01 |
7樓
▲ ▼ |
randoms = fnGetRandomAliveHuman(random_num(1, fnGetAliveHuman()))
get_user_name(randoms, temp, 64) 改为 do{ randoms = random_num(1, get_playersnum()) }while(!is_user_alive(randoms) || zp_get_user_zombie(randoms)) ??是吗? x0 |
引用 | 編輯
lichen
2011-03-12 20:03 |
8樓
▲ ▼ |
下面是引用 i-c0112 於 2011-03-12 16:40 發表的 : randoms = fnGetRandomAliveHuman(random_num(1, fnGetAliveHuman())) get_user_name(randoms, temp, 64) client_print(0 , print_center, "[%s] 已被选定为【救世主】", temp); 改为 randoms = fnGetRandomAliveHuman(random_num(1, fnGetAliveHuman())) if (randoms <= 0) return; client_print(0 , print_center, "[%s] 已被选定为【救世主】", temp); ???? x0 |
引用 | 編輯
a7811311622
2011-03-12 22:03 |
9樓
▲ ▼ |
是將5F原碼中的第一行換成我給的原碼…
x0 |