[Ajuda] Ajuda callback dialogresponse
#1

Linhas que dгo erro:

PHP Code:
new string256 ], File150 ];
Format(Filesizeof(File), LocalContasPlayerName(playerid)); 
Callback inteira:

PHP Code:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[]) {
    new 
string256 ], File150 ];
    
format(Filesizeof(File), LocalContasPlayerName(playerid));
    if(
dialogid == AVISO)
    {
        if(
response == 1)
        {
            if(
PlayerInfo[playerid][pLogado] == 0)
            {
                if(!
dini_Exists(File))
                {
                    
format(stringsizeof(string), "{FFFFFF}Seja Bem-vindo(a) Pela primeira vez ao servidor!\n\n{33AAFF}Nick: {FFFFFF}%s\n{33AAFF}Conta: {FF0000}Nгo Registrado(a)!\n\n{FFFFFF}Digite uma senha para Registrar-se."PlayerName(playerid));
                    
ShowPlayerDialog(playeridREGISTRODIALOG_STYLE_PASSWORD"• Registro"string"Registrar""Sair");
                }
                if(
dini_Exists(File))
                {
                    
format(stringsizeof(string), "{FFFFFF}Seja Bem-vindo(a) Novamente ao servidor!\n\n{33AAFF}Nick: {FFFFFF}%s\n{33AAFF}Conta: {00FF00}Registrado(a)!\n\n{FFFFFF}Digite sua senha para Logar-se."PlayerName(playerid));
                    
ShowPlayerDialog(playeridLOGINDIALOG_STYLE_PASSWORD"• Login"string"Logar""Sair");
                }
            }
        }
        else
        {
            
GameTextForPlayer(playerid,"~r~KICKADO!"30003);
            
Kick(playerid);
        }
    }
    if(
dialogid == REGISTRO)
    {
        if(
response == 1)
        {
            if(
strlen(inputtext) < MIN_SENHA || strlen(inputtext) > MAX_SENHA)
            {
                new 
STRX250 ];
                
format(STRXsizeof(STRX), "| ERRO | Sua senha deve ter entre %d e %d caracteres!"MIN_SENHAMAX_SENHA);
                
SendClientMessage(playeridVermelhoSTRX);
                
                
format(stringsizeof(string), "{FFFFFF}Seja Bem-vindo(a) Pela primeira vez ao servidor!\n\n{33AAFF}Nick: {FFFFFF}%s\n{33AAFF}Conta: {FF0000}Nгo Registrado(a)!\n\n{FFFFFF}Digite uma senha para Registrar-se."PlayerName(playerid));
                
ShowPlayerDialog(playeridREGISTRODIALOG_STYLE_PASSWORD"• Registro"string"Registrar""Sair");
                return 
1;
            }
            
dini_Create(File);
            
dini_Set(File"Senha"inputtext);
            
dini_Set(File"Profissao""0");
            
dini_Set(File"Level""0");
            
dini_Set(File"Dinheiro""0");
            
dini_Set(File"Admin""0");
            
GivePlayerGrana(playerid5000);
            
            
SendClientMessage(playerid0x808080AA"* Registrado(a) com sucesso!");
            
SpawnPlayer(playerid);
            
            
PlayerInfoplayerid ][ pProfissao ] = Desempregado;
            
PlayerInfoplayerid ][ pLogado ] = 1;
            
PlayerInfoplayerid ][ pLevel ] = 0;
            
SetarProfissao(playerid);
            
minUP[playerid] = 29;
            
segUP[playerid] = 59;
        }
        else
        {
            
GameTextForPlayer(playerid,"~r~KICKADO!"30003);
            
Kick(playerid);
        }
    }
    
    if(
dialogid == LOGIN)
    {
        new 
string256 ], File150 ];
        if(!
strlen(inputtext))
        {
            
SendClientMessage(playeridVermelho"| ERRO | Digite sua senha para Logar-se!");
            return 
1;
        }
        if(
response == 1)
        {
            new 
Password[256];
            
Password dini_Get(File"Senha");
            
            if(
strcmp(inputtextPasswordtrue) == 0)
            {
                
PlayerInfoplayerid ][ pAdmin ] = dini_Int(File"Admin");
                
PlayerInfoplayerid ][ pProfissao ] = dini_Int(File"Profissao");
                
SetPlayerScore(playeriddini_Int(File"Level"));
                
GivePlayerGrana(playeriddini_Int(File"Dinheiro"));
                
PlayerInfoplayerid ][ pLogado ] = 1;
                
SetarProfissao(playerid);
                
                
SendClientMessage(playerid0x808080AA"* Logado(a) com sucesso!");
                
SpawnPlayer(playerid);
                
                
segUP[playerid] = dini_Int(File"SegundosUP");
                
minUP[playerid] = dini_Int(File"MinutosUP");
            }
            else
            {
                
PlayerInfo[playerid][pErroSenha]++;
                if(
PlayerInfo[playerid][pErroSenha] >= 3)
                {
                    
format(stringsizeof(string), "| INFO-SERVER | O(A) Jogador(a) %s (%d) foi kickado do servidor! ( Motivo: Senha Incorreta )"PlayerName(playerid), playerid);
                    
SendClientMessageToAll(Vermelhostring);
                    
Kick(playerid);
                }
                else
                {
                    new 
ErroPW256 ];
                    
format(ErroPWsizeof(ErroPW), "• Senha Incorreta ( %d / 3 )"PlayerInfoplayerid ][ pErroSenha ]);
                    
SendClientMessage(playeridVermelhoErroPW);
                    
format(stringsizeof(string), "{FFFFFF}Seja Bem-vindo(a) Novamente ao servidor!\n\n{33AAFF}Nick: {FFFFFF}%s\n{33AAFF}Conta: {00FF00}Registrado(a)!\n\n{FFFFFF}Digite sua senha para Logar-se."PlayerName(playerid));
                    
ShowPlayerDialog(playeridLOGINDIALOG_STYLE_PASSWORD"• Login"string"Logar""Sair");
                }
            }
        }
        else
        {
            
GameTextForPlayer(playerid,"~r~KICKADO!"30003);
            
Kick(playerid);
        }
    }
    
    
//Profissхes
    
    
if(dialogid == MenuAgencia)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
ShowPlayerDialog(playeridHonestasDIALOG_STYLE_TABLIST_HEADERS"Profissхes » Honestas""Profissгo\t{33AAFF}Level\t{008000}Salбrio\nFotografo\t{33AAFF}0\t{008000}$600,00\nParamedico\t{33AAFF}5\t{008000}$700,00""Selecionar""Voltar");
            }
            if(
listitem == 1)
            {
                
ShowPlayerDialog(playeridTransportesDIALOG_STYLE_TABLIST_HEADERS"Profissхes » Transportes""Profissгo\t{33AAFF}Level\t{008000}Salбrio\nPetroleiro\t{33AAFF}0\t{008000}$1.100,00\nConcreteiro\t{33AAFF}10\t{008000}$1.200,00""Selecionar""Voltar");
            }
            if(
listitem == 2)
            {
                
ShowPlayerDialog(playeridPoliciasDIALOG_STYLE_TABLIST_HEADERS"Profissхes » Policias""Profissгo\t{33AAFF}Level\t{008000}Salбrio\nPolнcia Militar\t{33AAFF}50\t{008000}$2.100,00\nInterpol\t{33AAFF}200\t{008000}$2.500,00""Selecionar""Voltar");
            }
            if(
listitem == 3)
            {
                
ShowPlayerDialog(playeridForcasArmadasDIALOG_STYLE_TABLIST_HEADERS"Profissхes » ForcasArmadas""Profissгo\t{33AAFF}Level\t{008000}Salбrio\nExйrcito\t{33AAFF}700\t{008000}$3.000,00\nAйronautica\t{33AAFF}800\t{008000}$3.500,00""Selecionar""Voltar");
            }
        }
    }
    if(
dialogid == Honestas)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                if(
GetPlayerScore(playerid) >= 0
                {
                    
SendClientMessage(playerid0x008080AA"~~~~~~~~~~~~~~~~~~~~~~~ Fotografo ~~~~~~~~~~~~~~~~~~~~~~~");
                    
SendClientMessage(playerid0xFFFFFFAA"» Seu curriculo foi aceito nesta Profissгo!");
                    
SendClientMessage(playerid0xFFFFFFAA"» Agora vocк trabalha como Fotografo!");
                    
SendClientMessage(playerid0xFFFFFFAA"» Vocк passarб a receber um salбrio de {008000}$600,00");
                    
SendClientMessage(playerid0x008080AA"~~~~~~~~~~~~~~~~~~~~~~~ Fotografo ~~~~~~~~~~~~~~~~~~~~~~~");
                    
PlayerInfoplayerid ][ pProfissao ] = Fotografo;
                    
SetarProfissao(playerid);
                }
            }
            if(
listitem == 1)
            {
                if(
GetPlayerScore(playerid) >= 5)
                {
                    
SendClientMessage(playerid0x008080AA"~~~~~~~~~~~~~~~~~~~~~~~ Paramedico ~~~~~~~~~~~~~~~~~~~~~~~");
                    
SendClientMessage(playerid0xFFFFFFAA"» Seu curriculo foi aceito nesta Profissгo!");
                    
SendClientMessage(playerid0xFFFFFFAA"» Agora vocк trabalha como Paramedico!");
                    
SendClientMessage(playerid0xFFFFFFAA"» Vocк passarб a receber um salбrio de {008000}$700,00");
                    
SendClientMessage(playerid0x008080AA"~~~~~~~~~~~~~~~~~~~~~~~ Paramedico ~~~~~~~~~~~~~~~~~~~~~~~");
                    
PlayerInfoplayerid ][ pProfissao ] = Paramedico;
                    
SetarProfissao(playerid);
                }
                else
                {
                    
SendClientMessage(playerid0xFF0000AA"| ERRO | Vocк nгo tem level suficiente para pegar esta Profissгo!");
                }
            }
        }
        else
        {
            
ShowPlayerDialog(playeridMenuAgenciaDIALOG_STYLE_LIST"Agкncia de Empregos""Honestas\nTransporte\nPolicia\nForзas Armadas""Selecionar""Fechar");
        }
    }
    if(
dialogid == Transportes)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                if(
GetPlayerScore(playerid) >= 0)
                {
                    
SendClientMessage(playerid0x008080AA"~~~~~~~~~~~~~~~~~~~~~~~ Petroleiro ~~~~~~~~~~~~~~~~~~~~~~~");
                    
SendClientMessage(playerid0xFFFFFFAA"» Seu curriculo foi aceito nesta Profissгo!");
                    
SendClientMessage(playerid0xFFFFFFAA"» Agora vocк trabalha como Petroleiro!");
                    
SendClientMessage(playerid0xFFFFFFAA"» Vocк passarб a receber um salбrio de {008000}$1.100,00");
                    
SendClientMessage(playerid0x008080AA"~~~~~~~~~~~~~~~~~~~~~~~ Petroleiro ~~~~~~~~~~~~~~~~~~~~~~~");
                    
PlayerInfoplayerid ][ pProfissao ] = Petroleiro;
                    
SetarProfissao(playerid);
                }
            }
            if(
listitem == 1)
            {
                if(
GetPlayerScore(playerid) >= 10)
                {
                    
SendClientMessage(playerid0x008080AA"~~~~~~~~~~~~~~~~~~~~~~~ Concreteiro ~~~~~~~~~~~~~~~~~~~~~~~");
                    
SendClientMessage(playerid0xFFFFFFAA"» Seu curriculo foi aceito nesta Profissгo!");
                    
SendClientMessage(playerid0xFFFFFFAA"» Agora vocк trabalha como Concreteiro!");
                    
SendClientMessage(playerid0xFFFFFFAA"» Vocк passarб a receber um salбrio de {008000}$1.200,00");
                    
SendClientMessage(playerid0x008080AA"~~~~~~~~~~~~~~~~~~~~~~~ Concreteiro ~~~~~~~~~~~~~~~~~~~~~~~");
                    
PlayerInfoplayerid ][ pProfissao ] = Concreteiro;
                    
SetarProfissao(playerid);
                }
                else
                {
                    
SendClientMessage(playerid0xFF0000AA"| ERRO | Vocк nгo tem level suficiente para pegar esta Profissгo!");
                }
            }
        }
        else
        {
            
ShowPlayerDialog(playeridMenuAgenciaDIALOG_STYLE_LIST"Agкncia de Empregos""Honestas\nTransporte\nPolicia\nForзas Armadas""Selecionar""Fechar");
        }
    }
    if(
dialogid == Policias)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                if(
GetPlayerScore(playerid) >= 50)
                {
                    
SendClientMessage(playerid0x008080AA"~~~~~~~~~~~~~~~~~~~~~~~ Polнcia Militar ~~~~~~~~~~~~~~~~~~~~~~~");
                    
SendClientMessage(playerid0xFFFFFFAA"» Seu curriculo foi aceito nesta Profissгo!");
                    
SendClientMessage(playerid0xFFFFFFAA"» Agora vocк й um Polнcial Militar!");
                    
SendClientMessage(playerid0xFFFFFFAA"» Vocк passarб a receber um salбrio de {008000}$2.100,00");
                    
SendClientMessage(playerid0x008080AA"~~~~~~~~~~~~~~~~~~~~~~~ Polнcia Militar ~~~~~~~~~~~~~~~~~~~~~~~");
                    
PlayerInfoplayerid ][ pProfissao ] = PMilitar;
                    
SetarProfissao(playerid);
                }
                else
                {
                    
SendClientMessage(playerid0xFF0000AA"| ERRO | Vocк nгo tem level suficiente para pegar esta Profissгo!");
                }
            }
            if(
listitem == 1)
            {
                if(
GetPlayerScore(playerid) >= 200)
                {
                    
SendClientMessage(playerid0x008080AA"~~~~~~~~~~~~~~~~~~~~~~~ Interpol ~~~~~~~~~~~~~~~~~~~~~~~");
                    
SendClientMessage(playerid0xFFFFFFAA"» Seu curriculo foi aceito nesta Profissгo!");
                    
SendClientMessage(playerid0xFFFFFFAA"» Agora vocк й da Polнcia Interpol!");
                    
SendClientMessage(playerid0xFFFFFFAA"» Vocк passarб a receber um salбrio de {008000}$2.500,00");
                    
SendClientMessage(playerid0x008080AA"~~~~~~~~~~~~~~~~~~~~~~~ Interpol ~~~~~~~~~~~~~~~~~~~~~~~");
                    
PlayerInfoplayerid ][ pProfissao ] = Interpol;
                    
SetarProfissao(playerid);
                }
                else
                {
                    
SendClientMessage(playerid0xFF0000AA"| ERRO | Vocк nгo tem level suficiente para pegar esta Profissгo!");
                }
            }
        }
        else
        {
            
ShowPlayerDialog(playeridMenuAgenciaDIALOG_STYLE_LIST"Agкncia de Empregos""Honestas\nTransporte\nPolicia\nForзas Armadas""Selecionar""Fechar");
        }
    }
    if(
dialogid == ForcasArmadas)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                if(
GetPlayerScore(playerid) >= 700)
                {
                    
SendClientMessage(playerid0x008080AA"~~~~~~~~~~~~~~~~~~~~~~~ Exйrcito ~~~~~~~~~~~~~~~~~~~~~~~");
                    
SendClientMessage(playerid0xFFFFFFAA"» Seu curriculo foi aceito nesta Profissгo!");
                    
SendClientMessage(playerid0xFFFFFFAA"» Agora vocк й do Exйrcito!");
                    
SendClientMessage(playerid0xFFFFFFAA"» Vocк passarб a receber um salбrio de {008000}$3.000,00");
                    
SendClientMessage(playerid0x008080AA"~~~~~~~~~~~~~~~~~~~~~~~ Exйrcito ~~~~~~~~~~~~~~~~~~~~~~~");
                    
PlayerInfoplayerid ][ pProfissao ] = Exercito;
                    
SetarProfissao(playerid);
                }
                else
                {
                    
SendClientMessage(playerid0xFF0000AA"| ERRO | Vocк nгo tem level suficiente para pegar esta Profissгo!");
                }
            }
            if(
listitem == 1)
            {
                if(
GetPlayerScore(playerid) >= 800)
                {
                    
SendClientMessage(playerid0x008080AA"~~~~~~~~~~~~~~~~~~~~~~~ Aйronautica ~~~~~~~~~~~~~~~~~~~~~~~");
                    
SendClientMessage(playerid0xFFFFFFAA"» Seu curriculo foi aceito nesta Profissгo!");
                    
SendClientMessage(playerid0xFFFFFFAA"» Agora vocк й da Aйronautica!");
                    
SendClientMessage(playerid0xFFFFFFAA"» Vocк passarб a receber um salбrio de {008000}$3.500,00");
                    
SendClientMessage(playerid0x008080AA"~~~~~~~~~~~~~~~~~~~~~~~ Aйronautica ~~~~~~~~~~~~~~~~~~~~~~~");
                    
PlayerInfoplayerid ][ pProfissao ] = Aeronautica;
                    
SetarProfissao(playerid);
                }
                else
                {
                    
SendClientMessage(playerid0xFF0000AA"| ERRO | Vocк nгo tem level suficiente para pegar esta Profissгo!");
                }
            }
        }
        else
        {
            
ShowPlayerDialog(playeridMenuAgenciaDIALOG_STYLE_LIST"Agкncia de Empregos""Honestas\nTransporte\nPolicia\nForзas Armadas""Selecionar""Fechar");
        }
    if(
dialogid == DIALOG_BANCO) {
        switch(
listitem) {
            case 
0: { // Saldo
                
if(response) {
                    new 
aname[MAX_PLAYER_NAME], file[80], string[200], HoraMinutoSegundoDiaMesAno;
                    
gettime(HoraMinutoSegundo);
                    
getdate(AnoMesDia);
                    
GetPlayerName(playeridanamesizeof(aname));
                    
format(filesizeof(file),LocalContasaname);
                    
format(stringsizeof(string), "{FFFFFF}Banco {0fbefe}Cidade Vida Real\n\n\n{FFFFFF}Saldo em Conta {2fcc38}$%d \n\n{FFFFFF}Hora: {8de990}%02d:%02d:%02d \n\n{FFFFFF}Data: {8de990}%02d/%02d/%d"DOF2_GetInt(file"Saldo"), HoraMinutoSegundoDiaMesAno);
                    
ShowPlayerDialog(playeridDIALOG_BANCO_SALDODIALOG_STYLE_MSGBOX"{FFFFFF}Extrato"string"Sair""");
                    return 
1;
                }
            }
            case 
1: { //Saque
                
if(response) {
                    
ShowPlayerDialog(playeridDIALOG_BANCO_SAQUEDIALOG_STYLE_INPUT"{2fca38}Saque""{FFFFFF}Digite a quantia em que vocк quer sacar""Sacar""Cancelar");
                }
            }
            case 
2: { //Deposito
                
if(response) {
                    
ShowPlayerDialog(playeridDIALOG_BANCO_DEPOSITODIALOG_STYLE_INPUT"{2fca38}Deposito""{FFFFFF}Digite a quantia em que vocк quer depositar""Depositar""Cancelar");
                }
            }
        }
        return 
1;
    }
    if(
dialogid == DIALOG_BANCO_SAQUE) {
        if(
response) {
            new 
aname[MAX_PLAYER_NAME], file[80], string[250], HoraMinutoSegundoDiaMesAno;
            
gettime(HoraMinutoSegundo);
            
getdate(AnoMesDia);
            
GetPlayerName(playeridanamesizeof(aname));
            
format(filesizeof(file), LocalContasaname);
            if(
strval(inputtext) == 0) return SendClientMessage(playerid, -1"[x] {FF0000}Vocк tentou sacar 0 R$ de sua conta!");
            if(
strval(inputtext) > DOF2_GetInt(file"Saldo")) return SendClientMessage(playerid, -1"[x] {FF0000}Vocк nгo possui saldo suficiente para saque desta quantia!");
            
GivePlayerMoney(playeridstrval(inputtext));
            
DOF2_SetInt(file"Saldo", (DOF2_GetInt(file"Saldo")-strval(inputtext)));
            
DOF2_SaveFile();
            
format(stringsizeof(string), "{FFFFFF}Banco {0fbefe}Cidade Vida Real\n\n\n{FFFFFF}Vocк sacou {2fcc38}$%d \n\n{FFFFFF}Saldo em Conta {2fcc38}$%d \n\n{FFFFFF}Hora: {8de990}%02d:%02d:%02d \n\n{FFFFFF}Data: {8de990}%02d/%02d/%d"strval(inputtext), DOF2_GetInt(file"Saldo"), HoraMinutoSegundoDiaMesAno);
            
ShowPlayerDialog(playeridDIALOG_BANCO_SALDODIALOG_STYLE_MSGBOX"{FFFFFF}Saque"string"Sair""");
            return 
1;
        }
        return 
1;
    }
    if(
dialogid == DIALOG_BANCO_DEPOSITO) {
        if(
response) {
            new 
aname[MAX_PLAYER_NAME], file[80], string[250], HoraMinutoSegundoDiaMesAno;
            
gettime(HoraMinutoSegundo);
            
getdate(AnoMesDia);
            
GetPlayerName(playeridanamesizeof(aname));
            
format(filesizeof(file), LocalContasaname);
            if(
strval(inputtext) == 0) return SendClientMessage(playerid, -1"[x] {FF0000}Vocк tentou depositar 0 R$ em sua conta!");
            if(
strval(inputtext) > GetPlayerMoney(playerid)) return SendClientMessage(playerid, -1"[x] {FF0000}Vocк nгo possui estб quantia em mгos para depositar!");
            
GivePlayerMoney(playerid, -strval(inputtext));
            
DOF2_SetInt(file"Saldo", (DOF2_GetInt(file"Saldo")+strval(inputtext)));
            
DOF2_SaveFile();
            
format(stringsizeof(string), "{FFFFFF}Banco {0fbefe}Cidade Vida Real\n\n\n{FFFFFF}Vocк depositou {2fcc38}$%d \n\n{FFFFFF}Saldo em Conta {2fcc38}$%d \n\n{FFFFFF}Hora: {8de990}%02d:%02d:%02d \n\n{FFFFFF}Data: {8de990}%02d/%02d/%d"strval(inputtext), DOF2_GetInt(file"Saldo"), HoraMinutoSegundoDiaMesAno);
            
ShowPlayerDialog(playeridDIALOG_BANCO_SALDODIALOG_STYLE_MSGBOX"{FFFFFF}Deposito"string"Sair""");
            return 
1;
        }
        return 
1;
    }
    }
    return 
1;

Erros:

PHP Code:
C:\Users\Helder-PC\Desktop\gmtestes\gamemodes\PS.pwn(557) : warning 219local variable "string" shadows a variable at a preceding level
C
:\Users\Helder-PC\Desktop\gmtestes\gamemodes\PS.pwn(557) : warning 219local variable "File" shadows a variable at a preceding level
C
:\Users\Helder-PC\Desktop\gmtestes\gamemodes\PS.pwn(810) : warning 217loose indentation
C
:\Users\Helder-PC\Desktop\gmtestes\gamemodes\PS.pwn(814) : warning 219local variable "string" shadows a variable at a preceding level
C
:\Users\Helder-PC\Desktop\gmtestes\gamemodes\PS.pwn(839) : warning 219local variable "string" shadows a variable at a preceding level
C
:\Users\Helder-PC\Desktop\gmtestes\gamemodes\PS.pwn(857) : warning 219local variable "string" shadows a variable at a preceding level 
Reply


Messages In This Thread
Ajuda callback dialogresponse - by HelderPT - 30.04.2018, 22:18
Re: Ajuda callback dialogresponse - by AutoMatic2 - 30.04.2018, 22:36
Re: Ajuda callback dialogresponse - by HelderPT - 30.04.2018, 22:42
Re: Ajuda callback dialogresponse - by AutoMatic2 - 30.04.2018, 22:44
Re: Ajuda callback dialogresponse - by HelderPT - 30.04.2018, 22:46
Re: Ajuda callback dialogresponse - by HelderPT - 30.04.2018, 22:50
Re: Ajuda callback dialogresponse - by AutoMatic2 - 30.04.2018, 23:06

Forum Jump:


Users browsing this thread: 1 Guest(s)