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

Hey guy i want to Make my /stats Like This






If Anyone Can Help ++++rep rep reprep rpe REP/Who Help A Little REP REP REP REP REP


I just need The Dialog Like It

Here My Code

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[120], str1[100], str2[100];
        format(str, sizeof(str),"| ------ | %s's Status | ------- |", PlayerName2(player1));
        format(string,sizeof(string),"Scores: %d | Money: $%d | Kills: %d | Deaths: %d | K/D Ratio: %0.2f", GetPlayerScore(player1), GetPlayerMoney(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths);
        format(str1, sizeof(str1),"Admin Level: %d | Moderator: %s | Rank: %s | Team: %s | Class: %s", PlayerInfo[player1][Level], PlayerInfo[player1][Helper] ? ("Yes") : ("No"), GetRankName(player1), GetTeamName(player1), GetClass(player1));
        format(str2, sizeof(str2),"TimePlayed: [%d] hrs [%d] mins [%d] secs", h, m, s);

        SendClientMessage(playerid, 0xFFFFFFFF,str);
        SendClientMessage(playerid, 0xAAAAAAFF,string);
        SendClientMessage(playerid, 0xAAAAAAFF,str1);
        SendClientMessage(playerid, 0xAAAAAAFF,str2);
        SendClientMessage(playerid, 0xFFFFFFFF,"| ---------------------------------------------------- |");
       
    } else return SendClientMessage(playerid, red, "Player Not Connected!");
    return 1;
}

Can Anyone Help + REp



-REgard Thanks
Reply
#2

Sory For THe Douple Post Becuz Pic broken


http://imageshack.us/photo/my-images/15/8k01.png/


here is the real one
Reply
#3

pawn Код:
#define DIALOG_STATS 1005

//Replace this
        strcat(str,"| ------ | %s's Status | ------- |", PlayerName2(player1));
        strcat(str,"Scores: %d | Money: $%d | Kills: %d | Deaths: %d | K/D Ratio: %0.2f", GetPlayerScore(player1), GetPlayerMoney(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths);
        strcat(str,"Admin Level: %d | Moderator: %s | Rank: %s | Team: %s | Class: %s", PlayerInfo[player1][Level], PlayerInfo[player1][Helper] ? ("Yes") : ("No"), GetRankName(player1), GetTeamName(player1), GetClass(player1));
        strcat(str,"TimePlayed: [%d] hrs [%d] mins [%d] secs", h, m, s);
ShowPlayerDialog(playerid, DIALOG_STATS,DIALOG_STYLE_MSGBOX,"STATS",str,"Ok","Close");
Reply
#4

Quote:
Originally Posted by TonyII
Посмотреть сообщение
pawn Код:
#define DIALOG_STATS 1005

//Replace this
        strcat(str,"| ------ | %s's Status | ------- |", PlayerName2(player1));
        strcat(str,"Scores: %d | Money: $%d | Kills: %d | Deaths: %d | K/D Ratio: %0.2f", GetPlayerScore(player1), GetPlayerMoney(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths);
        strcat(str,"Admin Level: %d | Moderator: %s | Rank: %s | Team: %s | Class: %s", PlayerInfo[player1][Level], PlayerInfo[player1][Helper] ? ("Yes") : ("No"), GetRankName(player1), GetTeamName(player1), GetClass(player1));
        strcat(str,"TimePlayed: [%d] hrs [%d] mins [%d] secs", h, m, s);
ShowPlayerDialog(playerid, DIALOG_STATS,DIALOG_STYLE_MSGBOX,"STATS",str,"Ok","Close");
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;
}
Reply
#5

LEt My Try It If worked Rep REP REP
Reply
#6

Thanks Thanks Thanks Is Work But i said Never Use string :\
Reply
#7

Replace
pawn Код:
new string[100], pDeaths, player1, h, m, s,playername[MAX_PLAYER_NAME];
To
pawn Код:
new pDeaths, player1, h, m, s,playername[MAX_PLAYER_NAME];
Reply
#8

hey

The errore =

Quote:

warning 204: symbol is assigned a value that is never used: "string"

can you help o-o ?
Reply
#9

Do what I said above /\
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)