21.12.2014, 13:09
I'm having a problem with creating a stats dialog. Of course, I don't have any errors, or warnings, but I understand the way why it appears in-game like that, when I use /stats, it doesn't show the all info, but only "helper".
Picture:
Code looks like:
And yeah, I want it to appear verticaly down with the all info. Please help!
Picture:
Code looks like:
Код:
CMD:stats(playerid,params[]) { new id, string[1028]; sscanf(params, "u", id); if (isnull(params)) { format(string, sizeof(string), "_Statistics for '%s'_",PlayerName(playerid)); SendClientMessage(playerid, green, string); format(string, sizeof(string), "Score: %d\n", GetPlayerScore(playerid), string); format(string, sizeof(string), "Money: $%d\n", GetPlayerMoney(playerid), string); format(string, sizeof(string), "Kills: %d\n", PlayerInfo[playerid][pKills], string); format(string, sizeof(string), "Deaths: %d\n", PlayerInfo[playerid][pDeaths], string); format(string, sizeof(string), "Ratio: %0.2f\n", GetTeamName(playerid), string); format(string, sizeof(string), "Team: %s\n", GetTeamName(playerid), string); format(string, sizeof(string), "Rank: %s\n", GetRankName(playerid), string); format(string, sizeof(string), "Class: %s\n", GetClassName(playerid), string); format(string, sizeof(string), "Admin Level: %d\n", PlayerInfo[playerid][pAdmin], string); format(string, sizeof(string), "Helper: %d\n", PlayerInfo[playerid][pHelper], string); ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "{FF6666}Player Stats", string, "Okay",""); } else if(IsPlayerConnected(id)) { format(string, sizeof(string), "_Statistics for '%s'_",PlayerName(playerid)); SendClientMessage(playerid, green, string); format(string, sizeof(string), "Score: %d\n", GetPlayerScore(playerid), string); format(string, sizeof(string), "Money: $%d\n", GetPlayerMoney(playerid), string); format(string, sizeof(string), "Kills: %d\n", PlayerInfo[playerid][pKills], string); format(string, sizeof(string), "Deaths: %d\n", PlayerInfo[playerid][pDeaths], string); format(string, sizeof(string), "Ratio: %0.2f\n", GetTeamName(playerid), string); format(string, sizeof(string), "Team: %s\n", GetTeamName(playerid), string); format(string, sizeof(string), "Rank: %s\n", GetRankName(playerid), string); format(string, sizeof(string), "Class: %s\n", GetClassName(playerid), string); format(string, sizeof(string), "Admin Level: %d\n", PlayerInfo[playerid][pAdmin], string); format(string, sizeof(string), "Helper: %d\n", PlayerInfo[playerid][pHelper], string); ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "{FF6666}Player Stats", string, "Okay",""); } else SendClientMessage(playerid,RED,"[ERROR]: Player is not connected"); return 1; }