Участник
Пользователь
- Сообщения
- 278
- Реакции
- 137
Hello,
I learned lots of methods to get players.
And I wanted to ask you which one should I use.
Many people told me all these codes are same, i should use whatever I want.
Which one should I use?
(I always use get_players)
I learned lots of methods to get players.
And I wanted to ask you which one should I use.
Many people told me all these codes are same, i should use whatever I want.
Which one should I use?
(I always use get_players)
PHP:
func()
{
// g_MaxPlayers = get_member_game(m_nMaxPlayers); in plugin_init
// g_connected [true] on putinserver [false] on disconnected
// for(new id = 1; id <= MAX_CLIENTS; id++)
// for(new id = 1; id <= get_member_game(m_nMaxPlayers); id++)
for(new id = 1; id <= g_MaxPlayers; id++)
{
if(get_member(id, m_iTeam) == TEAM_TERRORIST && g_connected[id])
{
client_print_color(id, id, "You are a terrorist");
}
}
}
func_get_players()
{
new players[MAX_CLIENTS], inum;
// maybe it should be new, idk
static id;
get_players(players, inum, "e", "TERRORIST");
for(new i; i<inum; i++)
{
id = players[i];
client_print_color(id, id, "You are a terrorist");
}
}