Float but still int
#1

Hi guys, I have problem with setting a value to a var(Float). I'm making sign up system with some background vars for IC character. I declared enum with int and float vars. But for float vars value is always like int value(0.000, 1.000 or 2.000). I don't know why, here's a code and debug text for one var(it's same problem for other float vars from _HRP_kENUM

Код:
#define _HRP_RANDOM(%0,%1) \
 (random(%1-(%0))+%0)


enum _HRP_kENUM
{
 _kID,
 _kZaporka[129],
 _kMail[31],
 Float:_kMetabolizam,
 Float:_kPotrebaZaVodom,
 Float:_kBrzinaOpijanja, <-- this var
 Float:_kBrzinaDrogiranja,
 Float:_kJacinaUdarca,
 Float:_kBrzinaRastaKose,
 _kKod[15]
};
new _HRP_Korisnik[MAX_PLAYERS]          [_HRP_kENUM];


 new _ran = _HRP_RANDOM(5, 75);
 _HRP_Korisnik[_playerid][_kBrzinaOpijanja] = (_ran / (_HRP_kOstalaMasa{_playerid} + _HRP_kMisicnaMasa{_playerid} + _HRP_kMasaSala{_playerid}));
 printf("al %f, random %d masa %d", _HRP_Korisnik[_playerid][_kBrzinaOpijanja], _ran, _HRP_kOstalaMasa{_playerid} + _HRP_kMisicnaMasa{_playerid} + _HRP_kMasaSala{_playerid});
Quote:

[06.11.2015. 22:36:42] al 1.000000, random 73 masa 59

Result is 1.237. I changed _HRP_RANDOM with var _ran so I can debug random value.
Reply


Messages In This Thread
Float but still int - by vannesenn - 07.11.2015, 11:32
Re: Float but still int - by vannesenn - 07.11.2015, 13:26
Re: Float but still int - by PrO.GameR - 07.11.2015, 16:57
Re: Float but still int - by vannesenn - 07.11.2015, 17:05

Forum Jump:


Users browsing this thread: 1 Guest(s)