31.08.2013, 16:22
Something like this would be needed.
It inserts each 'string' into 'finalstring' and then sends that as the dialog text.
pawn Код:
CMD:stats(playerid, params[])
{
new money = PlayerInfo[playerid][pMoney];
new score = PlayerInfo[playerid][pScores];
new admin = PlayerInfo[playerid][pAdminLevel];
new vip = PlayerInfo[playerid][pVIPlevel];
new kills = PlayerInfo[playerid][pKills];
new Deaths = PlayerInfo[playerid][pDeaths];
new Kicks = PlayerInfo[playerid][pKicks];
new Warns = PlayerInfo[playerid][pWarns];
new string[128], string2[128],string3[128], finalstring[700];
format(string,sizeof(string), "{0099FF}Money: %d\nLevel: %d", money,score);
strins(finalstring, string,0,sizeof(string));
format(string,sizeof(string), "{00AAFF}%s\nAdmin: %d\nVIP: %d\n", string, admin, vip);
strins(finalstring, string,sizeof(string)+1,sizeof(string2));
format(string2,sizeof(string2), "{00AAFF}%s\nKills: %d\nDeaths: %d\n", string, kills, Deaths);
strins(finalstring, string,sizeof(string)+1,sizeof(string2));
format(string3,sizeof(string3), "{00AAFF}%s\nKicks: %d\nWarns: %d\n", Kicks, Warns);
strins(finalstring, string,sizeof(string2)+1,sizeof(string3));
ShowPlayerDialog(playerid, D_STATS, DIALOG_STYLE_MSGBOX, "Your stats", finalstring, "Close", "");
return 1;
}