[HELP] Make this into Dialog MSGBOX
#1

Hello Good day everyone! Anyone can make this into Dialog Msgbox that show not only in one line, but depends on how many players are muted, jailed and frozen.


pawn Код:
dcmd_muted(playerid,params[])
{
    #pragma unused params
    if(AccInfo[playerid][LoggedIn] == 1)
    {
        if(AccInfo[playerid][Level] >= 2)
        {
            new bool:First2 = false, Count, adminname[MAX_PLAYER_NAME], string[128], i;
            for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && AccInfo[i][Muted]) Count++;
            if(Count == 0) return SendClientMessage(playerid,red, "ERROR: No players are Muted!");

            for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && AccInfo[i][Muted])
            {
            GetPlayerName(i, adminname, sizeof(adminname));
            if(!First2)
            {
            format(string, sizeof(string), "Muted Players: (%d)%s", i,adminname);
            First2 = true;
            }
            else format(string,sizeof(string),"%s, (%d)%s ",string,i,adminname);
            }
            return SendClientMessage(playerid,yellow,string);
        }
        else return ErrorMessages(playerid, 1);
    }
    else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
pawn Код:
dcmd_jailed(playerid,params[])
{
    #pragma unused params
    if(AccInfo[playerid][LoggedIn] == 1)
    {
        if(AccInfo[playerid][Level] >= 2)
        {
            new bool:First2 = false;
            new Count, i;
            new string[128];
            new adminname[MAX_PLAYER_NAME];
            for(i = 0; i < MAX_PLAYERS; i++)
            if(IsPlayerConnected(i) && AccInfo[i][Jailed])
            Count++;
            if(Count == 0)
            return SendClientMessage(playerid,red, "No players are Jailed!");

            for(i = 0; i < MAX_PLAYERS; i++)
            if(IsPlayerConnected(i) && AccInfo[i][Jailed])
            {
            GetPlayerName(i, adminname, sizeof(adminname));
            if(!First2)
            {
            format(string, sizeof(string), "Jailed Players: (%d)%s", i,adminname); First2 = true;
            }
            else format(string,sizeof(string),"%s, (%d)%s ",string,i,adminname);
            }
            return SendClientMessage(playerid,yellow,string);
        }
        else return ErrorMessages(playerid, 1);
    }
    else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
pawn Код:
dcmd_frozen(playerid,params[])
{
    #pragma unused params
    if(AccInfo[playerid][LoggedIn] == 1)
    {
        if(AccInfo[playerid][Level] >= 2)
        {
            new bool:First2 = false;
            new Count,string[128], i;
            new adminname[MAX_PLAYER_NAME];
           
            for(i = 0; i < MAX_PLAYERS; i++)
            if(IsPlayerConnected(i) && AccInfo[i][Frozen])
            Count++;
            if(Count == 0)
            return SendClientMessage(playerid,red, "No players are Frozen!");
           
            for(i = 0; i < MAX_PLAYERS; i++)
            if(IsPlayerConnected(i) && AccInfo[i][Frozen])
            {
                GetPlayerName(i, adminname, sizeof(adminname));
                if(!First2)
                {
                format(string, sizeof(string), "Frozen Players: (%d)%s", i,adminname);
                First2 = true;
                }
                else format(string,sizeof(string),"%s, (%d)%s ",string,i,adminname);
            }
            return SendClientMessage(playerid,yellow,string);
        }
        else return ErrorMessages(playerid, 1);
    }
    else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
Reply
#2

there is a thing, to change lines.
which is: "\n"

E.X
pawn Код:
ShowPlayerDialog(playerid, 0, DIALOG_MSGBOX, "Hello \n how \n are \n you", "fine", "bad");
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)