SA-MP Forums Archive
[Ajuda] Dialog e String. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Dialog e String. (/showthread.php?tid=557686)



Dialog e String. - SampMovies - 14.01.2015

O que estб errado:

pawn Код:
CMD:info(playerid)
{
    new dialogrande[350];
    format(dialogrande, sizeof(dialogrande), "%s%s", dialogrande, "Level: [%d]\n", GetPlayerScore(playerid));
    format(dialogrande, sizeof(dialogrande), "%s%s", dialogrande, "Matei: [%d]\n", Matou[playerid]);
    format(dialogrande, sizeof(dialogrande), "%s%s", dialogrande, "Admin: [%d]", PlayerInfo[playerid][pADM]);
    ShowPlayerDialog(playerid, 6666, DIALOG_STYLE_MSGBOX, "[RealLife RPG]", dialogrande, "OK", "");
    return 1;
}
Nгo aparece como deveria...


Re: Dialog e String. - JonathanFeitosa - 14.01.2015

Utilize strcat http://forum.sa-mp.com/showpost.php?...23&postcount=8


Re: Dialog e String. - SampMovies - 14.01.2015

pawn Код:
CMD:info(playerid)
{
    new dialogrande[350];
    strcat(dialogrande, "{0080FF}[Matou: {FFFFFF}[%d] {0080FF}[Morreu: {FFFFFF}[%d] {0080FF}[Dinheiro: {FFFFFF}[%d] {0080FF}[Tipo de Conta: {FFFFFF}[%s]", Player[playerid][pMatou], Player[playerid][pMorreu], GetPlayerMoney(playerid), GetPlayerTypeAccount(playerid));
    ShowPlayerDialog(playerid, 6666, DIALOG_STYLE_MSGBOX, "[RealLife RPG]", dialogrande, "OK", "");
    return 1;
}
Код:
 3 Avisos:

warning: 202: number of arguments does not match definition
Linha:

pawn Код:
strcat(dialogrande, "{0080FF}[Matou: {FFFFFF}[%d] {0080FF}[Morreu: {FFFFFF}[%d] {0080FF}[Dinheiro: {FFFFFF}[%d] {0080FF}[Tipo de Conta: {FFFFFF}[%s]", Player[playerid][pMatou], Player[playerid][pMorreu], GetPlayerMoney(playerid), GetPlayerTypeAccount(playerid));



Re: Dialog e String. - JonathanFeitosa - 14.01.2015

pawn Код:
new dialogrande[50], string[20];
format(string, sizeof(string), "Exemplo\n");
strcat(dialogrande, string);
format(string, sizeof(string), "Exemplo 2\n");
strcat(dialogrande, string);
ShowPlayerDialog(playerid, 6666, DIALOG_STYLE_MSGBOX, "[RealLife RPG]", dialogrande, "OK", "");
// Exemploo.



Re: Dialog e String. - Artista - 14.01.2015

strcat serve para concatenar strings, vocк utilizou de uma maneira totalmente errada.
Recomendo que vocк leia esse tutorial: https://sampforum.blast.hk/showthread.php?tid=344000
Acredite, vocк vai ficar fera em manipulaзгo de strings


Re: Dialog e String. - [BOPE]Seu._.Madruga - 14.01.2015

Nгo precisa usar strcat nesta circunstвncia, apenas uma format jб da conta do objetivo.
PHP код:
CMD:info(playerid)
{
    static 
bradoks[124];
    
format(bradokssizeof(bradoks), "Level: [%d]\nMatei: [%d]\nAdmin: [%d]"GetPlayerScore(playerid), Matou[playerid], PlayerInfo[playerid][pADM]);
    
ShowPlayerDialog(playerid6666DIALOG_STYLE_MSGBOX"[RealLife RPG]"bradoks"OK""");
    return 
1;

Espero ter ajudado.




Re: Dialog e String. - SampMovies - 15.01.2015

nгo deu jonathan feitosa..


Re: Dialog e String. - JonathanFeitosa - 15.01.2015

Pelo que eu sei no caso quando й muito informaзгo na dialog, com strcat fica mais rбpido.
Se nгo estou enganado й claro.


Respuesta: Dialog e String. - Zume - 15.01.2015

http://forum.sa-mp.com/showpost.php?...92&postcount=2


Re: Dialog e String. - [BOPE]Seu._.Madruga - 15.01.2015

Usa oque eu postei brother.
Quote:
Originally Posted by [BOPE]Seu._.Madruga
Посмотреть сообщение
Nгo precisa usar strcat nesta circunstвncia, apenas uma format jб da conta do objetivo.
PHP код:
CMD:info(playerid)
{
    static 
bradoks[124];
    
format(bradokssizeof(bradoks), "Level: [%d]\nMatei: [%d]\nAdmin: [%d]"GetPlayerScore(playerid), Matou[playerid], PlayerInfo[playerid][pADM]);
    
ShowPlayerDialog(playerid6666DIALOG_STYLE_MSGBOX"[RealLife RPG]"bradoks"OK""");
    return 
1;

Espero ter ajudado.