28.10.2011, 17:18
Dialog Tutorial :
First
Open Pawno, Then in your script you can add dialogs, lets start, first lets start with OnPlayerConnect :
First
Open Pawno, Then in your script you can add dialogs, lets start, first lets start with OnPlayerConnect :
pawn Code:
public OnPlayerConnect(playerid)
pawn Code:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Welcome to my SA:MP Server!","Write somethin here","Button1","Button2");
Step 2 :
now OnDialogRespons !
pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
pawn Code:
if(dialogid == 1)
{
if(response == 1)
{
switch(listitem)
{
case 0:
{
}
case 1:
{
}
}
}
}
return 1;
}
pawn Code:
case 1:
{
Kick(playerid);
SendClientMessage(playerid,color,"you are kicked");
}
lets go to another dialog style !
pawn Code:
OnPlayerConnect(playerid)
pawn Code:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST ,"Welcome to my SA:MP Server!","Write Somethin","Button1","Button2");
NOTE : \n <--- for New Line
and the Dialog Response Same as other, you can delete kick !
ok now to Dialog Style password
pawn Code:
OnPlayerConnect(playerid);
pawn Code:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD ,"Welcome","Write your password","Button1","Button2");
pawn Code:
case 1:
{
Kick(playerid);
}
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/your command", cmdtext, true, 6) == 0)
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Write here somethin","Blalblalba","Button1","Button2"); // you can change the dialog style so
return 1;
}
return 0;
}
pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2)
{
if(response == 1)
{
switch(listitem)
{
case 0:
{
}
case 1:
{
}
}
}
}
return 1;
}
Enjoy this Tutorial, if there is something wrong, please let me know. thanks