Quote:
Originally Posted by Bugsy
Why don't you tell us what you changed so we do not need to read every line trying to find the mistake?
|
I made the following changes add new class
PHP Code:
#include <zp50_class_plasma>
#include <zp50_class_knifer>
#include <zp50_class_dragon>
#include <zp50_class_nightcrawler>
add novos cvar
PHP Code:
cvar_nightmare_kni_hp_multi = register_cvar("zp_nightmare_knife_hp_multi", "0.25")
cvar_nightmare_drag_hp_multi = register_cvar("zp_nightmare_dragon_hp_multi", "1.0")
cvar_nightmare_plasm_hp_multi = register_cvar("zp_nightmare_plasma_hp_multi", "1.0")
cvar_nightmare_nigh_hp_multi = register_cvar("zp_nightmare_nightcrawler_hp_multi", "1.0")
add them here too
PHP Code:
public zp_fw_gamemodes_start()
{
// Calculate player counts
new id, alive_count = GetAliveCount()
new survivor_count = floatround(alive_count * 0.20, floatround_ceil)
//new nemesis_count = floatround(alive_count * 0.20, floatround_ceil)
//new sniper_count = floatround(alive_count * 0.10, floatround_ceil)
//new knife_count = floatround(alive_count * 0.15, floatround_ceil)
//new plasma_count = floatround(alive_count * 0.10, floatround_ceil)
//new dragon_count = floatround(alive_count * 0.15, floatround_ceil)
//new nightcrawler_count = floatround(alive_count * 0.10, floatround_ceil)
new nemesis_count = survivor_count
new sniper_count = survivor_count
new knife_count = survivor_count
new plasma_count = survivor_count
new dragon_count = survivor_count
new nightcrawler_count = survivor_count
And in that part
PHP Code:
// Turn specified amount of players into Knifer
new iKnife, iMaxKnife = knife_count
while (iKnife < iMaxKnife)
{
// Choose random guy
id = GetRandomAlive(random_num(1, alive_count))
// Already a survivor or nemesis?
if (zp_class_survivor_get(id) || zp_class_nemesis_get(id) || zp_class_sniper_get(id) || zp_class_knifer_get(id) || zp_class_plasma_get(id) || zp_class_dragon_get(id) || zp_class_nightcrawler_get(id))
continue;
// If not, turn him into one
zp_class_knifer_set(id)
iKnife++
// Apply Knife health multiplier
set_user_health(id, floatround(get_user_health(id) * get_pcvar_float(cvar_nightmare_kni_hp_multi)))
}
// Turn specified amount of players into Knifer
new iPlasma, iMaxPlasma = plasma_count
while (iPlasma < iMaxPlasma)
{
// Choose random guy
id = GetRandomAlive(random_num(1, alive_count))
// Already a survivor or nemesis?
if (zp_class_survivor_get(id) || zp_class_nemesis_get(id) || zp_class_sniper_get(id) || zp_class_knifer_get(id) || zp_class_plasma_get(id) || zp_class_dragon_get(id) || zp_class_nightcrawler_get(id))
continue;
// If not, turn him into one
zp_class_plasma_set(id)
iPlasma++
// Apply Plasma health multiplier
set_user_health(id, floatround(get_user_health(id) * get_pcvar_float(cvar_nightmare_plasm_hp_multi)))
}
// Turn specified amount of players into Knifer
new iDragon, iMaxDragon = dragon_count
while (iDragon < iMaxDragon)
{
// Choose random guy
id = GetRandomAlive(random_num(1, alive_count))
// Already a survivor or nemesis?
if (zp_class_survivor_get(id) || zp_class_nemesis_get(id) || zp_class_sniper_get(id) || zp_class_knifer_get(id) || zp_class_plasma_get(id) || zp_class_dragon_get(id) || zp_class_nightcrawler_get(id))
continue;
// If not, turn him into one
zp_class_dragon_set(id)
iDragon++
// Apply Dragon health multiplier
set_user_health(id, floatround(get_user_health(id) * get_pcvar_float(cvar_nightmare_drag_hp_multi)))
}
// Turn specified amount of players into Knifer
new iNightCrawler, iMaxNightCrawler = nightcrawler_count
while (iNightCrawler < iMaxNightCrawler)
{
// Choose random guy
id = GetRandomAlive(random_num(1, alive_count))
// Already a survivor or nemesis?
if (zp_class_survivor_get(id) || zp_class_nemesis_get(id) || zp_class_sniper_get(id) || zp_class_knifer_get(id) || zp_class_plasma_get(id) || zp_class_dragon_get(id) || zp_class_nightcrawler_get(id))
continue;
// If not, turn him into one
zp_class_nightcrawler_set(id)
iNightCrawler++
// Apply NightCrawler health multiplier
set_user_health(id, floatround(get_user_health(id) * get_pcvar_float(cvar_nightmare_nigh_hp_multi)))
}
// Play Armageddon sound
if (get_pcvar_num(cvar_nightmare_sounds))
{
new sound[SOUND_MAX_LENGTH]
ArrayGetString(g_sound_nightmare, random_num(0, ArraySize(g_sound_nightmare) - 1), sound, charsmax(sound))
PlaySoundToClients(sound)
}