cache_get_row_int - Invalid datatype - 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: cache_get_row_int - Invalid datatype (
/showthread.php?tid=637861)
cache_get_row_int - Invalid datatype -
Romero837 - 22.07.2017
It happens that I already have a gamemode with saved mysql and because I am working on the system of needs, the one of hunger is already and because based on it was that I made the one of urine, until now it goes well and therefore I only have an error with The saved, I do not know which error I am committing and I understand that the cache_get_row_int is to save numbers but doing so gives me this error.
Error:
Code:
[14:43:50] [ERROR] cache_get_row_int - invalid datatype
Saved Code:
Urine [The error above]
Code:
cuenta[playerid][cOrine] = cache_get_row_int (0, 148, server[mysqlControl]);
Hungry
Code:
cuenta[playerid][cHambre] = cache_get_row_int (0, 144, server[mysqlControl]);
I already added the column in mysql with value INT of number, and in length or values I put "3" based on the hunger system that works well
Re: cache_get_row_int - Invalid datatype -
BrianFaria - 22.07.2017
Try this and show me the result to solve it.
cuenta[playerid][cHambre] = cache_get_row_int (0, 144, server[mysqlControl]);
printf("cHambre: %s",cuenta[playerid][cHambre]);
Respuesta: cache_get_row_int - Invalid datatype -
Romero837 - 22.07.2017
Being cHambre = 90 cOrine = 90 marks me in the printf
cHambre: Z
cOrine: Z
Re: cache_get_row_int - Invalid datatype -
Bolex_ - 22.07.2017
Well, It means you are trying loading something other than an integer from the database with the cache_get_row_int() function; as it only supports loading integers.
@RC
Respuesta: cache_get_row_int - Invalid datatype -
Romero837 - 22.07.2017
The variable I try to save only saves 0 - 100
Re: cache_get_row_int - Invalid datatype -
BrianFaria - 22.07.2017
Uhmm .. You should pass the code so I try. The server.log
Re: cache_get_row_int - Invalid datatype -
Banditul18 - 22.07.2017
Why you don't use cache_get_field_content_int ? Way easier , no need to know field index.
But for your problem , make sure both field indexes its same as the fields from the database where urine and hunger are stored.
And about values/lenght of a int in mysql is useless, that number its only for show when you view the table, integer value will be always same beside that value.
https://dev.mysql.com/doc/refman/5.7...ger-types.html
Respuesta: cache_get_row_int - Invalid datatype -
Romero837 - 22.07.2017
SOLVED, the fields were moved by number and so did not take the right field.
Thank you all
Re: cache_get_row_int - Invalid datatype -
saffierr - 22.07.2017
As Banditul18 said, use cache_get_field_content_int(); instead.