int buypotions = my_adventures() - have_effect(to_effect(176));
int potionfinally = buypotions / 10;
Does Mafia not give you decimal points in strings and ignores everything past the decimal ? Is it possible to use int round( float ) to make it go to the next higher up if its at a .1 or .2 and if so how would I plug that into a Variable ? Would Changing it to float instead of int help since that does Give you decimal Points it would seem. I have also tried the in ceil(float) and it wont give me the next value up when I know it should be 3.7 it should show 4 right since thats the next highest integer but it gives me 3.
Maybe I should explain what Im trying to do. I want to take the amount of Effect I have from the amount of Adventures I have left then I want to divide that by how many each of the buff gives ( 10 or 20 or 30 etc etc ) and if I get a whole number I would like to buy that many Potions so I dont have to do a while statement and buy 1 potion at a time and if I get a Decimal number I want it to buy 1 more potion that way it will have that effect so say that potionfinally brings me the number 30 and the buff does 10 each I want it to buy 3 of the potions and use them but if it has 3.1 or anything with a decimal point I want it to buy 4 of the potions and use them. I hope this makes sense.
int potionfinally = buypotions / 10;
Does Mafia not give you decimal points in strings and ignores everything past the decimal ? Is it possible to use int round( float ) to make it go to the next higher up if its at a .1 or .2 and if so how would I plug that into a Variable ? Would Changing it to float instead of int help since that does Give you decimal Points it would seem. I have also tried the in ceil(float) and it wont give me the next value up when I know it should be 3.7 it should show 4 right since thats the next highest integer but it gives me 3.
Maybe I should explain what Im trying to do. I want to take the amount of Effect I have from the amount of Adventures I have left then I want to divide that by how many each of the buff gives ( 10 or 20 or 30 etc etc ) and if I get a whole number I would like to buy that many Potions so I dont have to do a while statement and buy 1 potion at a time and if I get a Decimal number I want it to buy 1 more potion that way it will have that effect so say that potionfinally brings me the number 30 and the buff does 10 each I want it to buy 3 of the potions and use them but if it has 3.1 or anything with a decimal point I want it to buy 4 of the potions and use them. I hope this makes sense.
Last edited: