[Include] NDIALOG v1.0 - Create ZCMD like dialogs!
#1


About Me:

Hello dear SA-MP community My name\'s Nickk888, i\'m a German/Polish PAWN Scripter for about 7-8 years now, I own a YT 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 is a dialog system inspired by ZCMD by Zeex! The idea behind this was, to create a dialog system without entering a dialogid or even definitions of those numbers, i made it in 1 hour studying how ZCMD works so i made this small include ^_^ I don\'t know if someone made it this way yet, if so, i\'m sorry that i put effort into it?


Functions:
Code:
OpenDialog(playerid, dialogname[], style, caption[], info[], button1[], button2[] = ""); //Opens a dialog.
CallDialog(playerid, dialogname[]); //Calls the dialog intern callback without opening the dialog(Like you would do cmd_name(playerid, ""); in ZCMD).
Callbacks:
Code:
OnPlayerDialogOpen(playerid, dialogname[]); //This callback is been called when someone tries to open a dialog, return 1; opens the dialog, return 0; ignores it.
OnPlayerDialogClose(playerid, dialogname[]); //This callback is been called when someone closes/responsed a dialog, return 1; calls the internal dialog callback, return 0; ignores it.
How to use it(Examples):

To make a dialog, you have to use OpenDialog as a function to open the dialog, as the "dialogid" you have to enter the exact name of the dialog you create with "DIALOG:name" or "D:name", look at this example:
Code:
CMD:dialog(playerid)
{
	OpenDialog(playerid, "test_dialog", DIALOG_STYLE_LIST, "Choose your weapon!", \
	"AK-47
 \
	Desert Eagle
 \
	MINIGUN!
 \
	Dildo", "Button 1", "Button 2");
	return 1;
}

DIALOG:test_dialog(playerid, response, listitem)
{
	if(response)
	{
		switch(listitem)
		{
			case 0: GivePlayerWeapon(playerid, WEAPON_AK47, 100);
			case 1: GivePlayerWeapon(playerid, WEAPON_DEAGLE, 50);
			case 2: GivePlayerWeapon(playerid, WEAPON_MINIGUN, 5000);
			case 3: GivePlayerWeapon(playerid, WEAPON_DILDO, 1);
		}
		SendClientMessage(playerid, -1, "You have got a weapon!");
	}
	return 1;
}
Known Bugs:

I couldn\'t find any bug myself, just don\'t use if you can a dialogid ranging from 0 to 9, those numbers are given randomly the dialog within the system as a fail-safe protection. I didn\'t tried if it works though, testing is needed.

Changelog:

V1.0
Code:
First release
Download:
Whole package
Include only

Credits:

a_samp: SAMP Team

ZeeX: For the idea <3
Reply
#2

good job, will be usefull
Reply
#3

Easy dialog by Emmet_ its like this but have more functionality. You might wanna take a look at that include and see how it works
But nice work and keep it up
Reply
#4

Nice include. But experienced people disagree on using something like "Dialog:abc" because the `:` symbol is used to indicate tags like "new Float:a;" I hope you got what I want to say
Reply
#5

Woow, nice!

I am using it!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)