help with DIALOG_STYLE_INPUT
#1

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

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);
Reply
#3

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
Reply
#4

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));
Reply
#5

thanks dude for helping me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)