What could be the problem?
#1

This is the code.

pawn Код:
stock ShowTeam(playerid)
{
    new tempStr[128];

    for(new i = 0; i < MAX_TEAMS; i ++)
    {
        strcat(tempStr, TI[i][name], 128);
        strcat(tempStr, "\n", 128);
    }
    printf("%s", tempStr);
    ListBox(playerid, dChooseTeam, "Choose a team.", tempStr);
}
However the ListBox is not shown because it's not being called. Same with the printf function. What could be the problem?

Edit: This is the ListBox function.
pawn Код:
stock ListBox(playerid, dialogid, text[], list[]) ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, text, list, "SELECT", "CLOSE");
This is the TI array.

pawn Код:
new TI[MAX_TEAMS][tInfo] =
{
    { "Blue", { 0.0, 0.0, 0.0, 90.0 }, { 24, 0, 0, 0 }, 28, COLOR_BLUE, 0 },
    { "Red", { 0.0, 0.0, 0.0, 90.0 }, { 26, 0, 0, 0 }, 29, COLOR_RED,  0 }
};
P.S. The function itself(ShowTeam) has been called correctly.
Reply
#2

Still can't figure out the problem. :/
Reply
#3

Quote:
Originally Posted by Arca
Посмотреть сообщение
This is the code.

pawn Код:
stock ShowTeam(playerid)
{
    new tempStr[128];

    for(new i = 0; i < MAX_TEAMS; i ++)
    {
        strcat(tempStr, TI[i][name], 128);
        strcat(tempStr, "\n", 128);
    }
    printf("%s", tempStr); // This goes to your server.exe / server.bat and prints on it.
    ListBox(playerid, dChooseTeam, "Choose a team.", tempStr); // Correct define is, ShowPlayerDialog
}
However the ListBox is not shown because it's not being called. Same with the printf function. What could be the problem?

Edit: This is the ListBox function.
pawn Код:
stock ListBox(playerid, dialogid, text[], list[]) ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, text, list, "SELECT", "CLOSE");
This is the TI array.

pawn Код:
new TI[MAX_TEAMS][tInfo] =
{
    { "Blue", { 0.0, 0.0, 0.0, 90.0 }, { 24, 0, 0, 0 }, 28, COLOR_BLUE, 0 },
    { "Red", { 0.0, 0.0, 0.0, 90.0 }, { 26, 0, 0, 0 }, 29, COLOR_RED,  0 }
};
P.S. The function itself(ShowTeam) has been called correctly.
For your printf ~ I don't understand what you want there.

and add' , error logs and information, anything else that might be needed included for your errors.

Код:
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, text, list, "SELECT", "CLOSE");
Reply
#4

Quote:
Originally Posted by Akira297
Посмотреть сообщение
For your printf ~ I don't understand what you want there.

and add' , error logs and information, anything else that might be needed included for your errors.

Код:
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, text, list, "SELECT", "CLOSE");
There are no errors. I use printf to debug the code for seeing the actual problem. The problem was on the array.

P.S. I fixed it already.
Reply
#5

Error was fixed,

/closed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)