/stats in dialog how?
#1

CMDtats(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[120], str1[100];
format(str, sizeof(str),"%s's Stats", 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]/FloatDeaths);
format(str1, sizeof(str1),"Rank: %s | Team: %s | Class: %s | Session Kills %d",GetRankName(player1), GetTeamName(player1), GetClass(player1), Skills[player1]);

SendClientMessage(playerid, green,str);
SendClientMessage(playerid, green,string);
SendClientMessage(playerid, green,str1);
} else return SendClientMessage(playerid, red, "Player Not Connected!");
return 1;
}
#endif


plz convert it in dialog....
Reply
#2

pawn Код:
CMD:stats(playerid,params[])
{
    new string[128], 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[128], str1[128];
    format(str, sizeof(str),"%s's Stats", 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]/FloatDeaths);
    format(str1, sizeof(str1),"Rank: %s | Team: %s | Class: %s | Session Kills %d",GetRankName(player1), GetTeamName(player1), GetClass(player1), Skills[player1]);

    strcat(str, str);
    strcat(string, string);
    strcat(str1, str1);
    } else return SendClientMessage(playerid, red, "Player Not Connected!");
    return 1;
}
Reply
#3

this is not in dialog
Reply
#4

Scripting Help Section Is For General Help Like Errors - If you want a code writen for you and you havent even attempted it dont post -

TIPS:

1. Try yourself to make the code then post your error code and we will correct it for you
Reply
#5

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

    if (!IsPlayerConnected(player1)) return SendClientMessage(playerid, -1, "Player Not Connected!");
    GetPlayerName(player1, playername, sizeof(playername));
    if(PlayerInfo[player1][Deaths] == 0) pDeaths = 1; else pDeaths = PlayerInfo[player1][Deaths];
    new str[128], str1[128];
    new fstr[1800];
    format(str, sizeof(str),"%s's Stats", 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]/FloatDeaths);
    format(str1, sizeof(str1),"Rank: %s | Team: %s | Class: %s | Session Kills %d",GetRankName(player1), GetTeamName(player1), GetClass(player1), Skills[player1]);

    strcat(fstr, str);
    strcat(fstr, string);
    strcat(fstr, str1);
    ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "Player Stats", fstr, "OK", "");
    return 1;
}
Sorry forgot about something
Reply
#6

how i add operator: and admin level:
Reply
#7

how i remove these error:
cod-e.pwn(13395) : error 017: undefined symbol "str2"
cod-e.pwn(13395) : error 017: undefined symbol "str2"
cod-e.pwn(13395) : error 029: invalid expression, assumed zero
cod-e.pwn(13395) : fatal error 107: too many error messages on one line


error line:
format(str2, sizeof(str2),"TimePlayed: [%d] hrs [%d] mins [%d] secs", h, m, s);
Reply
#8

change this new fstr[1800]; to new fstr[1800], str2[250];
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)