Re: Xp problem
Quote:
Originally Posted by bigdaddy424
(Post 2768779)
Code:
new float: multiplier = str_to_float(fmt("%d.%02d", (gPlayerLevel[id] / 100) + 1, gPlayerLevel[id] % 100))
|
No need to build a string to achieve a floating point value. Simply float the variable and divide by 100.0 and add 1.0 (to achieve this same calculation).
When I first saw the request, I thought he was requesting something more related to the relative XP between the killer and the victim but the OP didn't clearly state how he wanted it to work. There are many different algorithms that could be use and this one should work well enough, IMO.
However, you're now completely ignoring the third parameter of the native which could be a big confusing in the long run. I think that maybe this type of modification should really go in the plugin that is calling these functions and passing the multiplier value into the function like normal.
|