24.12.2017, 09:47
(
Последний раз редактировалось Hunud; 24.12.2017 в 11:53.
)
I know it's outdated but still, i'm the beginner so i wan't to do step by step.
Somehow, the correct registration date does not load/show up. Sometimes it's shows n/a or any random date.
It should show the date when we registered. If any code needed i'll show.
It's a lux admin which i use for cops and robbers. +REP if helped
Somehow, the correct registration date does not load/show up. Sometimes it's shows n/a or any random date.
It should show the date when we registered. If any code needed i'll show.
It's a lux admin which i use for cops and robbers. +REP if helped
Код:
dcmd_stats(playerid,params[])
{
new string[150],
pDeaths, player1,
h, m, s, RegDate[256], file[256];
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
{
format(file,sizeof(file),"/LuxAdmin/Users/%s.sav",udb_encode(PlayerName2(player1)));
if(!strlen(params)) player1 = playerid;
else player1 = strval(params);
if(strlen(dini_Get(file,"RegisteredDate")) < 3)
RegDate = "n/a";
else RegDate = dini_Get(file,"RegisteredDate");
TotalGameTime(player1, h, m, s);
if(AccInfo[player1][Deaths] == 0) pDeaths = 1;
else pDeaths = AccInfo[player1][Deaths];
format(string, sizeof(string), "|- %s's Statistics -|",PlayerName2(player1));
SendClientMessage(playerid, green, string);
format(string, sizeof(string), "Kills: [%d] | Deaths: [%d] | Ratio: [%0.2f] | Money: [$%d] | Registration Date: %s | Time: [%d] hrs [%d] mins [%d] secs |", AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), RegDate, h, m, s);
return SendClientMessage(playerid, green, string);
} else
return SendClientMessage(playerid, red, "ERROR: Player Not Connected!");
}


