AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   convert message "short" to float (https://forums.alliedmods.net/showthread.php?t=61190)

Voi 09-23-2007 15:51

convert message "short" to float
 
i am catching "short" value from a screenfade message, and i want to convert it to float

how to do this ?

like:

new fvalue = read_data(2) / some_value // divide it so fvalue is max 1.0

but i cant do this couse read_data(2) is something like 3>>15

AlMod 09-23-2007 23:08

Re: convert message "short" to float
 
convert to float:
Quote:

new a = 15
new Float: f_a = float(a)
convert back to integer
Quote:

a = floatround(f_a)


All times are GMT -4. The time now is 16:13.

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