this code is crashing on (round end) when players are 20+ in ct team ..
tested the mod on 20 slot server works perfectly without crash for hours but on 32 it crashes..... like i said people in ct are 20+ .
it crashes without any logs on round end.
i took help from this topic
Random Selection tutorial by Exolent
first i tried the first one without array but it crashed when 15+ then i tried the 2nd one...
my round end code :- [cant show whole due to pvt but problem with random selection only]
PHP Code:
public RoundEndEvent()
{
gp_TNextRound = 0
new total, Array:players = ArrayCreate(1, 32)
for(new n = 1; n <= g_iMaxPlayers; n++)
{
if(is_user_connected(n) && cs_get_user_team(n) == CS_TEAM_CT)
{
if(g_TNextPlayer[n])
{
gp_TNextRound++
}
else
{
ArrayPushCell(players, n)
total++
}
}
}
new g_TAmount = (TAllowed() - gp_TNextRound)
if(g_TAmount > 0)
{
new count, player, rand
do
{
rand = random(total)
player = ArrayGetCell(players, rand)
g_TNextPlayer[player] = true
count++
ArrayDeleteItem(players, rand)
total--
}
while(count < g_TAmount)
}
}
__________________