Quote:
Originally Posted by ©ross
ehrm it sounds very simple.... in php i would write it.
PHP Code:
if($hp >= 10000 AND $hp < 20000){ $hp .= '10k'; }
afaik it is the same in C++ - only the variables are different
PS: Falls ich müll laber sagen^^ - Vom src wie so oft gesagt net viel Ahnung, deswegen assoziier ich das meiste mit PHP
|
It points in the right direction, buy what if my HP is 11000 or 15000 or over 1 million? Create a big if-else construct?
As same as ©ross I dont know anything about C++ buy a little bit about PHP. I guess, no flyff player will get more than 100 million HP, also it would be great, if there are one to two decimal places
(10k HP is a little inaccurate, 10.2k would be better).
PHP Code:
$strHP = PLAYERS_HP_AS_INTEGER;
if($strHP >= 1000000) {
$strHP = round($strHP / 1000000, 1) . 'm';
}
elseif($strHP >= 1000) {
$strHP = round($strHP / 1000, 1) . 'k';
}
But I dont know where you find the sourcecode for the HP status. Also I dont know, if its clever to use the same variable.