Quote:
Originally Posted by Emmet_
Use floatstr(). It converts a string to a floating point value.
Make sure you wrap it around inputtext, e.g:
For integers, you use "strval":
Code:
pawn Code:
if(ListItem[playerid] == 2) { format(GlobalQuery, sizeof(GlobalQuery), "UPDATE `factions` SET `IntX` = %.2f WHERE `FacID` = %d", floatstr(inputtext), FID[playerid]); mysql_function_query(MySQLConnection, GlobalQuery, true, "Query", ""); format(GlobalString, sizeof(GlobalString), "Interior X set to %.2f.", floatstr(inputtext)); SendClientMessage(playerid, COLOR_WHITE, GlobalString); FID[playerid] = 0; ListItem[playerid] = 0; }
|
Thanks it works. But only does 5. For example, 123.456 was entered, it'd be 123.45