下面是引用 10120091119 于 2010-08-16 18:34 发表的 zp 模式问题:
怎样把幸存者模式变1名幸存改做变3名幸存
删除1人感染模式
拜托
「把幸存者模式变1名幸存改做变3名幸存」:
将「make_a_zombie(mode, id)」里原本的
复制程式
// Choose player randomly?
if (mode == MODE_NONE)
id = fnGetRandomAlive(random_num(1, iPlayersnum))
// Remember id for calling our forward later
forward_id = id
// Turn player into a survivor
humanme(id, 1)
// Turn the remaining players into zombies
for (id = 1; id <= g_maxplayers; id++)
{
// Not alive
if (!is_user_alive(id))
continue;
// Survivor or already a zombie
if (g_survivor[id] || g_zombie[id])
continue;
// Turn into a zombie
zombieme(id, 0, 0, 1)
}
// Play survivor sound
PlaySound(sound_survivor[random_num(0, sizeof sound_survivor -1)]);
// Get player's name
get_user_name(forward_id, name, sizeof name - 1)
// Show Survivor HUD notice
set_hudmessage(20, 20, 255, HUD_EVENT_X, HUD_EVENT_Y, 1, 0.0, 5.0, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "%L", LANG_PLAYER, "NOTICE_SURVIVOR", name)
改成
复制程式
// Turn specified amount of players into Survivors
static iSurvivors, forward_id[3], forward_name[3] // forward_id和forward_name矩阵里的数字代表你想出现的人数
iSurvivors = 0
if (mode != MODE_NONE)
{
// Remember id for calling our forward later
forward_id[iSurvivors] = id
// If not, turn him into one
humanme(id, 1)
iSurvivors++
}
while (iSurvivors < 3) // iSurvivors后面的数字代表你想出现的人数
{
// Choose player randomly?
id = fnGetRandomAlive(random_num(1, iPlayersnum))
// Already a survivor?
if (g_survivor[id])
continue;
// Remember id for calling our forward later
forward_id[iSurvivors] = id
// If not, turn him into one
humanme(id, 1)
iSurvivors++
}
// Turn the remaining players into zombies
for (id = 1; id <= g_maxplayers; id++)
{
// Not alive
if (!is_user_alive(id))
continue;
// Survivor or already a zombie
if (g_survivor[id] || g_zombie[id])
continue;
// Turn into a zombie
zombieme(id, 0, 0, 1)
}
// Play survivor sound
PlaySound(sound_survivor[random_num(0, sizeof sound_survivor -1)]);
// Get player's name
for (iSurvivors = 0; iSurvivors < 3; iSurvivors++) // iSurvivors后面的数字代表你想出现的人数
get_user_name(forward_id[iSurvivors], forward_name[iSurvivors], sizeof forward_name[] - 1)
// Show Survivor HUD notice
set_hudmessage(20, 20, 255, HUD_EVENT_X, HUD_EVENT_Y, 1, 0.0, 5.0, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "%L^n%L^n%L", LANG_PLAYER, "NOTICE_SURVIVOR", forward_name[0], LANG_PLAYER, "NOTICE_SURVIVOR", forward_name[1], LANG_PLAYER, "NOTICE_SURVIVOR", forward_name[2])
// 以上使用三次「, LANG_PLAYER, "NOTICE_SURVIVOR", forward_name[人数]」代表会显示3行谁变成幸存者的字幕
之后再将「public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)」里的
复制程式
// Last human or swarm round or plague round
if (g_swarmround || g_plagueround || fnGetHumans() == 1)
return HAM_IGNORED; // human is killed
改成
复制程式
// Last human or swarm round or plague round
if (g_survround || g_swarmround || g_plagueround || fnGetHumans() == 1)
return HAM_IGNORED; // human is killed