how i converts
#1

how i converts it into dialog


CMDtats(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]/FloatDeaths);
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;
}
Reply
#2

Please use [PAWN][ /PAWN] tags next time.
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;
}
https://sampwiki.blast.hk/wiki/ShowPlayerDialog
pawn Код:
new string[128];
format(string, sizeof(string), "Score: %d", GetPlayerScore(playerid));
ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "Stats", string, "Close", "");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)