09/11/2020, 01:22 AM
(Última modificación: 09/11/2020, 01:23 AM por GeX~'. Edited 1 time in total.)
Hola buenas tengo el siguiente problema con el codigo del zp, tira estos errores no se como solucionarlo vi en un post hacer el CsTeam: y nada no se soluciona
donde muestra el error
Código:
L 11/09/2020 - 04:13:03: Start of error session.
L 11/09/2020 - 04:13:03: Info (map "zm_fox") (file "addons/amxmodx/logs/error_20201109.log")
L 11/09/2020 - 04:13:03: [CSTRIKE] Player out of range (0)
L 11/09/2020 - 04:13:03: [AMXX] Displaying debug trace (plugin "zp_niveles_v24.amxx", version "2.4")
L 11/09/2020 - 04:13:03: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 11/09/2020 - 04:13:03: [AMXX] [0] zp_niveles_v24.sma::balance_teams (line 6787)
L 11/09/2020 - 04:13:03: [AMXX] [1] zp_niveles_v24.sma::logevent_round_end (line 2545)
donde muestra el error
Código PHP:
// Balance Teams Task
balance_teams()
{
// Get amount of users playing
static iPlayersnum
iPlayersnum = fnGetPlaying()
// No players, don't bother
if (iPlayersnum < 1) return;
// Split players evenly
static iTerrors, iMaxTerrors, id;
new CsTeams:team = cs_get_user_team(id)
iMaxTerrors = iPlayersnum/2
iTerrors = 0
// First, set everyone to CT
for (id = 1; id <= MaxClients; id++)
{
// Skip if not connected
if (!g_isconnected[id])
continue;
// Skip if not playing
if (team == CS_TEAM_SPECTATOR || team == CS_TEAM_UNASSIGNED)
continue;
// Set team
remove_task(id+TASK_TEAM)
cs_set_user_team(id, CS_TEAM_CT)
team = CS_TEAM_CT
}
// Then randomly set half of the players to Terrorists
while (iTerrors < iMaxTerrors)
{
// Keep looping through all players
if (++id > MaxClients) id = 1
// Skip if not connected
if (!g_isconnected[id])
continue;
// Skip if not playing or already a Terrorist
if (team != CS_TEAM_CT)
continue;
// Random chance
if (random_num(0, 1))
{
cs_set_user_team(id, CS_TEAM_T)
team = CS_TEAM_T
iTerrors++
}
}
}