Creating a Mesage Dialog for your script -
stormchaser206 - 10.03.2012
NOTE: We will use a vip commands menu for this.
The First Start
Open Pawno.
Click "New" at the top.
Then do these steps:
At the top, after
,
Put this:
.
The Middle Front
Then go to:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
.
It should look like this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
Change "/mycommand" to your liking. I will be using /vcmds for this tutorial since i am creating a vip menu.
The Final Push
Change:
to:
pawn Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Vip Commands", "VIP COMMANDS\n/healme\n/vcmds\n/armourme\n/vipkill\nMORE COMMANDS TO COME", "OK", "Cancel");
NOTE: Make sure that is all on one line, not two.
Then, Press The compile button at the top (or F5), and you should get:
Код:
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Congratulations. You just created your message dialog!
Re: Creating a Mesage Dialog for your script -
Twisted_Insane - 10.03.2012
What should this be? This is showing a simple dialog, yes, but what if a player is clicking on the button of the dialog? NOTHING will continue, you didn't even try to continue scripting! You would have had to continue under "OnDialogResponse" and set some functions there! This is really one of the most useless tutorials I've ever seen, sorry! I mean, for this little piece, you could simply do the following:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "/healme, /makebettertutorial, etc...");
return 1;
}
return 0;
}
Re: Creating a Mesage Dialog for your script -
stormchaser206 - 10.03.2012
If nothing happened when you click OK, the compiler wouldn't compile
Re: Creating a Mesage Dialog for your script -
Max_Coldheart - 10.03.2012
You didn't even explain THAT SMALL PIECE OF CODE.
This is just a bad tutorial.
Re: Creating a Mesage Dialog for your script -
stormchaser206 - 10.03.2012
fine people... I am hating the pawno compiler right now... Its betraying me...
ADMIN REMOVE IT
Re: Creating a Mesage Dialog for your script -
Konstantinos - 10.03.2012
Congratulations!
Quote:
Originally Posted by stormchaser206
If nothing happened when you click OK, the compiler wouldn't compile
|
You are wrong. The compiler has nothing to do with this. I can have code at OnDialogResponse Callback that does something on Button1 or Button2, but I may not have at all. It will compiles fine. You didn't explain anything and you suggest them how to make a command with strcmp( not even command processor, but a string comparison ) using wrong length and get the message "SERVER: Unknown command."
pawn Код:
// Change "/mycommand" to your liking. I will be using /vcmds for this tutorial since i am creating a vip menu.
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
Re: Creating a Mesage Dialog for your script -
TRIPLE-xXx-GAMEING - 11.03.2012
i have tried to explain the msg dialog in my tut see and tell hows it? i wrote it in 2 min lol
Re: Creating a Mesage Dialog for your script -
Max_Coldheart - 11.03.2012
Quote:
Originally Posted by TRIPLE-xXx-GAMEING
i have tried to explain the msg dialog in my tut see and tell hows it? i wrote it in 2 min lol
|
No, you didn't explain it.
Also, tutorial could take even 2 hours to make, not 2 mins.
Re: Creating a Mesage Dialog for your script -
Shabi RoxX - 11.03.2012
Guy search showplayerdialog on ****** and goto wikI
That is much better than this tutoriAl !
Re: Creating a Mesage Dialog for your script -
MP2 - 11.03.2012
This is not a tutorial, you're just showing people code which they will copy and paste and change the text. You need to properly and clearly explain all the functions, parameters and outcomes. You don't talk about dialog types, dialog IDs, responses, hell, you don't even show a picture of a dialog!