Make this dialog msgbox
#1

If player do /afklist it should show up in dialog style box how? Thanks guys!

pawn Код:
CMD:_afklist(playerid, params[])
{
    #pragma unused params
        new count = 0;
        new name[MAX_PLAYER_NAME];
                new string[128];
        for(new i = 0; i < MAX_PLAYERS; i++)
                {
                        if (IsPlayerConnected(i))
                        {
 
                            if(PlayerInfo[i][AFKstatus] == 1)
                            {
                                        GetPlayerName(i, name, sizeof(name));
                                        format(string, 256, "-: AFK :- %s{FFFFFF} (ID:%d)", name,i );
                                        SendClientMessage(playerid, COLOR_YELLOW, string);
                                count++;
                                }
                        }
 
                }
                if (count == 0)
                {
                SendClientMessage(playerid, COLOR_RED, "None player Is Afk or Brb");
                }
                return 1;
}
Reply
#2

pawn Код:
CMD:_afklist(playerid)
{
        new count = 0, name[MAX_PLAYER_NAME], string[1024];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
           if (IsPlayerConnected(i)) if(PlayerInfo[i][AFKstatus]) count++;
        }

        if(count == 0) SendClientMessage(playerid, COLOR_RED, "None player Is Afk or Brb.");
        else if(count > 0)
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(PlayerInfo[i][AFKstatus])
                    {
                        GetPlayerName(i, name, sizeof(name));
                        format(string, sizeof(string), "%s-: AFK :- %s{FFFFFF} (ID:%d)", string,  name, i);
                    }
                }
            }
        }
        if(strlen(bigstring) < 1024) ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGOX, "AFK List", string, "Close", "");
        return 1;
}
Reply
#3

Quote:
Originally Posted by Cypress
Посмотреть сообщение
pawn Код:
CMD:_afklist(playerid)
{
        new count = 0, name[MAX_PLAYER_NAME], string[1024];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
           if (IsPlayerConnected(i)) if(PlayerInfo[i][AFKstatus]) count++;
        }

        if(count == 0) SendClientMessage(playerid, COLOR_RED, "None player Is Afk or Brb.");
        else if(count > 0)
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(PlayerInfo[i][AFKstatus])
                    {
                        GetPlayerName(i, name, sizeof(name));
                        format(string, sizeof(string), "%s-: AFK :- %s{FFFFFF} (ID:%d)", string,  name, i);
                    }
                }
            }
        }
        if(strlen(bigstring) < 1024) ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGOX, "AFK List", string, "Close", "");
        return 1;
}
Omg thaks cypress but that afklist is not working properly. I have tested and it doesn't show afk player when there is.

This is the new afklist, can you please make this to dialog?

pawn Код:
CMD:afklist(playerid, params[])
{
    new pString[MAX_PLAYER_NAME], pName3[MAX_PLAYER_NAME];
    for(new pID = 0; pID < MAX_PLAYERS; pID ++)
    {
        if(IsPlayerConnected(pID))
        {
            if(IsAFK[pID] == 1)
            {
                 SendClientMessage(playerid, red, "{0FFDD3}Players Currently {00FF00}AFK:");
                 GetPlayerName(playerid, pName3, sizeof(pName3));
                 format(pString, sizeof(pString), "%s", pName3);
                 SendClientMessage(playerid, red, pString);
            }
        }
     }
     return 1;
}
Reply
#4

What's the problem with it? Tell me so I can fix it.
Reply
#5

Quote:
Originally Posted by Cypress
Посмотреть сообщение
What's the problem with it? Tell me so I can fix it.
It's shows nothing when I do afklist even there is an Afk players, So I've change the AFK system. My only problem is that I need to make this into dialog This one is working perfectly!


pawn Код:
CMD:afklist(playerid, params[])
{
    new pString[MAX_PLAYER_NAME], pName3[MAX_PLAYER_NAME];
    for(new pID = 0; pID < MAX_PLAYERS; pID ++)
    {
        if(IsPlayerConnected(pID))
        {
            if(IsAFK[pID] == 1)
            {
                 SendClientMessage(playerid, red, "{0FFDD3}Players Currently {00FF00}AFK:");
                 GetPlayerName(playerid, pName3, sizeof(pName3));
                 format(pString, sizeof(pString), "%s", pName3);
                 SendClientMessage(playerid, red, pString);
            }
        }
     }
     return 1;
}
Reply
#6

pawn Код:
CMD:_afklist(playerid)
{
        new count = 0, name[MAX_PLAYER_NAME], string[1024];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
           if (IsPlayerConnected(i)) if(IsAFK[pID]) count++;
        }

        if(count < 1) SendClientMessage(playerid, COLOR_RED, "None player Is Afk or Brb.");
        else if(count > 0)
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(IsAFK[pID])
                    {
                        GetPlayerName(i, name, sizeof(name));
                        format(string, sizeof(string), "%s%d\t\t%s", string, i, name);
                    }
                }
            }
            strins(string, "ID\t\tName\n \n", 0);
        }
        if(strlen(string) < 1024) ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGOX, "AFK List", string, "Close", "");
        return 1;
}
I wouldn't say that there is any difference between the other and the new one. Only the variable changed.

Anyway, test this one.

EDIT: retest, corrected one mistake.
Reply
#7

Quote:
Originally Posted by Cypress
Посмотреть сообщение
pawn Код:
CMD:_afklist(playerid)
{
        new count = 0, name[MAX_PLAYER_NAME], string[1024];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
           if (IsPlayerConnected(i)) if(IsAFK[pID]) count++;
        }

        if(count < 1) SendClientMessage(playerid, COLOR_RED, "None player Is Afk or Brb.");
        else if(count > 0)
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(IsAFK[pID])
                    {
                        GetPlayerName(i, name, sizeof(name));
                        format(string, sizeof(string), "%s%d\t\t%s", string, i, name);
                    }
                }
            }
            strins(string, "ID\t\tName\n \n", 0);
        }
        if(strlen(string) < 1024) ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGOX, "AFK List", string, "Close", "");
        return 1;
}
I wouldn't say that there is any difference between the other and the new one. Only the variable changed.

Anyway, test this one.

EDIT: retest, corrected one mistake.
Oh thanks man but I got this warnings

Код:
 error 017: undefined symbol "pID"
error 017: undefined symbol "pID"
error 017: undefined symbol "DIALOG_STYLE_MSGOX"
and also If possible change this SendClientMessage(playerid, COLOR_RED, "None player Is Afk or Brb."); to dialog message box.

Thanks for your help can't wait!
Reply
#8

pawn Код:
CMD:_afklist(playerid)
{
        new count = 0, name[MAX_PLAYER_NAME], string[1024];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
           if (IsPlayerConnected(i)) if(IsAFK[i]) count++;
        }

        if(count < 1) ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "ERROR", "There are no afk or brb players.", "Close", "");
        else if(count > 0)
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(IsAFK[i])
                    {
                        GetPlayerName(i, name, sizeof(name));
                        format(string, sizeof(string), "%s%d\t\t%s", string, i, name);
                    }
                }
            }
            strins(string, "ID\t\tName\n \n", 0);
        }
        if(strlen(string) < 1024) ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "AFK List", string, "Close", "");
        return 1;
}
I'm sorry about being soo blind. Anyway thats what you wanted.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)