SA-MP Forums Archive
Dialog Inputtext as global - 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: Dialog Inputtext as global (/showthread.php?tid=521326)



Dialog Inputtext as global - edzis84 - 22.06.2014

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

I tried

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


Re: Dialog Inputtext as global - NaClchemistryK - 22.06.2014

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


Re: Dialog Inputtext as global - Konstantinos - 22.06.2014

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



Re: Dialog Inputtext as global - NaClchemistryK - 22.06.2014

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?


Re: Dialog Inputtext as global - edzis84 - 22.06.2014

Код:
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


Re: Dialog Inputtext as global - Konstantinos - 22.06.2014

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).


Re: Dialog Inputtext as global - NaClchemistryK - 22.06.2014

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


Re: Dialog Inputtext as global - edzis84 - 22.06.2014

Thanks +rep