chuchung712

|
分享:
▲
▼
複製程式
{
...
...
if (ts_num == 1)
{
static last_zombie_id
last_zombie_id = ts[0]
if (!g_boss[last_zombie_id]) // 檢查是否已經是成為喪屍王了
{
set_task(【時間】, "set_boss", last_zombie_id) //此行的【時間】要輸入數值
}
}
}
public set_boss(last_zombie_id)
{
g_survivor_class[last_zombie_id] = 0
g_boss[last_zombie_id] = true
set_boss_model(last_zombie_id)
play_boss_ambience_sound()
fm_set_user_health(last_zombie_id, g_boss_health)
g_user_maxspeed[last_zombie_id] = g_boss_maxspeed
fm_set_user_maxspeed(last_zombie_id, g_user_maxspeed[last_zombie_id])
set_task(1.0, "boss_beacon_effect", last_zombie_id)
static tname[32]
get_user_name(last_zombie_id, tname, charsmax(tname))
set_hudmessage(255, 255, 255, -1.0, 0.17, 0, 6.0, 999.0, 0.1, 0.2, -1)
//show_hudmessage(0, "%s is the Boss!!!", tname)
ShowSyncHudMsg(0, g_hudSync3, "%s 是喪屍王!!!", tname)
log_amx("殭屍王出現了,目前第%d局!",g_level)
}
|
沒有理想的世界
|
x0
[3 樓]
From:香港有線寬頻 | Posted:2010-11-24 22:44 |
|
|
i-c0112

|
分享:
▲
▼
不知道這樣行不行 我想應該不行吧 因為這邊的 if 不是每秒判斷的 複製程式
new Float:time_round_start
public event_round_start{
...
time_round_start = get_gametime()
}
if (get_gametime() - time_round_start >= xx.xx && !g_endround)
{
static last_zombie_id
last_zombie_id = ts[0]
if (!g_boss[last_zombie_id]) // 檢查是否已經是成為喪屍王了
{
g_survivor_class[last_zombie_id] = 0
g_boss[last_zombie_id] = true
set_boss_model(last_zombie_id)
play_boss_ambience_sound()
fm_set_user_health(last_zombie_id, g_boss_health)
g_user_maxspeed[last_zombie_id] = g_boss_maxspeed
fm_set_user_maxspeed(last_zombie_id, g_user_maxspeed[last_zombie_id])
set_task(1.0, "boss_beacon_effect", last_zombie_id)
static tname[32]
get_user_name(last_zombie_id, tname, charsmax(tname))
set_hudmessage(255, 255, 255, -1.0, 0.17, 0, 6.0, 999.0, 0.1, 0.2, -1)
//show_hudmessage(0, "%s is the Boss!!!", tname)
ShowSyncHudMsg(0, g_hudSync3, "%s 是喪屍王!!!", tname)
log_amx("殭屍王出現了,目前第%d局!",g_level)
}
else if (!g_endround)
{
set_hudmessage(255, 255, 255, -1.0, 0.17, 0, 6.0, 999.0, 0.1, 0.2, -1)
ShowSyncHudMsg(0, g_hudSync3, "%.2f秒後出現殭屍王!!!", xx.xx - (time_round_start - get_gametime()) )
}
}
[ 此文章被i-c0112在2010-11-25 23:05重新編輯 ]
|
|
x0
[5 樓]
From:台灣中華電信 | Posted:2010-11-25 22:56 |
|
|
i-c0112

|
分享:
▲
▼
不知改成這樣如何 懶得編排 請見諒 複製程式
new Float:time_round_start
public event_round_start
{
...
time_round_start = get_gametime()
set_task(1.0, "check", 0112, _, _, b)
}
if (get_gametime() - time_round_start >= xx.xx && !g_endround)
{
static last_zombie_id
last_zombie_id = ts[0]
if (!g_boss[last_zombie_id]) // 檢查是否已經是成為喪屍王了
{
g_survivor_class[last_zombie_id] = 0
g_boss[last_zombie_id] = true
set_boss_model(last_zombie_id)
play_boss_ambience_sound()
fm_set_user_health(last_zombie_id, g_boss_health)
g_user_maxspeed[last_zombie_id] = g_boss_maxspeed
fm_set_user_maxspeed(last_zombie_id, g_user_maxspeed[last_zombie_id])
set_task(1.0, "boss_beacon_effect", last_zombie_id)
static tname[32]
get_user_name(last_zombie_id, tname, charsmax(tname))
set_hudmessage(255, 255, 255, -1.0, 0.17, 0, 6.0, 999.0, 0.1, 0.2, -1)
//show_hudmessage(0, "%s is the Boss!!!", tname)
ShowSyncHudMsg(0, g_hudSync3, "%s 是喪屍王!!!", tname)
log_amx("殭屍王出現了,目前第%d局!",g_level)
}
}
public check(id)
{
if(get_gametime() - time_round_start >= xx.xx && !g_endround)
{
remove_task(0112)
new i = random_num(1, g_maxplayers)
while(!g_zombie[i] || !is_user_alive(i) || !g_boss[i])
i = random_num(1, g_maxplayers)
g_survivor_class[last_zombie_id] = 0
g_boss[last_zombie_id] = true
set_boss_model(last_zombie_id)
play_boss_ambience_sound()
fm_set_user_health(last_zombie_id, g_boss_health)
g_user_maxspeed[last_zombie_id] = g_boss_maxspeed
fm_set_user_maxspeed(last_zombie_id, g_user_maxspeed[last_zombie_id])
set_task(1.0, "boss_beacon_effect", last_zombie_id)
static tname[32]
get_user_name(last_zombie_id, tname, charsmax(tname))
set_hudmessage(255, 255, 255, -1.0, 0.17, 0, 6.0, 999.0, 0.1, 0.2, -1)
//show_hudmessage(0, "%s is the Boss!!!", tname)
ShowSyncHudMsg(0, g_hudSync3, "%s 是喪屍王!!!", tname)
log_amx("殭屍王出現了,目前第%d局!",g_level)
}
else if (!g_endround)
{
set_hudmessage(255, 255, 255, -1.0, 0.17, 0, 6.0, 999.0, 0.1, 0.2, -1)
ShowSyncHudMsg(0, g_hudSync3, "%.2f秒後出現殭屍王!!!", xx.xx - (time_round_start - get_gametime()) )
}
}
|
|
x0
[6 樓]
From:台灣中華電信 | Posted:2010-11-25 23:19 |
|
|
|