Making a tutorial
#1

I want to make a tutorial that shows the player rules and cool stuff around the server after registering.
I don't know how to start making this so please help me !I will provide every neccesary code that will help you helping me
Reply
#2

well if you really want you can just go download a role-play script and copy and paste there tutorial and change it. jsut use SetCameraLookat and SetCameraPos and some textdraws and you will be fine

i can make an example if you like?
Reply
#3

I tried that and got a bunch of errors and warings because of undefined things and missing stuff...
I just want to know how do you connect more dialogs.
An example would be: I click "register" and it starts a new dialog with asking my about my age and then i click my age and takes me to a new dialog etc...
Reply
#4

I have done the code that shoul check if player has done the tutorial and it looks like this
pawn Код:
if(IgracInfo[playerid][Tut] == 0)
        {
        ShowPlayerDialog(playerid,tut1,DIALOG_STYLE_INPUT,"{FF0000}                     Tutorijal"," dadadada\n\n\n adadadaad","OK","NO");
        }

but i don't know where to put it here

pawn Код:
public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, BF);
    TextDrawShowForPlayer(playerid, BM);
    SetPlayerPos(playerid,1108.7909,-839.2827,109.9381);
    SetPlayerCameraPos(playerid, 1108.7909,-839.2827,111.9381);
    SetPlayerCameraLookAt(playerid, 1109.7909,-840.2827,111.9281);
    new datoteka[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(datoteka,sizeof(datoteka),"/korisnici/%s.txt",name);
    if(dini_Exists(datoteka)) ///////////////////// LOGIN
    {
        for(new i = 0; i < 50; i++) SendClientMessageToAll(BIJELA," ");
        ShowPlayerDialog(playerid,LOGIRANJE,DIALOG_STYLE_PASSWORD,"{FF0000}                      PRIJAVA","{00FF00}_______________________________\n\n         Vaљ Acount je pronaden!\n\n      Molimo unesite vaљu lozinku:\n_______________________________","Logiraj","Odustani");
    }
    else                   /////////////////// RULES
    {
        new string[1024];
        strcat(string, "{00FF00}Dobrodoљli na BlackFade.org RPG server!\n");
        strcat(string, "{00D0FF}Prije pocetka igranja na naљem serveru morate prihvatiti uvjete koriљtenja:\n\n");
        strcat(string, "{FF0000}1.Vaљ nickname MORA biti u formatu Ime_Prezime(npr. Marko_Markovic) i MORA biti realan.\n");
        strcat(string, "2.Obavezni ste poљtovati i znati pravila servera koja se nalaze na forumu i serveru.\n");
        strcat(string, "3.Obavezni ste poљtovati druge igrace kao sto su i oni obavezni poљtovati Vas!\n\n");
        strcat(string, "4.Zabranjeno je davanje Vaљe lozinke drugim igracima!Obavezni ste je cuvati u tajnosti.\n");
        strcat(string, "5.BlackFade.org nece nikada nikome davati Vaљu lozinku niti je traћiti od Vas.\n");
        strcat(string, "6.BlackFade.org ne odgovara za vasu lozinku\n\n");
        strcat(string, "7.Zabranjeno je koristenje MODova koji Vam daju prednost nad drugim igracima!\n");
        strcat(string, "9.Zabranjeno je vrijedanje po bilo kojoj osnovi!\n");
        strcat(string, "10.Srogo je zabranjeno iskoristavanje BUGova\n\n");
        strcat(string, "BlackFade zadrzava pravo na promjenu pravila i zatvaranje Vaљeg racuna bez najave ukoliko\n");
        strcat(string, "krљite pravila servera.");     
        ShowPlayerDialog(playerid,REGISTRACIJA, DIALOG_STYLE_MSGBOX, "{FF0000}Uvjeti koriљtenja", string, "Prihvacam", "Odbijam");
        for(new i = 0; i < 50; i++) SendClientMessageToAll(BIJELA," ");
        IgracInfo[playerid][Loginf] += 1;
        if(IgracInfo[playerid][Loginf] == 5)///////////// KICKS AFTER FAILING PASSWORD 5 TIMES
        {
            SendClientMessage(playerid,CRVENA,"Unjeli ste pogreљnu lozinku previљe puta i izbaceni ste sa servera!");
            Kick(playerid);
        }
        return 1;
    }
    return 1;
}
Reply
#5

heres one i made awhile back
it wont function as you dont have all my stocks but it will show you how

