Need a solution for \t in dialogs.
#4

There's a sweet feature in the format function regarding strings, if you put a value between '%' and 's', it basically fills in the empty slots with spaces (' ').

Examples:
pawn Код:
print("%10s", "test");
// This will print "test      "

print("%20s", "test");
// This will print "test                "

print("%30s", "test");
// This will print "test                          "

print("%40s", "test");
// This will print "test                                    "

print("%50s", "test");
// This will print "test                                              "
Format your dialog strings this way:
pawn Код:
// 24 is the max player name lenght
format(string, sizeof(string), "%24s\t%d\t%s", name, level, activity);
I haven't tested this so I'm not sure if it works like you want, but just wanted to let you know about this feature.
Reply


Messages In This Thread
Need a solution for \t in dialogs. - by Kiets - 29.04.2012, 11:47
Re: Need a solution for \t in dialogs. - by Lorenc_ - 29.04.2012, 12:07
Re: Need a solution for \t in dialogs. - by Kiets - 29.04.2012, 12:15
Re: Need a solution for \t in dialogs. - by Finn - 29.04.2012, 12:38
Re: Need a solution for \t in dialogs. - by Danny1 - 29.04.2012, 12:57
Re: Need a solution for \t in dialogs. - by IceCube! - 29.04.2012, 13:27
Re: Need a solution for \t in dialogs. - by Kiets - 29.04.2012, 13:49

Forum Jump:


Users browsing this thread: 1 Guest(s)