Dialog problem... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog problem... (
/showthread.php?tid=214386)
Dialog problem... -
iJumbo - 21.01.2011
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);
Re: Dialog problem... -
Sascha - 21.01.2011
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...
Re: Dialog problem... -
NO.L3O - 21.01.2011
Sascha can you help me here pls! dialog problem
https://sampforum.blast.hk/showthread.php?tid=214189
Re: Dialog problem... -
iJumbo - 21.01.2011
okay im trying ..