grandc2000
|
分享:
▼
x0
|
[1.6][插件] 有關格式 sma
|
|
|
|
我將個 sma.檔 放入compile 但轉唔返amx檔出黎 唔知邊到出現左問題
紅色=修改 roundsound_4
// * 回合結束播放歌曲 * // 這回合某一方獲勝時,則下回合開始時就會播放獲勝那一隊的歌曲,最多播放到回合結束,或歌曲播放完畢. #include <amxmodx> #include <amxmisc> #define KEYS (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9) //KEYS:1,2,3,4,5,6,7,8,9,0 new bool:play_sound[33] //歌曲可以自行添加刪減,CT和TS的歌曲數量不用一樣,可以設定各自的數量 new tsoundlist[][] = { "G1Jockey001", "G1Jockey002", "G1Jockey003", "G1Jockey004", "G1Jockey005", "G1Jockey006", "G1Jockey007", "G1Jockey008", "G1Jockey009", "G1Jockey010", "G1Jockey011", "G1Jockey012", "G1Jockey014", "G1Jockey015" , "G1Jockey016" , "G1Jockey017" , "G1Jockey018" , "G1Jockey019" , "G1Jockey020" , "G1Jockey021", "G1Jockey022" , "G1Jockey023" , "G1Jockey024" , "G1Jockey025" , "G1Jockey026" , "G1Jockey027" , "G1Jockey028" , "G1Jockey029" , "G1Jockey030","G1Jockey031, "G1Jockey032" , "G1Jockey033" }, "G1Jockey034" , "G1Jockey035", "G1Jockey036" , "G1Jockey037", "G1Jockey038" , "G1Jockey039" , "G1Jockey040" } new ctsoundlist[][]= { "G1Jockey001", "G1Jockey002", "G1Jockey003", "G1Jockey004", "G1Jockey005", "G1Jockey006", "G1Jockey007", "G1Jockey008" , "G1Jockey009", "G1Jockey010", "G1Jockey011", "G1Jockey012", "G1Jockey014" , "G1Jockey015" , "G1Jockey016" , "G1Jockey017" , "G1Jockey018" , "G1Jockey019" , "G1Jockey020" , "G1Jockey021", "G1Jockey022" , "G1Jockey023" , "G1Jockey024" , "G1Jockey025" , "G1Jockey026" , "G1Jockey027" , "G1Jockey028" , "G1Jockey029" , "G1Jockey030","G1Jockey031, "G1Jockey032" }, "G1Jockey033" , "G1Jockey034" , "G1Jockey035", "G1Jockey036" , "G1Jockey037", "G1Jockey038" , "G1Jockey039" , "G1Jockey040" } //預設放歌曲的路徑,以 cstrike\sound 為放置起點 new sound_path[] = "misc/" new maxplayers new win_team public plugin_init() { register_plugin("RoundSound", "2.0", "kevin14144") register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin") register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin") register_event("ResetHUD","NewRound","be") register_logevent("logevent_round_end", 2, "1=Round_End") register_clcmd("say /roundsound", "roundsound_set_menu") register_clcmd("say_team /roundsound", "roundsound_set_menu") register_menucmd(register_menuid("Set RoundSound Play"), KEYS, "roundsound_set_process") maxplayers = get_maxplayers() } public plugin_precache() { new i, temp[128] for (i = 0; i < sizeof tsoundlist; i++) { format(temp, sizeof temp -1, "%s%s.mp3", sound_path, tsoundlist) precache_sound(temp) } for (i = 0; i < sizeof ctsoundlist; i++) { format(temp, sizeof temp -1, "%s%s.mp3", sound_path, ctsoundlist) precache_sound(temp) } for (i = 1; i <= 32; i++) play_sound = true return PLUGIN_CONTINUE } public t_win() { win_team = 1 return PLUGIN_CONTINUE } public ct_win() { win_team = 2 return PLUGIN_CONTINUE } public NewRound() { if (win_team > 0) { new i, sound[128] switch (win_team) { case 1: { i = random_num(0, sizeof tsoundlist -1) format(sound, sizeof sound -1, "%s%s", sound_path, tsoundlist) } case 2: { i = random_num(0, sizeof ctsoundlist -1) format(sound, sizeof sound -1, "%s%s", sound_path, ctsoundlist) } } for (i = 1; i <= maxplayers; i++) { if (play_sound) client_cmd(i, "mp3 play sound/%s", sound) } } win_team = 0 return PLUGIN_CONTINUE } public logevent_round_end() { client_cmd(0, "mp3 stop") return PLUGIN_CONTINUE } public roundsound_set_menu(id) { new menu[256], len len = format(menu, sizeof menu - 1, "\r回合結束音樂播放設定^n^n") if (play_sound[id]) { len += format(menu[len], sizeof menu - 1 - len, "\y1. 播放音樂^n") len += format(menu[len], sizeof menu - 1 - len, "\w2. 關掉音樂^n^n") } else { len += format(menu[len], sizeof menu - 1 - len, "\w1. 播放音樂^n") len += format(menu[len], sizeof menu - 1 - len, "\y2. 關掉音樂^n^n") } format(menu[len], sizeof menu - 1 - len, "\w0. 離開") show_menu(id, KEYS, menu, -1, "Set RoundSound Play") } public roundsound_set_process(id, key) { switch (key) { case 0: play_sound[id] = true case 1: play_sound[id] = false case 9: return PLUGIN_HANDLED default: { roundsound_set_menu(id) return PLUGIN_HANDLED } } return PLUGIN_HANDLED }
[ 此文章被grandc2000在2010-07-19 18:58重新編輯 ] |
|
|
|
|
|
|
x0
[樓 主]
From:香港特別行政區 | Posted:2010-07-19 18:19 |
|
|
grandc2000
|
分享:
▲
▼
new tsoundlist[][] = { "G1Jockey001", "G1Jockey002", "G1Jockey003", "G1Jockey004", "G1Jockey005", "G1Jockey006", "G1Jockey007", "G1Jockey008", "G1Jockey009", "G1Jockey010", "G1Jockey011", "G1Jockey012", "G1Jockey014", "G1Jockey015" , "G1Jockey016" , "G1Jockey017" , "G1Jockey018" , "G1Jockey019" , "G1Jockey020" , "G1Jockey021", "G1Jockey022" , "G1Jockey023" , "G1Jockey024" , "G1Jockey025" , "G1Jockey026" , "G1Jockey027" , "G1Jockey028" , "G1Jockey029" , "G1Jockey030","G1Jockey031, "G1Jockey032" , "G1Jockey033" , "G1Jockey034" , "G1Jockey035", "G1Jockey036" , "G1Jockey037", "G1Jockey038" , "G1Jockey039" , "G1Jockey040" } new ctsoundlist[][]= { "G1Jockey001", "G1Jockey002", "G1Jockey003", "G1Jockey004", "G1Jockey005", "G1Jockey006", "G1Jockey007", "G1Jockey008" , "G1Jockey009", "G1Jockey010", "G1Jockey011", "G1Jockey012", "G1Jockey014" , "G1Jockey015" , "G1Jockey016" , "G1Jockey017" , "G1Jockey018" , "G1Jockey019" , "G1Jockey020" , "G1Jockey021", "G1Jockey022" , "G1Jockey023" , "G1Jockey024" , "G1Jockey025" , "G1Jockey026" , "G1Jockey027" , "G1Jockey028" , "G1Jockey029" , "G1Jockey030","G1Jockey031, "G1Jockey032" , "G1Jockey033" , "G1Jockey034" , "G1Jockey035", "G1Jockey036" , "G1Jockey037", "G1Jockey038" , "G1Jockey039" , "G1Jockey040" }
以修改 都係唔得
|
|
x0
[3 樓]
From:香港特別行政區 | Posted:2010-07-19 19:00 |
|
|
|