Jump to content

návod Dialógy A Všetko O Nich [*]


Lax.

Recommended Posts

ešte poradím, keď nechceš stále dávať

 

 

ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Caption","Info","Tlačítko 1","Tlačítko 2");
ShowedPlayerDialog[playerid]=true;

tak tu je pomoc

 

 

hore dajte ako v návode

new bool:ShowedPlayerDialog[MAX_PLAYERS];

a potom niekam dajte stock

stock ShowPlayerDialogEx(playerid,id,style,lis[],mess[],button1[],button2[]){
if(ShowedPlayerDialog[playerid] == true) return 0;
ShowPlayerDialogEx(playerid,id,style,lis[],mess[],button1[],button2[]);
ShowedPlayerDialog[playerid]=true;
}

 

a potom hore medzi define

#define  ShowPlayerDialog ShowPlayerDialogEx

 

A ešte do ondialogresponse

ShowedPlayerDialog[playerid]=false;

:d

použitie ?

ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Rules","NO CHEAT","Tlačítko 1","Tlačítko 2");

 

MAFIAN mohol by si to dať hore...

Link to comment
Share on other sites

Mám tu něco.

 

Když je tedy 1. Tlačítko, vyčetl jsem z tutu response == 1 ,dobře. A co to druhé tlačítko ?

 

images.jpg

 

Zapoměl jsi zmínit, že

2. tlačítko je response == 0

 

V jedné registraci jsem viděl na druhém tlačítku response == 2, samozřejmě to nefungovalo.

Kdyby jsem se mýlil, vysvětlete mi to.

Link to comment
Share on other sites

mxco - ano v registraci je to špatně a když dáš druhý tlačítko tak tě to nevyhodí.

 

Pěkný TuT i s obrázky ale zapoměl si napsat jak se pracuje s inputtextem v OnDialogResponse.

Link to comment
Share on other sites

Bezesporu pěkný TUT, ale myslím, že by stálo za doplnění, jak udělat dialog pouze s jednou možností...

viz:

 

dialog.png

Nebudu psát z jakého serveru screen je, myslím, že to stejně každý pozná sám :think:

 

Předem díky za odpověď.

Link to comment
Share on other sites

ShowPlayerDialog(playerid, ID, STYL, "NADPIS", "TEXT", "Tlacitko1", "");

kdyz das druhy tlacitko jako "" tak se nezobrazi.

 

Tohle už mi funguje ale jen v 0.3c.

V 0.3b mě to vytvořilo i to druhé tlačítko ale bylo prázdné.

Link to comment
Share on other sites

QWER opraveno -

stock ShowPlayerDialogEx(playerid, id, style, lis[], mess[], button1[], button2[])
{
ShowPlayerDialogEx(playerid, id, style, lis, mess, button1, button2);
ShowedPlayerDialog[playerid] = true;
return 1;
}

Link to comment
Share on other sites

stock ShowPlayerDialogEx(playerid, id, style, lis[], mess[], button1[], button2[])
{
if(ShowedPlayerDialog[playerid] == true) return 0;
  ShowPlayerDialog(playerid, id, style, lis, mess, button1, button2);
  ShowedPlayerDialog[playerid] = true;
  return 1;
}

Link to comment
Share on other sites

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/zkouska",true) == 0)
   {
   ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Caption","Info","Tlačítko 1","Tlačítko 2");
   return 1;
   }

return 0;
}



public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
if(dialogid == 1)
{
if(response == 1)
{
if(listitem == 0)
{
SendClientMessage(playerid,COLOR_GREEN,"ahoj.zkouska");
ShowedPlayerDialog[playerid]=false;
}
}
}



stock ShowPlayerDialogEx(playerid,id,style,lis[],mess[],button1[],button2[]){
ShowedPlayerDialog[playerid]=true;
return 1;
}

 

pls nehaze mi to error ale neukaze mi to tu tabulku :d pise kdyz dam /zkouska tak ze prikaz neexistuje

Link to comment
Share on other sites

10/10 moc pekne sice gialogu rozumim ale nekdo kdo se ho uci se to hodi NICE...

 

-- pon 03. led 2011 5:16:39 --

 

hele ti C3RN3J tu ej moje skype skypr55 napiš mi ja ti ukazu a opravim...:d

Link to comment
Share on other sites

Hore ako new:

Kód:

new bool:ShowedPlayerDialog[MAX_PLAYERS];

 

Aby nepreskakovalo menu na prvu položku v dialogu

 

 

 

stock

 

Kód:

stock ShowPlayerDialogEx(playerid, id, style, lis[], mess[], button1[], button2[])

{

ShowPlayerDialogEx(playerid, id, style, lis, mess, button1, button2);

ShowedPlayerDialog[playerid] = true;

return 1;

}

 

 

 

Definícia

 

Kód:

#define ShowPlayerDialog ShowPlayerDialogEx

 

 

 

 

a ešte do OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

 

Kód:

ShowedPlayerDialog[playerid]=false;

 

 

 

Použitie:

 

 

ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Caption","Info","Tlačítko 1","Tlačítko 2");

 

 

Ahoj, mám problem s tímhle. vše jsem udělal aby se to neopakovalo ale teď se mi dialogy vůbec nezobrazují.. možná jsem pokazil toto:

 

a ešte do OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

 

Kód:

ShowedPlayerDialog[playerid]=false;

 

Dal sem to do toho publiku uplně zvlášť nad return je to tak dobře??

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...