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 |
|
|
|