02.02.2010, 18:00
Here a basic exemple for you:
Command:
In OnDialogResponse:
Response of dialog "DIALOG_CMDS_1"
And, response of dialog "DIALOG_CMDS_2":
Command:
pawn Code:
if (strcmp("/cmds",cmdtext,true) == 0)
{
ShowPlayerDialog(playerid,DIALOG_CMDS_1,DIALOG_STYLE_LIST,"CrazyStunts Commands","Register On Server\nLogin Into Server\nSend Private Message","Select","Cancel");
return 1;
}
Response of dialog "DIALOG_CMDS_1"
pawn Code:
if(dialogid == DIALOG_CMDS_1)
{
if(response)
{
switch(listitem)
{
//Register On Server
case 0: ShowPlayerDialog(playerid,DIALOG_CMDS_2,DIALOG_STYLE_INPUT,"CrazyStunts Commands","Please write a password.","Register","Cancel");
//Login Into Server
case 1: ShowPlayerDialog(playerid,DIALOG_CMDS_2+1,DIALOG_STYLE_INPUT,"Login","Login","Login","Cancel");
//Send Private Message
case 2: ShowPlayerDialog(playerid,DIALOG_CMDS_2+2,DIALOG_STYLE_INPUT,"Client Message","Send a Client Message","Send!","Cancel");
}
}
return 1;
}
pawn Code:
if(dialogid == DIALOG_CMDS_2)
{
if(response == 0) //If has pressed 'Cancel'
{
SendClientMessage(playerid,COLOR_RED,"Register Canceled!");
}
if(response) //If has pressed 'Register'
{
//Function Here
SendClientMessage(playerid,COLOR_RED,"Register Successfully");
}
return 1;
}