i need help,/stats in dialog - 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: i need help,/stats in dialog (
/showthread.php?tid=595238)
i need help,/stats in dialog -
NightHell - 30.11.2015
Who can change my stats to dialog?
here is code
Код:
#if defined USE_STATS
CMD:stats(playerid,params[]) {
new string[128], 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];
format(string, sizeof(string), "| %s's Stats: Level: %d | Kills: %d | Deaths: %d | Ratio: %0.2f | Money: $%d | Bank: $%d | Time: %d hrs %d mins %d secs |",PlayerName2(player1), PlayerInfo[player1][Level],PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1),PlayerInfo[player1][bank], h, m, s);
return SendClientMessage(playerid, green, string);
} else return SendClientMessage(playerid, red, "Player Not Connected!");
}
#endif
Re: i need help,/stats in dialog -
NightHell - 30.11.2015
help me please
Re: i need help,/stats in dialog -
Alpay0098 - 30.11.2015
Код:
#if defined USE_STATS
CMD:stats(playerid,params[]) {
new string[128], 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];
format(string, sizeof(string), "| %s's Stats: Level: %d | Kills: %d | Deaths: %d | Ratio: %0.2f | Money: $%d | Bank: $%d | Time: %d hrs %d mins %d secs |",PlayerName2(player1), PlayerInfo[player1][Level],PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1),PlayerInfo[player1][bank], h, m, s);
return ShowPlayerDialog(playerid,6969,DIALOG_STYLE_MSGBOX,"Stats",string,"Ok","");
} else return SendClientMessage(playerid, red, "Player Not Connected!");
}
#endif
Re: i need help,/stats in dialog -
NightHell - 30.11.2015
Thx It Work
Код:
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase