COMMAND:stats(playerid,params[]) { new string[250], pDeaths, player1, player, h, m, s; if(sscanf(params, "r", player)) { player1 = playerid; } else { player1 = player; } if(IsPlayerConnected(player1)) { TotalGameTime(player1, h, m, s); if(PlayerInfo[player1][Deaths] == 0) { pDeaths = 1; } else { pDeaths = PlayerInfo[player1][Deaths]; } #if USE_VIP_SYSTEM == true format(string, sizeof(string), "\n{FEFEFE}Stats of the player: %s\n\n{FEFEFE}Kills:\t\t%d\nDeaths:\t\t%d\nK/D:\t\t%0.2f\nScore:\t\t%d\nMoney:\t\t$%d\nVIP Level:\t%d\nHours:\t\t%d\nMinutes\t%d\nSeconds:\t%d\nRegister date:\t%s",GetName(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths],Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerScore(player1),GetPlayerMoney(player1),PlayerInfo[player1][VIPLevel],h,m,s,PlayerInfo[player1][RegDate]); #else format(string, sizeof(string), "\n{FEFEFE}Stats of the player: %s\n\n{FEFEFE}Kills:\t\t%d\nDeaths:\t\t%d\nK/D:\t\t%0.2f\nScore:\t\t%d\nMoney:\t\t$%d\nHours:\t\t%d\nMinutes\t%d\nSeconds:\t%d\nRegister date:\t%s",GetName(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths],Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerScore(player1),GetPlayerMoney(player1),h,m,s,PlayerInfo[player1][RegDate]); #endif ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX, "Player Statistics", string, "Close", ""); } else { GameTextForPlayer(playerid, "~r~player is unavailable", 3000, 3); } return 1; }
COMMAND:stats(playerid,params[])
{
new string[250], string2[250], AllStrings[500], pDeaths, player1, player, h, m, s;
if(sscanf(params, "r", player))
{
player1 = playerid;
}
else
{
player1 = player;
}
if(IsPlayerConnected(player1))
{
TotalGameTime(player1, h, m, s);
if(PlayerInfo[player1][Deaths] == 0) { pDeaths = 1; }
else { pDeaths = PlayerInfo[player1][Deaths]; }
#if USE_VIP_SYSTEM == true
format(string, sizeof(string), "\n{FEFEFE}Stats of the player: %s\n\n{FEFEFE}Kills:\t\t%d\nDeaths:\t\t%d\nK/D:\t\t%0.2f\nScore:\t\t%d",GetName(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths],Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerScore(player1));
format(string2, sizeof(string2), "Money:\t\t$%d\nVIP Level:\t%d\nHours:\t\t%d\nMinutes\t%d\nSeconds:\t%d\nRegister date:\t%s",GetPlayerMoney(player1),PlayerInfo[player1][VIPLevel],h,m,s,PlayerInfo[player1][RegDate]);
format(AllStrings, sizeof(AllStrings), "%s\n%s",string, string2);
#else
format(string, sizeof(string), "\n{FEFEFE}Stats of the player: %s\n\n{FEFEFE}Kills:\t\t%d\nDeaths:\t\t%d\nK/D:\t\t%0.2f\nScore:\t\t%d",GetName(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths],Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerScore(player1));
format(string2, sizeof(string2), "Money:\t\t$%d\nHours:\t\t%d\nMinutes\t%d\nSeconds:\t%d\nRegister date:\t%s",,GetPlayerMoney(player1),h,m,s,PlayerInfo[player1][RegDate]);
format(AllStrings, sizeof(AllStrings), "%s\n%s",string, string2);
#endif
ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX, "Player Statistics", string, "Close", "");
}
else
{
GameTextForPlayer(playerid, "~r~player is unavailable", 3000, 3);
}
return 1;
}
You can just try this one :-
pawn Код:
![]() |
sizeof(string), "\nPlayer: %s",GetName(player1) sizeof(string), "\nKills: %d",PlayerInfo[player1][Kills] sizeof(string), "\nDeaths: %d",PlayerInfo[player1][Deaths] sizeof(string), "\nK/D: %0.2f",Float:PlayerInfo[player1][Kills] and so on
format(string, sizeof(string), "My Name is: %s", pName); format(string2, sizeof(string2), "My ID is: %d", playerid); format(string3, sizeof(string3), "The number is %i.",number); //-> The number is 42. format(string4, sizeof(string4), "This is a %s containing the number %i.", string, number); format(AllStrings, sizeof(AllStrings), "%s\n%s\n%s\n%s", string, string2, string3, string4); ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX, "Player Statistic(s)", AllStrings, "Close", "");
new string[100], dialogstring[750];
format(string, sizeof(string), "text %specifier", variable);
strcat(dialogstring, string);
format(string, sizeof(string), "text %specifier", variable);
strcat(dialogstring, string);
ShowPlayerDialog(... dialogstring ...); // do the rest of the parameters yourself, I'm on my phone :P
format(string, sizeof(string), "My Name is: %s", pName); format(string2, sizeof(string2), "My ID is: %d", playerid); format(string3, sizeof(string3), "The number is %i.",number); //-> The number is 42. format(string4, sizeof(string4), "This is a %s containing the number %i.", string, number); format(AllStrings, sizeof(AllStrings), "%s\n%s\n%s\n%s", string, string2, string3, string4); ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX, "Player Statistic(s)", AllStrings, "Close", "");
format(string, sizeof(string), "My Name is: %s", pName); format(string2, sizeof(string2), "My ID is: %d", playerid); format(string3, sizeof(string3), "The number is %i.",number); //-> The number is 42. format(string4, sizeof(string4), "This is a %s containing the number %i.", string, number); format(AllStrings, sizeof(AllStrings), "%s\n%s\n%s\n%s", string, string2, string3, string4); SendClientMessage(playerid, -1, AllStrings);
format(string, sizeof(string), "My Name is: %s", pName); format(string2, sizeof(string2), "My ID is: %d", playerid); format(string3, sizeof(string3), "The number is %i.",number); //-> The number is 42. format(string4, sizeof(string4), "This is a %s containing the number %i.", string, number); format(AllStrings, sizeof(AllStrings), "%s\n%s\n%s\n%s", string, string2, string3, string4); SendClientMessageToAll(-1, AllStrings);
You can just edit it by yourself for Example :-
Using ShowPlayerDialog, Код:
format(string, sizeof(string), "My Name is: %s", pName); format(string2, sizeof(string2), "My ID is: %d", playerid); format(string3, sizeof(string3), "The number is %i.",number); //-> The number is 42. format(string4, sizeof(string4), "This is a %s containing the number %i.", string, number); format(AllStrings, sizeof(AllStrings), "%s\n%s\n%s\n%s", string, string2, string3, string4); ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX, "Player Statistic(s)", AllStrings, "Close", ""); Код:
format(string, sizeof(string), "My Name is: %s", pName); format(string2, sizeof(string2), "My ID is: %d", playerid); format(string3, sizeof(string3), "The number is %i.",number); //-> The number is 42. format(string4, sizeof(string4), "This is a %s containing the number %i.", string, number); format(AllStrings, sizeof(AllStrings), "%s\n%s\n%s\n%s", string, string2, string3, string4); SendClientMessage(playerid, -1, AllStrings); Код:
format(string, sizeof(string), "My Name is: %s", pName); format(string2, sizeof(string2), "My ID is: %d", playerid); format(string3, sizeof(string3), "The number is %i.",number); //-> The number is 42. format(string4, sizeof(string4), "This is a %s containing the number %i.", string, number); format(AllStrings, sizeof(AllStrings), "%s\n%s\n%s\n%s", string, string2, string3, string4); SendClientMessageToAll(-1, AllStrings); ![]() |