16.02.2010, 12:55
pawn Код:
irccmd_players(conn, channel[], user[], params[]) //made by Grove, taken from CYS Echo Bot 1.2
{
new count, PlayerNames[512], string[256];
for(new i=0; i<=MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(count == 0)
{
new PlayerName1[MAX_PLAYER_NAME];
GetPlayerName(i, PlayerName1, sizeof(PlayerName1));
format(PlayerNames, sizeof(PlayerNames),"2%s1",PlayerName1);
count++;
}
else
{
new PlayerName1[MAX_PLAYER_NAME];
GetPlayerName(i, PlayerName1, sizeof(PlayerName1));
format(PlayerNames, sizeof(PlayerNames),"%s, 2%s1", PlayerNames, PlayerName1);
count++;
}
}
else { if(count == 0) format(PlayerNames, sizeof(PlayerNames), "1No Players Online!"); }
}
new counter = 0;
for(new i=0; i<=MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)) counter++;
}
format(string, 256, "6Connected Players[%d]:1 %s", counter, PlayerNames);
ircSay(conn, channel, string);
#pragma unused params,user
return true;
}