SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 05/01/2016, 11:53 AM   #1
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 953
Reputation: 333
Default Alternative Dialogs - Dialogs with the new design

Alternative Dialogs

by Nexius


Description:

Alternative Dialogs - dialogs with a new design.
They have nearly all of the functions that the default dialogs have, but they can be used together.
The new design drawn via textdraws, it will radically change the interface of your server.

How do they look:

AD_STYLE_LIST / SKINS


To choose any of the available skins, just write the following before connecting the include:
Code:
#define AD_SKIN_1 //1 - ID of the skin
Functions:
  • ShowPlayerAltDialog(playerid, dialogid, style, caption[], info[], button1[], button2[] = "") - use to show the dialog for a player
  • OnAltDialogResponse(playerid, dialogid, response, listitem) - called when a player "response" on the dialog
  • GetPlayerAltDialog(playerid) - use to get a player's current dialog ID

How to install:

Download alt_dialogs.inc by the link below.

Include it to the desired gamemode thus:

Code:
#include <alt_dialogs>
And recompile your script.

Then you can use any of the available above features in your script.

Download:

* v6.5: MediaFire Pastebin

Example usage:
Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp("/wdialog", cmdtext, true)) return cmd_wdialog(playerid);
	return 0;
}

forward cmd_wdialog(playerid);
public cmd_wdialog(playerid)
{
	ShowPlayerAltDialog(playerid, 0, AD_STYLE_LIST, "Weapons", "AK47\nM4\nSniper Rifle", "Ok", "Cancel");
	return 1;
}

public OnAltDialogResponse(playerid, dialogid, response, listitem)
{
	if(dialogid == 0)
	{
		if(response == 1)
		{
			switch(listitem)
			{
				case 0: GivePlayerWeapon(playerid, 30, 100);
				case 1: GivePlayerWeapon(playerid, 31, 100);
				case 2: GivePlayerWeapon(playerid, 34, 50);
			}
			return 1;
		}
	}
	return 0;
}
Bugs:

Currently they were not found. If you found a bug, please let me know about it in this thread.

Changelog:
Code:
v1.5
- Minor bugfix

v2.0
- Added Scroll-Bar (visually)
- Changed the color of some dialog elements
- Fixed minor bugs

v2.5
- Minor optimization
- Added the ability to call items only by quick double click
- Fixed a bug with call ShowPlayerAltDialog in OnAltDialogResponse

v3.0
- Fixed hook OnPlayerClickPlayerTextDraw

v3.5
- Added compatibility with y_hooks

v4.0
- Added new skins for dialogs
- Now to select the dialog you need to quickly click on it twice by default
- Minor bug fixes

v4.5
- Added new skins for dialogs

v5.0
- Fixed return values in some callback functions

v5.5
- Memory usage optimization
- Minor fixes

v6.0
- Ability to place defines with the settings before the include
- Removed additional y_hooks support
- Minor improvements and fixes

v6.5
- Define "FAST_DOUBLE_CLICK" renamed to "AD_FAST_DOUBLE_CLICK"
- Define "MAX_CLICK_INTERVAL" renamed to "AD_MAX_CLICK_INTERVAL"
Thanks:

Zamaroht and adri1 for Zamaroht's Textdraw Editor

Frequently asked Questions:

Q: How to hide the dialog shown?
A: This can be done like in default dialogs.
Use ShowPlayerAltDialog function, specifying dialogid parameter with a value of -1

Q: What does the response parameter mean with the value of 2 in OnAltDialogResponse?
A: This means that the dialog was closed by pressing the "cross" button or by ESC

Q: How to make the separate words in the dialog colored?
A: In this case you can use that.

This section will be updated as questions are received.

Enjoy using!
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker

Last edited by OstGot; 30/05/2020 at 07:22 PM.
OstGot is offline   Reply With Quote
Old 05/01/2016, 12:21 PM   #2
Untonyst
Big Clucker
 
Untonyst's Avatar
 
Join Date: Dec 2015
Posts: 65
Reputation: 9
Default Re: Alternative Dialogs - Dialogs with the new design

Nice job
__________________

GitHub account.
Untonyst is offline   Reply With Quote
Old 05/01/2016, 02:57 PM   #3
SoFahim
Gangsta
 
