[Tutorial] Using Dialog List/Msgbox
#1

Many people are in doubt as DIALOGS. Many People Can not A Good Tutorial! This Explains Here Footsteps How to Create Your DIALOG Simple! This Tutorial Almost nobody knew existed. In Tava Paste Code Useful arose when a guy asked by MSN Help! Ai Pro Lux asked if I could post here, He said He could spell it so there!Good Luck !


Before You Start Learn the Basics:



Using the \n is the \r:

Before You Begin What You Should Know:

\n - Skip To Use Line in Linux (also works on Windows)
\r - Only Used In Windows

Bottom Has Everything With \n, If You Want to Use \r Simply Replace the\n For \r !



\n = Used To Skip Lines. Example In 3DTextLabel :

pawn Code:
Create3DTextLabel("This is My Tutorial\nknow? ?", cor,2453.7878,-1460.9454,24.0000,50.0,0);

Another Example:

You Have A Notebook, Beauty, Oh you reach the end of the sheet to jump to another line, You Need To Take Another Line Hand *-*. Aki is Different Just Use \n(\r) At The End Of The Line Which of Pula.

Completing \n(\r) serves to Skip Lines!




Example in DIALOG MSGBOX :

pawn Code:
if(strcmp(cmdtext,"/Jonathan",true)==0) {
           new Jonathan[400];
           strins(Jonathan,"See what the end will have > \n",strlen(Jonathan));
           strins(Jonathan,"This is my notebook! Now go to another line \n",strlen(Jonathan));
           strins(Jonathan,"\n",strlen(Jonathan)); // This Example Pula A White Line =)
           ShowPlayerDialog(playerid, 1235, DIALOG_STYLE_MSGBOX, "Jonathan Owna ! ",Jonathan, "Tutorial", "Exit");
// We'll See In La Final =)
           return 1;
    }
Example in DIALOG LIST :


pawn Code:
if(!strcmp("/meudialoglist", cmdtext, true)) // Comando
{
ShowPlayerDialog(playerid, 1239, DIALOG_STYLE_LIST, "Header", "JFS\nJonathan", "Select", "Cancel");
//Serve To Be Or Go Jump in the Line DIALOG LIST ALSO ! IF NOT BY \n There's Something on the same line!
return 1;
}
Using \t



Ai More What is this? Never heard of, oh my god is it now? Your problems are over! I'll teach you how to use it!
/t Let Lists In The Middle Or Let's say it is a TAB.
Before You Begin Making Shit, See How is the \t :





I will use this example:


pawn Code:
ShowPlayerDialog(playerid, 3944, DIALOG_STYLE_LIST, "Header", "Tiririca\nMy Towel", "Select", "Exit");
Learning About \n We went to this, Using the Example Let's La Cima !!

- Tiririca = List 1
- My Towel = List 2

Set Lists, Let's Practice.

Up there is as you see. For what I will interece Here To See Better!


pawn Code:
Tiririca\nMy Towel
Oh How We See It Now as the\t ?

- If For No Place at Home Home
- If You Just After the First Place \t AFTER \n!


Examples :


pawn Code:
\tTiririca\nMy Towel // Used At Home
//-----------------------------------------------
Tiririca\n\tMy Towel // After First Used
//-----------------------------------------------
\tTiririca\n\tMinha Toalha // Used With Two !!

Putting Color in Dialog / Message ...

pawn Code:
#define Yellow 0xFFFF00AA
#define Red     0x9D000096
Definida as Cores Vamos Lб

Exemplo :


pawn Code:
SendClientMessage(playerid, cor, "{FFFF00}Yellow {9D0000}Red");

That is, where you Yellow This Yellow , Where Have Red This Red!

Where CUTTING THE FINAL TWO AND TWO OF THE BEGINNING!


pawn Code:
#define Yellow 0xFFFF00AA   =     {FFFF00}
#define Red 0x9D000096   =     {9D0000}
Another Example:

pawn Code:
SendClientMessage(playerid, COLOR, "This pencil is very {FFFF00}Yellow ");
SendClientMessage(playerid, COLOR, "This pencil is very {9D0000}Red ");
Example in DIALOG MSGBOX :

pawn Code:
if(strcmp(cmdtext,"/JFS",true)==0) {
           new JFS[200];
           strins(JFS,"{FFFF00}  Ok Here it All Yellow Knew? \n",strlen(JFS));
           strins(JFS,"{9D0000}Ok Here it All Red Knew ? \n",strlen(JFS));
           strins(JFS,"Here it Ta White Normal! aki {9D0000} Red aki is{FFFF00} Yellow \n",strlen(JFS));
           ShowPlayerDialog(playerid, 1234, DIALOG_STYLE_MSGBOX, "{F60000} JFS OWNA ! ",JFS, "Tutorial", "Exit");
           return 1;
   }
Example in DIALOG LIST :

pawn Code:
if(!strcmp("/mydialoglist", cmdtext, true)) // Command
{
ShowPlayerDialog(playerid, 123, DIALOG_STYLE_LIST, "Header", "{9D0000}Red\n{FFFF00}Yellow", "Select", "Cancel");
//Forever After \n !
return 1;
}

For as a button? Or 2 buttons?

pawn Code:
ShowPlayerDialog(playerid, 123, DIALOG_STYLE_LIST, "My Button", "Tutorial My Button !!", "Select", "Cancel");
Simple! Let's Get The Buttons Above:

pawn Code:
"Select", "Cancel")
Button 1= Select
Button 2 = Cancel

