zylack
New Member
- Reaction score
- 15
Im making a trigger that shows your kills/death ratio in a percent. Only problem though is that it obviosly shows up in a decimal and its bugging me...anyone know how to convert this to a percent?
Actions
Set ([B]total number kill+deaths(interger)[/B])[(Player number of (Owner of (Killing unit)))] = ([B]Death_Count[/B][(Player number of (Owner of (Killing unit)))] + [B]Kill_Count[/B][(Player number of (Owner of (Killing unit)))])
Set [B]real interger[/B][(Player number of (Owner of (Killing unit)))] = ((Real(Kill_Count[(Player number of (Owner of (Killing unit)))])) / (Real([B]totalnumber[/B][(Player number of (Owner of (Killing unit)))])))
Set [B]FIRST DIGIT (string)[/B][(Player number of (Owner of (Killing unit)))] = (Substring((String([B]Real interger[/B][(Player number of (Owner of (Killing unit)))])), 1, 1))
Set [B]second digit (string)[/B][(Player number of (Owner of (Killing unit)))] = (Substring((String([B]real interger[/B][(Player number of (Owner of (Killing unit)))])), 3, 4))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Integer([B]First digit[/B][(Player number of (Owner of (Killing unit)))])) Equal to 0
Then - Actions
Set [B]Percent (string)[/B][(Player number of (Owner of (Killing unit)))] = (Integer([B]Second digit[/B][(Player number of (Owner of (Killing unit)))]))
Else - Actions
Set [B]Percent[/B][(Player number of (Owner of (Killing unit)))] = (Integer((1 + [B]Second Digit[/B][(Player number of (Owner of (Killing unit)))])))
Else - Actions