Ich hab ein Problem mit ShowPlayerDialog:
Wieso geht das nicht?:
dcmd_stats(playerid,params[]) {
new string[128], pDeaths, player1, h, m, s;
if(!strlen(params)) player1 = playerid;
else player1 = strval(params);
if(IsPlayerConnected(player1)) {
TotalGameTime(player1, h, m, s);
if(PlayerInfo[player1][Deaths] == 0) pDeaths = 1; else pDeaths = PlayerInfo[player1][Deaths];
format(string, sizeof(string), "{00B9FF} %s's Stats: \nKills: %d \nDeaths: %d \nScore: %d \nRatio: %0.2f \nMoney: $%d \nTime: %d hrs %d mins %d secs",PlayerName2(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths],GetPlayerScore(player1), Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s);
return ShowPlayerDialog(playerid, 98771, DIALOG_STYLE_MSGBOX, "{00B9FF}Stats", string, "ok", "ok");
} else return SendClientMessage(playerid, red, "Player Not Connected!");
}
Mit SendClientMsg gehts doch auch!:
dcmd_stats(playerid,params[]) {
new string[128], pDeaths, player1, h, m, s;
if(!strlen(params)) player1 = playerid;
else player1 = strval(params);
if(IsPlayerConnected(player1)) {
TotalGameTime(player1, h, m, s);
if(PlayerInfo[player1][Deaths] == 0) pDeaths = 1; else pDeaths = PlayerInfo[player1][Deaths];
format(string, sizeof(string), "| %s's Stats: Kills: %d | Deaths: %d | Score: %d | Ratio: %0.2f | Money: $%d | Time: %d hrs %d mins %d secs |",PlayerName2(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths],GetPlayerScore(player1), Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s);
return SendClientMessage(playerid, green, string);
} else return SendClientMessage(playerid, red, "Player Not Connected!");
}