SA-MP Forums Archive
[MySQL] Problem with numbers - 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: [MySQL] Problem with numbers (/showthread.php?tid=275854)



[SOLVED] [MySQL] Problem with numbers - scuess - 11.08.2011

Hi guys, I've got a little problem with saving numbers into MySQL...
I have simple script for players profile... I have dialog with options and one of them is Set Age...
Код:
Dialog_SetAge(playerid, response, inputtext[])
{
	// Just close the dialog if the player clicked "Cancel"
	if(!response) return 1;

	// Setup player variables
	format(PVar[playerid][pAge],3,"%d",inputtext);
//    SavePInfo(playerid);
	return 1;
}
Problem is somewhere in this dialog because a strange numbers going from there. I put in the dialog for example number 15 and it saves it as 53 for example. Do you know where is the problem ? O

Sorry for my English


Re: [MySQL] Problem with numbers - Sascha - 11.08.2011

change "inputtext" to "strval(inputtext)"


Re: [MySQL] Problem with numbers - scuess - 11.08.2011

I did so and still the same problem


Re: [MySQL] Problem with numbers - scuess - 11.08.2011

Ah Solved

Just change

format(PVar[playerid][pAge],3,"%d",strval(inputtext));

to

PVar[playerid][pAge] = strval(inputtext);


Thank you Sascha