31.10.2014, 03:26
System of Rules
Hello people,its my first tutorial in the board english,its so simple system of rules for beginners,sorry for my bad english,i am Brazilian,and speak Portuguese, And Need the Include zCMD by Zeex
Step 1:Define the Dialogue at the top of the script
Explanation 1:Its Defines the we dialog
pawn Код:
#define DialogRules 150//You can change its
Explanation 2:Create the command,and the function(ShowPlayerDialog)Show the dialog,the "DialogRules" Is the defines in top of script, the "DIALOG_STYLE_MSGBOX" is the style of dialog.
pawn Код:
CMD:rules(playerid, params[])
{
ShowPlayerDialog(playerid, DialogRules, DIALOG_STYLE_MSGBOX, "The Rules", "1° You set the rules\n2° You set the rules\n3° You set the rules", "Next", "Quit");
return 1;
}
Explanation 3:the if(dialogid == DialogRules) verify if is DialogRules,the "if(response == 0) is the button "quit", and Send the message,the "if(response == 1) is the button "Next" e make the second page of the rules,all works correctly.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DialogRules){
if(response == 0)
SendClientMessage(playerid, 0xFF0000FF, "You quit of the rules");
}
if(response == 1)
{
ShowPlayerDialog(playerid, DialogRules, DIALOG_STYLE_MSGBOX, "The Rules", "1° You set the rules\n2° You set the rules\n3° You set the rules", "Quit", "");
}
return 1;
}