stats in dialog needed
#2

Below the includes
pawn Код:
#define StatsDialog 1245
and command:
pawn Код:
#if defined USE_STATS
CMD:stats(playerid,params[]) {
    new string[500], pDeaths, player1, h, m, s;
    if(isnull(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];
        new string2[128];
        format(string2,sizeof(string2),"%s's statistics",PlayerName2(player1));
        strcat(string,"Level: %d");
        strcat(string,"Kills: %d");
        strcat(string,"Deaths: %d");
        strcat(string,"Ratio: %0.2f");
        strcat(string,"Money: $%d");
        strcat(string,"Bank: $%d");
        strcat(string,"Time: %d hrs %dmins %d secs");
        format(string,sizeof(string),string,
        PlayerInfo[player1][Level],PlayerInfo[player1][Kills],PlayerInfo[player1][Deaths],Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(playerid1),PlayerInfo[player1][bank],h,m,s);
        ShowPlayerDialog(playerid, StatsDialog, DIALOG_STYLE_MSGBOX, string2, string, "Close", "");
        format(string,sizeof(string),"");
    } else return SendClientMessage(playerid, red, "Player Not Connected!");
}
#endif
Reply


Messages In This Thread
stats in dialog needed - by ScripteRNaBEEL - 30.05.2014, 07:14
Re: stats in dialog needed - by biker122 - 30.05.2014, 07:40
Re: stats in dialog needed - by ScripteRNaBEEL - 30.05.2014, 08:50
Re: stats in dialog needed - by Faisal_khan - 30.05.2014, 08:55
Re: stats in dialog needed - by ScripteRNaBEEL - 30.05.2014, 09:02

Forum Jump:


Users browsing this thread: 1 Guest(s)