Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mt_rand

Comments in 'Plugin Development' started by Kripak, Oct 9, 2015.

Thread Status:
Not open for further replies.
  1. Kripak
    Offline

    Kripak New Member

    Joined:
    Jul 17, 2015
    Posts:
    45
    Minecraft User:
    Kripak
    How to use mt_rand ?
  2. Kripak
    Offline

    Kripak New Member

    Joined:
    Jul 17, 2015
    Posts:
    45
    Minecraft User:
    Kripak
    For example I use this:

    switch(mt_rand(1,3)){
    case 1:
    $player->sendMessage("Рандом");
    break;
    case 2:
    $player->sendMessage("Рандом");
    break;
    case 3:
    $player->sendMessage("Рандом");
    break;

    Where wrong ?
  3. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    mt_rand(1,3) is 1 or 2 or 3 or is random i think your code is not wrong
  4. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
  5. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    mt_rand() is the PHP function to get a random number between a min and a max, exemple: mt_rand(0, 100) .

    It's very usefull.
    KubixQ and Jelly9912 like this.
Thread Status:
Not open for further replies.

Share This Page

Advertisement