SoFahim's Avatar
 
Join Date: May 2015
Location: Bangladesh.
Posts: 879
Reputation: 86
Default Re: Alternative Dialogs - Dialogs with the new design

I will check it, Hope it will be nice
__________________
Lead Developer & Mapping manager of SARP

You can contact me at Discord, my ID: Gold#8839 available for paid works
Quote:
SoFahim is offline   Reply With Quote
Old 05/01/2016, 05:42 PM   #4
Marcuse
Big Clucker
 
Marcuse's Avatar
 
Join Date: Dec 2011
Location: Bosnia
Posts: 98
Reputation: 5
Default Re: Alternative Dialogs - Dialogs with the new design

Looks freakin' awesome!
Gonna test it later
Marcuse is offline   Reply With Quote
Old 05/01/2016, 06:17 PM   #5
Crayder
Banned
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,324
Reputation: 652
Default Re: Alternative Dialogs - Dialogs with the new design

It could be a bit less "stretched". Also, instead of using pre-defined constant values (mainly the colors) for the user customization, it'd be better if these values could be changed by the function itself.

Otherwise, sweet.
Crayder is offline   Reply With Quote
Old 05/01/2016, 06:24 PM   #6
Z0MBERTH
Huge Clucker
 
Z0MBERTH's Avatar
 
Join Date: Dec 2015
Location: Venezuela.
Posts: 273
Reputation: 10
Default Respuesta: Alternative Dialogs - Dialogs with the new design

Good Job, nice
__________________
Lucifer ♥
Z0MBERTH is offline   Reply With Quote
Old 06/01/2016, 03:23 AM   #7
Stanford
Gangsta
 
Stanford's Avatar
 
Join Date: Feb 2012
Posts: 983
Reputation: 84
Default Re: Alternative Dialogs - Dialogs with the new design

The idea is awesome, you need to work on the design! Thanks Osgot for everything you do to boost up the community! (REP+ BOOST!)
__________________
******: "That code compiles perfectly, but I can tell you now it won't make me a cup of tea."

******: "I've said this before. People think that MySQL is some simple plug-and-play magic bullet that you can use to just make your mode instantly better. They don't realise that the "L" in "SQL" means "language". So instead of programming PAWN, and using a bit of this mystery thing, you are now programming in two languages at once. If you spend months learning PAWN, you should spend the same time learning SQL, if not more - it is probably the more complex of the two languages, and not something that just gets bolted on to the side."
Stanford is offline   Reply With Quote
Old 06/01/2016, 11:08 AM   #8
Sellize
Gangsta
 
Sellize's Avatar
 
Join Date: Jan 2013
Location: (ง ͠° ͟ل͜ ͡°)ง fight me irl
Posts: 708
Reputation: 293
Default Re: Alternative Dialogs - Dialogs with the new design

That's a little ugly, I don't know why anyone would use it over the default dialogs but nice effort nonetheless.
__________________
dead
Sellize is offline   Reply With Quote
Old 06/01/2016, 01:09 PM   #9
SpikY_
High-roller
 
SpikY_'s Avatar
 
Join Date: Jul 2014
Posts: 1,246
Reputation: 128
Default Re: Alternative Dialogs - Dialogs with the new design

The Method of using this Include is perfect but The dialog looks ugly as other people are also complementing at it. So hope that you will improve it. Thanks!
__________________
-
SpikY_ is offline   Reply With Quote
Old 06/01/2016, 01:52 PM   #10
Mr.R
Little Clucker
 
Join Date: Nov 2011
Location: Poland
Posts: 40
Reputation: 1
Default Re: Alternative Dialogs - Dialogs with the new design

Yeah looks good! And styles? MSG BOX or INPUTTEXT? Any photos?
__________________
Virtual-Game comming soon...
Mr.R 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
[FilterScript] Items spawner dialogs (zcmd & dialogs include) Q_Lite Filterscripts 17 16/10/2016 11:09 AM
A few errors I cannot see what I have done wrong. - Dialogs and Dialogs I guess... Deal-or-die Scripting Help 2 14/08/2012 05:35 PM
[DESIGN]Dialogs efeitadas andmeida10 Lançamentos/Releases 14 08/04/2010 03:25 PM


All times are GMT. The time now is 01:15 PM.


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