cache_get_field_content_float - 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_field_content_float - invalid datatype (
/showthread.php?tid=541967)
cache_get_field_content_float - invalid datatype -
MarTaTa - 15.10.2014
Hello everyone,
I started learning MySQL few days ago, and suddenly something goes wrong with some floats. It's about register / login system, that saves your position. The problem is when I try to load the last position from the DB with cache_get_field_content_float, I'm getting an error in the mysql log. (cache_get_field_content_float - invalid datatype)
But it's compiling without any errors.
Here's the code:
pawn Код:
PlayerInfo[playerid][posX] = cache_get_field_content_float(0, "posX");
I tried to find some solution, but I couldn't ... Am I doing something wrong ?
P.S. I'm using the latest BlueG's MySQL plugin (r39-2).
Re: cache_get_field_content_float - invalid datatype -
ThePhenix - 15.10.2014
Quote:
Originally Posted by MarTaTa
Hello everyone,
I started learning MySQL few days ago, and suddenly something goes wrong with some floats. It's about register / login system, that saves your position. The problem is when I try to load the last position from the DB with cache_get_field_content_float, I'm getting an error in the mysql log. (cache_get_field_content_float - invalid datatype)
But it's compiling without any errors.
Here's the code:
pawn Код:
PlayerInfo[playerid][posX] = cache_get_field_content_float(0, "posX");
I tried to find some solution, but I couldn't ... Am I doing something wrong ?
P.S. I'm using the latest BlueG's MySQL plugin (r39-2).
|
According to that error you get in the mysql log, I can tell that the "posX" column type is not float, so take a look at it and change the type to float.
Re: cache_get_field_content_float - invalid datatype -
MarTaTa - 16.10.2014
Quote:
Originally Posted by ThePhenix
According to that error you get in the mysql log, I can tell that the "posX" column type is not float, so take a look at it and change the type to float.
|
Nope. It is a Float... Here's the enumerator :
pawn Код:
enum pInfo
{
// other stuff
Float: posX,
Float: posY,
Float: posZ,
// other stuff
}
new PlayerInfo[MAX_PLAYERS][pInfo];