PDA

View Full Version : it doesnt skip to next line


Melktert
12/04/2017, 09:58 PM
Sorry for my newbieness, but this doesnt skip to next line, any reason why?

CMD:stats(playerid, params[])
{
new string[220], tempString[50];
format(tempString, sizeof(tempString), "{FFFFFF}Cash: {FFFF00}$%d /n", GetPlayerMoney(playerid));
strcat(string, tempString);

format(tempString, sizeof(tempString), "{FFFFFF}Admin Level: {FFFF00}%i /n", PlayerInfo[playerid][pAdmin]);
strcat(string, tempString);

format(tempString, sizeof(tempString), "{FFFFFF}Kills: {FFFF00}%i /n", PlayerInfo[playerid][pKills]);
strcat(string, tempString);

format(tempString, sizeof(tempString), "{FFFFFF}Deaths: {FFFF00}%i /n", PlayerInfo[playerid][pDeaths]);
strcat(string, tempString);

format(tempString, sizeof(tempString), "{FFFFFF}Score: {FFFF00}%i", GetPlayerScore(playerid));
strcat(string, tempString);

ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "Stats", string, "Ok", "");

return 1;
}

DarkSkull
12/04/2017, 09:59 PM
Because you use /n instead of \n
Try this:
CMD:stats(playerid, params[])
{
new string[220], tempString[50];
format(tempString, sizeof(tempString), "{FFFFFF}Cash: {FFFF00}$%d \n", GetPlayerMoney(playerid));
strcat(string, tempString);

format(tempString, sizeof(tempString), "{FFFFFF}Admin Level: {FFFF00}%i \n", PlayerInfo[playerid][pAdmin]);
strcat(string, tempString);

format(tempString, sizeof(tempString), "{FFFFFF}Kills: {FFFF00}%i \n", PlayerInfo[playerid][pKills]);
strcat(string, tempString);

format(tempString, sizeof(tempString), "{FFFFFF}Deaths: {FFFF00}%i \n", PlayerInfo[playerid][pDeaths]);
strcat(string, tempString);

format(tempString, sizeof(tempString), "{FFFFFF}Score: {FFFF00}%i", GetPlayerScore(playerid));
strcat(string, tempString);

ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "Stats", string, "Ok", "");

return 1;
}

YouHack
12/04/2017, 10:06 PM
Use \n to start a new line and \t to tabulate.
Source: http://wiki.sa-mp.com/wiki/How_to_Create_a_Dialog
it's really helpful ^^