嘛…随便乱回答一下…复制程式
// Make Zombie Task
public make_zombie_task()
{
// Get alive players count
static iPlayersnum, id
iPlayersnum = fnGetAlive()
// Not enough players, come back later!
if (iPlayersnum < 1)
{
g_time_countdown = 10
remove_task(TASK_MAKEZOMBIE)
set_task(1.0, "make_zombie_task", TASK_MAKEZOMBIE)
return;
}
if (g_time_countdown >= 1)
{
for (id = 1; id <= g_maxplayers; id++) if (is_user_alive(id) && !fm_get_user_godmode(id)) fm_set_user_godmode(id, 1)
if (g_time_countdown <= 10)
{
set_hudmessage(255, 0, 0, HUD_EVENT_X, HUD_EVENT_Y + 0.1, 0, 0.0, 3.0, 2.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "%L", LANG_PLAYER, "NOTICE_TIME_COUNTDOWN", g_time_countdown)
PlaySound(sound_countdown[g_time_countdown - 1])
}
g_time_countdown -= 1
remove_task(TASK_MAKEZOMBIE)
set_task(1.0, "make_zombie_task", TASK_MAKEZOMBIE)
}
else
{
for (id = 1; id <= g_maxplayers; id++) if (is_user_alive(id) && fm_get_user_godmode(id)) fm_set_user_godmode(id, 0)
// Call make a zombie with no specific mode
make_a_zombie(MODE_NONE, 0)
}
}
stock fm_get_user_godmode(index)
{
static Float:val
pev(index, pev_takedamage, val)
return (val == DAMAGE_NO)
}
stock fm_set_user_godmode(index, godmode = 0)
{
set_pev(index, pev_takedamage, godmode == 1 ? DAMAGE_NO : DAMAGE_AIM)
}