[ZCMD]Help Stats Something
#1

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;
}
Can You help my Makes This ? Works ? I need This went i preass /stats is show my Stats | And if i /stats 1 Is Show The Other ID Stats Can You Guys help ?
Reply
#2

Try this

Код:
CMD:stats(playerid,params[]) {
	new string[100], pDeaths, player1,playername[MAX_PLAYER_NAME];
	if(isnull(params)) player1 = playerid;
	else player1 = strval(params);

	if(IsPlayerConnected(player1)) {
	    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;
}
Reply
#3

hey ! were these code ?

pawn Код:
new pDeaths, player1, h, m, s,playername[MAX_PLAYER_NAME];
TotalGameTime(player1, h, m, s);
If you removed how is will works :\
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)