/STATS In Dialog [+rep] - 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)
+--- Thread: /STATS In Dialog [+rep] (
/showthread.php?tid=516366)
/STATS In Dialog [+rep] -
[Cali]ChrOnic_T - 30.05.2014
hey, I own a server and I want it perfect before it get on hosted tab. Im still waiting for Smartbytes to reply to my support ticket.
I want the /stats in dialog.
But heres the CMD:
pawn Код:
dcmd_stats(playerid,params[]) {
new string[180], pDeaths, player1, h, m, s;
if(!strlen(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];
format(string, sizeof(string), "| %s's Stats: Kills: %d | Deaths: %d | Ratio: {38F709}%0.2f |Money: {38F709}$%d | Time: %d hrs %d mins %d secs |",PlayerName2(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s);
return SendClientMessage(playerid, green, string);
} else return SendClientMessage(playerid, red, "Player is not connected.");
}
Please I would +rep , i really need this command done for my server
Re: /STATS In Dialog [+rep] -
Whitetiger - 30.05.2014
What are you trying to do, put it in a dialog?
pawn Код:
#define DIALOGID_STATS 100
dcmd_stats(playerid,params[]) {
new string[180], pDeaths, player1, h, m, s;
if(!strlen(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];
format(string, sizeof(string), "| %s's Stats: Kills: %d | Deaths: %d | Ratio: {38F709}%0.2f |Money: {38F709}$%d | Time: %d hrs %d mins %d secs |",PlayerName2(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s);
return ShowPlayerDialog(playerid, DIALOGID_STATS, "Stats", string, "OK", "");
} else return SendClientMessage(playerid, red, "Player is not connected.");
}
?
Re: /STATS In Dialog [+rep] -
[Cali]ChrOnic_T - 30.05.2014
thank you, whitetiger, you play on lsgw sometimes right?
Re: /STATS In Dialog [+rep] -
Whitetiger - 31.05.2014
yeah