Jump to content

Float From Uint, How To?


Guest freeganja
 Share

Recommended Posts

Hi, I need help, in unit_fields, there are some values stored in integer but they are float like crit chance and stuff like that.

How to convert that integer value to correct float in mysql and in php?

In c++ it looks like it is done simply with things like

return float

or (float)int_value

it looks that its not just inserting floating point inside

Link to comment
Share on other sites

If you want get float value from updatefields in php.. use this function

function readFloatValue($value)
{
       return ceil(array_pop(unpack("f", pack("L", $value))));

}

Holy crit can be extracted by this script

$data= mysql_query("SELECT `data` from `characters` where `name`='Charlie';

$r = mysqL_fetch_array($data);

$r = $r['data'];

$fields = explode(" ",$r);

$prvek = readFloatValue($fields[1324]);

echo "Holy crit chance.. $prvek % ";

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use