Divide 2 floats?
#1

Hello,

I try to divide 2 floats, but whatever I try, it won't work. Now I've found something in SAMP-Wiki: https://sampwiki.blast.hk/wiki/Floatdiv. I tried that but it doesn't work (I get this error: Undefined symbol "floatdiv"), too. Have anyone ideas? Thanks for helping.. Oh and: I want to make a Kills/Deaths Ratio







XCarBOn
Reply
#2

Erm, floatround? + then divide it by the amount of decimal places used, to get it back to float after you have divided them. I havent tried it, but it seems logical enough.

+ But using the "/" operator should work anyway.
Reply
#3

Well if you want to make a KTD ratio, you're most probably dividing the kills by the deaths:
pawn Код:
new Float:KTD = floatdiv(Kills, Deaths);
Reply
#4

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
Well if you want to make a KTD ratio, you're most probably dividing the kills by the deaths:
pawn Код:
new Float:KTD = floatdiv(Kills, Deaths);
Floatdiv won't work^^ I get an error when I use floatdiv..
Reply
#5

Then you're using it wrong. Post the error with the corresponding code.
Reply
#6

Found the error: I've copied the example and forget the replace the "F" of float with a little "f". I knew that I've forgotten something. I'll try, Thanks!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)