引用 | 編輯
tony987852
2010-07-03 10:05 |
樓主
▼ |
||
x0
請問,有哪個function是隨機選人?就像是隨機選出一個CT / T什麼什麼的... 如果有的話可以放出來嗎? 謝謝! x0
|
引用 | 編輯
a7811311622
2010-07-03 19:09 |
1樓
▲ ▼ |
沒有function能隨機選人吧…
只看過用native製造亂數來隨機選擇ID的… x0 |
引用 | 編輯
tony987852
2010-07-03 22:45 |
2樓
▲ ▼ |
引用 | 編輯
yesterday00
2010-07-05 19:30 |
3樓
▲ ▼ |
借鉴zombie_plague40.sma
new iPlayersnum, id iPlayersnum = fnGetAlive() id = fnGetRandomAlive(random_num(1, iPlayersnum)) fnGetAlive() { static iAlive, id iAlive = 0 for (id = 1; id <= g_maxplayers; id++) { if (g_isalive[id]) iAlive++ } return iAlive; } fnGetRandomAlive(n) { static iAlive, id iAlive = 0 for (id = 1; id <= g_maxplayers; id++) { if (g_isalive[id]) iAlive++ if (iAlive == n) return id; } return -1; } x0 |
引用 | 編輯
tony987852
2010-07-05 20:18 |
4樓
▲ ▼ |