16.11.2013, 08:29
pawn Код:
CMD:stats(playerid,params[])
{
new pDeaths, player1, h, m, s,playername[MAX_PLAYER_NAME];
if(isnull(params)) player1 = playerid;
else player1 = strval(params);
if(IsPlayerConnected(player1)) {
TotalGameTime(player1, h, m, s);
GetPlayerName(player1, playername, sizeof(playername));
if(PlayerInfo[player1][Deaths] == 0) pDeaths = 1; else pDeaths = PlayerInfo[player1][Deaths];
new str[20][1000];
format(str[0],1000," YG Stats For %s's\n", PlayerName2(player1));
strcat(str[1],str[0]);
format(str[2],1000,"Scores: %d | Money: $%d | Kills: %d | Deaths: %d | K/D Ratio: %0.2f\n", GetPlayerScore(player1), GetPlayerMoney(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths);
strcat(str[1],str[2]);
format(str[3],1000,"Admin Level: %d | Skin: %d | Ping: %d | Bank: $%d | Wanted Level: %d\n", PlayerInfo[playerid][Level],GetPlayerSkin(player1),GetPlayerPing(playerid),PlayerInfo[playerid][bank],GetPlayerWantedLevel(playerid));
strcat(str[1],str[3]);
format(str[4],1000,"TimePlayed: [%d] hrs [%d] mins [%d] secs | Interior: %d | Country: %s\n", h, m, s, GetPlayerInterior(playerid),GetPlayerCountryName(playerid));
strcat(str[1],str[4]);
format(str[5],1000,"Cookies: %d, Cakes: %d\n", PlayerInfo[playerid][Cookies], PlayerInfo[playerid][Cakes]);
strcat(str[1],str[5]);
ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"Player Stats",str[1],"OK","");
} else return SendClientMessage(playerid, red, "Player Not Connected!");
return 1;
}
How i can Make this ? I just want them to show went player preass /stats | i dont want people /stats 1 2 3 4 56 other stats