String lenght is too high
#26

Quote:
Originally Posted by xMoBi
Посмотреть сообщение
You can use this code to do multiple pages:

Definition:
Код:
#define        MAX_LINE_PER_PAGE        30
Variable:
Код:
static        playerPage[MAX_PLAYERS] = {0, ...};
Array:
Код:
new vehList[][] = {
        {"{FFFFFF}BMX"},
};
Function:
Код:
ShowPlayerVehicleDialog(playerid) {
        static msg[30 * MAX_LINES_PER_PAGE], page = playerPage[playerid], i = page; // opimisation
        for (; i < sizeof vehList; i++) {
                if (i != 0 && (i - MAX_LINES_PER_PAGE) > MAX_LINES_PER_PAGE) break; // if player page is 0 then continue

                strcat(msg, sizeof msg, "\n");
                strcat(msg, sizeof msg, vehList[i]);
        }

        if (playerPage[playerid] >= sizeof vehList) {
                SendClientMessage(playerid, -1, "Dialog closed.");
                playerPage[playerid] = 0;
                return false;
        }

        ShowPlayerDialog(playerid, DIALOG_VEHICLES, DIALOG_STYLE_LIST, "Vehicle List", msg, "Select", "Next");

        return false; // this means the code successfully worked
}
Command:
Код:
CMD:vehiclelist(playerid) {
        ShowPlayerVehicleDialog(playerid);
        return 1;
}
When player press "Select", use ShowPlayerVehicleDialog
Alright, thanks a lot I think that will do instead. When I'm going to use OnDialogResponse, the process is the same?
Each case corresponds to an item of the array?
Reply


Messages In This Thread
String lenght is too high - by Adamoneoone - 26.06.2018, 10:44
Re: String lenght is too high - by JasonRiggs - 26.06.2018, 11:12
Re: String lenght is too high - by RoboN1X - 26.06.2018, 11:28
Re: String lenght is too high - by Adamoneoone - 26.06.2018, 11:42
Re: String lenght is too high - by Adamoneoone - 26.06.2018, 12:01
Re: String lenght is too high - by aoky - 26.06.2018, 12:07
Re: String lenght is too high - by Adamoneoone - 26.06.2018, 12:08
Re: String lenght is too high - by Spmn - 26.06.2018, 12:46
Re: String lenght is too high - by Adamoneoone - 26.06.2018, 14:29
Re: String lenght is too high - by GTLS - 26.06.2018, 14:54
Re: String lenght is too high - by Adamoneoone - 26.06.2018, 17:04
Re: String lenght is too high - by JasonRiggs - 26.06.2018, 17:26
Re: String lenght is too high - by Adamoneoone - 26.06.2018, 19:16
Re: String lenght is too high - by Adamoneoone - 27.06.2018, 13:36
Re: String lenght is too high - by GTLS - 27.06.2018, 15:26
Re: String lenght is too high - by Zeth - 27.06.2018, 15:42
Re: String lenght is too high - by Adamoneoone - 27.06.2018, 16:03
Re: String lenght is too high - by Verc - 27.06.2018, 20:47
Re: String lenght is too high - by CodeStyle175 - 27.06.2018, 21:06
Re: String lenght is too high - by Adamoneoone - 28.06.2018, 07:15
Re: String lenght is too high - by xMoBi - 28.06.2018, 07:22
Re: String lenght is too high - by Adamoneoone - 28.06.2018, 20:07
Re: String lenght is too high - by GhostHacker9 - 29.06.2018, 02:49
Re: String lenght is too high - by NaS - 29.06.2018, 05:48
Re: String lenght is too high - by xMoBi - 29.06.2018, 06:03
Re: String lenght is too high - by Adamoneoone - 29.06.2018, 07:03
Re: String lenght is too high - by Sasino97 - 29.06.2018, 14:44
Re: String lenght is too high - by Adamoneoone - 29.06.2018, 16:13
Re: String lenght is too high - by Adamoneoone - 30.06.2018, 20:43
Re: String lenght is too high - by Adamoneoone - 01.07.2018, 20:51
Re: String lenght is too high - by CodeStyle175 - 01.07.2018, 20:52
Re: String lenght is too high - by Adamoneoone - 01.07.2018, 22:25

Forum Jump:


Users browsing this thread: 1 Guest(s)