this is all in my OnDialogResponse()
pawn Код:
//this would start the wizard
ShowPlayerDialog(playerid,DIALOG_USER_DOB,DIALOG_STYLE_INPUT,"DOB","Enter your Date Of Birth:\n Use the format YYYY\\MM\\DD","Enter","Skip");


//this is the struct
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid) // Lookup the dialogid
    {
       
        //###########Start profile wizard################
        case DIALOG_USER_DOB:
        {
            if(!response)
            {
                //they skiped show next dialog
                return ShowPlayerDialog(playerid,DIALOG_USER_GENDER,DIALOG_STYLE_LIST,"Gender","Male\r\nFemale","Enter","Skip");
            }
            //save DOB
            //show next dialog
            return ShowPlayerDialog(playerid,DIALOG_USER_GENDER,DIALOG_STYLE_LIST,"Gender","Male\r\nFemale","Enter","Skip");
 
        }
        case DIALOG_USER_GENDER:
        {
            if(!response)
            {
                //they skiped show next dialog
                return ShowPlayerDialog(playerid,DIALOG_USER_ABOUT,DIALOG_STYLE_INPUT,"About","Enter a little info about you.","Enter","Skip");
            }
            //save Gender
            //show next dialog
            return ShowPlayerDialog(playerid,DIALOG_USER_ABOUT,DIALOG_STYLE_INPUT,"About","Enter a little info about you.","Enter","Skip");
 
        }
        case DIALOG_USER_ABOUT:
        {
            if(!response)
            {
                //they skiped show next dialog
                return ShowPlayerDialog(playerid,DIALOG_USER_HOBBY,DIALOG_STYLE_INPUT,"Hobbies","Enter your Hobbies","Enter","Skip");
            }
            //save About
            //show next dialog
            return ShowPlayerDialog(playerid,DIALOG_USER_HOBBY,DIALOG_STYLE_INPUT,"Hobbies","Enter your Hobbies","Enter","Skip");
 
        }
        case DIALOG_USER_HOBBY:
        {
            if(!response)
            {
                //they skiped show next dialog
                return ShowPlayerDialog(playerid,DIALOG_USER_SIG,DIALOG_STYLE_INPUT,"Signature","Enter your profile sig","Enter","Skip");
            }
            //save Hobby
            //show next dialog
            return ShowPlayerDialog(playerid,DIALOG_USER_SIG,DIALOG_STYLE_INPUT,"Signature","Enter your profile sig","Enter","Skip");
            //1; // We processed it
 
        }
        case DIALOG_USER_SIG:
        {
            if(!response)
            {
                //they skiped show next dialog
                return ShowPlayerDialog(playerid,DIALOG_USER_LOCATION,DIALOG_STYLE_INPUT,"Location","Enter your location","Enter","Skip");
            }
            //save Sig
            //show next dialog
            return ShowPlayerDialog(playerid,DIALOG_USER_LOCATION,DIALOG_STYLE_INPUT,"Location","Enter your location","Enter","Skip");
 
        }
        case DIALOG_USER_LOCATION:
        {
            if(!response)
            {
                //they skiped end the wizard
                return 1;
            }
            //save Gender
            //end the wizard
            return 1; // We processed it
        }
       
       
        //###########end profile wizard################
       
       
        case DIALOG_USER_LOGIN:
        {
            if(!response)
            {
               
                return 1; // We processed it
            }
 
            //blah blah
            return 1; // We processed it
 
        }
 
    }
    return 0;
}

EDIT:
I removed all my code and left just the structure
hope that helps.
Reply
#6

Thank you but I'm using an another "system",I have made a variable tutorial=0 which is made by registration and saves on exit and when you finish your tutorial its =1,so now I need to put this

pawn Код:
if(IgracInfo[playerid][Tut] == 0) //player didn't finish the tutorial
        {
        ShowPlayerDialog(playerid,tut1,DIALOG_STYLE_INPUT,"{FF0000}                     Tutorijal"," dadadada\n\n\n adadadaad","OK","NO");
        }
I don't know where so when a player connects it checks if he has done his tutorila,if not he will have to do it.

Anyone know where to put this?
Reply
#7

well i would go in OnPlayerSpawn()

and freeze them if they have not dont tut,
also i edited my code to show a more clear example


look above
Reply
#8

If i put it on OnPlayerSpawn() it overwrites my registering procses,so after accepting the Tearms Of Use there is no password dialog anymore but there is the tutorial which i don't want...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)