Alignment Dialog - 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: Alignment Dialog (
/showthread.php?tid=501476)
Alignment Dialog -
ATomas - 18.03.2014
Hello,
i wrote this code:
pawn Код:
#include <a_samp>
new Text[][] = {//Is not constant text
"Something",
"Something else",
"Other"
};
new Text2[][] = {
"Yes",
"No",
"Yes"
};
public OnPlayerSpawn(playerid)
{
new string[256];
for(new i;i<sizeof(Text);i++)
{
strcat(string,Text[i]);
if(strlen(Text[i]) < 4) strcat(string,"\t");
if(strlen(Text[i]) < 8) strcat(string,"\t");
if(strlen(Text[i]) < 12) strcat(string,"\t");
if(strlen(Text[i]) < 16) strcat(string,"\t");
strcat(string,Text2[i]);
strcat(string,"\n");
}
ShowPlayerDialog(playerid,0,DIALOG_STYLE_LIST,"Caption",string,"OK","Cancel");
return 1;
}
dialog looks like this:
![](http://www.img.tpx.cz/uploads/Dialog%20failed.png)
But I need to look like this:
![](http://www.img.tpx.cz/uploads/dialog%20ok.png)
how to do it using tabs?
Re: Alignment Dialog -
MP2 - 18.03.2014
The font is not monospaced, so you can't base tabulation on the number of characters, as different characters are different widths.
For example, 10 chars:
WWWWWWWWWW
llllllllll
Very obvious to see. The second line will need more tabs.
I can't think of any way you can resolve this. I've had this problem before.