/stats (DIALOG)
#4

It's really confusing when i read your code
But i clean up your code & use an dialog for your stats here :

PHP код:
#define DIALOG_STATS 9999
forward ShowPlayerStats(playeridtargetid);
public 
ShowStats(playeridgiveplayerid)
{
    new 
string[512], tmp[512], hms;
    
format(tmpsizeof(tmp), "|-  %s's Statistics -|\n\n"GetPlayerNameEx(giveplayerid));
    
strcat(stringtmp);
    
format(tmpsizeof(tmp), "Kills: [%d]\nDeaths: [%d]\nRatio: [%0.2f]\nMoney: [$%d]\nTime: [%d] hrs [%d] mins [%d] secs"AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), hms);
    
strcat(stringtmp);
    
ShowPlayerDialog(playeridDIALOG_STATSDIALOG_STYLE_MSGBOX"- Stats -"string"OK""");
    return 
1;
}
dcmd_stats(playeridparams[])
{
    new 
string[128];
    new 
player1;
    if(!
strlen(params)) player1 playerid;
    else 
player1 strval(params);
    if(
IsPlayerConnected(player1))
    {
        if(
AccInfo[player1][Deaths] == 0
        {    
            
AccInfo[player1][Deaths]++;
        }
        else
        {
            
ShowPlayerStats(playeridplayer1);
        }
    }
    else
    {
        
SendClientMessage(playeridCOLOR_MESSAGE_RED"* Sorry, Player Not Connected!");
    }
    return 
1;

I hope this will be helpful
Reply


Messages In This Thread
/stats (DIALOG) - by AwokenNeoX - 05.02.2017, 22:07
Re: /stats (DIALOG) - by Juonis - 05.02.2017, 22:26
Re: /stats (DIALOG) - by AwokenNeoX - 05.02.2017, 22:49
Re: /stats (DIALOG) - by haikalbintang - 06.02.2017, 00:57
Re: /stats (DIALOG) - by AwokenNeoX - 06.02.2017, 12:13
Re: /stats (DIALOG) - by haikalbintang - 06.02.2017, 14:05

Forum Jump:


Users browsing this thread: 1 Guest(s)