AFKList
#1

Hey guys.
I want to change my AFKList, My AFK List creates 1 line everytime there is Player AFK

i don't wanna have big big big long dialog that list many AFK Players.
How can i make like this?

Код:
Romel(0), John(1), Ruzie(5)
instead of

Код:
Romel(0)
John(1)
Ruzie(5)
my AFKList is in Dialog.

CODE:

pawn Код:
CMD:afklist(playerid, params[])
{
    new string[900];
    new fstring[900];
    new count = 0;
    for(new slots = GetMaxPlayers(), i; i < slots; i++)
    {
        if (!IsPlayerConnected(i)) continue;
        if(pData[i][pAFK] > 1)
        {
            count++;
            format(fstring, 900, "%s (%d)\r\n\nTotal AFK Players: %d", GetpName(i), i, count);
            strcat(string, fstring, 900);
            ShowPlayerDialog(playerid, AFKLIST, DIALOG_STYLE_MSGBOX, "[iP] AFK Players", string, "OK", "");
        }
    }
    if(count == 0) return ShowPlayerDialog(playerid, AFKLIST, DIALOG_STYLE_MSGBOX, "[iP] AFK Players", ""red"There is no current AFK Players!", "OK", "");
    return 1;
}
Reply
#2

Remove the \r\n and add ","

--

ShowPlayerDialog(playerid, AFKLIST, DIALOG_STYLE_MSGBOX, "[iP] AFK Players", string, "OK", "");

out from the "for"

--

pawn Код:
CMD:afklist(playerid, params[])
{
    new string[900];
    new fstring[900];
    new count = 0;
    for(new slots = GetMaxPlayers(), i; i < slots; i++)
    {
        if (!IsPlayerConnected(i)) continue;
        if(pData[i][pAFK] > 1)
        {
            count++;
            format(fstring, 900, "%s (%d), ", GetpName(i), i);
            strcat(string, fstring, 900);
        }
    }

    if(count == 0) return ShowPlayerDialog(playerid, AFKLIST, DIALOG_STYLE_MSGBOX, "[iP] AFK Players", ""red"There is no current AFK Players!", "OK", "");
    else {
        format(fstring, 900, "\r\nTotal AFK Players: %d", count);
        strcat(string, fstring, 900);
        ShowPlayerDialog(playerid, AFKLIST, DIALOG_STYLE_MSGBOX, "[iP] AFK Players", string, "OK", "");
    }
    return 1;
}
try this
Reply
#3

Thanks i will try
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)