[ZCMD]Dialog Help With Status (/stats)
#10

Quote:
Originally Posted by xganyx
Посмотреть сообщение
You wrong the strcat don't have the %s",Float:...

_________________________________________

Try this

pawn Код:
CMD:stats(playerid,params[])
{
    new string[100], 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,"| ------ | %s's Status | ------- |\n", PlayerName2(player1));
        strcat(str[1],str[0]);
        fotmat(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 | Moderator: %s | Rank: %s | Team: %s | Class: %s\n", PlayerInfo[player1][Level], PlayerInfo[player1][Helper] ? ("Yes") : ("No"), GetRankName(player1), GetTeamName(player1), GetClass(player1));
        strcat(str[1],str[3]);
        format(str[4],1000,"TimePlayed: [%d] hrs [%d] mins [%d] secs\n", h, m, s);
        strcat(str[1],str[4]);
        format(str[5],1000,"| ---------------------------------------------------- |");
        strcat(str[1],str[5]);
        ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"Your status",str[1],"OK","");
    } else return SendClientMessage(playerid, red, "Player Not Connected!");
    return 1;
}
Did this work?

When player login you just create a variable LoggedIn[playerid] = 1; And when player disconnect save that in player ini files and use

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

    if(LoggedIn[player1] == 1) {
        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,"| ------ | %s's Status | ------- |\n", PlayerName2(player1));
        strcat(str[1],str[0]);
        fotmat(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 | Moderator: %s | Rank: %s | Team: %s | Class: %s\n", PlayerInfo[player1][Level], PlayerInfo[player1][Helper] ? ("Yes") : ("No"), GetRankName(player1), GetTeamName(player1), GetClass(player1));
        strcat(str[1],str[3]);
        format(str[4],1000,"TimePlayed: [%d] hrs [%d] mins [%d] secs\n", h, m, s);
        strcat(str[1],str[4]);
        format(str[5],1000,"| ---------------------------------------------------- |");
        strcat(str[1],str[5]);
        ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"Your status",str[1],"OK","");
    } else return SendClientMessage(playerid, red, "Your not Login!");
    return 1;
}
Reply


Messages In This Thread
[ZCMD]Dialog Help With Status (/stats) - by donhu789 - 22.09.2013, 01:59
Re: [ZCMD]Dialog Help With Status (/stats) - by donhu789 - 22.09.2013, 02:02
Re: [ZCMD]Dialog Help With Status (/stats) - by TonyII - 22.09.2013, 02:08
Re: [ZCMD]Dialog Help With Status (/stats) - by xganyx - 22.09.2013, 02:23
Re: [ZCMD]Dialog Help With Status (/stats) - by donhu789 - 22.09.2013, 02:26
Re: [ZCMD]Dialog Help With Status (/stats) - by donhu789 - 22.09.2013, 02:30
Re: [ZCMD]Dialog Help With Status (/stats) - by TonyII - 22.09.2013, 02:32
Re: [ZCMD]Dialog Help With Status (/stats) - by donhu789 - 22.09.2013, 02:34
Re: [ZCMD]Dialog Help With Status (/stats) - by TonyII - 22.09.2013, 02:35
Re: [ZCMD]Dialog Help With Status (/stats) - by xganyx - 22.09.2013, 03:54

Forum Jump:


Users browsing this thread: 1 Guest(s)