Float return problem
#1

Hello all,

i got an problem sometime,

i use an system when players crash and save it into sql db,

Код:
GetPlayerPos(playerid, JoueurInfos[playerid][jCPosX], JoueurInfos[playerid][jCPosY], JoueurInfos[playerid][jCPosZ]);
and sometime i got error like this

Quote:

ErreurID: 1054 , Erreur Unknown column 'NaN' in 'field list' , thread ID: -1 , Extraid: яИЬ , Callback NULL , Query UPDATE `DBCrash` SET CrashPosX=NaN,CrashPosY=NaN,CrashPosZ=NaN,CrashVW= 0,CrashInt=0 WHERE ID = 4631

ErreurID: 1064 , Erreur You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/,),(-*,(.((((((,CrashPosY=-11.730871,CrashPosZ=5199.609375,CrashVW=0,CrashInt =0' at line 1 , thread ID: -1 , Extraid: яŒH , Callback NULL , Query UPDATE `DBCrash` SET CrashPosX=-./,),(-*,(.((((((,CrashPosY=-11.730871,CrashPosZ=5199.609375,CrashVW=0,CrashInt =0 WHERE ID = 40129
Thank you

Max
Reply
#2

Post the part where you update the database.
Reply
#3

Quote:

ErreurID: 1054 , Erreur Unknown column 'NaN' in 'field list' , thread ID: -1 , Extraid: яИЬ , Callback NULL , Query UPDATE `DBCrash` SET CrashPosX=NaN,CrashPosY=NaN,CrashPosZ=NaN,CrashVW= 0,CrashInt=0 WHERE ID = 4631

4char
Reply
#4

Quote:
Originally Posted by Skribblez
Посмотреть сообщение
Post the part where you update the database.
It is in ma save player,

Quote:
Originally Posted by doreto
Посмотреть сообщение
4char
what do you mean?



I don't bug every time, at each save

Thank you

Max
Reply
#5

Could you post "ya" save player then?
Reply
#6

Quote:
Originally Posted by scott1
Посмотреть сообщение
what do you mean?
Quote:

ErreurID: 1054 , Erreur Unknown column 'NaN' in 'field list' , thread ID: -1 , Extraid: яИЬ , Callback NULL , Query UPDATE `DBCrash` SET

Here is your problem and mean you don't have that column you try to update data.
Solution: add column with NaN name.
Reply
#7

Look at the request,

Quote:

CrashPosX=NaN,CrashPosY=NaN,CrashPosZ=NaN,

CrashPosX is the X from GetPlayerPos
CrashPosY is the Y from GetPlayerPos
CrashPosZ is the Z from GetPlayerPos

Hard to explain into english, but my float returned by getplayerpos, became Nan,

why?

Max
Reply
#8

Can you show when you format the query? Also, when are you getting the player's pos?

Here's info on "NaN": http://en.wikipedia.org/wiki/NaN
Reply
#9

i format the query when i save account, on disconnect,

i get the pos into onplayerdisconnect

Код:
switch(reason)
    {
        case 0:
		{
			format(string, sizeof(string), "* %s quitte le serveur (Crash).", nom);
		    JoueurInfos[playerid][jCInt] = GetPlayerInterior(playerid);
			JoueurInfos[playerid][jCVw]= GetPlayerVirtualWorld(playerid);
		    new Float:x, Float:y, Float:z;
			GetPlayerPos(playerid, x, y, z);
			JoueurInfos[playerid][jCrash] = 1;
			JoueurInfos[playerid][jCPosX] = x;
			JoueurInfos[playerid][jCPosY] = y;
			JoueurInfos[playerid][jCPosZ] = z;
Thank you for the time you spend to help me

Max
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)