Results 1 to 5 of 5

Thread: K/D Ratio

  1. #1
    Private
    Join Date
    Feb 2018
    Posts
    28
    Thanks
    12
    Thanked 17 Times in 16 Posts

    K/D Ratio



    Is it possible to delete the last 4 numbers?

    To display only 0.30....
    I tried this way https://killtube.org/showthread.php?...ight=getSubStr
    but it does not work

    Code:
    if(self.pers["die"] == 0)
    				self.kdratio = self.pers["kills"] / 1;
    			else if(self.pers["die"] == 1)
    				self.kdratio = self.pers["kills"] / 1.5;
    			else
    				self.kdratio = self.pers["kills"] / self.pers["die"];
    			
    			self.kdratiohud setValue(self.kdratio);
    Last edited by buLLeT_; 11th June 2018 at 12:20.

  2. The Following User Says Thank You to buLLeT_ For This Useful Post:

    kung foo man (11th June 2018)

  3. #2
    Private
    Join Date
    Jun 2013
    Posts
    70
    Thanks
    20
    Thanked 32 Times in 26 Posts
    try this
    iprintlnbold("\n *** Test:"+getSubStr( (3/11) , 0 , 3 ));

    u should also add a check if its greater then 10 or 100 and then increase the endindex

    end = 3;

    if (kd >= 10) end = 4;
    elseif (kd >= 100) end = 5 ;
    Last edited by vanfreddy; 11th June 2018 at 15:59.

  4. The Following 2 Users Say Thank You to vanfreddy For This Useful Post:

    buLLeT_ (12th June 2018),kung foo man (11th June 2018)

  5. #3
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    iprintlnbold(int(kdratio*100)/100);
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  6. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    buLLeT_ (12th June 2018),kung foo man (11th June 2018)

  7. #4
    Private
    Join Date
    Feb 2018
    Posts
    28
    Thanks
    12
    Thanked 17 Times in 16 Posts
    Quote Originally Posted by IzNoGoD View Post
    iprintlnbold(int(kdratio*100)/100);
    It works


    problem with headshots doesn't work



    no errors with developer 1
    Last edited by buLLeT_; 12th June 2018 at 12:16.

  8. #5
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    very ez method (maybe no work ):
    PHP Code:
    /*
    kda - your var with 0.302564
    */

    final_kda "";
    temp ""+kda;

    for (
    03i++)
         
    final_kda+=temp[i];

    /*
    final_kda - var with 0.30; 
    */ 
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  9. The Following User Says Thank You to maxdamage99 For This Useful Post:

    buLLeT_ (13th June 2018)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •