if is not working
#1

I already tried several ways but it does not work, it always goes to the next dialog.

PHP код:
    if(dialogid == 51)
    {
        if(
response)
        {
            if(
strlen(inputtext) < && strlen(inputtext) > && IsNumeric(inputtext))
            {
            
ShowPlayerDialog(playerid2DIALOG_STYLE_LIST"{33CCFF}Customizaзхes""{FFFF00}Veiculos customizados\n{33AA33}Clima\n{33AA33}Tempo da corrida\nTempo para iniciar a corrida\ntempo para os jogadores entra na corrida\nCriar Carro""Selecionar""Cancelar");
            
DOF2_SetInt(trackname,"TempoCorrida",strval(inputtext)*60000);
            }
            else
            {
            
ShowPlayerDialog(playerid51DIALOG_STYLE_INPUT"Tempo da corrida""Coloque o tempo da corrida. lembrando de 1 a 60 minutos!""Selecionar""");
            }
        }
        
//ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "{33CCFF}Customizaзхes", "{FFFF00}Veiculos customizados\n{33AA33}Clima\n{33AA33}Tempo da corrida\nTempo para iniciar a corrida\ntempo para os jogadores entra na corrida\nCriar Carro", "Selecionar", "Cancelar");
    

Reply
#2

Quote:
Originally Posted by Marllun
Посмотреть сообщение
I already tried several ways but it does not work, it always goes to the next dialog.

PHP код:
    if(dialogid == 51)
    {
        if(
response)
        {
            if(
strlen(inputtext) < && strlen(inputtext) > && IsNumeric(inputtext))
            {
.......
....... 
PHP код:
 if(strlen(inputtext) < && strlen(inputtext) > && IsNumeric(inputtext)) 
i have no idea what this is, you literally put if the text is lower than 0 and bigger than 2
you used a case that will NEVER happen wtf is that man ? change that to:

PHP код:
 if(strlen(inputtext) > && IsNumeric(inputtext)) 
Reply
#3

Did not work

PHP код:
    if(dialogid == 51)
    {
        if(
response == 1)
        {
              if(
strlen(inputtext) > && IsNumeric(inputtext))
            {
            
ShowPlayerDialog(playerid2DIALOG_STYLE_LIST"{33CCFF}Customizaзхes""{FFFF00}Veiculos customizados\n{33AA33}Clima\n{33AA33}Tempo da corrida\nTempo para iniciar a corrida\ntempo para os jogadores entra na corrida\nCriar Carro""Selecionar""Cancelar");
            
DOF2_SetInt(trackname,"TempoCorrida",strval(inputtext)*60000);
            }
            else
            {
            
ShowPlayerDialog(playerid51DIALOG_STYLE_INPUT"Tempo da corrida""Coloque o tempo da corrida. lembrando de 1 a 60 minutos!""Selecionar""");
            }
        }
        
//ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "{33CCFF}Customizaзхes", "{FFFF00}Veiculos customizados\n{33AA33}Clima\n{33AA33}Tempo da corrida\nTempo para iniciar a corrida\ntempo para os jogadores entra na corrida\nCriar Carro", "Selecionar", "Cancelar");
    

Reply
#4

show your IsNumeric and if you don't mind answering, what kind of a dialog is this? register/login..??
and in what case is this dialog shown?
Reply
#5

PHP код:
IsNumeric(const string[])
{
        for (new 
0strlen(string); ji++)
        {
                if (
string[i] > '9' || string[i] < '0') return 0;
        }
        return 
1;

PHP код:
ShowPlayerDialog(playerid2DIALOG_STYLE_LIST"{33CCFF}Customizaзхes""{FFFF00}Veiculos customizados\n{33AA33}Clima\n{33AA33}Tempo da corrida\nTempo para iniciar a corrida\ntempo para os jogadores entra na corrida\nCriar Carro""Selecionar""Cancelar"); 
When I select Time Racer it goes to this dialog ai I have to type from 1 to 60.But when I put anything 21124 rjerj 0 12 or $ @ @ @ it goes to list instead of back to the dialog
Reply
#6

Код:
if(strlen(inputtext) < 0 && strlen(inputtext) > 2 && IsNumeric(inputtext))
Quote:

StringInteira(texto) abaixo de 0 E StringInteira(texto) acima de 2 E ValorNъmero(texto)

Nгo entendi!
Reply
#7

It was my mistake
Reply
#8

oh i think now i understand, you want the dialog to only accept numbers from 1 to 60! try this code and let me know if it works.
PHP код:
 if(strlen(inputtext) > && strlen(inputtext) <&& IsNumeric(inputtext)) 
Reply
#9

tente
Код:
if(strval(inputtext) > 2 && IsNumeric(inputtext))
Reply
#10

Quote:
Originally Posted by DarkBr
Посмотреть сообщение
tente
Код:
if(strval(inputtext) > 2 && IsNumeric(inputtext))
Are you stupid? first of all use English and second of all stop copying my comments you're taking irrelevant space and making the thread poster more confused!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)