SA-MP Forums Archive
Advance LuxAdmin - 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: Advance LuxAdmin (/showthread.php?tid=359747)



Advance LuxAdmin - kbalor - 15.07.2012

Anyone know about LuxAdmin System filterscript and edit /stats command? When I do use /stats it only show a little bit details about your stats. I want to add more details about yourself and other stuff you use.

Lets say I use /stats. It should print like this in dialog msgbox.

Код:
Player Statistics
    "Player name"
   
    Skin Id:
    Score: 
    Kills:
    Death:
    Ratio:
    Money:
    Ping:
    Time Login: Hours/minutes/seconds
    Map: (If possible)
So it would look neat and well presented to the players.


Re: Advance LuxAdmin - Andi_Evandy - 15.07.2012

pawn Код:
dcmd_stats(playerid,params[])
{
    new str[512], pDeaths, player1, h, m, s;
    if(!strlen(params)) player1 = playerid;
    else player1 = strval(params);
    if(!IsPlayerConnected(player1)) return SendClientMessage(playerid, red, "ERROR: Player Not Connected!");
    TotalGameTime(player1, h, m, s);
    if(AccInfo[player1][Deaths] == 0) pDeaths = 1;
    else pDeaths = AccInfo[player1][Deaths];
    format(str, sizeof(str), "Player Statistics\n\t%s (ID: %d)", PlayerName2(player1), player1);  
    format(str, sizeof(str), "%s\tSkinID: %d\n", str, GetPlayerSkin(player1));
    format(str, sizeof(str), "%s\tScore: %d\n", str, GetPlayerScore(player1));
    format(str, sizeof(str), "%s\tKills: %d\n", str, AccInfo[player1][Kills]);
    format(str, sizeof(str), "%s\tDeaths: %d\n", str, AccInfo[player1][Deaths]);
    format(str, sizeof(str), "%s\tRatio: %d\n", str, Float:AccInfo[player1][Kills]/Float:pDeaths);
    format(str, sizeof(str), "%s\tMoney: $%d\n", str, GetPlayerMoney(player1));
    format(str, sizeof(str), "%s\tPing: $%d\n", str, GetPlayerPing(player1));
    format(str, sizeof(str), "%s\tTime Login: %d hours %d minutes %d seconds\n", str, h, m, s);
    ShowPlayerDialog(playerid, 8435, DIALOG_STYLE_MSGBOX, "Player Statistics", str, "OK", "");
    return 1;
}



Re: Advance LuxAdmin - kbalor - 15.07.2012

Quote:
Originally Posted by Andi_Evandy
Посмотреть сообщение
pawn Код:
dcmd_stats(playerid,params[])
{
    new str[512], pDeaths, player1, h, m, s;
    if(!strlen(params)) player1 = playerid;
    else player1 = strval(params);
    if(!IsPlayerConnected(player1)) return SendClientMessage(playerid, red, "ERROR: Player Not Connected!");
    TotalGameTime(player1, h, m, s);
    if(AccInfo[player1][Deaths] == 0) pDeaths = 1;
    else pDeaths = AccInfo[player1][Deaths];
    format(str, sizeof(str), "Player Statistics\n\t%s (ID: %d)", PlayerName2(player1), player1);  
    format(str, sizeof(str), "%s\tSkinID: %d\n", str, GetPlayerSkin(player1));
    format(str, sizeof(str), "%s\tScore: %d\n", str, GetPlayerScore(player1));
    format(str, sizeof(str), "%s\tKills: %d\n", str, AccInfo[player1][Kills]);
    format(str, sizeof(str), "%s\tDeaths: %d\n", str, AccInfo[player1][Deaths]);
    format(str, sizeof(str), "%s\tRatio: %d\n", str, Float:AccInfo[player1][Kills]/Float:pDeaths);
    format(str, sizeof(str), "%s\tMoney: $%d\n", str, GetPlayerMoney(player1));
    format(str, sizeof(str), "%s\tPing: $%d\n", str, GetPlayerPing(player1));
    format(str, sizeof(str), "%s\tTime Login: %d hours %d minutes %d seconds\n", str, h, m, s);
    ShowPlayerDialog(playerid, 8435, DIALOG_STYLE_MSGBOX, "Player Statistics", str, "OK", "");
    return 1;
}
Something is not right...




Re: Advance LuxAdmin - Andi_Evandy - 15.07.2012

change this:
pawn Код:
format(str, sizeof(str), "Player Statistics\n\t%s (ID: %d)", PlayerName2(player1), player1);
to this:
pawn Код:
format(str, sizeof(str), "Player Statistics\n\t%s (ID: %d)\n", PlayerName2(player1), player1); //Just forget the "\n" XD
and for the ping:

change this:
pawn Код:
format(str, sizeof(str), "%s\tPing: $%d\n", str, GetPlayerPing(player1));
to this:
pawn Код:
format(str, sizeof(str), "%s\tPing: %d\n", str, GetPlayerPing(player1)); //Just delete the "$" XD



Re: Advance LuxAdmin - kbalor - 15.07.2012

Quote:
Originally Posted by Andi_Evandy
Посмотреть сообщение
change this:
pawn Код:
format(str, sizeof(str), "Player Statistics\n\t%s (ID: %d)", PlayerName2(player1), player1);
to this:
pawn Код:
format(str, sizeof(str), "Player Statistics\n\t%s (ID: %d)\n", PlayerName2(player1), player1); //Just forget the "\n" XD
and for the ping:

change this:
pawn Код:
format(str, sizeof(str), "%s\tPing: $%d\n", str, GetPlayerPing(player1));
to this:
pawn Код:
format(str, sizeof(str), "%s\tPing: %d\n", str, GetPlayerPing(player1)); //Just delete the "$" XD
thanks bro, just like a charm. works! +rep 9999


Re: Advance LuxAdmin - kbalor - 15.07.2012

Quote:
Originally Posted by Andi_Evandy
Посмотреть сообщение
change this:
pawn Код:
format(str, sizeof(str), "Player Statistics\n\t%s (ID: %d)", PlayerName2(player1), player1);
to this:
pawn Код:
format(str, sizeof(str), "Player Statistics\n\t%s (ID: %d)\n", PlayerName2(player1), player1); //Just forget the "\n" XD
and for the ping:

change this:
pawn Код:
format(str, sizeof(str), "%s\tPing: $%d\n", str, GetPlayerPing(player1));
to this:
pawn Код:
format(str, sizeof(str), "%s\tPing: %d\n", str, GetPlayerPing(player1)); //Just delete the "$" XD
Already did thanks! About the ratio. Is is possible to use decimal like this 0.0% ??


Re: Advance LuxAdmin - clarencecuzz - 15.07.2012

Change %d to %.2f

.2f will show up to 2 decimal points, .3f will show up to 3 decimal points etc.