SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 23/12/2018, 12:38 PM   #1
Nickk888
Little Clucker
 
Nickk888's Avatar
 
Join Date: Oct 2011
Location: Germany
Posts: 28
Reputation: 37
Thumbs up NDIALOG-PAGES - Split dialog lists into multiple pages!



About Me:
Hello dear SA-MP community My name's Nickk888, i'm a German/Polish PAWN Scripter for about 8 years now, I own a YouTube channel about SA-MP Scripting in Polish language and I create scripts for the public for free. Excuse my English skill, I'm no native English speaker, so please keep this in mind I'll try my best ^_^

About Include:
NDialog-Pages is basically an addon that adds 3 additional options to the "ShowPlayerDialog" function. It will add a feature so that you can split the dialog list into multiple pages!
It will basically calculate how many items will fit into one page and generate the "Next" button if there are too many. It will also add a "Back" button if you go to the second page etc. It will calculate the "listitem" in such way, like a normal list would work, so you don't need to make some calculation yourself, everything is automatic and it will return the correct "listitem".
It is VERY easy to use, because everything is fully automatic.

Features:
  • Adds 3 new parameters to "ShowPlayerDialog"
  • Easy to use!
  • Fully customable.
  • Fully automatic, no need to script page change.

Changelog:
Version 1.0:
Code:
- First Release
Known Bugs:
Code:
- The max pages variable is sometimes wrong calculated, so it show's one page more, but it doesn't change how the system works, it's only for information purpose.
Overall, this include needs some more testing, please comment if you find a bug, so i can fix it ASAP!
Functions:
Code:
ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[], items_per_page = 0, nextbutton[] = "{FF0000}>>>", backbutton[] = "{FF0000}<<<");
Parameters:
Code:
items_per_page - Items inside a page
nextbutton[] - "Next" button string
backbutton[] - "Back" button string
Additional informations inside dialog:
Code:
#curpage - Shows the current page.
#maxpage - Shows max available pages.
#nextpage - Shows the next available page.
#prevpage - Shows the previous page.
How to use it(Examples):
Code:
CMD:dialog3(playerid)
{
	t_string = "Collumn 1\tCollumn 2\tCollumn 3\tCollumn 4\n";
	for(new i; i < 90; i++)
		format(t_string, sizeof t_string, "%sTest %i\tCollumn\tCollumn\tCollumn\n", t_string, i);
	ShowPlayerDialog(playerid, 888, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Tablist Headers Dialog Test {FFFF00}(#curpage / #maxpage)", t_string, "Test 1", "Test 2", 10,  "{FFFF00}[ Next >  #nextpage ]", "{FFFF00}[ #prevpage < Back ]");
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 888)
	{
		if(response)
		{
			if(listitem != INVALID_LISTITEM)
			{
				format(t_string, sizeof t_string, "{FFFF00}[DIALOG-PAGES TEST] {FFFFFF}Listitem: %i", listitem);
				SendClientMessage(playerid, -1, t_string);
			}
		}
	}
	return 0;
}
Defines:
Code:
#define INVALID_LISTITEM -1
Download:
All versions: http://bit.do/ndialog-pages
V1.0: https://pastebin.com/7SppXqML

Credits:
a_samp: SAMP Team
Y_Hooks: ******
Nickk888 is offline   Reply With Quote
Old 23/12/2018, 12:58 PM   #2
Zyzol
Little Clucker
 
Join Date: Nov 2017
Posts: 2
Reputation: 0
Default Re: NDIALOG-PAGES - Split dialog lists into multiple pages!

Nice
Zyzol is offline   Reply With Quote
Old 23/12/2018, 01:32 PM   #3
SyS
High-roller
 
SyS's Avatar
 
Join Date: Oct 2015
Posts: 1,951
Reputation: 500
Default Re: NDIALOG-PAGES - Split dialog lists into multiple pages!

Nice idea
SyS is offline   Reply With Quote
Old 23/12/2018, 02:41 PM   #4
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,198
Reputation: 386
Default Re: NDIALOG-PAGES - Split dialog lists into multiple pages!

Nicely done c:
__________________
Quote:
Originally Posted by Andy
I offer paid scripting services, I can do anything except mapping because fuck mapping.

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link
RogueDrifter is offline   Reply With Quote
Old 23/12/2018, 03:30 PM   #5
cuber
Gangsta
 
cuber's Avatar
 
Join Date: Oct 2016
Posts: 797
Reputation: 173
Default Re: NDIALOG-PAGES - Split dialog lists into multiple pages!

I will definetly be using this in the future, nice release.
cuber is offline   Reply With Quote
Old 23/12/2018, 03:53 PM   #6
Smith.
Big Clucker
 
Join Date: Apr 2012
Posts: 146
Reputation: 7
Default Re: NDIALOG-PAGES - Split dialog lists into multiple pages!

works with easyDialog?
Smith. is offline   Reply With Quote
Old 23/12/2018, 03:55 PM   #7
Nickk888
Little Clucker
 
Nickk888's Avatar
 
Join Date: Oct 2011
Location: Germany
Posts: 28
Reputation: 37
Default Re: NDIALOG-PAGES - Split dialog lists into multiple pages!

Quote:
Originally Posted by Smith. View Post
works with easyDialog?
I have no idea, probably? You would have to check it. The problem with Easy Dialog is, it doesn't support the 3 additional parameters, so you would need to modify Easy Dialog for your needs.
Nickk888 is offline   Reply With Quote
Old 23/12/2018, 04:11 PM   #8
Smith.
Big Clucker
 
Join Date: Apr 2012
Posts: 146
Reputation: 7
Default Re: NDIALOG-PAGES - Split dialog lists into multiple pages!

Thanks, good work
Smith. is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I list up to X messages and split the messages between "pages" EtayJ Scripting Help 2 31/10/2017 10:13 AM
Report dialog max 17 rows ... how can i make pages? Metharon Scripting Help 6 30/05/2015 11:07 PM
Dynamic Dialog Pages GiamPy. Scripting Help 4 20/06/2013 07:05 AM
Pawno, C++, web pages... AiVAMAN Everything and Nothing 4 18/01/2009 03:25 PM


All times are GMT. The time now is 08:39 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.