Dialog problem...
#1

I make a year insert thing ... but when i type for example 16 in inputbox the result of inputtext is 49 lol look at my code


pawn Код:
if(dialogid == DialogoClass)
    {
        if(response)
        {
            if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DialogoClass,DIALOG_STYLE_INPUT,"Quanti anni hai?","Inserisci qui sotto il numero dei tuoi anni!\nServono per questioni di parolaccie e contenuti non adatti ai minori\ni tuoi anni non verranno detti a nessuno!\nse premi no il server te li richiedera una prossima volta \n INSERISCI GLI ANNI PRIMA DI PREMERE OK!\n SE NON VUOI INSERIRE NIENTE PREMI NO","Ok","No");
            if(!isNumeric(inputtext)) return ShowPlayerDialog(playerid,DialogoClass,DIALOG_STYLE_INPUT,"Quanti anni hai?","Inserisci qui sotto il numero dei tuoi anni!\nServono per questioni di parolaccie e contenuti non adatti ai minori\ni tuoi anni non verranno detti a nessuno!\nse premi no il server te li richiedera una prossima volta \n SI POSSONO INSERIRE SOLO NUMERI","Ok","No");
            SendClientMessage(playerid,RED,"Grazie per aver inserito gli anni!");
            printf("Player %s Ha inserito gli anni (%d)",Name(playerid),inputtext);
            new QueryA[300];
            format(QueryA, sizeof(QueryA), "UPDATE `"TavoMysql"` SET `Anni` = '%d' WHERE `NomePlayer` = '%s'",inputtext,Name(playerid));
            mysql_query(QueryA);
        }
    }
EDIT

pawn Код:
printf("Player %s Ha inserito gli anni (%d)",Name(playerid),inputtext);
eng printf("Player %s ahve insert the years (>>> the years of inputtext%d)",Name(playerid),inputtext);
Reply
#2

you are trying to execute a string with an integer variable..
use:
pawn Код:
printf("Player %s Ha inserito gli anni (%d)",Name(playerid),strval(inputtext));
eng printf("Player %s ahve insert the years (>>> the years of inputtext%d)",Name(playerid),strval(inputtext));


format(QueryA, sizeof(QueryA), "UPDATE `"TavoMysql"` SET `Anni` = '%d' WHERE `NomePlayer` = '%s'",strval(inputtext),Name(playerid));
            mysql_query(QueryA);
strval(string) returns an integer... e.g. if you enter a string with 46 (e.g. format(string, sizeof(string), "46")) and then use strval(string) it returns 46...
Reply
#3

Sascha can you help me here pls! dialog problem

https://sampforum.blast.hk/showthread.php?tid=214189
Reply
#4

okay im trying ..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)