SA-MP Forums Archive
[Include] MultipageV1 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] MultipageV1 (/showthread.php?tid=534903)



Multipage V1 - multi page dialogs - horsemeat - 31.08.2014

samp multipage dialog
Have you ever wanted a dialog box that was more then one page and actual tryed to make it? It takes way to long and you don't get much done especial if you want to make it multiple times. well I have the solution for you try my Include called Multipage. This Include can create an entire list box with as many pages.

You need YSI


How to use the Include
  1. Код:
    #include <multipage>
  2. find a place to input a dialog box
  3. Код:
    MenuPage(playerid,dialogid, data[], size, string:label[],string:button1[],string:button2[])
    • playerid is for playerid
    • dialogid: Unique dialogid is required if you have seperate boxes
    • data[]: this is were you input an array of stats this detirmins what item is active you need one that uses 0s and ones instead of boolean.You can fix that your self if you want
    • size: The size of the data array
    • button1[]: What button 1 says.
    • button2[]: What button 2 says
  4. add these functions to your script
    pawn Код:
    public MenuPageString(playerid,index,dialogid,string[],size)[*]public MenuPageReturn(playerid,index,dialogid)
  5. Alright now you need to chose the string you want to use here is a sample
    pawn Код:
    public MenuPageString(playerid,index,dialogid,string[],size)
    {
        if((dialogid)==0)//This is the current dialogid <a href="http://cityadspix.com/tsclick-MIQCWPUV-GECAQBFF?sa=New_traff&url=http%3A%2F%2Fwww.sotmarket.ru%2Fproduct%2Fpartner-night.html&bt=20&pt=9&lt=2&tl=3&im=ODI1LTAtMTQxMDM4MDEzNi0xMDI5NzM0OA==" target="_blank" alt="Partners of the Night" title="Partners of the Night" style="">of the</a> box you created
        {
            format(string,size,"Crap:%i",index);//This is the string you want per line
        }//index returns the index of your array you inputed
        return 1;
    }
  6. Alright now you need the return <a href="http://cityadspix.com/tsclick-MIQCWPUV-GECAQBFF?sa=New_traff&url=http%3A%2F%2Fwww.sotmark et.ru%2Fproduct%2Fpartner-night.html&bt=20&pt=9&lt=2&tl=3&im=ODI1LTAtMTQxMDM 4MDEzNi0xMDgwODc5Ng==" target="_blank" alt="Partners of the Night" title="Partners of the Night" style="">of the</a> selected index that is what MenuPageReturn is for here is a sample
    pawn Код:
    public MenuPageReturn(playerid,index,dialogid)
    {
        if(dialogid == 0)//This is the current dialogid <a href="http://cityadspix.com/tsclick-MIQCWPUV-GECAQBFF?sa=New_traff&url=http%3A%2F%2Fwww.sotmarket.ru%2Fproduct%2Fpartner-night.html&bt=20&pt=9&lt=2&tl=3&im=ODI1LTAtMTQxMDM4MDEzNi0xMjIxOTAzNQ==" target="_blank" alt="Partners of the Night" title="Partners of the Night" style="">of the</a> box you created
        {
            new string[256];
            format(string,sizeof(string),"You have selected %i",index);
            SendClientMessage(playerid,RED,string);
        }
        return 1;
    }
Sample Script
Here is a sample script so you can grab a grasp of how it works
pawn Код:
#include <a_samp>
#include <multipage>
#include <zcmd>
#include <ysi\y_dialog>
#include <ysi\y_inline>
#define RED 0xFF0000ff
#define DARKBLUE 0x0000FFff
#define LIGHTBLUE 0x00E1FFff
#define GREEN 0x22D451ff
#define YELLOW 0xEAFF00ff
#define BLUEGREEN 0xA5C9B0ff
#define PINK 0xFF00CCff
#define WHITE 0xFFFFFFff
#define GREY 0x969696ff
#define PURPLE 0xC2A2DAAA
#define ORANGE 0xFF9100ff
new crap[256];
public OnFilterScriptInit()
{
    for(new count;count < 22;count++)
    {
        crap[count] = 1;
    }
    crap[188] = 1;
    crap[76] = 1;
    crap[42] = 1;
    crap[222] = 1;
    crap[221] = 1;
    crap[77] = 1;
    crap[89] = 1;
    crap[120] = 1;
    crap[140] = 1;
    crap[122] = 1;
    return 1;
}
public MenuPageString(playerid,index,dialogid,string[],size)
{
    if((dialogid)==0)
    {
        format(string,size,"Crap:%i",index);
    }
    return 1;
}
public MenuPageReturn(playerid,index,dialogid)
{
    if(dialogid == 0)
    {
        new string[256];
        format(string,sizeof(string),"You have selected %i",index);
        SendClientMessage(playerid,RED,string);
    }
    return 1;
}
CMD:testdialog(playerid, params[])
{
    MenuPage(playerid,0, crap, sizeof(crap), "Crap Menu","Okay","Close");
    return 1;
}

Downloadlinks
direct link
Have to put a direct link since I have to.

Screen Shots
Alright Here are are few screen shots I used the sample script that I made to test this. The one from above. I also have a shot description of each picture



On the first page you have no previous button

on the second page you have both a next and previous button

on the last page it says no next page and last page. When you click no next page then the dialog resprings

When you click on an option it will return the index


Respuesta: MultipageV1 - JustBored - 31.08.2014

adf.ly links are not allowed in these forums.


Re: MultipageV1 - horsemeat - 31.08.2014

so I can't make a few buck here on the side? alright I will change it


Re: MultipageV1 - Abagail - 31.08.2014

No, sorry you can't. No one wants to even click it not to mention give you money for doing absolutely nothing.


Re: MultipageV1 - SmileySmile - 01.09.2014

Why are you calling it a "plugin" when it's basicaly an include? Btw, some screens would be really great.


Re: MultipageV1 - horsemeat - 01.09.2014

Your right sorry


Re: MultipageV1 - zT KiNgKoNg - 01.09.2014

You need to remove the AdFly link, you're not allowed them in any case (Just a heads up)


Re: MultipageV1 - GreenS - 02.09.2014

Useful include!