19.09.2012, 07:12
Could anyone make this to something like this:
I've try but it gives me tons of warnings. Thanks in advance!
Код:
format(string, sizeof(string), "{FEFEFE}Stats of the Player: %s", GetName(player1); format(string, sizeof(string), "{FEFEFE}Kills: %d", PlayerInfo[player1][Deaths]; and so on
pawn Код:
COMMAND:stats(playerid,params[])
{
new string[250], pDeaths, player1, player, h, m, s;
if(sscanf(params, "r", player))
{
player1 = playerid;
}
else
{
player1 = player;
}
if(IsPlayerConnected(player1))
{
TotalGameTime(player1, h, m, s);
if(PlayerInfo[player1][Deaths] == 0) { pDeaths = 1; }
else { pDeaths = PlayerInfo[player1][Deaths]; }
#if USE_VIP_SYSTEM == true
format(string, sizeof(string), "\n{FEFEFE}Stats of the Player: %s\n\n{FEFEFE}Kills:\t\t%d\nDeaths:\t\t%d\nK/D:\t\t%0.2f\nScore:\t\t%d\nMoney:\t\t$%d\nVIP Level:\t%d\nHours:\t\t%d\nMinutes\t%d\nSeconds:\t%d\nRegister date:\t%s",GetName(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths],Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerScore(player1),GetPlayerMoney(player1),PlayerInfo[player1][VIPLevel],h,m,s,PlayerInfo[player1][RegDate]);
#else
format(string, sizeof(string), "\n{FEFEFE}Stats of the Player: %s\n\n{FEFEFE}Kills:\t\t%d\nDeaths:\t\t%d\nK/D:\t\t%0.2f\nScore:\t\t%d\nMoney:\t\t$%d\nHours:\t\t%d\nMinutes\t%d\nSeconds:\t%d\nRegister date:\t%s",GetName(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths],Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerScore(player1),GetPlayerMoney(player1),h,m,s,PlayerInfo[player1][RegDate]);
#endif
ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX, " ", string, "OK", "");
}
else
{
SendClientMessage(playerid, RED, "Player is not connected!");
}
return 1;
}