AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Float data type table row (https://forums.alliedmods.net/showthread.php?t=156946)

monolit 05-14-2011 07:04

Float data type table row
 
Hey, I've got table row skill (FLOAT)
And I want to insert 10.0 into it, but it doesn't insert, the skill is still 0.

When Player connects I get his skill float like this:
PHP Code:

iSkill[id]        = SQL_ReadResult(Query6) + 0.0

then in-game I receive like 10.0 skill, so when I print it like this:

PHP Code:

client_print(idprint_chat"your skill %0.1f"Float:iSkill[id]) 

it says your skill 10.0

But when I try to save it on client disconnect, like this:

PHP Code:

format(szTemp,charsmax(szTemp),"UPDATE `rank` SET `name` = '%s', `skill` = '%0.1f' WHERE `rank`.`auth` = '%s';",szNameFloat:iSkill[id], szAuthID); 

Then I check it on my phpmyadmin and skill value is still 0.

where is the problem ? as I've mentioned that skill row is skill FLOAT(10)

Exolent[jNr] 05-15-2011 02:00

Re: Float data type table row
 
That is not how you read a float value from an SQL query.

Code:
new Float:value; SQL_ReadResult(query, column, value);


All times are GMT -4. The time now is 04:29.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.