1. Vamos a game modes.
Veremos esto :
PHP Code:
MODE_NONE = 0,
MODE_INFECTION,
MODE_NEMESIS,
MODE_SURVIVOR,
MODE_SWARM,
MODE_MULTI,
MODE_PLAGUE
Nosotros lo dejaremos asi :
PHP Code:
MODE_NONE = 0,
MODE_INFECTION,
MODE_NEMESIS,
MODE_SURVIVOR,
MODE_SWARM,
MODE_MULTI,
MODE_PLAGUE,
MODE_ARMAGEDON
Ahora vamos a
PHP Code:
if ((mode == MODE_NONE && (!preventconsecutive || g_lastmode != MODE_SURVIVOR) && random_num(1, get_pcvar_num(cvar_survchance)) == get_pcvar_num(cvar_surv) && iPlayersnum >= get_pcvar_num(cvar_survminplayers)) || mode == MODE_SURVIVOR)
Abajo de :
PHP Code:
ExecuteForward(g_fwRoundStart, g_fwDummyResult, MODE_SURVIVOR, forward_id);
}
Tenemos que poner :
PHP Code:
else if ((mode == MODE_NONE && (!preventconsecutive || g_lastmode != MODE_ARMAGEDON) && random_num(1, get_pcvar_num(cvar_armagedonchance)) == get_pcvar_num(cvar_armagedon) && floatround((iPlayersnum-2)*get_pcvar_float(cvar_armagedonratio), floatround_ceil) >= 1 && iPlayersnum >= get_pcvar_num(cvar_armagedonminplayers)) || mode == MODE_ARMAGEDON)
{
//Armagedon Mode
g_plagueround = true
g_armagedonround = true
// Turn someone into a Survivor
id = fnGetRandomAlive(random_num(1, iPlayersnum))
humanme(id, 1)
// Turn someone into a Nemesis (not the survivor!)
while (g_survivor[id]) id = fnGetRandomAlive(random_num(1, iPlayersnum));
zombieme(id, 0, 1, 0)
// iMaxZombies is rounded up, in case there aren't enough players
iMaxZombies = floatround((iPlayersnum-2)*get_pcvar_float(cvar_plagueratio), floatround_ceil)
iZombies = 0
// Randomly turn iMaxZombies players into zombies
while (iZombies < iMaxZombies)
{
if (id < g_maxplayers)
id++
else
id = 1
// Dead or already a zombie or survivor
if (!is_user_alive(id) || g_zombie[id] || g_survivor[id])
continue;
// Random chance
if (random_num(0, 1))
{
// Turn into a nemesis
zombieme(id, 0, 1, 0)
iZombies++
}
}
// Turn the rest of players into humans
for (id = 1; id <= g_maxplayers; id++)
{
// Only those of them who arent zombies or survivor
if (!is_user_alive(id) || g_zombie[id] || g_survivor[id])
continue
// Remove previous tasks and make them survivors
remove_task(id+TASK_TEAM)
humanme(id, 1)
/* Switch to CT
if (fm_get_user_team(id) != CS_TEAM_CT) // need to change team?
{
fm_set_user_team(id, CS_TEAM_CT)
set_task(0.1+g_teams_i, "fm_set_user_team_msg", id+TASK_TEAM)
g_teams_i += 0.1; // increase teams task counter
}*/
}
// Play plague sound
PlaySound(sound_plague[random_num(0, sizeof sound_plague -1)]);
// Show Plague HUD notice
set_hudmessage(0, 50, 200, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "%L", LANG_PLAYER, "NOTICE_ARMAGEDON")
// Round start forward
ExecuteForward(g_fwRoundStart, g_fwDummyResult, MODE_ARMAGEDON, 0);
}
Ahora vamos a :
Abajo de
PHP Code:
new g_nemround // nemesis round
Agregamos esto
PHP Code:
new g_armagedonround // armagedon round
Vamos a
PHP Code:
// CVAR pointers
Al lado de
agregamos :
PHP Code:
cvar_armagedonratio, cvar_armagedon, cvar_armagedonchance, cvar_armagedonminplayers,
Y nos quedaria asi no?
PHP Code:
cvar_humanhp, cvar_armagedonratio, cvar_armagedon, cvar_armagedonchance, cvar_armagedonminplayers,
Ahora vamos a
PHP Code:
// Admin commands
y agregamos :
PHP Code:
register_concmd("zp_armagedon", "cmd_armagedon", ACCESS_FLAG, " - start mode armagedon")
Vamos aca :
PHP Code:
// New round starting
g_newround = true
g_endround = false
g_survround = false
g_nemround = false
g_swarmround = false
g_plagueround = false
g_raptorround = false
g_synapsisround = false
g_sniperround = false
g_assaround = false
ahi agregamos :
PHP Code:
// New round starting
g_newround = true
g_endround = false
g_survround = false
g_nemround = false
g_armagedonround = false <--- nustro armagedon
g_swarmround = false
g_plagueround = false
g_raptorround = false
g_synapsisround = false
g_sniperround = false
g_assaround = false
vamos a [Admin Commands] abajo de "zp_swarm"
agregamos :
PHP Code:
// zp_armagedon
public cmd_armagedon(id, level, cid)
{
// Check for access flag
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED;
// Swarm mode not allowed
if (!allowed_swarm())
{
client_print(id, print_console, "[ZP] %L", id, "CMD_NOT")
return PLUGIN_HANDLED;
}
command_armagedon(id)
return PLUGIN_HANDLED;
}
ahora vamos a // Reset Player Vars
ahi agregamos
PHP Code:
g_armagedon[id] = false
ahora // Admin Command. zp_swarm
PHP Code:
command_armagedon(id)
{
static name1[32]
get_user_name(id, name1, sizeof name1 - 1)
// Show activity?
switch (get_pcvar_num(cvar_showactivity))
{
case 1: client_print(0, print_chat, "ADMIN - %L", LANG_PLAYER, "CMD_ARMAGEDON")
case 2: client_print(0, print_chat, "ADMIN %s - %L", name1, LANG_PLAYER, "CMD_ARMAGEDON")
}
// Log to Zombie Plague log file?
if (get_pcvar_num(cvar_logcommands))
{
static logdata[100], authid[32], ip[16]
get_user_authid(id, authid, sizeof authid - 1)
get_user_ip(id, ip, sizeof ip - 1, 1)
formatex(logdata, sizeof logdata - 1, "ADMIN %s <%s><%s> - %L (Players: %d/%d)", name1, authid, ip, LANG_SERVER, "CMD_ARMAGEDON", fnGetPlaying(), g_maxplayers)
log_to_file("zombieplague.log", logdata)
}
// Call Swarm Mode
remove_task(TASK_MAKEZOMBIE)
make_a_zombie(MODE_ARMAGEDON, 0)
}
Vamos a // Player vars
y agregamos esto:
PHP Code:
new g_armagedon[33] // is armagedon
Despues vamos a // CVARS - Swarm Mode
y agregamos esto :
PHP Code:
// CVARS - Armagedon Mode
cvar_armagedon = register_cvar("zp_armagedon_enabled", "1")
cvar_armagedonchance = register_cvar("zp_armagedon_chance", "30")
cvar_armagedonminplayers = register_cvar("zp_armagedon_min_players", "0")
Probablemente ahi nos tire warnign o algo asi xD asi que :
Vamos a
PHP Code:
public plugin_natives()
y agregamos
PHP Code:
register_native("zp_get_user_armagedon", "native_get_user_armagedon", 1)
Luego a
// Round natives
y agregamos :
PHP Code:
register_native("zp_is_armagedon_round", "native_is_armagedon_round", 1)
Vamos a
PHP Code:
// Native: zp_get_user_survivor
y agregamos
PHP Code:
// Native: zp_get_user_armagedon
public native_get_user_armagedon(id)
{
return g_armagedon[id];
}
Por ultimo :
PHP Code:
// Native: zp_is_armagedon_round
public native_is_armagedon_round()
{
return g_armagedonround;
}
Fin del tuto