ID:175390
 
How do i make it so that i dont get .5(or something like it) in my gold and HP and stuff cause i have it when u die, usr.gold/2 and if u have 81 gold u get 45.5 gold in the end and i dont want the .5 Also when you get poison damage, i use usr.hp - poisond where poisond = usr.maxhp/20 and i get like "Your HP decreased by 22.6 HP!" and the person has 188.4 HP. How do i fix that kind of stuff? (this might be newbie, i dont know)
first off, because deatch_check and your poison are probobly procs, DON'T USE 'usr'. Second off:


mob
proc
DeatchCheck
//stuff here
round(src.gold)

of course, for poison, src might be the turf.
In response to Airjoe
I added that and it says Battle.dm:418:round :warning: statement has no effect
In response to Airjoe
mob
proc
DeatchCheck
//stuff here
src.gold = round(src.gold)

Give that a try.. what I normally do is create a var
just for rounding and then add or make my primary var = the rounded var.

What this does is takes your player's gold in src.gold, rounds it with round(src.gold) and then makes src.gold you player's gold variable, and = itself but rounded.

LJR