ZCMD help
#1

pawn Код:
command(helpers, playerid, params[])
{
    #pragma unused params
    if(Player[playerid][Helper] >= 1)
    {
        new string[128];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(Player[i][Helper] >= 1)
            {
                format(string, sizeof(string), "{37DB45}HELPER: {FFFFFF}%s", GetName(i));
                ShowPlayerDialog(playerid, 0, 9315, "Online helpers:", string, "Done", "");
            }
        }
    }
    return 1;
}
This command should show me all the online helpers into a dialog, but it shows me a dialog with an imput text and something doesn't work at all.
I made sure at OnDialogResponse there's nothing associated with this dialog ID.
Why's that?
Reply
#2

You put the wrong place between dialogid and dialogstyle.
Reply
#3

Oh my godable, how can I make that shit??

Thanks btw
Reply
#4

Quote:
Originally Posted by GangsTa_
Посмотреть сообщение
Oh my godable, how can I make that shit??

Thanks btw
Emm like this
pawn Код:
ShowPlayerDialog(playerid, 0, 9315, "Online helpers:", string, "Done", "");
//change to
ShowPlayerDialog(playerid, 9315, 0, "Online helpers:", string, "Done", "");
Reply
#5

pawn Код:
command(helpers, playerid, params[])
{
    #pragma unused params
    if(Player[playerid][Helper] >= 1)
    {
        new string[256]; // This might need to be increased.
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(Player[i][Helper] >= 1)
            {
                format(string, sizeof(string), "%s\n{37DB45}HELPER: {FFFFFF}%s", string, GetName(i));
            }
        }
       
        ShowPlayerDialog(playerid, 0, 9315, "Online helpers:", string, "Done", "");
    }
    return 1;
}
I assume you wanted something that'd get all of the online helpers and then add their names in to a string and show them in that dialog?
Reply
#6

Yes, and it works I guess, tested
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)