cache_get_row_int - Invalid datatype
#1

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
Reply
#2

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]);
Reply
#3

Being cHambre = 90 cOrine = 90 marks me in the printf

cHambre: Z
cOrine: Z
Reply
#4

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
Reply
#5

The variable I try to save only saves 0 - 100
Reply
#6

Uhmm .. You should pass the code so I try. The server.log
Reply
#7

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
Reply
#8

SOLVED, the fields were moved by number and so did not take the right field.

Thank you all
Reply
#9

As Banditul18 said, use cache_get_field_content_int(); instead.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)