29/03/2021, 06:40 PM
(Última modificación: 29/03/2021, 06:44 PM por aramayo123. Edited 3 times in total.)
Hola necesito ayuda con mi zp, aveces se bugea y no inicia ningun modo.. alguien sabe por que pueda ser? en consola y logs me tira este error
L 03/29/2021 - 17:05:52: [AMXX] Run time error 10: native error (native "get_pcvar_float")
L 03/29/2021 - 17:05:52: [AMXX] [0] zombie_plague40.sma::make_a_zombie (line 6330)
L 03/29/2021 - 17:05:52: [AMXX] [1] zombie_plague40.sma::make_zombie_task (line 6239)
dejo el make
L 03/29/2021 - 17:05:52: [AMXX] Run time error 10: native error (native "get_pcvar_float")
L 03/29/2021 - 17:05:52: [AMXX] [0] zombie_plague40.sma::make_a_zombie (line 6330)
L 03/29/2021 - 17:05:52: [AMXX] [1] zombie_plague40.sma::make_zombie_task (line 6239)
dejo el make
Código PHP:
// Make Zombie Task
public make_zombie_task()
{
// Call make a zombie with no specific mode
make_a_zombie(MODE_NONE, 0)
}
Código PHP:
// Make a Zombie Function
make_a_zombie(mode, id)
{
// Get alive players count
static iPlayersnum
iPlayersnum = fnGetAlive()
// Not enough players, come back later!
if (iPlayersnum < 1)
{
set_task(10.0, "make_zombie_task", TASK_MAKEZOMBIE)
return;
}
#if defined AMBIENCE_SOUNDS
// Start ambience sounds after a mode begins
remove_task(TASK_AMBIENCESOUNDS)
set_task(2.0, "ambience_sound_effects", TASK_AMBIENCESOUNDS)
#endif
// Get prevent consecutive modes setting
static preventconsecutive
preventconsecutive = get_pcvar_num(cvar_preventconsecutive)
// Round starting
g_newround = false
/* para evitar bugs
g_survround = false
g_nemround = false
g_swarmround = false
g_plagueround = false
g_weskerround = false
g_aniquilacionround = false
g_sniperround = false
*/
// Set up some common vars
static forward_id, name[32], iZombies, iMaxZombies
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)
{
// Survivor Mode
g_survround = true
g_lastmode = MODE_SURVIVOR
// 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)
static survhealth
survhealth = get_pcvar_num(cvar_survhp)
fm_set_user_health(id, survhealth + ammount_shealth(g_habilidad[id][2][1]))
set_pev(id, pev_gravity, get_pcvar_float(cvar_survgravity) - ammount_sgravity(g_habilidad[id][2][3]))
// 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)
// Round start forward
ExecuteForward(g_fwRoundStart, g_fwDummyResult, MODE_SURVIVOR, forward_id);
}
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, "!!!ARMAGEDON!!!")
// Round start forward
ExecuteForward(g_fwRoundStart, g_fwDummyResult, MODE_ARMAGEDON, 0);
}
else if ((mode == MODE_NONE && (!preventconsecutive || g_lastmode != MODE_SYNAPSIS) && random_num(1, get_pcvar_num(cvar_synapsischance)) == get_pcvar_num(cvar_synapsis) && floatround((iPlayersnum-2)*get_pcvar_float(cvar_synapsisratio), floatround_ceil) >= 1 && iPlayersnum >= get_pcvar_num(cvar_synapsisminplayers)) || mode == MODE_SYNAPSIS)
{
//Synapsis mode
g_plagueround = true
g_synapsisround = true
// Turn 3 into a nemesis
id = fnGetRandomAlive(random_num(1, iPlayersnum))
zombieme(id, 0, 1, 0)
id = fnGetRandomAlive(random_num(1, iPlayersnum))
if (!g_nemesis[id])
{
zombieme(id, 0, 1, 0)
}
else
{
id = fnGetRandomAlive(random_num(1, iPlayersnum))
zombieme(id, 0, 1, 0)
}
if (!g_nemesis[id])
{
zombieme(id, 0, 1, 0)
}
else
{
id = fnGetRandomAlive(random_num(1, iPlayersnum))
zombieme(id, 0, 1, 0)
}
// Finish
for (id = 1; id <= g_maxplayers; id++)
{
// Only those of them who arent zombies or survivor
if (!is_user_alive(id) || g_nemesis[id] )
continue
// Remove previous tasks
remove_task(id+TASK_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, "Modo Synapsis")
// Round start forward
ExecuteForward(g_fwRoundStart, g_fwDummyResult, MODE_SYNAPSIS, 0);
}
else if ((mode == MODE_NONE && (!preventconsecutive || g_lastmode != MODE_SNIPER) && random_num(1, get_pcvar_num(cvar_sniperchance)) == get_pcvar_num(cvar_sniper) && iPlayersnum >= get_pcvar_num(cvar_sniperminplayers)) || mode == MODE_SNIPER)
{
g_survround = false
g_sniperround = true
g_lastmode = MODE_SNIPER
id = fnGetRandomAlive(random_num(1, iPlayersnum))
forward_id = id
g_survivor[id] = false
g_sniper[id] = true
humanme(id, 1)
fm_strip_user_weapons(id)
fm_give_item(id, "weapon_knife")
fm_give_item(id, "weapon_awp")
fm_set_rendering(id, kRenderFxGlowShell, 26, 248, 74, kRenderNormal, 8)
static sniperhealth
sniperhealth = get_pcvar_num(cvar_sniperhp)
fm_set_user_health(id, sniperhealth)
set_pev(id, pev_gravity, get_pcvar_float(cvar_snipergravity))
for (id = 1; id <= g_maxplayers; id++)
{
if (!is_user_alive(id))
continue;
if (g_survivor[id] || g_zombie[id])
continue;
zombieme(id, 0, 1, 0)
}
PlaySound(sound_wesker[random_num(0, sizeof sound_wesker -1)]);
get_user_name(forward_id, name, sizeof name - 1)
set_hudmessage(185, 135, 15, HUD_EVENT_X, HUD_EVENT_Y, 1, 0.0, 5.0, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "!!! %s Es SNIPER !!!", name)
ExecuteForward(g_fwRoundStart, g_fwDummyResult, MODE_SNIPER, forward_id);
}
else if ((mode == MODE_NONE && (!preventconsecutive || g_lastmode != MODE_WESKER) && random_num(1, get_pcvar_num(cvar_weskerchance)) == get_pcvar_num(cvar_wesker) && iPlayersnum >= get_pcvar_num(cvar_weskerminplayers)) || mode == MODE_WESKER)
{
// wesker Mode
g_survround = false
g_weskerround = true
g_lastmode = MODE_WESKER
// Choose player randomly?
id = fnGetRandomAlive(random_num(1, iPlayersnum))
// Remember id for calling our forward later
forward_id = id
g_survivor[id] = false
g_wesker[id] = true
humanme(id, 1)
fm_strip_user_weapons(id)
fm_give_item(id, "weapon_knife")
fm_give_item(id, "weapon_ak47")
fm_set_rendering(id, kRenderFxGlowShell, 252, 202, 3, kRenderNormal, 8)
static weskerhealth
weskerhealth = get_pcvar_num(cvar_weskerhp)
fm_set_user_health(id, weskerhealth + ammount_whealth(g_habilidad[id][4][1]))
set_pev(id, pev_gravity, get_pcvar_float(cvar_weskergravity) - ammount_wgravity(g_habilidad[id][4][3]))
// Turn the rest of players into a zombie
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 swarm sound
PlaySound(sound_wesker[random_num(0, sizeof sound_wesker -1)]);
// Get player's name
get_user_name(forward_id, name, sizeof name - 1)
// Show wesker HUD notice
set_hudmessage(185, 135, 15, HUD_EVENT_X, HUD_EVENT_Y, 1, 0.0, 5.0, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "!!%s es WESKER!!", name)
// Round start forward
ExecuteForward(g_fwRoundStart, g_fwDummyResult, MODE_WESKER, forward_id);
}
else if ((mode == MODE_NONE && (!preventconsecutive || g_lastmode != MODE_SWARM) && random_num(1, get_pcvar_num(cvar_swarmchance)) == get_pcvar_num(cvar_swarm) && iPlayersnum >= get_pcvar_num(cvar_swarmminplayers)) || mode == MODE_SWARM)
{
// Swarm Mode
g_swarmround = true
g_lastmode = MODE_SWARM
// Turn every T into a zombie
for (id = 1; id <= g_maxplayers; id++)
{
// Not alive
if (!is_user_alive(id))
continue;
// Not a Terrorist
if (fm_get_user_team(id) != CS_TEAM_T)
continue;
// Turn into a zombie
zombieme(id, 0, 0, 1)
}
// Play swarm sound
PlaySound(sound_swarm[random_num(0, sizeof sound_swarm -1)]);
// Show Swarm HUD notice
set_hudmessage(20, 255, 20, HUD_EVENT_X, HUD_EVENT_Y, 1, 0.0, 5.0, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "%L", LANG_PLAYER, "NOTICE_SWARM")
// Round start forward
ExecuteForward(g_fwRoundStart, g_fwDummyResult, MODE_SWARM, 0);
}
else if ((mode == MODE_NONE && (!preventconsecutive || g_lastmode != MODE_MULTI) && random_num(1, get_pcvar_num(cvar_multichance)) == get_pcvar_num(cvar_multi) && floatround(iPlayersnum*get_pcvar_float(cvar_multiratio), floatround_ceil) >= 2 && floatround(iPlayersnum*get_pcvar_float(cvar_multiratio), floatround_ceil) < iPlayersnum && iPlayersnum >= get_pcvar_num(cvar_multiminplayers)) || mode == MODE_MULTI)
{
// Multi Infection Mode
g_lastmode = MODE_MULTI
// iMaxZombies is rounded up, in case there aren't enough players
iMaxZombies = floatround(iPlayersnum*get_pcvar_float(cvar_multiratio), floatround_ceil)
iZombies = 0
// Randomly turn iMaxZombies players into zombies
while (iZombies < iMaxZombies)
{
// Keep looping through all players
if (++id > g_maxplayers) id = 1
// Dead or already a zombie
if (!is_user_alive(id) || g_zombie[id])
continue;
// Random chance
if (random_num(0, 1))
{
// Turn into a zombie
zombieme(id, 0, 0, 1)
iZombies++
}
}
// Turn the remaining players into humans
for (id = 1; id <= g_maxplayers; id++)
{
// Only those of them who aren't zombies
if (!is_user_alive(id) || g_zombie[id])
continue
// Remove previous tasks
remove_task(id+TASK_TEAM)
// Switch to CT
if (fm_get_user_team(id) != CS_TEAM_CT) // need to change team?
{
fm_set_user_team(id, CS_TEAM_CT)
fm_user_team_update(id)
}
}
// Play multi infection sound
PlaySound(sound_multi[random_num(0, sizeof sound_multi -1)]);
// Show Multi Infection HUD notice
set_hudmessage(200, 50, 0, HUD_EVENT_X, HUD_EVENT_Y, 1, 0.0, 5.0, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "%L", LANG_PLAYER, "NOTICE_MULTI")
// Round start forward
ExecuteForward(g_fwRoundStart, g_fwDummyResult, MODE_MULTI, 0);
}
else if ((mode == MODE_NONE && (!preventconsecutive || g_lastmode != MODE_ANIQUILACION) && random_num(1, get_pcvar_num(cvar_aniquilacionchance)) == get_pcvar_num(cvar_aniquilacion) && floatround((iPlayersnum-2)*get_pcvar_float(cvar_aniquilacionratio), floatround_ceil) >= 1 && iPlayersnum >= get_pcvar_num(cvar_aniquilacionminplayers)) || mode == MODE_ANIQUILACION)
{
g_aniquilacionround = true
server_cmd("zp_deathmatch 2")
id = fnGetRandomAlive(random_num(1, iPlayersnum))
new name[33]
get_user_name(id, name, 32)
set_hudmessage(255, 0, 0, HUD_EVENT_X, HUD_EVENT_Y, 1, 0.0, 5.0, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "Modo Aniquilacion!^nInfectado: %s", name)
zombieme(id, 0, 0, 1)
// Remaining players should be humans (CTs)
for (id = 1; id <= g_maxplayers; id++)
{
// Not alive
if (!is_user_alive(id))
continue;
message_begin(MSG_ONE_UNRELIABLE, g_msgScreenShake, _, id)
write_short(UNIT_SECOND*100) // amplitude
write_short(UNIT_SECOND*5) // duration
write_short(UNIT_SECOND*120) // frequency
message_end()
// First zombie/nemesis
if (g_zombie[id])
continue;
// Remove previous tasks
remove_task(id+TASK_TEAM)
// Switch to CT
if (fm_get_user_team(id) != CS_TEAM_CT) // need to change team?
{
fm_set_user_team(id, CS_TEAM_CT)
fm_user_team_update(id)
}
}
PlaySound(sound_plague[random_num(0, sizeof sound_plague -1)]);
ExecuteForward(g_fwRoundStart, g_fwDummyResult, MODE_ANIQUILACION, 0);
}
else if ((mode == MODE_NONE && (!preventconsecutive || g_lastmode != MODE_PLAGUE) && random_num(1, get_pcvar_num(cvar_plaguechance)) == get_pcvar_num(cvar_plague) && floatround((iPlayersnum-(get_pcvar_num(cvar_plaguenemnum)+get_pcvar_num(cvar_plaguesurvnum)))*get_pcvar_float(cvar_plagueratio), floatround_ceil) >= 1
&& iPlayersnum-(get_pcvar_num(cvar_plaguesurvnum)+get_pcvar_num(cvar_plaguenemnum)+floatround((iPlayersnum-(get_pcvar_num(cvar_plaguenemnum)+get_pcvar_num(cvar_plaguesurvnum)))*get_pcvar_float(cvar_plagueratio), floatround_ceil)) >= 1 && iPlayersnum >= get_pcvar_num(cvar_plagueminplayers)) || mode == MODE_PLAGUE)
{
// Plague Mode
g_plagueround = true
g_lastmode = MODE_PLAGUE
// Turn specified amount of players into Survivors
static iSurvivors, iMaxSurvivors
iMaxSurvivors = get_pcvar_num(cvar_plaguesurvnum)
iSurvivors = 0
while (iSurvivors < iMaxSurvivors)
{
// Choose random guy
id = fnGetRandomAlive(random_num(1, iPlayersnum))
// Already a survivor?
if (g_survivor[id])
continue;
// If not, turn him into one
humanme(id, 1)
iSurvivors++
// Apply survivor health multiplier
fm_set_user_health(id, floatround(pev(id, pev_health)*get_pcvar_float(cvar_plaguesurvhpmulti)))
}
// Turn specified amount of players into Nemesis
static iNemesis, iMaxNemesis
iMaxNemesis = get_pcvar_num(cvar_plaguenemnum)
iNemesis = 0
while (iNemesis < iMaxNemesis)
{
// Choose random guy
id = fnGetRandomAlive(random_num(1, iPlayersnum))
// Already a survivor or nemesis?
if (g_survivor[id] || g_nemesis[id])
continue;
// If not, turn him into one
zombieme(id, 0, 1, 0)
iNemesis++
// Apply nemesis health multiplier
fm_set_user_health(id, floatround(pev(id, pev_health)*get_pcvar_float(cvar_plaguenemhpmulti)))
}
// iMaxZombies is rounded up, in case there aren't enough players
iMaxZombies = floatround((iPlayersnum-(get_pcvar_num(cvar_plaguenemnum)+get_pcvar_num(cvar_plaguesurvnum)))*get_pcvar_float(cvar_plagueratio), floatround_ceil)
iZombies = 0
// Randomly turn iMaxZombies players into zombies
while (iZombies < iMaxZombies)
{
// Keep looping through all players
if (++id > g_maxplayers) 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 zombie
zombieme(id, 0, 0, 1)
iZombies++
}
}
// Turn the remaining 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
remove_task(id+TASK_TEAM)
// Switch to CT
if (fm_get_user_team(id) != CS_TEAM_CT) // need to change team?
{
fm_set_user_team(id, CS_TEAM_CT)
fm_user_team_update(id)
}
}
// Play plague sound
PlaySound(sound_plague[random_num(0, sizeof sound_plague -1)]);
// Show Plague HUD notice
set_hudmessage(0, 50, 200, HUD_EVENT_X, HUD_EVENT_Y, 1, 0.0, 5.0, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "%L", LANG_PLAYER, "NOTICE_PLAGUE")
// Round start forward
ExecuteForward(g_fwRoundStart, g_fwDummyResult, MODE_PLAGUE, 0);
}
else
{
// Single Infection Mode or Nemesis Mode
// Choose player randomly?
if (mode == MODE_NONE)
id = fnGetRandomAlive(random_num(1, iPlayersnum))
// Remember id for calling our forward later
forward_id = id
if ((mode == MODE_NONE && (!preventconsecutive || g_lastmode != MODE_NEMESIS) && random_num(1, get_pcvar_num(cvar_nemchance)) == get_pcvar_num(cvar_nem) && iPlayersnum >= get_pcvar_num(cvar_nemminplayers)) || mode == MODE_NEMESIS)
{
// Nemesis Mode
g_nemround = true
g_lastmode = MODE_NEMESIS
// Turn player into nemesis
zombieme(id, 0, 1, 0)
}
else
{
// Single Infection Mode
g_lastmode = MODE_INFECTION
// Turn player into the first zombie
zombieme(id, 0, 0, 0)
}
// Remaining players should be humans (CTs)
for (id = 1; id <= g_maxplayers; id++)
{
// Not alive
if (!is_user_alive(id))
continue;
// First zombie/nemesis
if (g_zombie[id])
continue;
// Remove previous tasks
remove_task(id+TASK_TEAM)
// Switch to CT
if (fm_get_user_team(id) != CS_TEAM_CT) // need to change team?
{
fm_set_user_team(id, CS_TEAM_CT)
fm_user_team_update(id)
}
}
if (g_nemround)
{
// Play Nemesis sound
PlaySound(sound_nemesis[random_num(0, sizeof sound_nemesis -1)]);
// Get player's name
get_user_name(forward_id, name, sizeof name - 1)
// Show Nemesis HUD notice
set_hudmessage(255, 20, 20, HUD_EVENT_X, HUD_EVENT_Y, 1, 0.0, 5.0, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "%L", LANG_PLAYER, "NOTICE_NEMESIS", name)
// Round start forward
ExecuteForward(g_fwRoundStart, g_fwDummyResult, MODE_NEMESIS, forward_id);
}
else
{
// Get player's name
get_user_name(forward_id, name, sizeof name - 1)
// Show First Zombie HUD notice
set_hudmessage(255, 0, 0, HUD_EVENT_X, HUD_EVENT_Y, 0, 0.0, 5.0, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "%L",LANG_PLAYER, "NOTICE_FIRST", name)
// Round start forward
ExecuteForward(g_fwRoundStart, g_fwDummyResult, MODE_INFECTION, forward_id);
}
}
// Last Zombie Check
set_task(0.1, "fnCheckLastZombie")
}