Results 1 to 7 of 7

Thread: Meaning 2

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    probability = true / total || ak47 / 100 weapons (on server) = 1 / 100 = 0,01 = 1% chance for ak47
    example random box for 10 weapons:
    PHP Code:

    rand_int 
    randomint(1000);

    if (
    rand_int <= 100//10%
       
    giveWeapon(/* your weapon */);
    else
    if (
    rand_int <= 200//10%
       
    giveWeapon(/* your weapon */); 
    else
    if (
    rand_int <= 300//10%
       
    giveWeapon(/* your weapon */);
    else 
    if (
    rand_int <= 700//40%
       
    giveWeapon(/* your weapon */); 

    /* etc. */ 
    P.S: cod2 have pseudorandom algorithm
    Last edited by maxdamage99; 13th March 2018 at 13:49.
    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

Posting Permissions

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