I have a plugin that does this code every round start, and its crashing the server, and i dont know why. Anyone know why?
PHP Code:
public round_start()
{
new enough = get_maxplayers()
if (enough <= 1)
{
client_print_color(0, RED, "%s ^4Can ^3NOT ^4start, minimum to start: ^32 ^4Players.", PREFIX)
return PLUGIN_HANDLED
}
else
{
new players[32], pnum, tempid;
get_players(players, pnum, "ch");
new playertot = random(pnum)
new nameofp[60]
for (new i; i<pnum ; i++)
{
tempid = players[i]
g_didType[tempid] = false
}
while ((cs_get_user_team(players[playertot]) != CS_TEAM_UNASSIGNED) && (cs_get_user_team(players[playertot]) != CS_TEAM_SPECTATOR))
{
playertot = random(pnum)
}
cs_set_user_team(players[playertot], CS_TEAM_T)
get_user_name(players[playertot], nameofp, 59)
client_print_color(0, RED, "%s ^4The player ^3%s ^4was chosen to be the Terrorist.", PREFIX, nameofp)
}
return PLUGIN_HANDLED