Участник
Пользователь
- Сообщения
- 278
- Реакции
- 137
Hello,
I want to change index after someone left the game but sometimes bug happens.
I will give an example and you'll see the problem.
Happens;
I want to change index after someone left the game but sometimes bug happens.
I will give an example and you'll see the problem.
Happens;
Код:
(He dropped)
empty dropped.
empty has left the game.
(Next terrorist did not change. It was still empty even if he left the server.)
empty left the game, next terrorist is empty.
Код:
new pNextTerrorist;
public client_disconnected(pPlayer) {
new iPlayers[32], iNum;
get_players(iPlayers, iNum);
//... inum checks
if(pNextTerrorist == pPlayer) {
pNextTerrorist = iPlayers[random(iNum)];
rg_set_user_team(pNextTerrorist, TEAM_TERRORIST);
client_print_color(0, 0, "%L", LANG_PLAYER, "REDEATHRUN_LEFT_GAME", pPlayer, pNextTerrorist);
}
}