[DIALOG](ZCMD)Help With Dialogs false all time worked
#1

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[120];
        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 | Skin[%d] |", h, m, s, GetPlayerSkin(player1));

        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;
}
I need help With This i always try to change to dialog but is always false my can anyone help ?
Reply
#2

What's false exactly? you need it in a Dialog instead of text? okay then use "ShowPlayerDialog":
https://sampwiki.blast.hk/wiki/ShowPlayerDialog
Reply
#3

Huh Can You Make My Example O_o ?
Reply
#4

Declare one variable with larger size and use strcat like:
pawn Код:
new _str[ 50 ], str[128], str_[ 350 ]; // CHANGE 350 to your needs. I always count the characters!

format(_str, sizeof(_str),"| ------ | %s's Status | ------- |", PlayerName2(player1));
format(str,sizeof(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_, str);
format(str, sizeof(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_, str);
format(str, sizeof(str),"TimePlayed: [%d] hrs [%d] mins [%d] secs | Skin[%d] |", h, m, s, GetPlayerSkin(player1));
strcat(str_, str);

ShowPlayerDialog(playerid, 550, DIALOG_STYLE_MSGBOX, _str, str_, "Close", "");
Reply
#5

-_-


PHP код:
C:\Documents and Settings\PhongLan\Desktop\Samp CS\gamemodes\codww.pwn(14129) : error 017undefined symbol "_str"
C:\Documents and Settings\PhongLan\Desktop\Samp CS\gamemodes\codww.pwn(14129) : error 017undefined symbol "_str"
C:\Documents and Settings\PhongLan\Desktop\Samp CS\gamemodes\codww.pwn(14129) : error 029invalid expressionassumed zero
C
:\Documents and Settings\PhongLan\Desktop\Samp CS\gamemodes\codww.pwn(14129) : fatal error 107too many error messages on one line 

This Code When I compile i'm Using COD gamemode Can Anyone help My do with it ?? i doing zcmd CMD:
Reply
#6

Before line 14129, do:
pawn Код:
new
    _str[ 50 ]
;
Reply
#7

Still not Work please do a commands Example For my please :\
Reply
#8

Quote:
Originally Posted by donhu789
Посмотреть сообщение
-_-


PHP код:
C:\Documents and Settings\PhongLan\Desktop\Samp CS\gamemodes\codww.pwn(14129) : error 017undefined symbol "_str"
C:\Documents and Settings\PhongLan\Desktop\Samp CS\gamemodes\codww.pwn(14129) : error 017undefined symbol "_str"
C:\Documents and Settings\PhongLan\Desktop\Samp CS\gamemodes\codww.pwn(14129) : error 029invalid expressionassumed zero
C
:\Documents and Settings\PhongLan\Desktop\Samp CS\gamemodes\codww.pwn(14129) : fatal error 107too many error messages on one line 

This Code When I compile i'm Using COD gamemode Can Anyone help My do with it ?? i doing zcmd CMD:
Code you can edit:


Код:
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 coordsstring[256];
	new string2[1024];
        format(string2, sizeof(string2),"| ------ | %s's Status | ------- |\n", PlayerName2(player1));
        format(coordsstring,sizeof(coordsstring,"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(string2,coordsstring);
        format(coordsstring, sizeof(coordsstring),"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(string2,coordsstring);
        format(coordsstring, sizeof(coordsstring),"TimePlayed: [%d] hrs [%d] mins [%d] secs | Skin[%d] |", h, m, s, GetPlayerSkin(player1));
        strcat(string2,coordsstring);
        format(coordsstring, sizeof(coordsstring), "_________________________________________________________________________________________");
	strcat(string2,coordsstring);
	ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "Stats", string2, "Okay", "");

    } else return SendClientMessage(playerid, red, "Player Not Connected!");
    return 1;
}
Remember make #define DIALOG_STATS number
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)