[Include] MultipageV1
#1

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
Reply
#2

adf.ly links are not allowed in these forums.
Reply
#3

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

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

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

Your right sorry
Reply
#7

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

Useful include!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)