tony987852

|
分享:
▲
▼
下面是引用 a7811311622 於 2010-04-17 01:08 發表的 :  我會解釋的部分只有: ExecuteHam(Ham_Killed, this, idattacker, shouldgib) this:要被殺死之目標ID idattacker:殺人者之ID shouldgib:如果是1就是讓屍體留個全屍…就是普通的屍體…但是如果是2…就是死無全屍… 如果看過復仇者被幹掉時的壯烈畫面就知道何謂「死無全屍」… 請問....如果要讓一個人殺掉另一個人...是這樣嗎 public cmd_kill(id, level, cid) { if (!cmd_access(id, level, cid, 3)) return PLUGIN_HANDLED new Arg1[32] new Arg2[32] read_argv(1, Arg1, 31) read_argv(2, Arg2, 31) new player = cmd_target(id, Arg1, 24) new player2 = cmd_target(id, Arg2, 4) if (!player) { return PLUGIN_HANDLED } else { ExecuteHam(Ham_Killed, player2, player, 1) } return PLUGIN_HANDLED }
|
|
x0
[2 樓]
From:未知地址 | Posted:2010-04-17 08:53 |
|
|
a7811311622
我…在工作了…

級別: 版主 
版區: CS提問區
x771
x2152
|
分享:
▲
▼
下面是引用 tony987852 於 2010-04-17 08:53 發表的 :
請問....如果要讓一個人殺掉另一個人...是這樣嗎 public cmd_kill(id, level, cid) { if (!cmd_access(id, level, cid, 3)) return PLUGIN_HANDLED
new Arg1[32] new Arg2[32]
read_argv(1, Arg1, 31) read_argv(2, Arg2, 31)
new player = cmd_target(id, Arg1, 24) new player2 = cmd_target(id, Arg2, 4)
if (!player) { return PLUGIN_HANDLED } else { ExecuteHam(Ham_Killed, player2, player, 1) }
return PLUGIN_HANDLED }
「cmd_kill」?這是判斷輸入"kill ×××"的指令才會判斷的嗎? 其實不一定要這麼寫…只需用個迴圈讀取所有人的ID即可, 例如「for(i = 1; i <= get_playersnum(); i++)」 之後再判斷「if (id != i)」,內容寫成「ExecuteHam(Ham_Killed, i, id, 1)」, 這樣就能讓自己以外的人全部被你殺死…傳說中的「一回合抹殺」… 
|
|
x0
[3 樓]
From:台灣教育部 | Posted:2010-04-17 10:05 |
|
|
|