Hi,
Der CMD soll eigentlich so funktionieren, dass wenn ich keine Parameter eingebe, immer die eigenen Statistiken angezeigt werden. Sobald ich aber einen Parameter eingebe, sollen die Statistiken des angegebenen Spielers gezeigt werden. Nur klappt das bisher noch nicht so ganz.
COMMAND:stats(playerid, params[])
{
if(IsPlayerAFK[playerid]) return SendLanguageMessage(playerid, C_RED, "»WARNUNG« Du bist AFK. Du kannst keine Aktion durchführen.", "»WARNING« You are AFK. You can't take any action.");
new ID,
stringDE[256],
stringEN[256],
pName[MAX_PLAYER_NAME],
pAdminLevel = pInfo[ID][AdminLevel],
pMoney = pInfo[ID][Money] + pInfo[ID][Bank],
pScore = pInfo[ID][Score],
pKills = pInfo[ID][Kills],
pDeaths = pInfo[ID][Deaths],
Float:pRatio = Float:pInfo[ID][Kills] / Float:pInfo[ID][Deaths];
if(isnull(params)) ID = playerid;
else return sscanf(params, "u", ID);
if(!IsPlayerConnected(ID)) return SendLanguageMessage(playerid, C_RED, "»WARNUNG« Dieser Spieler ist nicht online!", "»WARNING« This player is not online!");
GetPlayerName(playerid, pName, sizeof(pName));
format(stringDE, sizeof(stringDE), ""#C_WHITE_E"Name: "#C_LIGHT_BLUE_E"%s"#C_WHITE_E"\nRang: "#C_LIGHT_BLUE_E"%d"#C_WHITE_E"\nGeld: "#C_LIGHT_BLUE_E"%d"#C_WHITE_E"\nScore: "#C_LIGHT_BLUE_E"%d"#C_WHITE_E"\nKills: "#C_LIGHT_BLUE_E"%d"#C_WHITE_E"\nTode: "#C_LIGHT_BLUE_E"%d"#C_WHITE_E"\nRatio: "#C_LIGHT_BLUE_E"%0.2f", pName, pAdminLevel, pMoney, pScore, pKills, pDeaths, pRatio);
format(stringEN, sizeof(stringEN), ""#C_WHITE_E"Name: "#C_LIGHT_BLUE_E"%s"#C_WHITE_E"\nRank: "#C_LIGHT_BLUE_E"%d"#C_WHITE_E"\nMoney: "#C_LIGHT_BLUE_E"%d"#C_WHITE_E"\nScore: "#C_LIGHT_BLUE_E"%d"#C_WHITE_E"\nKills: "#C_LIGHT_BLUE_E"%d"#C_WHITE_E"\nDeaths: "#C_LIGHT_BLUE_E"%d"#C_WHITE_E"\nRatio: "#C_LIGHT_BLUE_E"%0.2f", pName, pAdminLevel, pMoney, pScore, pKills, pDeaths, pRatio);
ShowLanguageDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "Spielerstatistik", "Player Statistics", stringDE, stringEN, "OK", "OK", "", "");
return 1;
}