SA-MP Forums Archive
Problem with float. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with float. (/showthread.php?tid=198207)



Problem with float. - ajwar - 11.12.2010

pawn Код:
new Float:x,Float:y,Float:z,data2[13],data[6][50];
sscanf(line, "p|ssddddfdfffssddd", data[0], data[1], data2[0], data2[1], data2[2], data2[3], data2[8],data2[4],x,y,z,data[4],data[5],data2[10],data2[11],data2[12]);

new string12[64];
format(string12,sizeof(string12),"XPOZ: %f , YPOZ:%f, ZPOZ:%f",x,y,z);
SendClientMessage(playerid,0xFFFFFFAA,string12);
It shows XPOZ: 0.0000000 YPOZ: 0.000000000 ZPOZ: 0.0000000 it's something wrong with taking float from DB. All other information - works perfect (username, password etc..)

What may be wrong with float ?


Re: Problem with float. - Benjo - 11.12.2010

I think you need to use the method floatstr(string[]) to convert the string data into a float.