[Ajuda] Saldo
#1

Porque em dialog esse codigo funciona e no /saldo nгo?

pawn Код:
if(strcmp(cmd, "/saldo", true) == 0) {
new PName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PName, sizeof(PName));
format(string, sizeof(string), "Seu saldo й {00FF00}'R$: %d'",dini_Int(file, "SaldoBancario"));
ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Saldo",string,"Ok","Fechar");
}
Reply
#2

Код:
 
if (strcmp("/saldo", cmdtext, true) == 0)
{
    new PName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, PName, sizeof(PName));
    format(string, sizeof(string), "Seu saldo й {00FF00}'R$: %d'",dini_Int(file, "SaldoBancario"));
    ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Saldo",string,"Ok","Fechar");
    return 1;
}
vocк ta usando if(strcmp(cmd, "/saldo", true) == 0), o cmd ali que vocк ta errando, atй onde eu sei isso й do strtok usado para criar comandos com espaзo, exemplo /dararma [id], /ir [id]...
Reply
#3

Tenta
pawn Код:
if(strcmp(cmd, "/saldo", true) == 0) {
    new PName[MAX_PLAYER_NAME], s1[300], s2[100];
    GetPlayerName(playerid, PName, sizeof(PName));
    format(s2, sizeof(s2), "Seu saldo й {00FF00}'R$: %d'",dini_Int(file, "SaldoBancario"));
    strcat(s1, s2);
    ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Saldo",s2,"Ok","Fechar");
    strdel(s1, s2);
    return true;
}
Reply
#4

Ola,

Depois tenta;

pawn Код:
#define Saldo 29191

if(strcmp(cmd, "/saldo", true) == 0)
{
    new PTName[MAX_PLAYER_NAME], PT[80];
    GetPlayerName(playerid, PTName, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, PTName);
   
    format(PT, sizeof(PT), "Seu saldo й {00FF00}'R$: %d'", dini_Int(file, "SaldoBancario");
    strcat(PT, PT, sizeof(PT));
    ShowPlayerDialog(playerid, Saldo, DIALOG_STYLE_MSGBOX, "Saldo", PT, "Ok", "Fechar");
}

PT
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)