CMD:stats(playerid,params[])
{
new id;
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
new string[50];
sscanf(params, "u", id);
if (isnull(params))
{
format(string, sizeof(string), "_Statistics for '%s'_", PlayerName);
SendClientMessage(playerid, LIME, string);
format(string, sizeof(string), "General Stats\n");
format(string, sizeof(string), "Money: %d\n", GetPlayerCash(playerid));
format(string, sizeof(string), "Score: $%d\n", GetPlayerScore(playerid));
format(string, sizeof(string), "Total Kills: %d\n", pInfo[playerid][pKills]);
format(string, sizeof(string), "Total Deaths: %d\n", pInfo[playerid][pDeaths]);
format(string, sizeof(string), "Moneybags Found: %0.2f\n", pInfo[playerid][pMoneyBags]);
format(string, sizeof(string), "Total Times Farted: %s\n", pInfo[playerid][pFarts]);
format(string, sizeof(string), "Spontaneous Combustions: %s\n", pInfo[playerid][pFartExp]);
format(string, sizeof(string), "Total Panadol Used: %s\n", pInfo[playerid][pPanadolUsed]);
format(string, sizeof(string), "Criminal Stats\n");
format(string, sizeof(string), "Total Players Robbed: %d\n", pInfo[playerid][pPlayerRobs]);
format(string, sizeof(string), "Total Times Robbed: %d\n", pInfo[playerid][pRobbedBy]);
format(string, sizeof(string), "Total 24/7s Robbed: %d\n", pInfo[playerid][p247Robs]);
format(string, sizeof(string), "Total Ammunations Robbed: %d\n", pInfo[playerid][pAmmuRobs]);
format(string, sizeof(string), "Total Banks Robbed: %d\n", pInfo[playerid][pBankRobs]);
format(string, sizeof(string), "Total Heists Done: %d\n", pInfo[playerid][pBankHeists]);
format(string, sizeof(string), "Total Times Jailed: %d\n", pInfo[playerid][pJails]);
format(string, sizeof(string), "Total Stars Attained: %d\n", pInfo[playerid][pStarsAtt]);
format(string, sizeof(string), "Total Drugs Purchased: %d\n", pInfo[playerid][pDrugsPurch]);
format(string, sizeof(string), "Total Drugs Sold: N/A\n");
format(string, sizeof(string), "Total Drugs Used: %d\n", pInfo[playerid][pDrugsUsed]);
format(string, sizeof(string), "[Police Stats]\n");
format(string, sizeof(string), "Total Arrests: %d\n", pInfo[playerid][pArrests]);
ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX, "{FF6666}Player Stats for %s", PlayerName, "Okay","");
}
else if(IsPlayerConnected(id))
{
format(string, sizeof(string), "_Statistics for '%s'_", PlayerName);
SendClientMessage(playerid, LIME, string);
format(string, sizeof(string), "General Stats\n");
format(string, sizeof(string), "Money: %d\n", GetPlayerCash(playerid));
format(string, sizeof(string), "Score: $%d\n", GetPlayerScore(playerid));
format(string, sizeof(string), "Total Kills: %d\n", pInfo[playerid][pKills]);
format(string, sizeof(string), "Total Deaths: %d\n", pInfo[playerid][pDeaths]);
format(string, sizeof(string), "Moneybags Found: %0.2f\n", pInfo[playerid][pMoneyBags]);
format(string, sizeof(string), "Total Times Farted: %s\n", pInfo[playerid][pFarts]);
format(string, sizeof(string), "Spontaneous Combustions: %s\n", pInfo[playerid][pFartExp]);
format(string, sizeof(string), "Total Panadol Used: %s\n", pInfo[playerid][pPanadolUsed]);
format(string, sizeof(string), "Criminal Stats\n");
format(string, sizeof(string), "Total Players Robbed: %d\n", pInfo[playerid][pPlayerRobs]);
format(string, sizeof(string), "Total Times Robbed: %d\n", pInfo[playerid][pRobbedBy]);
format(string, sizeof(string), "Total 24/7s Robbed: %d\n", pInfo[playerid][p247Robs]);
format(string, sizeof(string), "Total Ammunations Robbed: %d\n", pInfo[playerid][pAmmuRobs]);
format(string, sizeof(string), "Total Banks Robbed: %d\n", pInfo[playerid][pBankRobs]);
format(string, sizeof(string), "Total Heists Done: %d\n", pInfo[playerid][pBankHeists]);
format(string, sizeof(string), "Total Times Jailed: %d\n", pInfo[playerid][pJails]);
format(string, sizeof(string), "Total Stars Attained: %d\n", pInfo[playerid][pStarsAtt]);
format(string, sizeof(string), "Total Drugs Purchased: %d\n", pInfo[playerid][pDrugsPurch]);
format(string, sizeof(string), "Total Drugs Sold: N/A\n");
format(string, sizeof(string), "Total Drugs Used: %d\n", pInfo[playerid][pDrugsUsed]);
format(string, sizeof(string), "[Police Stats]\n");
format(string, sizeof(string), "Total Arrests: %d\n", pInfo[playerid][pArrests]);
ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX, "{FF6666}Player Stats for %s", PlayerName, "Okay","");
}
else SendClientMessage(playerid,RED,"[ERROR]: Player is not connected");
return 1;
}
CMD:stats(playerid,params[]) { new id; new PlayerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); new string[50]; sscanf(params, "u", id); if (isnull(params)) { format(string, sizeof(string), "_Statistics for '%s'_", PlayerName); SendClientMessage(playerid, LIME, string); format(string, sizeof(string), "General Stats\n"); format(string, sizeof(string), "Money: %d\n", GetPlayerCash(playerid)); format(string, sizeof(string), "Score: $%d\n", GetPlayerScore(playerid)); format(string, sizeof(string), "Total Kills: %d\n", pInfo[playerid][pKills]); format(string, sizeof(string), "Total Deaths: %d\n", pInfo[playerid][pDeaths]); format(string, sizeof(string), "Moneybags Found: %0.2f\n", pInfo[playerid][pMoneyBags]); format(string, sizeof(string), "Total Times Farted: %s\n", pInfo[playerid][pFarts]); format(string, sizeof(string), "Spontaneous Combustions: %s\n", pInfo[playerid][pFartExp]); format(string, sizeof(string), "Total Panadol Used: %s\n", pInfo[playerid][pPanadolUsed]); format(string, sizeof(string), "Criminal Stats\n"); format(string, sizeof(string), "Total Players Robbed: %d\n", pInfo[playerid][pPlayerRobs]); format(string, sizeof(string), "Total Times Robbed: %d\n", pInfo[playerid][pRobbedBy]); format(string, sizeof(string), "Total 24/7s Robbed: %d\n", pInfo[playerid][p247Robs]); format(string, sizeof(string), "Total Ammunations Robbed: %d\n", pInfo[playerid][pAmmuRobs]); format(string, sizeof(string), "Total Banks Robbed: %d\n", pInfo[playerid][pBankRobs]); format(string, sizeof(string), "Total Heists Done: %d\n", pInfo[playerid][pBankHeists]); format(string, sizeof(string), "Total Times Jailed: %d\n", pInfo[playerid][pJails]); format(string, sizeof(string), "Total Stars Attained: %d\n", pInfo[playerid][pStarsAtt]); format(string, sizeof(string), "Total Drugs Purchased: %d\n", pInfo[playerid][pDrugsPurch]); format(string, sizeof(string), "Total Drugs Sold: N/A\n"); format(string, sizeof(string), "Total Drugs Used: %d\n", pInfo[playerid][pDrugsUsed]); format(string, sizeof(string), "[Police Stats]\n"); format(string, sizeof(string), "Total Arrests: %d\n", pInfo[playerid][pArrests]); ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX, "{FF6666}Player Stats for %s", PlayerName, "Okay",""); } else if(IsPlayerConnected(id)) { format(string, sizeof(string), "_Statistics for '%s'_", PlayerName); SendClientMessage(playerid, LIME, string); format(string, sizeof(string), "General Stats\n"); format(string, sizeof(string), "Money: %d\n", GetPlayerCash(playerid)); format(string, sizeof(string), "Score: $%d\n", GetPlayerScore(playerid)); format(string, sizeof(string), "Total Kills: %d\n", pInfo[playerid][pKills]); format(string, sizeof(string), "Total Deaths: %d\n", pInfo[playerid][pDeaths]); format(string, sizeof(string), "Moneybags Found: %0.2f\n", pInfo[playerid][pMoneyBags]); format(string, sizeof(string), "Total Times Farted: %s\n", pInfo[playerid][pFarts]); format(string, sizeof(string), "Spontaneous Combustions: %s\n", pInfo[playerid][pFartExp]); format(string, sizeof(string), "Total Panadol Used: %s\n", pInfo[playerid][pPanadolUsed]); format(string, sizeof(string), "Criminal Stats\n"); format(string, sizeof(string), "Total Players Robbed: %d\n", pInfo[playerid][pPlayerRobs]); format(string, sizeof(string), "Total Times Robbed: %d\n", pInfo[playerid][pRobbedBy]); format(string, sizeof(string), "Total 24/7s Robbed: %d\n", pInfo[playerid][p247Robs]); format(string, sizeof(string), "Total Ammunations Robbed: %d\n", pInfo[playerid][pAmmuRobs]); format(string, sizeof(string), "Total Banks Robbed: %d\n", pInfo[playerid][pBankRobs]); format(string, sizeof(string), "Total Heists Done: %d\n", pInfo[playerid][pBankHeists]); format(string, sizeof(string), "Total Times Jailed: %d\n", pInfo[playerid][pJails]); format(string, sizeof(string), "Total Stars Attained: %d\n", pInfo[playerid][pStarsAtt]); format(string, sizeof(string), "Total Drugs Purchased: %d\n", pInfo[playerid][pDrugsPurch]); format(string, sizeof(string), "Total Drugs Sold: N/A\n"); format(string, sizeof(string), "Total Drugs Used: %d\n", pInfo[playerid][pDrugsUsed]); format(string, sizeof(string), "[Police Stats]\n"); format(string, sizeof(string), "Total Arrests: %d\n", pInfo[playerid][pArrests]); ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX, "{FF6666}Player Stats for %s", PlayerName, "Okay",""); } else { SendClientMessage(playerid,RED,"[ERROR]: Player is not connected"); } return 1; }
still doesn't work. I can't see what you've changed, but yeah, its still not working.
heres a pic: |
ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX, "{FF6666}Player Stats for %s",--> PlayerName, "Okay","");
ur just showin em their name use format(string, sizeof(string), "{FF6666}Player stats for $s", PlayerName); ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX, string... |
format(string, sizeof(string), "{FF6666}Player stats for %s\nGeneral Stats\nMoney: $%d\nScore: %d\n", PlayerName, GetPlayerCash(playerid), GetPlayerScore(playerid));
ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX, string, "Okay","");
format(string, sizeof(string), "General Stats\nMoney: $%d\nScore: %d\n", GetPlayerCash(playerid), GetPlayerScore(playerid));
ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX, "{FF6666}Player Stats for %s", string, "Okay","");
i see what you mean, how would i go about showing them all the stats i listed without making multiple dialogs?
|
CMD:stats(playerid,params[])
{
new id;
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
new string[1028], tmp[50];
sscanf(params, "u", id);
if (isnull(params))
{
format(string, sizeof(string), "_Statistics for '%s'_", PlayerName);
SendClientMessage(playerid, LIME, string);
format(tmp, sizeof(tmp), "General Stats\n");
strcat(string, tmp);
format(tmp, sizeof(tmp), "Money: %d\n", GetPlayerCash(playerid));
strcat(string, tmp);
format(tmp, sizeof(tmp), "Score: $%d\n", GetPlayerScore(playerid));
strcat(string, tmp);
format(tmp, sizeof(tmp), "Total Kills: %d\n", pInfo[playerid][pKills]);
strcat(string, tmp);
format(tmp, sizeof(tmp), "Total Deaths: %d\n", pInfo[playerid][pDeaths]);
strcat(string, tmp);
format(tmp, sizeof(tmp), "Moneybags Found: %0.2f\n", pInfo[playerid][pMoneyBags]);
strcat(string, tmp);
format(tmp, sizeof(tmp), "Total Times Farted: %s\n", pInfo[playerid][pFarts]);
strcat(string, tmp);
format(tmp, sizeof(tmp),, "Spontaneous Combustions: %s\n", pInfo[playerid][pFartExp]);
strcat(string, tmp);
.... continue
new name[128];
format(name, sizeof(name), "{FF6666}Player Stats for %s", PlayerName);
ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX, name, string, "Okay","");
}