27.07.2018, 09:07
(
Last edited by Nickk888; 09/08/2018 at 01:20 PM.
)

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).
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.
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;
}
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
Whole package
Include only
Credits:
a_samp: SAMP Team
ZeeX: For the idea <3

