SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Reply
 
Thread Tools Display Modes
Old 06/05/2014, 10:50 AM   #1
Teemo
Big Clucker
 
Teemo's Avatar
 
Join Date: Jan 2014
Location: SA-MP
Posts: 90
Reputation: 4
Default How to create a simple help dialog (For newbies)

Hello,

In here, I am going to show you how to create a basic help dialog with pages.

What do i need?

Just focus with me .

Start:

At the top of your script, Put:

pawn Code:
#define DIALOG_HELP1 4500
#define DIALOG_HELP2 4501
#define DIALOG_HELP3 4502

Now at your commands (ZCMD or YCMD), Use:

pawn Code:
CMD:help(playerid,params[]);
{
    ShowPlayerDialog(playerid, DIALOG_HELP1, DIALOG_STYLE_MSGBOX, "Help: Page 1", "Put your message here\nPut your message here", "Next Page", "Cancel");
    return 1;
}

Find OnDialogResponse:, Type this under:

pawn Code:
switch dialogid;
{
    case DIALOG_HELP1:
    {
        if(response)
        {
           ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "Help: Page 2", "Put your messages here\nPut your messages here", "Next Page", "First Page");
        }
    }
    case DIALOG_HELP2:
    {
        if(response)
        {
           ShowPlayerDialog(playerid, DIALOG_HELP3, DIALOG_STYLE_MSGBOX, "Help: Page 3", "Put your message here\nPut your message here", "First Page", "Second Page");
        }
        else
        {
            ShowPlayerDialog(playerid, DIALOG_HELP1, DIALOG_STYLE_MSGBOX, "Help: Page 1", "Put your message     here\nPut your message here", "Next Page", "Cancel");
        }
    }
    case DIALOG_HELP3:
    {
        if(response)
        {
            ShowPlayerDialog(playerid, DIALOG_HELP1, DIALOG_STYLE_MSGBOX, "Help: Page 1", "Put your message here\nPut your message here", "Next Page", "Cancel");
        }
        else
        {
            ShowPlayerDialog(playerid, DIALOG_HELP2, DIALOG_STYLE_MSGBOX, "Help: Page 2", "Put your message here\nPut your message here", "Next Page", "First Pagel");
        }
    }

Well, That is it.

At "Put your messages here", It means enter your help words here :P.

If this helped you, +Rep me.

__________________
Teemo is offline   Reply With Quote
Old 06/05/2014, 10:58 AM   #2
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,092
Reputation: 2655
Default Re: How to create a simple help dialog (For newbies)

Using an enumerator to assign dialogids is usually more maintainable; if the ids ever need to change you only have to edit the first one instead of the entire list. Using a switch statement to select the proper dialogid in OnDialogResponse is also bound to be faster than checking each dialogid individually.
__________________
Vince is offline   Reply With Quote
Old 06/05/2014, 10:59 AM   #3
Teemo
Big Clucker
 
Teemo's Avatar
 
Join Date: Jan 2014
Location: SA-MP
Posts: 90
Reputation: 4
Default Re: How to create a simple help dialog (For newbies)

Well, Thank you for your suggestion, Editing it now
__________________
Teemo 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
[Tutorial] Making Some Simple Command using ZCMD or OnPlayerText + SendClientMessage(For Newbies/Beginners) zProfessional Tutorials 5 26/10/2013 02:45 PM
[GameMode] Hydra Wars - Simple Script(Good for Newbies). ColonelBurton Gamemode Scripts 7 08/06/2013 08:09 AM
[Tutorial] How To Create Two Types Admin Chat.[Helpful to Newbies] Jarnu Tutorials 5 01/07/2012 07:39 AM
[Tutorial] How to create a simple Dialog Car Spawner. Shockey HD Tutorials 7 10/04/2012 04:36 AM


All times are GMT. The time now is 04:37 PM.


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