SA-MP Forums Archive
IRC Bot list !players problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: IRC Bot list !players problem (/showthread.php?tid=288587)



IRC Bot list !players problem - misterlc - 08.10.2011

Hi i just a got a little problem with my irc echo bot.
If i'm doing !players , it only shows up to 12-15 players, althought there are more players on the server.
It counts all the players, but it doesn't show all the playernames.


Here is the code:

IRCCMDlayers(botid, channel[], user[], host[], params[])
{
new count, PlayerNames[512];
if(EchoStatus == 0) return 1;
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),"[%d] %s",i,PlayerName1);
count++;
}
else
{
new PlayerName1[MAX_PLAYER_NAME];
GetPlayerName(i, PlayerName1, sizeof(PlayerName1));
format(PlayerNames, sizeof(PlayerNames),"%s, [%d] %s",PlayerNames,i,PlayerName1);
count++;
}
}
else { if(count == 0) format(PlayerNames, sizeof(PlayerNames),"No Players Online"); }
}
new counter = 0, msg[256], players = GetMaxPlayers();
for(new i=0; i<=MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)) counter++;
}
format(msg,256,"10>> Players Online [%d/%d]: %s",counter,players,PlayerNames);
IRC_GroupSay(IRC_Group, EchoChan, msg);
return 1;
}




I would be pleased about some help

Greetz