引用 | 编辑
tw2twtw
2010-11-24 21:45 |
楼主
▼ |
||
x0
问题1 请问如何把下面的 if 变成倒数时间的限制.... 就是在时间到时执行当僵尸王.... // 当剩下最后一只丧尸时,设定让他变成丧尸王. if (ts_num == 1) { 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) } } 问题2~ 我用了sk大的模组被攻击范围....当僵尸王变成残达时是有成功....((用nst 动作100多的残达 但是到下局时"当过僵尸王的小僵拥有达叔的被攻击范围"...... 希望可以设定,下局时会清除这局的效力... x0
|
引用 | 编辑
chuchung712
2010-11-24 22:03 |
1楼
▲ ▼ |
问题1只要用set_task就好了
x0 |
引用 | 编辑
chuchung712
2010-11-24 22:44 |
3楼
▲ ▼ |
复制程式
{ ... ... 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 |
引用 | 编辑
tw2twtw
2010-11-25 21:21 |
4楼
▲ ▼ |
我想设的是游戏下面的黄色倒数.....
而且是要来取代下面这段..... // 当剩下最后一只丧尸时,设定让他变成丧尸王. if (ts_num == 1) x0 |
引用 | 编辑
i-c0112
2010-11-25 22:56 |
5楼
▲ ▼ |
不知道这样行不行
我想应该不行吧 因为这边的 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()) ) } } x0 |
引用 | 编辑
i-c0112
2010-11-25 23:19 |
6楼
▲ ▼ |
不知改成这样如何
懒得编排 请见谅 复制程式 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 |
引用 | 编辑
tw2twtw
2010-11-26 21:39 |
7楼
▲ ▼ |
if 不是每秒判断的
我不是要每秒判断.......只是在某时某刻会出僵尸王.......((这样会不会比较简单? 如:SV回合设置3分钟...在最后一分钟时执行当尸王的指令.... ((不用显示也可.... x0 |