SA-MP Forums Archive
it doesnt skip to next line - 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: it doesnt skip to next line (/showthread.php?tid=632362)



it doesnt skip to next line - Melktert - 12.04.2017

Sorry for my newbieness, but this doesnt skip to next line, any reason why?

PHP код:
CMD:stats(playeridparams[])
{
    new 
string[220], tempString[50];
    
format(tempStringsizeof(tempString), "{FFFFFF}Cash: {FFFF00}$%d /n"GetPlayerMoney(playerid));
    
strcat(stringtempString);
    
    
format(tempStringsizeof(tempString), "{FFFFFF}Admin Level: {FFFF00}%i /n"PlayerInfo[playerid][pAdmin]);
    
strcat(stringtempString);
    
    
format(tempStringsizeof(tempString), "{FFFFFF}Kills: {FFFF00}%i /n"PlayerInfo[playerid][pKills]);
    
strcat(stringtempString);
    
    
format(tempStringsizeof(tempString), "{FFFFFF}Deaths: {FFFF00}%i /n"PlayerInfo[playerid][pDeaths]);
    
strcat(stringtempString);
    
    
format(tempStringsizeof(tempString), "{FFFFFF}Score: {FFFF00}%i"GetPlayerScore(playerid));
    
strcat(stringtempString);
    
    
ShowPlayerDialog(playeridDIALOG_STATSDIALOG_STYLE_MSGBOX"Stats"string"Ok""");
    return 
1;




Re: it doesnt skip to next line - DarkSkull - 12.04.2017

Because you use /n instead of \n
Try this:
PHP код:
CMD:stats(playeridparams[])
{
    new 
string[220], tempString[50];
    
format(tempStringsizeof(tempString), "{FFFFFF}Cash: {FFFF00}$%d \n"GetPlayerMoney(playerid));
    
strcat(stringtempString);
    
    
format(tempStringsizeof(tempString), "{FFFFFF}Admin Level: {FFFF00}%i \n"PlayerInfo[playerid][pAdmin]);
    
strcat(stringtempString);
    
    
format(tempStringsizeof(tempString), "{FFFFFF}Kills: {FFFF00}%i \n"PlayerInfo[playerid][pKills]);
    
strcat(stringtempString);
    
    
format(tempStringsizeof(tempString), "{FFFFFF}Deaths: {FFFF00}%i \n"PlayerInfo[playerid][pDeaths]);
    
strcat(stringtempString);
    
    
format(tempStringsizeof(tempString), "{FFFFFF}Score: {FFFF00}%i"GetPlayerScore(playerid));
    
strcat(stringtempString);
    
    
ShowPlayerDialog(playeridDIALOG_STATSDIALOG_STYLE_MSGBOX"Stats"string"Ok""");

    return 
1;




Re: it doesnt skip to next line - YouHack - 12.04.2017

Quote:

Use \n to start a new line and \t to tabulate.

Source: https://sampwiki.blast.hk/wiki/How_to_Create_a_Dialog
it's really helpful ^^