SA-MP Forums Archive
help with DIALOG_STYLE_INPUT - 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)
+--- Thread: help with DIALOG_STYLE_INPUT (/showthread.php?tid=607149)



[SOLVED]help with DIALOG_STYLE_INPUT - ratxrat - 15.05.2016

how to take variable from input text , example a=input_text , a as string. can someone giveme example?


Re: help with DIALOG_STYLE_INPUT - Konstantinos - 15.05.2016

Do you mean to copy the text from inputtext to a new variable (string)?

pawn Код:
#if !defined strcpy
    #define strcpy(%0,%1) strcat((%0[0] = EOS, %0), %1)
#endif
and then:
pawn Код:
// strpy(destination[], source[], size);
new tmp_inputtext[128]; // inputtext's max length can be 128
strcpy(tmp_inputtext, inputtext, sizeof tmp_inputtext);



Re: help with DIALOG_STYLE_INPUT - ratxrat - 15.05.2016

yes i mean variable as string .

i just want take variable string from input box
PHP код:
ShowPlayerDialog(playerid666DIALOG_STYLE_INPUT"text""Please enter your text:""oke""Cancel"); 
for example take string use format
PHP код:
format(stringsizeof(string), "text:%s "input_box));
                    
SendClientMessageEx(playeridCOLOR_LIGHTBLUEstring); 
sorry im noob at scrip samp can you Explain hehe


Re: help with DIALOG_STYLE_INPUT - Konstantinos - 15.05.2016

In OnDialogResponse callback, check if dialogid is equal to 666 and if response is 1 and do it like the way you did:
pawn Код:
new string[134]; // max input (128) + "text:" (5) + NULL
format(string, sizeof(string), "text:%s ", inputtext));



Re: help with DIALOG_STYLE_INPUT - ratxrat - 15.05.2016

thanks dude for helping me