Jump to content
MakeWebGames

Recommended Posts

Posted

Re: How Would I do this?

Firstly you will probably want to use mt_rand i beleive its quicker then the standard rand

And to use a mt_rand in a if statement i beleive it would be something like

<?php
if(mt_rand(1,100) == 50) {
//Do w/e
}
?>
Posted

Re: How Would I do this?

I have used mt_rand() before as well, however I did it differently to yours SkyFuse, but I think yours will work nonetheless.

$blah = mt_rand(1,1000)

if($blah == 14354) {

//blah blah

}

Guest Sniko`
Posted

Re: How Would I do this?

$blah = mt_rand(1,1000)

if($blah == 14354) {

//blah blah

}

As OPrime stated but you could add a bit of maths signs in there

$blah = mt_rand(1,1000)

if($blah < 500) { //less than 500

//blah blah

}

if($blah > 500) { //more than 500

//blah blah

}

Posted

Re: How Would I do this?

 

$blah = mt_rand(1,1000)

if($blah == 14354) {

//blah blah

}

As OPrime stated but you could add a bit of maths signs in there

$blah = mt_rand(1,1000)

if($blah < 500) { //less than 500

//blah blah

}

if($blah > 500) { //more than 500

//blah blah

}

Your stuck if it is 500..

 

if($blah < 500) { 
   //less than 500
} else { 
   //more than 500 or = to 500
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...