Age - 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)
+--- Thread: Age (
/showthread.php?tid=476348)
Age -
Wizzy951 - 17.11.2013
Found the problem. Thanks for your replies.
Re: Age -
HardRock - 17.11.2013
PHP код:
format(query, sizeof(query), "UPDATE players SET Age = %d WHERE Name = '%s'", inputtext, Name(playerid));
//Edit: And remove....
PHP код:
mysql_real_escape_string(inputtext, EscAge);
Re: Age -
Ardendshy - 17.11.2013
Function
strlen(const string[]) get the length of a specific string, but function
strval(const string[]) convert a string to an integer. So change
strlen(inputtext) to
strval(inputtext).
Re: Age -
Wizzy951 - 17.11.2013
Quote:
Originally Posted by HardRock
PHP код:
format(query, sizeof(query), "UPDATE players SET Age = %d WHERE Name = '%s'", inputtext, Name(playerid));
//Edit: And remove....
PHP код:
mysql_real_escape_string(inputtext, EscAge);
|
I will try it.
EDIT: Oops, I copy-pasted another function, so instead of checking if the entered value is suitable (between 18 and 80) I'm checking the lenght of the entered value and I have to enter 18 characters long value to make it work.