Skip to content
User Avatar
#1168
Auto-translated
Nargott
Yeah, I already managed to solve the problem using it.
Only instead of the "magic" numbers 1 and 0, I used the constant PLAYER_ACTIVE (which, apparently, corresponds to 1).
-- Getting the number of players in the game
function getTotalPlayers()
local total = 0
for playerID = PLAYER_1, PLAYER_8 do
if GetPlayerState(playerID) == PLAYER_ACTIVE then
total = total + 1
end
end
return total
end
Why "magic"?
And why use the value PLAYER_NOT_IN_GAME (0)?
Where? Besides, players who are not in the game are designated as 4.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4

Statistics

Welcome our newest member: leyu