SA-MP Forums Archive
Dialog help. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog help. (/showthread.php?tid=126035)



Dialog help. - NewYorkRP - 06.02.2010

Is there any tutorial on how Dialog input text box's work? i need to add some to my server.

Any link is appreciated.


Re: Dialog help. - nastoe - 06.02.2010

Код:
if(!strcmp(cmdtext, "/example", true))
{
  SendClientMessageToAll(0xDEEE20FF, "Somebody was typed /example");
  ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "HEADER", "TEXT HERE", "OK", "Cancle");
  return 1;
}



Re: Dialog help. - NewYorkRP - 06.02.2010

Aha, i see what you done there.

But now, i need it, so aka:

You typed in : 10 and pressed ok

so it would do the following

Sexlevel[playerid] = 10; -- (is it inputtext) or what?


like /sex [AMOUNT] - the AMOUNT is classed as money
new money;
Sexlevel = money;




Re: Dialog help. - nastoe - 06.02.2010

you need box where you can write something?

then make this

Код:
if(!strcmp(cmdtext, "/example", true))
{
  SendClientMessageToAll(0xDEEE20FF, "Somebody was type /example");
  ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT
, "HEADER", "Put your text downhere", "Ok", "Cancle");
  return 1;
}
and this somewhere in script

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  
  if(dialogid == 0 && response) 
  {
    
    switch(listitem)
    {
      case 0:
      {
        //do something here
      }
     }
   }
   return 1;
}



Re: Dialog help. - NewYorkRP - 06.02.2010

is
Код:
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT
the dialogid == 0 ?

And would that work? what would i do, would the final text be classed as 'inputtext' or what?


Re: Dialog help. - nastoe - 06.02.2010

no srry dont do this
Код:
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT
put this

Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT



Re: Dialog help. - NewYorkRP - 06.02.2010

Can you give me an example of a text input box.

And when you type in a number [AKA 300000]

it sets your money to 300,000 - That's literally what im looking for, but i will ofc edit it!

Thanks so much if you could do this. - Then i'd learn what inputtext dialog boxes do :P


Re: Dialog help. - nastoe - 06.02.2010

srry i dont have time now, put new topic...