SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 22/09/2009, 03:52 PM   #1
woot
Gangsta
 
Join Date: Jun 2007
Posts: 785
Reputation: 173
Default [MySQL] Loading data from a row - issue

Hello,

I have the following problem, for some reason the Spawn_X keeps coming out as 0.00000 (float) although it is set up properly in my Table.
The Spawn_Y and Spawn_Z is correct though, same with the ID.
The icons are wrongly placed ingame (X = 0.00000), it really is annoying and I have no clue what could be wrong.
Note: For the first row the X coord is correct, for the third+ rows they are wrong.

Table:


Script:
http://pastebin.com/m12367526

Outcome:
Code:
[17:44:40] [DEBUG] Pickup for 1 (Rent-a-Car) created. 2482.389892.2,1323.780029.2,10.820300.2
[17:44:40] [BIZ] (1) 'Rent-a-Car' loaded!
[17:44:40] [DEBUG] Pickup for 2 (Biz Test 2) created. 1.100000.2,2.200000.2,3.299999.2
[17:44:40] [BIZ] (2) 'Biz Test 2' loaded!
[17:44:40] [DEBUG] Pickup for 3 (Peters sick store!) created. 0.000000.2,0.000000.2,77.769996.2
[17:44:40] [BIZ] (3) 'Peters sick store!' loaded!
[17:44:40] [DEBUG] Pickup for 6 (~w~Random ~r~Store~w~.) created. 0.000000.2,1300.459960.2,10.820300.2
[17:44:40] [BIZ] (6) '~w~Random ~r~Store~w~.' loaded!

EDIT:
Alright, I tried converting all those to strings, that seems to work correctly since mysql doesnt support that float ranges.
But -> floatstr(); doesnt seem to have any effect, it just returns 0 and still is a string. What could I do?
__________________
woop
woot is offline  
Old 22/09/2009, 04:29 PM   #2
Sergei
High-roller
 
Sergei's Avatar
 
Join Date: Mar 2008
Location: Slovenia
Posts: 2,862
Reputation: 230
Default Re: [MySQL] Loading data from a row - issue

sscanf has a little bug for case 'f', so you need to replace that part of code with this: http://forum.sa-mp.com/index.php?top...8481#msg678481
__________________
Watch out, scouts everywhere!
Sergei is offline  
Old 22/09/2009, 04:50 PM   #3
woot
Gangsta
 
Join Date: Jun 2007
Posts: 785
Reputation: 173
Default Re: [MySQL] Loading data from a row - issue

Quote:
Originally Posted by $ЯĢ
sscanf has a little bug for case 'f', so you need to replace that part of code with this: http://forum.sa-mp.com/index.php?top...8481#msg678481
Thanks dude, that fixed it. <3
__________________
woop
woot is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[MySQL] Problem with extraction data ErF Help Archive 2 25/02/2010 01:02 PM
[HELP] Getting data from MySQL database ???? cAMo Help Archive 17 11/11/2009 02:28 PM
MYSQL - Reading data from Database joshAllan Help Archive 4 14/10/2009 11:46 AM
Rendering SA-MP Mysql data on SMF? uni Help Archive 1 22/08/2009 08:26 AM
How to get data from MySQL? Vince Help Archive 2 13/07/2009 09:57 PM


All times are GMT. The time now is 06:57 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.