Looping
#4

Use R33 mysql plugin

I've tried to put my row count i get from my Loadfunction in a variable

so
pawn Code:
cache_get_data(rows, fields, dbHandle);

BuildingRows = rows;
Which gives me in a print, which is correct since there is 3 rows.
Code:
Building 1
Building 2
Building 3
That prints when i type this command

pawn Code:
YCMD:test(playerid, params[], help)
{
    #pragma unused params
    new str[128];
    if(PLogged[playerid] == 0) return
        SendClientMessage(playerid, ERROR_COLOR, NOT_LOGGED);
    if(PlayerInfo[playerid][pAdmin] < 9 && !IsPlayerAdmin(playerid)) return
        SendClientMessage(playerid, COLOR_GREY, ADMIN_CMD_ERROR);
    if (help) return
        SendClientMessage(playerid, COMMAND_HELP_COLOR, "Test command");
    for (new i = 0; i < BuildingRows; i++)
    {
        printf("Building Rows %d", i+1);
        format(str, sizeof(str), "%d %s\n", BuildingInfo[i][buMysqlId],BuildingInfo[i][buName]);
        ShowPlayerDialog(playerid,12,DIALOG_STYLE_LIST,"Test",str,"Select","");
    }
    return 1;
}
I can get it to show 1 row but not all of them at once

I've never used that strcat function.

I don't wanna have to fetch the data that has already been fetched with my loadfunction
Reply


Messages In This Thread
Looping - by ihatetn931 - 31.03.2015, 13:48
Re: Looping - by xXShadowXx - 31.03.2015, 13:54
AW: Looping - by Kaliber - 31.03.2015, 13:54
Re: Looping - by ihatetn931 - 31.03.2015, 14:14

Forum Jump:


Users browsing this thread: 3 Guest(s)