[BEP]AcerPilot
Unregistered
Use:
pawn Код:
if(dialogid == DIALOG_MDCNOME3)
{
new count = 0, string[128];
format(SkillBase, sizeof(SkillBase), "LSPD/Suspects/%s.ini", strlen(inputtext));
while(fread(SkillBase, string))
{
// do what you want here
count ++;
if(count == 20)
{
break;
}
}
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "-", string, "Ok", "Fechar");
}
Hope you understood.
@Vocк podia ter postado na PT/BR hehe
Posts: 2,640
Threads: 122
Joined: Feb 2010
Reputation:
0
I appreciate your help.
But I want to show the twenty lines.
Thanks,
[BEP]AcerPilot
Unregistered
Ah I see. You can concatenate all the 20 lines in one master string and show it. As you're advanced in PAWN I won't document the code:
pawn Код:
if(dialogid == DIALOG_MDCNOME3)
{
new count = 0, masterstring[256 /*maybe tmpstring > 128*/], tmpstring[128], line[128];
format(SkillBase, sizeof(SkillBase), "LSPD/Suspects/%s.ini", strlen(inputtext));
while(fread(SkillBase, line))
{
format(tmpstring, sizeof(tmpstring), "%s\r\n", line);
strins(masterstring, tmpstring, strlen(masterstring));
count ++;
if(count == 20)
{
break;
}
}
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "-", string, "Ok", "Fechar");
}
[BEP]AcerPilot
Unregistered
You are formatting SkillBase as a string (%s) but the value you are passing is a integer. Substitute strlen(inputtext) with inputtext.