Need it ! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need it ! (
/showthread.php?tid=238213)
Need it ! -
Roomeo - 11.03.2011
I Need /stats command Which Show Player his Stats (kills Deaths Total Time Played i mean which save Times)
Re: Need it ! -
Davz*|*Criss - 11.03.2011
pawn Код:
#if USE_STATS == true
dcmd_stats(playerid,params[])
{
new string[128];
new pDeaths;
new player1, h, m, s;
if(!strlen(params)) player1 = playerid;
else player1 = strval(params);
if(IsPlayerConnected(player1))
{
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] | Time: [%d] hrs [%d] mins [%d] secs |", AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s);
return SendClientMessage(playerid, green, string);
} else
return SendClientMessage(playerid, red, "ERROR: Player Not Connected!");
}
#endif
Re: Need it ! -
Stigg - 11.03.2011
Quote:
Originally Posted by Davz*|*Criss
pawn Код:
#if USE_STATS == true dcmd_stats(playerid,params[]) { new string[128]; new pDeaths; new player1, h, m, s;
if(!strlen(params)) player1 = playerid; else player1 = strval(params);
if(IsPlayerConnected(player1)) { 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] | Time: [%d] hrs [%d] mins [%d] secs |", AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s); return SendClientMessage(playerid, green, string); } else return SendClientMessage(playerid, red, "ERROR: Player Not Connected!"); } #endif
|
Tell him where you ripped that from, he'll need AccInfo[MAX_PLAYERS] and the defines and all that.
Re: Need it ! -
Roomeo - 11.03.2011
i will check it in a half Hour
Re: Need it ! -
Davz*|*Criss - 11.03.2011
Quote:
Originally Posted by Stigg
Tell him where you ripped that from, he'll need AccInfo[MAX_PLAYERS] and the defines and all that.
|
I did not made this code. i just pasted for helping him.
Roomeo go visit lux admin fs, hope you get help from there stats command.