Dialog Inputtext as global
#1

Hello, how can i make dialog inputtext as global variable?

I tried

Код:
mything = inputtext;
But it's not working.
Reply
#2

the mything variable must be a string. Make sure it is one
Reply
#3

Assuming the global variable is string:
pawn Код:
strcpy(mything, inputtext, 128);
pawn Код:
#define strcpy(%0,%1) strcat((%0[0] = '\0', %0), %1)
Reply
#4

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
#define strcpy(%0,%1) strcat((%0[0] = '\0', %0), %1)
The first time I am seeing a weird define
Can you explain this for me please?
Reply
#5

Код:
new passwords[64];
Код:
Dialog:Password(playerid, response, listitem, inputtext[])
{
    if (response)
    {
		if(isnull(inputtext))
		{
			ShowDialog(playerid, Show:<Password>, DIALOG_STYLE_INPUT, ""EMBED_WHITE"Login"EMBED_WHITE"", ""EMBED_WHITE"Please enter your password below", "Okay", "Exit");
			return 1;
		}
		passwords = inputtext;
    }
    else
    {
		//dont do nothing
    }
    return 1;
}
I want to make that passwords global that i can use it in other cmd
Reply
#6

pawn Код:
strcpy(passwords, inputtext, sizeof (passwords));
Quote:
Originally Posted by NaClchemistryK
Посмотреть сообщение
The first time I am seeing a weird define
Can you explain this for me please?
It resets the string and it makes it as destination. The rest is the source and the max length (optional).
Reply
#7

I am talking about the #define strcp(%0 %1) strcat[..... whatever.
Reply
#8

Thanks +rep
Reply


Forum Jump:


Users browsing this thread: