Array 的使用方法?

Home Home
引用 | 編輯 tw2twtw
2011-11-13 06:42
樓主
推文 x0
我在很多插件有看到Array(如ZP武器選單),但就是不會用也不知道是什麼意思.... 表情 
教學區也找過了...[ 沒有查找符合的內容 ] 

獻花 x0
引用 | 編輯 史來姆
2011-11-13 23:08
1樓
  
具體上你知道甚麼?
array就像這些new xdd[32]

獻花 x0
引用 | 編輯 tw2twtw
2011-11-14 17:46
2樓
  
如果 g_weapon_names = ArrayCreate(32, 1)
是等於g_weapon_names[1][32]

然後ArrayPushString(g_weapon_names, " ")
之後格式會變成這樣?
g_weapon_names[2][32]

獻花 x0
引用 | 編輯 史來姆
2011-11-14 18:06
3樓
  
先弄個例子...
假設你現在要儲存60個隨機(1~100)數字
用常理的話就會這樣寫
複製程式
new num[60]
for (new i=0;i<sizeof num;i++) num[i] = random_num(1, 100)

用Array表示的話
複製程式
new Array:num = ArrayCreate(1, 1)
for (new i=0;i<60;i++) ArrayPushCell(num, random_num(1, 100))


獻花 x0
引用 | 編輯 安安壓
2011-11-27 19:58
4樓
  
你好 請問在嗎?

獻花 x0