. txt file Dialog. That is, how to use the Dialog. Txt with. -
citromhun - 05.04.2014
Hi there!
Today I will explain what I have learned yet ano Pedro master. Now create a new tab and enter this line is 2.
pawn Code:
#include <a_samp>
#include <zcmd>
a_samp: Fund must as without can not be converted.
zcmd: Due command.
Then create a command.
If you're so far to create a "output" and a "line" is.
pawn Code:
new output[2048], line[512];
output[0] = EOS;
Although do you have a file in the folder scriptfiles Eg help.txt
pawn Code:
new File:tmp=fopen("commands/help.txt");
In this way you do that. Txt file to bring up. But now comes a layover you can not really understand. First I do not understand it easy.
pawn Code:
if(tmp) {
while(fread(tmp, line, 512)) strins(output, line, strlen(output), sizeof(output));
fclose(tmp);
}
In the meantime, read the open file as long as it is taken. (while) repeats until the result is non-zero reading (fread) set of files.
Now view the Dialog.
pawn Code:
ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FFFFFF}Help", kimenet, "Ok", "");
Thus, so the command is fully operational. But we are still not ready. Be alive to finish the order.
And we are ready. Now we test. Enter into a txt to file, for example:.. Many a letter "a".
Results.:

(Hungary contains letters)
Full code.:
pawn Code:
#include <a_samp>
#include <zcmd>
CMD:help(playerid) {
new output[2048], line[512];
output[0] = EOS;
new File:tmp=fopen("commands/help.txt");
if(tmp) {
while(fread(tmp, line, 512)) strins(output, line, strlen(output), sizeof(output));
fclose(tmp);
}
ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FFFFFF}Help", output, "Ok", "[x]");
return 1;
}
Thank you for your attention! Further around a lot.
Re: . txt file Dialog. That is, how to use the Dialog. Txt with. -
Jochemd - 08.04.2014
Have you tested this code? AFAIK you shouldn't use strins inside any function because it would entirely bug the server. You can use format or strcat instead.
Re: . txt file Dialog. That is, how to use the Dialog. Txt with. -
citromhun - 11.04.2014
Tested in the code. What causes a server error? Because I never had any problems with it!
Re: . txt file Dialog. That is, how to use the Dialog. Txt with. -
ChandraLouis - 11.04.2014
what is Kimenet ?
Re: . txt file Dialog. That is, how to use the Dialog. Txt with. -
vassilis - 11.04.2014
Quote:
Originally Posted by ChandraLouis
what is Kimenet ?
|
output
Re: . txt file Dialog. That is, how to use the Dialog. Txt with. -
citromhun - 11.04.2014
ops... kimenet=output
Re: . txt file Dialog. That is, how to use the Dialog. Txt with. -
FinStar - 11.08.2015
How to next list ?
Code:
#include <a_samp>
#include <zcmd>
CMD:help(playerid) {
new output[2048], line[512];
output[0] = EOS;
new File:tmp=fopen("commands/help.txt");
if(tmp) {
while(fread(tmp, line, 512)) strins(output, line, strlen(output), sizeof(output));
fclose(tmp);
}
ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FFFFFF}Help", output, "Ok", "[x]");
return 1;
}