I have been trying to add a next/back button to this dialog for every 10 results. So far, I haven't managed to do it, hence I reverted the code back to the version without that.
Can anyone help me figure this out? There's really no good guide on this.
Can anyone help me figure this out? There's really no good guide on this.
Code:
case E_WARP_DIALOG_EXTS:
{
new warpstr[2000];
format(warpstr, sizeof warpstr, INLINE[COLOR_SPOPT]"ID\t" INLINE[COLOR_SPOPT]"Name\n");
for(new i = 0; i < MAX_WARPS; i++)
{
if(!g_WarpsInfo[i][E_WARP_EXISTS])
continue;
if(g_WarpsInfo[i][E_WARP_CATEGORY] != 1) // 1 is the category ID for exteriors
continue;
else
format(warpstr, sizeof(warpstr), "%s" INLINE[COLOR_OPTION] "#%d\t" INLINE[COLOR_OPTION] "%s\t\n", warpstr, i, g_WarpsInfo[i][E_WARP_NAME]);
}
inline DialogResponse_2(_playerid, dialogid, response, listitem, inputtext[])
{
#pragma unused dialogid, listitem
if(!response)
{
WARPS_TeleportList(_playerid, E_WARP_DIALOG_MAIN);
}
if(response)
{
new str[256], warp_id;
sscanf(inputtext[1],"d",warp_id);
DelayedTeleport(playerid, g_TeleportDelay, g_WarpsInfo[warp_id][E_WARP_POS][0], g_WarpsInfo[warp_id][E_WARP_POS][1], g_WarpsInfo[warp_id][E_WARP_POS][2]\
, g_WarpsInfo[warp_id][E_WARP_POS][3], g_WarpsInfo[warp_id][E_WARP_WORLD], g_WarpsInfo[warp_id][E_WARP_INT]);
format(str, sizeof(str), "%s %s(%d) has warped to %s(%d).", ReturnStaffLevel(playerid), ReturnICName(playerid), playerid, g_WarpsInfo[warp_id][E_WARP_NAME], warp_id);
ABroadCast(COLOR[COLOR_SADMIN], str, 1);
}
}
Dialog_ShowCallback(playerid, using inline DialogResponse_2, DIALOG_STYLE_TABLIST_HEADERS, INLINE[COLOR_HEADER] "Exterior Warps", warpstr, "Teleport", "Return");
}