How to get players ID's ?
#1

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;
}
I'm using Jacob's filterscript, and i have no clue how to get Players ID's after theyre names, when i do in irc "!players".
Reply
#2

(( W00t comments are gone :O ))

Help anyone please?
Reply
#3

Just

'playerid' like in GetPlayerName(playerid, blabla);

Or, if you have
pawn Код:
for(new i = 0; i<MAX_PLAYERS; i++)
It's 'i'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)