SA-MP Forums Archive
[DIALOG](ZCMD)Help With Dialogs false all time worked - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [DIALOG](ZCMD)Help With Dialogs false all time worked (/showthread.php?tid=464827)



[DIALOG](ZCMD)Help With Dialogs false all time worked - donhu789 - 19.09.2013

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 ?


Re: [DIALOG](ZCMD)Help With Dialogs false all time worked - alinategh - 19.09.2013

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


AW: [DIALOG](ZCMD)Help With Dialogs false all time worked - donhu789 - 19.09.2013

Huh Can You Make My Example O_o ?


Re: [DIALOG](ZCMD)Help With Dialogs false all time worked - Konstantinos - 19.09.2013

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", "");



AW: [DIALOG](ZCMD)Help With Dialogs false all time worked - donhu789 - 19.09.2013

-_-


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:


Re: [DIALOG](ZCMD)Help With Dialogs false all time worked - Konstantinos - 19.09.2013

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



AW: [DIALOG](ZCMD)Help With Dialogs false all time worked - donhu789 - 19.09.2013

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


Re: AW: [DIALOG](ZCMD)Help With Dialogs false all time worked - nguyenquynh - 20.09.2013

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