30.06.2015, 19:24
[TUT] How To Make A Dialog Menu
Or if you're too lazy![Wink](images/smilies/wink.png)
You shouldnt really be doing math in a format argument, so i fixed that too, but didnt test so not 100% sure if you need that Float: or not.
Or if you're too lazy
![Wink](images/smilies/wink.png)
Код:
BEFORE: format(string, sizeof(string), "| %s's Stats: Level: %d | Kills: %d | Deaths: %d | Ratio: %0.2f | Money: $%d | Bank: $%d | Time: %d hrs %d mins %d secs |",PlayerName2(player1), PlayerInfo[player1][Level],PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1),PlayerInfo[player1][bank], h, m, s); return SendClientMessage(playerid, green, string); AFTER: new playerName[MAX_PLAYER_NAME], dialogTitle[MAX_PLAYER_NAME+24], dialogString[128], killDeathRatio = Float:PlayerInfo[player1][Kills]/Float:pDeaths; GetPlayerName(player1, playerName, sizeof(playerName)); format(dialogTitle, sizeof(dialogTitle), "Stats of %s", playerName); format(dialogString, sizeof(dialogString), "Level: %d \nKills: %d \nDeaths: %d \nRatio: %0.2f \nMoney: $%d \nBank: $%d \nTime: %d hrs %d mins %d secs", PlayerInfo[player1][Level], PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:killDeathRatio, GetPlayerMoney(player1), PlayerInfo[player1][bank], h, m, s); ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, dialogTitle, dialogString, "Ok", "");