SA-MP Forums Archive
How to get players ID's ? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to get players ID's ? (/showthread.php?tid=128089)



How to get players ID's ? - ДitisOnHuora - 16.02.2010

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".


Re: How to get players ID's ? - ДitisOnHuora - 16.02.2010

(( W00t comments are gone :O ))

Help anyone please?


Re: How to get players ID's ? - VonLeeuwen - 16.02.2010

Just

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

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