Jump to content

Tutorial dialog by Kingston


Kingston46

Recommended Posts

ShowPlayerDialog(PLAYERID,DIALOGID,DIALOG_STYLE,Mesaj,Buton_1,Buton_2);

PLAYERID-Cui sa ii arate

DIALOGID-Numarul dialogului

DIALOG_STYLE-stilul dialogului:

0 - DIALOG_STYLE_MSGBOX -numai mesaj

1 - DIALOG_STYLE_INPUT -in care poti scrie ceva

2 - DIALOG_STYLE_LIST -lista.

Daca vrei sa adaugi o noua linie scrii \n (ex:"Reguli:\n -Nu injura...)

Daca vrei sa creezi un spatiu mai mare \t (ex:"-nu injura\t-nu discrimina")

OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

playerid-cine a raspuns

dialogid-numarul dialogului

response-ce buton a apasat

listitem-daca e DIALOG_STYLE_LIST ce a ales

inputtext-daca e DIALOG_STYLE_INPUT ce a scris in casuta

Acum sa construim un dialog:

1.

Code:

#define Dialog_Test 1

Dialog_Test - e o scurtatura

1-Numarul dialogului

2.

Code:

ShowPlayerDialog(playerid,Dialog_Test,DIALOG_STYLE_LIST,"Selecteaza","Ajutor\nTeleporturi\nReguli\nComenzi","Selecteaza","Inchide");

Asta adaugi intro comanda,sau unde vrei tu

3.

La OnDialogResponse:

Code:

if(dialogid==Dialog_Test)

{

if(response)//daca apasa primul buton

{

if(listitem==0)//Ajutor

{

SendClientMessage(playerid,COLOR_RED,"Ajutor...spanzura-te");

}

if(listitem==1)//Teleporturi

{

SendClientMessage(playerid,COLOR_RED,"Teleporteaza-te in mormant");

}

//si tot asa

}else //daca a dat click pe celalt buton

{

SendClientMessage(playerid,COLOR_RED,"Bine ca nu ai ales");

}

return 1;

}

Sper ca ati inteles. Astept parerile voastra . Acest tutorial este facut 100% de mine va rog sa ma credeteti. si app. e primul meu tutorial.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.