[Tutorial] How to Make a Simple System of Rules
#1

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
Step 2:Make the command,with zCMD by Zeex
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;
}
Step 3:In the public OnDialogResponse,put the command,for define the buttons.
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;
}
Is the my first tutorial,I think it is well explained,But I like constructive criticism,I really want someone to learn something with this tutorial, and it serves as a basis for something later.
Reply
#2

Simple and nice.

Great job.
Reply
#3

Thank's
Reply
#4

Seems like a good way of explaining the dialog system, kind of. Good job.
Reply
#5

Thank's, You board English,You encourage me so much, on our board, only know how to complain, thank you
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)