So You Can See How is course has two buttons there, Or Be So it is normal. What should be noted:

1 - Between The Buttons has " " !!!
2 - Button To Go = Select
3 - To Exit Button = Cancel

Only one button to Put Simply Put only one. In the above example, If You Want It Just Looks Like You will be a button:


pawn Code:
"Select", "")
The second button will become empty with only "" !!!
Only With A Ai'll be!



REMEMBERING BEFORE: ALL THE KEYS TO OPEN, CLOSE!

Let Pro Home Now!


Creating my System DIALOG MSGBOX. By: Jonathan_Feitosa.


pawn Code:
if(strcmp(cmdtext,"/mydialogmsgbox",true)==0) {
         new meudialog[200]; // DEFINING CHARACTERISTICS OF THE NUMBER BELOW !
         strins(meudialog,"\n",strlen(meudialog)); // Use Of \n Be Or skip blank line
         strins(meudialog,"{7491F6}This is My Special Commando! \n",strlen(meudialog)); // ALWAYS WRITE WITH \n End To Jump In Line
         strins(meudialog,"{7491F6}Know My commands from my server?\n",strlen(meudialog));// ALWAYS WRITE WITH \ n End To Jump In Line
         strins(meudialog,"{7491F6}Credits e.e.e.e.e.e.e.e \n",strlen(meudialog));// ALWAYS WRITE WITH \ n End To Jump In Line
         // DIALOG ( MAIN ) :
         ShowPlayerDialog(playerid,1281, DIALOG_STYLE_MSGBOX, "{F60000} My Simple Command ! ",meudialog, "Exit", ""); // just want to put a Botao c 2! IS THE HEAD
       return 1;
    }

Explaining the DIALOG :

ShowPlayerDialog = The dialog
playerid = For the Player
1281 = DIALOG-ID ( TAKE CARE NOT TO HAVE IN 1235 GM )
DIALOG_STYLE_MSGBOX = DIALOG MSGBOX
{F60000} = COLOR, ie the header color
Jonathan Owna = header
meudialog = DEFINED IN THE TOP !
Fechar = Only a Button, If You Want To Add Just For Two which has "" Be, "Here"



Creating A DIALOG LIST By: Jonathan_Feitosa

Top :

pawn Code:
#define JFS_OWNA 1
//DIALOG careful not to have set in with a GM/FS !!
Now in public OnPlayerCommandText

pawn Code:
if(!strcmp("/mydialoglist", cmdtext, true)) // Comando
{
ShowPlayerDialog(playerid, JFS_OWNA, DIALOG_STYLE_LIST, "{33CCFF} ---- Teleports By: Jonathan_Feitosa ---- ", "{FFFF00}JFS\n{33AA33}Jonathan", "Select", "Exit");
// JFS = LIST1
// Jonathan = LIST2
// PS : THE LOOK \n
return 1;
}
Explaining :

ShowPlayerDialog = to appear
playerid = player
JFS_OWNA = Defined name
DIALOG_STYLE_LIST = TO BE LIST
{33CCFF} = Header Color
---- Teleports By: Jonathan_Feitosa ---- = Header
{FFFF00} = COLOR LIST JFS
JFS = LIST 1
\n = Skip Line
{33AA33} = COLOR THAT IS THE LIST Jonathan
Jonathan = LIST 2
Selecionar = Button to select
Cancelar = Button to Exit


pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) // In OnDialogResponse !!!
{
         
      if(dialogid == JFS_OWNA)  // ENTERING THE  /mydialoglist Will Open:
       {
          if(response)
           {
          if(listitem == 0)     // LIST 1 - JFS -
           {
               // Coloque Sua Funзгo Aqui !!
               // VAMO POR UM SIMPLES AQUI EM BAIXO,  :
                SetPlayerPos(playerid, CORX, CORY, CORZ); // WHERE HE WILL COORDINATE
                SetPlayerArmour(playerid, 100.0); // Armour
                SetPlayerHealth(playerid, 100.0); // Health
                SetPlayerSpecialAction(playerid, 2); // JETPACK
                GivePlayerWeapon(playerid,24,999); // Weopon
         }
           else if(listitem == 1) // LIST 2 - JONATHAN -
         {
               // Coloque Sua Funзгo Aqui !!
               // VAMO POR UM SIMPLES AQUI EM BAIXO,  :
                SetPlayerPos(playerid, CORX, CORY, CORZ); // WHERE HE WILL COORDINATE
                SetPlayerArmour(playerid, 100.0); // Armour
                SetPlayerHealth(playerid, 100.0); // Health
                SetPlayerSpecialAction(playerid, 2); // JETPACK
                GivePlayerWeapon(playerid,24,999); // Weopon
            return 1;
         }
      }
   }
    return 0;
}
// Closing the OnDialogResponse
Crйdits : Jonathan_Feitosa = ALL !
Should Have Doubts Or Send PM MSN Add On My Signature, I will go into the afternoon.
Also Visit My Projects. Good Luck!
Send Errors For MP! Next I explain in the Best !!

PS : Sorry For Caps Some words just to highlight them

I am of Portuguese Forum, Vim My Topic Post Here.
Errors in English, sorry.
Reply
#2

Good Job!
Reply
#3

This doesn't look like tutorial, explain better.
Reply
#4

****** Translator much?
Reply
#5

Quote:
Originally Posted by alpha500delta
View Post
****** Translator much?
Grammar failing 'too' much?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)